semantic web introduction [email protected]

26
Semantic Web Introduction [email protected]

Upload: nico-dawn

Post on 14-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Semantic Web Introduction

[email protected]

2

IntroductionData 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

3

SPARQL 1.1 ProtocolConveying SPARQL queries and updates to a processing service

Returning the results via HTTP

4

SPARQL 1.1 ProtocolConveying SPARQL queries and updates to a processing service

Returning the results via HTTP

http://fr.dbpedia.org/sparql?query=select distinct * where { <http://fr.dbpedia.org/resource/Auguste> ?p ?v } limit 100

5

SPARQL 1.1 ProtocolConveying SPARQL queries and updates to a processing service

Returning the results via HTTP

http://fr.dbpedia.org/sparql?query=select distinct * where { <http://fr.dbpedia.org/resource/Auguste> ?p ?v } limit 100

6

SPARQL 1.1 ProtocolConveying SPARQL queries and updates to a processing service

Returning the results via HTTP

http://fr.dbpedia.org/sparql?query=select distinct * where { <http://fr.dbpedia.org/resource/Auguste> ?p ?v } limit 100

7

SPARQL 1.1 ProtocolConveying SPARQL queries and updates to a processing service

Returning the results via HTTP

http://example.org/sparql?update=insert data {<a> <b> <c>}

8

SPARQL 1.1 ProtocolConveying SPARQL queries and updates to a processing service

Returning the results via HTTP

http://example.org/sparql?update=insert data {<a> <b> <c>}

9

SPARQL 1.1 Graph Store HTTP ProtocolSpecifies 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

10

SPARQL 1.1 Graph Store HTTP ProtocolSpecifies 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

11

SPARQL 1.1 Graph Store HTTP ProtocolSpecifies 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

12

SPARQL 1.1 Graph Store HTTP ProtocolHTTP 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:Olivier a ex:Teacher .

13

SPARQL 1.1 Graph Store HTTP ProtocolHTTP 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:Olivier a ex:Teacher .

14

SPARQL 1.1 Graph Store HTTP ProtocolHTTP 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:Olivier a ex:Teacher .

15

SPARQL 1.1 Graph Store HTTP Protocol

HTTP POST: INSERT

HTTP DELETE

16

Linked Data

1. Use URIs as names for things

2. Use HTTP URIs so that people can look up those names

3. When someone looks up a URI, provide useful information, using the standards (RDF*, SPARQL)

4. Include links to other URIs, so that they can discover more things

17

Linked Data PlatformBest practices for:

read-write Linked Data architecture, based on HTTP access to web resources resources describe their state using RDF

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

18

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.

19

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>

20

RDF in Attributes: RDFa

prefix ex: <http://jdev.org/schema/><http://example.org/jdev/program/sw>

rdf:type ex:Course ;ex:date "2013-09-05" ;ex:location <http://www.polytechnique.fr> .

21

GRDDLGleaning Resource Descriptions from Dialects of Languages

Obtaining RDF data from XML documents

Use a profile

Indicate a transformation

22

GRDDLUse 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"> <head profile="http://www.w3.org/2003/g/data-view" > <title>Robin's Schedule</title> <link rel="transformation"

href="http://www.w3.org/2002/12/cal/glean-hcal" /> </head> <body> ...

23

GRDDLIndicate 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"> <head profile="http://www.w3.org/2003/g/data-view" > <title>Robin's Schedule</title> <link rel="transformation"

href="http://www.w3.org/2002/12/cal/glean-hcal" /> </head> <body> ...

24

R2RMLRDB to RDF Mapping Language

1. Direct Mapping of Relational Data to RDF

2. Customized Mapping from relational databases to RDF

25

R2RML Direct Mapping Direct translation of table to triples

Subject is « Table/ID » Property is « 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> .

Table: People

ID fname addr (Address)

7 Catherine 18

8 Olivier 22

… … …

26

R2RML Customized Mapping <#TriplesMap1> rr:logicalTable [ rr:tableName "EMP" ];

rr:subjectMap [ rr:template "http://jdev.org/staff/{EMPNO}"; rr:class ex:Teacher; ];

rr:predicateObjectMap [ rr:predicate foaf:name; rr:objectMap [ rr:column "ENAME" ]; ].

<http://jdev.org/staff/7369> rdf:type ex:Teacher.<http://jdev.org/staff/7369> foaf:name "Catherine".<http://jdev.org/staff/7370> rdf:type ex:Teacher.<http://jdev.org/staff/7370> foaf:name "Olivier".