Resistencia extrema al cobre por un consorcio bacteriano conformado por Sulfo...
Publicando RDF y Linked Data con LODSPeaKr
1. PUBLICANDO RDF
Y LINKED DATA
CON LODSPEAKR
Alvaro Graves - alvaro@graves - @alvarograves
Tetherless World Constellation -Rensselaer Polytechnic Institute
2. AGENDA
• Cómo publicar datos en la Web?
• Qué es Linked Data ...
• ...y porqué me debería importar?
• Publicando datos con LODSPeaKr
• Trabajo futuro
• Conclusiones
3. CÓMO PUBLICAMOS DATOS?
• Subir archivos a un servidor WWW o FTP
• Fácil de publicar
• Difícil de encontrar o usar
• Exportar página HTML
• Fácil de publicar y encontrar
• Difícil de usar
• Publicar como Linked Data
• No tan fácil de publicar
• Fácil de usar y encontrar
4. ¿QUÉ ES LINKED DATA?
• Setof best practices (based on Semantic Web technologies)
to publish structured data on the Web
• Use of Web technologies (RDF, HTTP, URIs)
• Connect my data to other people’s data by links
5. ¿QUÉ ES LINKED DATA? (2)
http://logd.tw.rpi.edu/id/us/state/New_York rdfs:label New York
dcterms:identifier
NY
6. ¿QUÉ ES LINKED DATA? (2)
http://www.ny.gov
foaf:homepage
http://dbpedia.org/resource/New_York
owl:sameAs
dbpedia-owl:capital
http://dbpedia.org/resource/Albany,_New_York
http://logd.tw.rpi.edu/id/us/state/New_York rdfs:label New York
dcterms:identifier
NY
7. ¿QUÉ ES LINKED DATA? (3)
• Cuando se intenta traer una URI, es necesario proveer
información en
• HTML para humanos
• RDF para máquinas
• Enlazar
a otras URIs relevantes (idealmente en otros datasets)
de manera que la gente pueda descubrir más datos
8. ¿CUÁL ES LA GRACIA?
• LOD hace más fácil accesar datos por aplicaciones
(mecanismos estándares)
• “Breaks the walls of data silos”, una Web de Datos
• Facilita el descubrimiento de datos
• Facilita la integración
9. DE LOS DATOS A APLICACIONES
fm:farmersMarket_4239 a fm:FarmersMarket ;
con:address implicit_address:address_4239 ;
dcterms:title "Troy Neighborhood Farmers Market - Downtown" ;
wgs:lat "-73.68599"^^xsd:decimal ;
State Name Address City Zipcode Lat Long
wgs:long "42.73168"^^xsd:decimal ;
Troy Neighborhood ov:csvRow "4239"^^xsd:integer .
New York Farmers Market - 6th Ave Troy 12180 -73.686 42.73168
Downtown
fm:farmersMarket_4243 a fm:FarmersMarket ;
The con:address implicit_address:address_4243 ;
Troy Neighborhood MarketPlace, Hill dcterms:title "Troy Waterfront Farmers Market" ;
New York Farmers Market- Little Street, btw Troy 12181 -73.6898 42.72478
Italy Washington & wgs:lat "-73.68942"^^xsd:decimal ;
Liberty Sts. wgs:long "42.73491"^^xsd:decimal ;
ov:csvRow "4243"^^xsd:integer .
Data Conversion
Publication Publication
Creation to RDF
Enhancements
LODSPeaKr
10. EJEMPLO: FARMERS MARKETS
State Name Address City Zipcode Lat Long
Troy Neighborhood
New York Farmers Market - 6th Ave Troy 12180 -73.686 42.73168
Downtown
The
Troy Neighborhood MarketPlace, Hill
New York Farmers Market- Little Street, btw Troy 12181 -73.6898 42.72478
Italy Washington &
Liberty Sts.
11. Example: Data about Farmers Markets
State Name Address City Zipcode Lat Long
Troy Neighborhood
New York Farmers Market - 6th Ave Troy 12180 -73.68599 42.73168
Downtown
The MarketPlace,
Troy Neighborhood Hill Street, btw
New York Troy 12181 -73.68983 42.72478
Farmers Market- Little Italy Washington &
Liberty Sts.
fm:farmersMarket_4239 a fm:FarmersMarket ;
con:address implicit_address:address_4239 ;
dcterms:title "Troy Neighborhood Farmers Market - Downtown" ;
wgs:lat "-73.68599"^^xsd:decimal ;
wgs:long "42.73168"^^xsd:decimal ;
ov:csvRow "4239"^^xsd:integer .
fm:farmersMarket_4243 a fm:FarmersMarket ;
con:address implicit_address:address_4243 ;
dcterms:title "Troy Waterfront Farmers Market" ;
wgs:lat "-73.68942"^^xsd:decimal ;
wgs:long "42.73491"^^xsd:decimal ;
ov:csvRow "4243"^^xsd:integer .
Buena idea: Subirlo a un triple store. Siguiente paso?
13. LODSPeaKr
• Sitio funcional en 1 minuto
• Publicar
en varios formatos
(RDF/XML, Turtle,
RDFJSON, etc.)
• Altamente configurable
(usando Haanga)
• Facilita la exploración de
datos
15. Redirección 303 en LODSPeaKr
GET http://example.org/resource
HTTP Accept: application/rdf+xml
• Los datos dan forma
HTTP Status: 303 See Other
Location: http://example.org/resource.rdf LODSPeaKr
al sitio
GET http://example.org/resource.rdf
HTTP Accept: application/rdf+xml
• AplicacionesLOD User
debiesen ser data- http://example.org/resource.rdf
Content-type: application/rdf+xml
céntricas
Triple Store
20. LODSPeaKr Triple Store
Give me info
about
http://example.org/john
Client
21. What is
http://example.org/john ?
LODSPeaKr Triple Store
Give me info
about
http://example.org/john
Client
22. What is
http://example.org/john ?
http://example.org/john
is a foaf:Person
LODSPeaKr Triple Store
Give me info
about
http://example.org/john
Client
23. What is
http://example.org/john ?
http://example.org/john
is a foaf:Person
QUERY FOR
LODSPeaKr foaf:Person Triple Store
Give me info
about
http://example.org/john
Client
24. What is
http://example.org/john ?
http://example.org/john
is a foaf:Person
QUERY FOR
LODSPeaKr foaf:Person Triple Store
DATA
Give me info
about
http://example.org/john
Person
{{name}}
{{lastName}}
Client
26. Query for foaf:Person
LODSPeaKr Triple Store
DATA
Give me info
about
http://example.org/john
Client
27. Query for foaf:Person
http://example.org/john
LODSPeaKr owl:sameAs Triple Store
http://logd.tw.rpi.edu/john
DATA
Give me info
about
http://example.org/john
Client
28. LODSPeaKr Triple Store
QUERY FOR
http://logd.tw.rpi.edu/john
DATA
Give me info
about
http://example.org/john
LOGD
Client
29. QUERY FOR
http://logd.tw.rpi.edu/john
http://logd.tw.rpi.edu/john
owl:sameAs
LODSPeaKr Triple Store
http://dbpedia.org/resource/john
DATA
Give me info
about
http://example.org/john
LOGD
Client
30. LODSPeaKr Triple Store
QUERY FOR
http://dbpedia/org/resource/john
Give me info
about
http://example.org/john
DATA
LOGD
Client DBpedia
31. LODSPeaKr Triple Store
Give me info
about
http://example.org/john
LOCAL DBPEDIA
LOGD
LOGD
Client DBpedia
32. CREACIÓN DE WORKFLOWS
Endpoint A Endpoint C
Endpoint F
LODSPeaKr
Endpoint B
Endpoint D
Final Page
34. SPECIAL URLs
• Documentos que agregan información de varios recursos
• Por defecto, URLs para clases disponibles e instancias de una clase
• Se pueden crear nuevas URLs especiales
36. MODELS
• Archivo (CURIE de clase) con consulta SPARQL
• Directorio (CURIE de clase) donde dentro:
• Archivo con consulta SPARQL (cualquier nombre)
• Directorio (nombre SPARQL endpoint) con más consultas
SPARQL
SELECT ?s2 ?p2 ?s1 ?p1 WHERE {
{
<{{uri}}> ?s1 ?p1 .
}UNION{
?s2 ?p2 <{{uri}}> .
}
}
37. VIEWS
(TEMPLATES DE HAANGA)
<table>
{% for row in r %}
{% if row.s1%}
<tr>
<td><a href='{{row.s1.value}}'>{{row.s1.curie}}</a></td>
{% if row.p1.uri == 1 %}
<td><a rel='{{row.s1.curie}}'
href='{{row.p1.value}}'>{{row.p1.curie}}</a></td>
{% else %}
<td><span property='{{row.s1.curie}}'>{{row.p1.value}}</
span></td>
{% endif %}
</tr>
{% endif %}
{% endfor %}
</table>
38. MODELS REVISITED
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dbpedia: <http://dbpedia.org/resource/>
SELECT ?anotherUri WHERE{
{%for row in r.details%}
{%if forloop.first%}
<{{row.state.value}}>
{%endif%}
{%endfor%}
owl:sameAs ?anotherUri .
FILTER(regex(str(?anotherUri),"http://dbpedia.org"))
}
Valor se puede acceder como
r.sameas.anotherUri.[value|curie]
39. FUTURO
• Más azúcar sintáctico (ej. para primer/únicos valores)
• Agregar la “C” en el MVC
• Un Framework para LODapps
• No sólo aplicaciones Read-only, sino Read/Write
• Replicar aplicaciones (experimental)
• Fork de aplicación en vivo
• Tracear genealogía (bene gesserit)
40. CONCLUSIONES
• LODSPeaKr hace fácil y rápida la publicación de Linked Data
• Es
posible crear diversas aplicaciones usando Linked Open
Data
• Open Data Portals
• Machine-readable APIs
• Mobile webapps