260 likes | 408 Views
Semantic Web Introduction. olivier.corby@inria.fr. Introduction. Data Access Protocol SPARQL 1.1 Protocol SPARQL 1.1 Graph Store HTTP Protocol: Linked Data Platform Populating Web of Data RDFa GRDDL R2RML : mappings relational databases to RDF. SPARQL 1.1 Protocol.
E N D
Semantic Web Introduction olivier.corby@inria.fr
Introduction Data Access Protocol • SPARQL 1.1 Protocol • SPARQL 1.1 Graph Store HTTP Protocol: • LinkedData Platform Populating Web of Data • RDFa • GRDDL • R2RML: mappingsrelationaldatabases to RDF
SPARQL 1.1 Protocol ConveyingSPARQL queries and updates to a processingservice Returningthe results via HTTP
SPARQL 1.1 Protocol ConveyingSPARQL queries and updates to a processingservice Returningthe results via HTTP http://fr.dbpedia.org/sparql?query=select distinct * where { <http://fr.dbpedia.org/resource/Auguste> ?p ?v } limit 100
SPARQL 1.1 Protocol ConveyingSPARQL queries and updates to a processingservice Returningthe results via HTTP http://fr.dbpedia.org/sparql?query=select distinct * where { <http://fr.dbpedia.org/resource/Auguste> ?p ?v } limit 100
SPARQL 1.1 Protocol ConveyingSPARQL queries and updates to a processingservice Returningthe results via HTTP http://fr.dbpedia.org/sparql?query=select distinct * where { <http://fr.dbpedia.org/resource/Auguste> ?p ?v } limit 100
SPARQL 1.1 Protocol ConveyingSPARQL queries and updates to a processingservice Returningthe results via HTTP http://example.org/sparql?update=insert data {<a> <b> <c>}
SPARQL 1.1 Protocol ConveyingSPARQL queries and updates to a processingservice Returningthe results via HTTP http://example.org/sparql?update=insert data {<a> <b> <c>}
SPARQL 1.1 Graph Store HTTP Protocol Specifies the semantics of HTTP operations for managing a Graph Store. Directly interact with a graph store using HTTP Provides operations for: • retrieving RDF graph content • removing, creating, and replacing RDF graph content • adding RDF statements to existing RDF graph content. HTTP GET: http://server.example.org?graph=http%3A//www.example.com/cnrs/people
SPARQL 1.1 Graph Store HTTP Protocol Specifies the semantics of HTTP operations for managing a Graph Store. Directly interact with a graph store using HTTP Provides operations for: • retrieving RDF graph content • removing, creating, and replacing RDF graph content • adding RDF statements to existing RDF graph content. HTTP GET: http://server.example.org?graph=http%3A//www.example.com/cnrs/people
SPARQL 1.1 Graph Store HTTP Protocol Specifies the semantics of HTTP operations for managing a Graph Store. Directly interact with a graph store using HTTP Provides operations for: • retrieving RDF graph content • removing, creating, and replacing RDF graph content • adding RDF statements to existing RDF graph content. HTTP GET: http://server.example.org?graph=http%3A//www.example.com/cnrs/people
SPARQL 1.1 Graph Store HTTP Protocol HTTP PUT: DROP + INSERT PUT /rdf-graph-store?graph=http%3A//server.example.org/test HTTP/1.1 Host: example.com Content-Type: text/turtle @prefix ex: <http://example.org/schema/> ex:Catherine a ex:Teacher . ex:Oliviera ex:Teacher .
SPARQL 1.1 Graph Store HTTP Protocol HTTP PUT: DROP + INSERT PUT /rdf-graph-store?graph=http%3A//server.example.org/testHTTP/1.1 Host: example.com Content-Type: text/turtle @prefix ex: <http://example.org/schema/> ex:Catherine a ex:Teacher . ex:Oliviera ex:Teacher .
SPARQL 1.1 Graph Store HTTP Protocol HTTP PUT: DROP + INSERT PUT /rdf-graph-store?graph=http%3A//server.example.org/test HTTP/1.1 Host: example.com Content-Type: text/turtle @prefix ex: <http://example.org/schema/> ex:Catherine a ex:Teacher . ex:Oliviera ex:Teacher .
SPARQL 1.1 Graph Store HTTP Protocol HTTP POST: INSERT HTTP DELETE
Linked Data • Use URIs as names for things • Use HTTP URIs so that people can look up those names • When someone looks up a URI, provide useful information, using the standards (RDF*, SPARQL) • Include links to other URIs, so that they can discover more things
Linked Data Platform Best practices for: • read-writeLinked Data architecture, • basedon HTTP access to web resources • resourcesdescribetheir state usingRDF Clarifies the 4 rules of Linked Data: URI, HTTP URI, RDF/SPARQL, Link URI Discuss standard HTTP and RDF techniques and best practices for client/server that read and write Linked Data Container for partitioning space of resources Proposal of pagination for large graphs
Linked Data Platform • 4.2.1 LDPR servers MUST at least be HTTP/1.1 conformant servers [HTTP11]. • 4.2.2 LDPR servers MUST provide an RDF representation for LDPRs. The HTTP Request-URI of the LDPR is typically the subject of most triples in the response. • 4.2.4 LDPRs SHOULD reuse existing vocabularies instead of creating their own duplicate vocabulary terms. In addition to this general rule, some specific cases are covered by other conformance rules. • 4.2.4.1 LDPR predicates SHOULD use standard vocabularies such as Dublin Core [DC-TERMS], RDF [RDF-CONCEPTS] and RDF Schema [RDF-SCHEMA], whenever possible. • 4.2.5 LDPR representations SHOULD have at least one rdf:type set explicitly. This makes the representations much more useful to client applications that don’t support inferencing. • 4.2.6 LDPR servers MAY support standard representations beyond those necessary to conform to this specification. These could be other RDF formats, like N3 or NTriples, but non-RDF formats like HTML [HTML401] and JSON [RFC4627] would likely be common.
RDF in Attributes: RDFa Add structured data to HTML pages directly Mark up human-readable Web page to express machine-readable data <body vocab="http://jdev.org/schema/"> <div resource="/jdev/program/sw" typeof="Course"> <h2 property="title">Semantic Web</h2> <p>Date: <span property="date">2013-09-05</span></p> ... <p>Outstanding introduction to the Semantic Web (of Data) <a property="location" href="http://www.polytechnique.fr/">Ecole Polytechnique</a> </p> </div> </body>
RDF in Attributes: RDFa prefix ex: <http://jdev.org/schema/> <http://example.org/jdev/program/sw> rdf:typeex:Course ; ex:date "2013-09-05" ; ex:location <http://www.polytechnique.fr> .
GRDDL Gleaning Resource Descriptions from Dialects of Languages Obtaining RDF data from XML documents Use a profile Indicate a transformation
GRDDL Use a profile <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <headprofile="http://www.w3.org/2003/g/data-view" > <title>Robin's Schedule</title> <linkrel="transformation" href="http://www.w3.org/2002/12/cal/glean-hcal" /> </head> <body> ...
GRDDL Indicate a transformation (e.g. XSLT) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <headprofile="http://www.w3.org/2003/g/data-view" > <title>Robin's Schedule</title> <linkrel="transformation" href="http://www.w3.org/2002/12/cal/glean-hcal" /> </head> <body> ...
R2RML RDB to RDF Mapping Language • Direct Mapping of Relational Data to RDF • CustomizedMappingfromrelationaldatabases to RDF
R2RML Direct Mapping Direct translation of table to triples Subjectis « Table/ID » Propertyis « Table#column» Type is « Table » Object is value of column <People/ID=7> rdf:type <People> . <People/ID=7> <People#fname> "Catherine" . <People/ID=7> <People#ref-addr> <Address/ID=18> . <People/ID=8> rdf:type <People> . <People/ID=8> <People#fname> "Olivier" . <People/ID=8> <People#ref-addr> <Address/ID=22> .
R2RML Customized Mapping <#TriplesMap1> rr:logicalTable [ rr:tableName "EMP" ]; rr:subjectMap [ rr:template "http://jdev.org/staff/{EMPNO}"; rr:classex:Teacher; ]; rr:predicateObjectMap [ rr:predicatefoaf:name; rr:objectMap [ rr:column "ENAME" ]; ]. <http://jdev.org/staff/7369> rdf:typeex:Teacher. <http://jdev.org/staff/7369> foaf:name"Catherine". <http://jdev.org/staff/7370> rdf:typeex:Teacher. <http://jdev.org/staff/7370> foaf:name"Olivier".