Introduction
to
W3C Linked Data Platform (LDP)
Nandana Mihindukulasooriya,
W3C Linked Data Platform WG,
Ontology Engineering Group,
Universidad Politécnica de Madrid,
Spain.
@nandanamihindu
LDAC 2016 - June 21st, 2016 – Madrid, Spain
From static web pages …
2
1991
To Web 2.0, Web APIs, etc …
3
2004
Linked Data
4
Linked Data principles
• 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
Tim Berners-Lee. Linked data-design issues (2006) http://www. w3.org/DesignIssues/LinkedData.html
Leo Sauermann and Richard Cyganiak. Cool URIs for the Semantic Web (2008) http://www.w3.org/TR/cooluris/
Tom Heath and Christian Bizer. Linked Data: Evolving the Web into a Global Data Space (2011) http://linkeddatabook.com/
2006
Let’s see an example
5
FI - UPM
Bloque 5
GET /data/building/bloque3#it HTTP/1.1
Host: fi.upm.es
HTTP/1.1 200 OK
Content-Type: text/turtle; charset=UTF-8
Content-Length: 250
@prefix dc: <http://purl.org/dc/terms/> .
@prefix dbo: <http://dbpedia.org/ontology/> .
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix ifc: <http://ifcowl.openbimstandards.org/IFC4#> .
<http://fi.upm.es/data/bloque3#it> a ifc:IfcBuilding;
ifc:buildingAddress_IfcBuilding _:address;
geo:long "-116.175869655195683"^^xsd:decimal ;
geo:lat "43.544840771226816"^^xsd:decimal ;
dbo:city <http://dbpedia.org/resource/Madrid>;
dbo:owningOrganisation <http://fi.upm.es> .
(1)
(3)
(4)
(2) http://fi.upm.es/data/bloque3#it
Linked Data Platform 1.0 http://www.w3.org/2012/ldp/
6
• RESTful protocol for Read / Write Linked Data
• Extensions to HTTP protocol
• Pagination, ordering, partial updates, introspection, creation factories,
collections
• Standardization focused of interoperability
• Developed by W3C Linked Data Platform Working Group
• 54 participants from 32 organizations
• Industry: IBM, Oracle, EMC, Fujitsu, OpenLink Software, Base22, …
• Academia: Universidad Politécnica de Madrid, MIT, University of
Oxford, DERI, Université de Lyon, INRIA, …
• Progress:
• W3C LDP WG created, 18 June 2012,
• W3C Candidate Recommendation 19 June 2014,
• W3C Proposed Recommendation 18 November 2014
• W3C Recomendation, 26 February 2015 2012
Outcomes
7
LDP Implementations
8
• 22 implementations
• https://www.w3.org/wiki/LDP_Implementations
• https://www.w3.org/2012/ldp/hg/tests/reports/ldp.html
LDP4j
9
• Java-based framework for the development of read-write Linked
Data applications
• Motto: Focus on your business logic, we will take care of the rest
• License: Apache License, v2.0
• Features:
• Simplified business object handling:
• Lifting from and lowering to an intermediate representation that can be
automatically unmarshalled from or marshalled to RDF, respectively.
• LDP support
• Protocol conversation control
• Transparent metadata management
• REST aware
• Transparent publication of RDF URIRefs.
• HTTP compliant
• The framework takes care of fulfilling the requirements prescribed by the
HTTP related RFCs (i.e., conditional requests processing, content
negotiation, entity tag handling,…)
www.ldp4j.org
https://github.com/ldp4j/ldp4j @LDP4j
contact@ldp4j.org
Other related initiatives
10
• W3C Hydra Community Group
• https://www.w3.org/community/hydra/
• W3C Read Write Web Community Group
• https://www.w3.org/community/rww/
• W3C RDF Shapes Working Group
• https://www.w3.org/2014/data-shapes/charter
• W3C Permissions & Obligations Expression Working
Group
• https://www.w3.org/2016/poe/charter
• WebID Community Group
• https://www.w3.org/community/webid/
What’s next?
LDAC2016 11
LDP IN USE
LDP high-level overview
12
LDP Terminology
13
Common LDP scenarios
14
• Looking up a Linked Data resource
• Paging
• Modifying a Linked Data resource
• Creating Linked Data resources
• Basic Container / Direct Containers / Indirect
containers
• Creating Linked Data Platform containers
• Deleting a Linked Data resource
Looking up a Linked Data resource
15
• a simple HTTP GET with
• additional guarantees
• LDP mandates some features that are optional in HTTP
• e.g., e-tags, HEAD, OPTIONS
GET
200 OK
GET
LDP Paging
16
• Some resources are too large
• Clients may not be able to handle the complete resource
• Alternatives
• Server-driven
• Client-driven
• Client preferences
• max-triple-count, max-kbyte-count, max-member-count
• Page links
• next, canonical, first, last,
Modifying a Linked Data resource
17
200 OK
PUT/PATCH
ETag: “123456789”
If-Match: W/'123456789'
GET
204 No Content
GET
Modify
• uses HTTP PUT or PATCH operations
• encourages conditional requests to avoid “lost update”
problem
LDP Containers
18
• a special type of Linked Data resource that acts as
• an enumeration of a collection of linked documents
• a creation factory
• Handles resource management and clean up
• Flexible and configurable
• Three types of LDP containers
• Direct container
• Direct container
• Indirect container
LDP Basic Container - Creating an LDPR
19
Contact List
<<Basic Container>>
Raul’s
Contact
Miguel’s
Contact
ldp:contains
ldp:contains
Fernando’s
Contact
POST
LDP Basic Container - Creating an LDPR
20
Raul’s
Contact
Miguel’s
Contact
ldp:contains
ldp:contains
Fernando’s
Contact
POST
Fernando’s
Contact
ldp:contains
Contact List
<<Basic Container>>
LDP IN USE
LDP4j in practice
21
morph-LDP
22
• Exposes relational databases as read-write Linked Data
Oegmembers Table
id fname lname
asun Asunción Gómez Pérez
fpriyatna Freddy Priyatna
mesteban Miguel Estebam
nmihindu Nandana Mihindukulas
ocorcho Oscar Corcho
rgarcia Raul Garcia Castro
@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<TriplesMapPerson>
a rr:TriplesMap;
rr:logicalTable [ rr:tableName "oegmembers" ];
rr:subjectMap [ a rr:Subject; rr:class foaf:Person;
rr:template “http://example.org/oeg/members/{id}";
rr:termType rr:IRI; ];
rr:predicateObjectMap [
rr:predicateMap [ rr:constant foaf:firstName ];
rr:objectMap [ rr:column “fname"; rr:termType rr:Literal; ];
];
rr:predicateObjectMap [
rr:predicateMap [ rr:constant foaf:lastName ];
rr:objectMap [ rr:column “lname"; rr:termType rr:Literal; ];
];
…
http://example.org/oeg/members/fpriyatna
Registration
Office
morph-LDP
Web App
Relational
Database
Library
Legacy Applications
configures
exposes
Tabulator
OpenLink Data Explorer
ldspider LDIF
Freddy
Priyatna
dereferences to
GET /oeg/members/ HTTP/1.1
Host: example.org
Accept: text/turtle
200 OK
HTTP/1.1 200 OK
Content-Type: text/turtle; charset=UTF-8
Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
ETag: W/"195482449"
@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix ldp: <http://www.w3.org/ns/ldp#>.
<> a ldp:BasicContainer;
dcterms:title "Members of OEG, UPM";
ldp:contains <http://example.org/oeg/members/asun> ;
ldp:contains <http://example.org/oeg/members/fpriyatna> ;
ldp:contains <http://example.org/oeg/members/mesteban>;
ldp:contains <http://example.org/oeg/members/nmihindu>;
ldp:contains <http://example.org/oeg/members/ocorcho> ;
ldp:contains <http://example.org/oeg/members/rgarcia> .
Read-write LDMorph-LDPDatabase + R2RML
mappings
Mihindukulasooriya, N., Priyatna, F., Corcho, O., Garcıa-Castro, R., Esteban-
Gutiérrez, M.: morph-LDP: An R2RML-based Linked Data Platform implementation.
Demo at the 11th Extended Semantic Web Conference, Crete, Greece (May 2014)
The Bugzilla LDP adapter
23
• Exposes Bugzilla as an LDP-enabled application
 RDF
 HTTP
Headers
LDP Clients
Bugzilla
LDP Adapter
 XML-RPC
 Native data
model
ALM iStack ontology
POST /ita/containers/bugs HTTP/1.1
Host: localhost
Content-Type: text/turtle
@prefix ai: <http://delicias.dia.fi.upm.es/ontologies/alm-istack#> .
…rest of the namespace declarations are omitted for brevity.
<> a ai:ClientDefect;
dcterms:creator <http://localhost/ita/ldp/resources/users/9> ;
dcterms:title "Bugzilla adapter build is broken"^^xsd:string;
dcterms:description "Bugzilla adapter build fails due to a
test failure"^^xsd:string;
oslc_asset:relatedAsset <http://localhost/ita/ldp/resources/versions/16> ;
ai:relatedIncident <https://bugzilla.mozilla.org/show_bug.cgi?id=730698> .
HTTP/1.1 201 Created
Location: http://localhost/ita/ldp/resources/bugs/12
Link: <http://www.w3.org/ns/ldp#Resource>; rel='type'
Content-Length: 0
An example of bug creation
Mihindukulasooriya, N., Esteban-Gutiérrez, M., García-Castro, R.: A Linked Data
Platform adapter for the Bugzilla issue tracker. Demo at the 13th International
Semantic Web Conference, Riva del Garda, Italy (Oct 2014)
Smart Developer Hub
24
• integration of heterogeneous ALM tools and the
provision of tool-independent metrics
References
25
• Linked Data Platform 1.0
• http://www.w3.org/TR/ldp/
• Linked Data Platform 1.0 Primer
• http://www.w3.org/TR/ldp-primer/
• Linked Data Platform Best Practices and Guidelines
• http://www.w3.org/TR/ldp-bp/
• Linked Data Platform Paging 1.0
• http://www.w3.org/TR/ldp-paging/
• Linked Data Patch Format
• http://www.w3.org/TR/ldpatch/
Questions?
Nandana Mihindukulasooriya,
W3C Linked Data Platform WG,
Ontology Engineering Group,
Universidad Politécnica de Madrid,
Spain.
@nandanamihindu

Introduction to W3C Linked Data Platform

  • 1.
    Introduction to W3C Linked DataPlatform (LDP) Nandana Mihindukulasooriya, W3C Linked Data Platform WG, Ontology Engineering Group, Universidad Politécnica de Madrid, Spain. @nandanamihindu LDAC 2016 - June 21st, 2016 – Madrid, Spain
  • 2.
    From static webpages … 2 1991
  • 3.
    To Web 2.0,Web APIs, etc … 3 2004
  • 4.
    Linked Data 4 Linked Dataprinciples • 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 Tim Berners-Lee. Linked data-design issues (2006) http://www. w3.org/DesignIssues/LinkedData.html Leo Sauermann and Richard Cyganiak. Cool URIs for the Semantic Web (2008) http://www.w3.org/TR/cooluris/ Tom Heath and Christian Bizer. Linked Data: Evolving the Web into a Global Data Space (2011) http://linkeddatabook.com/ 2006
  • 5.
    Let’s see anexample 5 FI - UPM Bloque 5 GET /data/building/bloque3#it HTTP/1.1 Host: fi.upm.es HTTP/1.1 200 OK Content-Type: text/turtle; charset=UTF-8 Content-Length: 250 @prefix dc: <http://purl.org/dc/terms/> . @prefix dbo: <http://dbpedia.org/ontology/> . @prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> . @prefix ifc: <http://ifcowl.openbimstandards.org/IFC4#> . <http://fi.upm.es/data/bloque3#it> a ifc:IfcBuilding; ifc:buildingAddress_IfcBuilding _:address; geo:long "-116.175869655195683"^^xsd:decimal ; geo:lat "43.544840771226816"^^xsd:decimal ; dbo:city <http://dbpedia.org/resource/Madrid>; dbo:owningOrganisation <http://fi.upm.es> . (1) (3) (4) (2) http://fi.upm.es/data/bloque3#it
  • 6.
    Linked Data Platform1.0 http://www.w3.org/2012/ldp/ 6 • RESTful protocol for Read / Write Linked Data • Extensions to HTTP protocol • Pagination, ordering, partial updates, introspection, creation factories, collections • Standardization focused of interoperability • Developed by W3C Linked Data Platform Working Group • 54 participants from 32 organizations • Industry: IBM, Oracle, EMC, Fujitsu, OpenLink Software, Base22, … • Academia: Universidad Politécnica de Madrid, MIT, University of Oxford, DERI, Université de Lyon, INRIA, … • Progress: • W3C LDP WG created, 18 June 2012, • W3C Candidate Recommendation 19 June 2014, • W3C Proposed Recommendation 18 November 2014 • W3C Recomendation, 26 February 2015 2012
  • 7.
  • 8.
    LDP Implementations 8 • 22implementations • https://www.w3.org/wiki/LDP_Implementations • https://www.w3.org/2012/ldp/hg/tests/reports/ldp.html
  • 9.
    LDP4j 9 • Java-based frameworkfor the development of read-write Linked Data applications • Motto: Focus on your business logic, we will take care of the rest • License: Apache License, v2.0 • Features: • Simplified business object handling: • Lifting from and lowering to an intermediate representation that can be automatically unmarshalled from or marshalled to RDF, respectively. • LDP support • Protocol conversation control • Transparent metadata management • REST aware • Transparent publication of RDF URIRefs. • HTTP compliant • The framework takes care of fulfilling the requirements prescribed by the HTTP related RFCs (i.e., conditional requests processing, content negotiation, entity tag handling,…) www.ldp4j.org https://github.com/ldp4j/ldp4j @LDP4j contact@ldp4j.org
  • 10.
    Other related initiatives 10 •W3C Hydra Community Group • https://www.w3.org/community/hydra/ • W3C Read Write Web Community Group • https://www.w3.org/community/rww/ • W3C RDF Shapes Working Group • https://www.w3.org/2014/data-shapes/charter • W3C Permissions & Obligations Expression Working Group • https://www.w3.org/2016/poe/charter • WebID Community Group • https://www.w3.org/community/webid/
  • 11.
  • 12.
    LDP IN USE LDPhigh-level overview 12
  • 13.
  • 14.
    Common LDP scenarios 14 •Looking up a Linked Data resource • Paging • Modifying a Linked Data resource • Creating Linked Data resources • Basic Container / Direct Containers / Indirect containers • Creating Linked Data Platform containers • Deleting a Linked Data resource
  • 15.
    Looking up aLinked Data resource 15 • a simple HTTP GET with • additional guarantees • LDP mandates some features that are optional in HTTP • e.g., e-tags, HEAD, OPTIONS GET 200 OK GET
  • 16.
    LDP Paging 16 • Someresources are too large • Clients may not be able to handle the complete resource • Alternatives • Server-driven • Client-driven • Client preferences • max-triple-count, max-kbyte-count, max-member-count • Page links • next, canonical, first, last,
  • 17.
    Modifying a LinkedData resource 17 200 OK PUT/PATCH ETag: “123456789” If-Match: W/'123456789' GET 204 No Content GET Modify • uses HTTP PUT or PATCH operations • encourages conditional requests to avoid “lost update” problem
  • 18.
    LDP Containers 18 • aspecial type of Linked Data resource that acts as • an enumeration of a collection of linked documents • a creation factory • Handles resource management and clean up • Flexible and configurable • Three types of LDP containers • Direct container • Direct container • Indirect container
  • 19.
    LDP Basic Container- Creating an LDPR 19 Contact List <<Basic Container>> Raul’s Contact Miguel’s Contact ldp:contains ldp:contains Fernando’s Contact POST
  • 20.
    LDP Basic Container- Creating an LDPR 20 Raul’s Contact Miguel’s Contact ldp:contains ldp:contains Fernando’s Contact POST Fernando’s Contact ldp:contains Contact List <<Basic Container>>
  • 21.
    LDP IN USE LDP4jin practice 21
  • 22.
    morph-LDP 22 • Exposes relationaldatabases as read-write Linked Data Oegmembers Table id fname lname asun Asunción Gómez Pérez fpriyatna Freddy Priyatna mesteban Miguel Estebam nmihindu Nandana Mihindukulas ocorcho Oscar Corcho rgarcia Raul Garcia Castro @prefix rr: <http://www.w3.org/ns/r2rml#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . <TriplesMapPerson> a rr:TriplesMap; rr:logicalTable [ rr:tableName "oegmembers" ]; rr:subjectMap [ a rr:Subject; rr:class foaf:Person; rr:template “http://example.org/oeg/members/{id}"; rr:termType rr:IRI; ]; rr:predicateObjectMap [ rr:predicateMap [ rr:constant foaf:firstName ]; rr:objectMap [ rr:column “fname"; rr:termType rr:Literal; ]; ]; rr:predicateObjectMap [ rr:predicateMap [ rr:constant foaf:lastName ]; rr:objectMap [ rr:column “lname"; rr:termType rr:Literal; ]; ]; … http://example.org/oeg/members/fpriyatna Registration Office morph-LDP Web App Relational Database Library Legacy Applications configures exposes Tabulator OpenLink Data Explorer ldspider LDIF Freddy Priyatna dereferences to GET /oeg/members/ HTTP/1.1 Host: example.org Accept: text/turtle 200 OK HTTP/1.1 200 OK Content-Type: text/turtle; charset=UTF-8 Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type" ETag: W/"195482449" @prefix dcterms: <http://purl.org/dc/terms/>. @prefix ldp: <http://www.w3.org/ns/ldp#>. <> a ldp:BasicContainer; dcterms:title "Members of OEG, UPM"; ldp:contains <http://example.org/oeg/members/asun> ; ldp:contains <http://example.org/oeg/members/fpriyatna> ; ldp:contains <http://example.org/oeg/members/mesteban>; ldp:contains <http://example.org/oeg/members/nmihindu>; ldp:contains <http://example.org/oeg/members/ocorcho> ; ldp:contains <http://example.org/oeg/members/rgarcia> . Read-write LDMorph-LDPDatabase + R2RML mappings Mihindukulasooriya, N., Priyatna, F., Corcho, O., Garcıa-Castro, R., Esteban- Gutiérrez, M.: morph-LDP: An R2RML-based Linked Data Platform implementation. Demo at the 11th Extended Semantic Web Conference, Crete, Greece (May 2014)
  • 23.
    The Bugzilla LDPadapter 23 • Exposes Bugzilla as an LDP-enabled application  RDF  HTTP Headers LDP Clients Bugzilla LDP Adapter  XML-RPC  Native data model ALM iStack ontology POST /ita/containers/bugs HTTP/1.1 Host: localhost Content-Type: text/turtle @prefix ai: <http://delicias.dia.fi.upm.es/ontologies/alm-istack#> . …rest of the namespace declarations are omitted for brevity. <> a ai:ClientDefect; dcterms:creator <http://localhost/ita/ldp/resources/users/9> ; dcterms:title "Bugzilla adapter build is broken"^^xsd:string; dcterms:description "Bugzilla adapter build fails due to a test failure"^^xsd:string; oslc_asset:relatedAsset <http://localhost/ita/ldp/resources/versions/16> ; ai:relatedIncident <https://bugzilla.mozilla.org/show_bug.cgi?id=730698> . HTTP/1.1 201 Created Location: http://localhost/ita/ldp/resources/bugs/12 Link: <http://www.w3.org/ns/ldp#Resource>; rel='type' Content-Length: 0 An example of bug creation Mihindukulasooriya, N., Esteban-Gutiérrez, M., García-Castro, R.: A Linked Data Platform adapter for the Bugzilla issue tracker. Demo at the 13th International Semantic Web Conference, Riva del Garda, Italy (Oct 2014)
  • 24.
    Smart Developer Hub 24 •integration of heterogeneous ALM tools and the provision of tool-independent metrics
  • 25.
    References 25 • Linked DataPlatform 1.0 • http://www.w3.org/TR/ldp/ • Linked Data Platform 1.0 Primer • http://www.w3.org/TR/ldp-primer/ • Linked Data Platform Best Practices and Guidelines • http://www.w3.org/TR/ldp-bp/ • Linked Data Platform Paging 1.0 • http://www.w3.org/TR/ldp-paging/ • Linked Data Patch Format • http://www.w3.org/TR/ldpatch/
  • 26.
    Questions? Nandana Mihindukulasooriya, W3C LinkedData Platform WG, Ontology Engineering Group, Universidad Politécnica de Madrid, Spain. @nandanamihindu