Linked Data APIs
May 2015
Linked Open Data in 1 slide
1. URIs
2. Uniform access
3. Uniform representation
4. Links
Web of linked documents
1. URLs
2. HTTP GET/POST
3. HTML (DOM tree)
4. href
Web of linked data
1. Use URIs to name things
2. Make URIs accessible through HTTP with
standard uniform semantics (REST)
3. Use standard uniform representations for the
exposed things (RDF)
4. Link representations
A note on RDF
Uniform and general data model
Carlos
33 31
Jillhttp://mexicans.mx/Carlos#me
http://britons.co.uk/Jill#me
foaf:friendOf
foaf:age
foaf:age
foaf:name
foaf:name
A note on RDF
Abstract graph, concrete triples
http://mexicans.mx/Carlos#me foaf:age (33 xsd:int)
http://mexicans.mx/Carlos#me foaf:name (‘Carlos’ xsd:string)
http://mexicans.mx/Carlos#me foaf:friendOf http://britons.co.uk/Jill#me
http://britons.co.uk/Jill#me foaf:age (31 xsd:int)
http://britons.co.uk/Jill#me foaf:name (‘Jill’ xsd:String)
http://britons.co.uk/Jill#me foaf:friendOf http://mexicans.mx/Carlos#me
A note on RDF
GET http://mexicans.mx/Carlos#me
Accept: application/json+ld
GET http://mexicans.mx/Carlos
Accept: application/json+ld
{
"@id": "http://mexicans.mx/Carlos#me",
"name": "Carlos",
"age": 33,
"knows": "http://britons.co.uk/Jill#me",
"@context": {
"@vocab": "http://xmlns.com/foaf/0.1/",
"friendOf": {"@type":"@id"}
}
}
http://mexicans.mx/Carlos#me foaf:age (33 xsd:int)
http://mexicans.mx/Carlos#me foaf:name (‘Carlos’ xsd:string)
http://mexicans.mx/Carlos#me foaf:friendOf http://britons.co.uk/Jill#me
Carlos
33
http://mexicans.mx/Carlos#me
foaf:friendOf
foaf:age
foaf:name
http://britons.co.uk/Jill#me
A note on RDF
GET http://britons.co.uk/Jill#me
Accept: text/n3
GET http://britons.co.uk/Jill
Accept: text/n3
<http://britons.co.uk/Jill#me>
<foaf:name> “Jill” ;
<foaf:age> 35^^<xsd:int> ;
<foaf:friendOf> <http://mexicans.mx/Carlos#me> .
http://britons.co.uk/Jill#me foaf:age (31 xsd:int)
http://britons.co.uk/Jill#me foaf:name (‘Jill’ xsd:String)
http://britons.co.uk/Jill#me foaf:friendOf http://mexicans.mx/Carlos#me
Carlo
s
33 31
http://mexicans.mx/Carlos#me
http://britons.co.uk/Jill#me
foaf:friendOf
foaf:age
foaf:age
foaf:name
foaf:name
Jill
LD API architecture
ABox / Data (RDF)
TBox / Schema
(OWL,FOAF,FIBO)
Relatio
nal DB
Triple
Store
Physical Mapping (R2RML)
Conceptual RDF graph
Linked
Resource
Graph partition
HTTPS
CRUD Semantics / SPARQL
REST Semantics / Linked
Data Platform (LDP)
Representa
tion
JSON-LD, N3, Turtle, RDF/XML
URL
Legacy
API
Authentication / WebID
(W3C Recommendations)
API design advice
● Use URIs, not db ids, UUIDs...
● Design a data model, not end-points
● Re-use vocabularies / ontologies
● Link entities, don’t embed them
● Data needs a schema / meta-data
● Representation is different from data model
Demo
https://github.com/antoniogarrote/geektalk
Github
JSON-LD Macro
RDFStore-js
Stack OverflowTwitter
JSON-LD
DOM Nodes
RDF Graph / DOM Tree declarative bindings (SemKO+SPARQL)
Linked Data APIs (Funding Circle May 2015)
Linked Data APIs (Funding Circle May 2015)
Linked Data APIs (Funding Circle May 2015)
Linked Data APIs (Funding Circle May 2015)

Linked Data APIs (Funding Circle May 2015)

  • 1.
  • 2.
    Linked Open Datain 1 slide 1. URIs 2. Uniform access 3. Uniform representation 4. Links
  • 3.
    Web of linkeddocuments 1. URLs 2. HTTP GET/POST 3. HTML (DOM tree) 4. href
  • 4.
    Web of linkeddata 1. Use URIs to name things 2. Make URIs accessible through HTTP with standard uniform semantics (REST) 3. Use standard uniform representations for the exposed things (RDF) 4. Link representations
  • 5.
    A note onRDF Uniform and general data model Carlos 33 31 Jillhttp://mexicans.mx/Carlos#me http://britons.co.uk/Jill#me foaf:friendOf foaf:age foaf:age foaf:name foaf:name
  • 6.
    A note onRDF Abstract graph, concrete triples http://mexicans.mx/Carlos#me foaf:age (33 xsd:int) http://mexicans.mx/Carlos#me foaf:name (‘Carlos’ xsd:string) http://mexicans.mx/Carlos#me foaf:friendOf http://britons.co.uk/Jill#me http://britons.co.uk/Jill#me foaf:age (31 xsd:int) http://britons.co.uk/Jill#me foaf:name (‘Jill’ xsd:String) http://britons.co.uk/Jill#me foaf:friendOf http://mexicans.mx/Carlos#me
  • 7.
    A note onRDF GET http://mexicans.mx/Carlos#me Accept: application/json+ld GET http://mexicans.mx/Carlos Accept: application/json+ld { "@id": "http://mexicans.mx/Carlos#me", "name": "Carlos", "age": 33, "knows": "http://britons.co.uk/Jill#me", "@context": { "@vocab": "http://xmlns.com/foaf/0.1/", "friendOf": {"@type":"@id"} } } http://mexicans.mx/Carlos#me foaf:age (33 xsd:int) http://mexicans.mx/Carlos#me foaf:name (‘Carlos’ xsd:string) http://mexicans.mx/Carlos#me foaf:friendOf http://britons.co.uk/Jill#me Carlos 33 http://mexicans.mx/Carlos#me foaf:friendOf foaf:age foaf:name http://britons.co.uk/Jill#me
  • 8.
    A note onRDF GET http://britons.co.uk/Jill#me Accept: text/n3 GET http://britons.co.uk/Jill Accept: text/n3 <http://britons.co.uk/Jill#me> <foaf:name> “Jill” ; <foaf:age> 35^^<xsd:int> ; <foaf:friendOf> <http://mexicans.mx/Carlos#me> . http://britons.co.uk/Jill#me foaf:age (31 xsd:int) http://britons.co.uk/Jill#me foaf:name (‘Jill’ xsd:String) http://britons.co.uk/Jill#me foaf:friendOf http://mexicans.mx/Carlos#me Carlo s 33 31 http://mexicans.mx/Carlos#me http://britons.co.uk/Jill#me foaf:friendOf foaf:age foaf:age foaf:name foaf:name Jill
  • 9.
    LD API architecture ABox/ Data (RDF) TBox / Schema (OWL,FOAF,FIBO) Relatio nal DB Triple Store Physical Mapping (R2RML) Conceptual RDF graph Linked Resource Graph partition HTTPS CRUD Semantics / SPARQL REST Semantics / Linked Data Platform (LDP) Representa tion JSON-LD, N3, Turtle, RDF/XML URL Legacy API Authentication / WebID (W3C Recommendations)
  • 10.
    API design advice ●Use URIs, not db ids, UUIDs... ● Design a data model, not end-points ● Re-use vocabularies / ontologies ● Link entities, don’t embed them ● Data needs a schema / meta-data ● Representation is different from data model
  • 11.
  • 12.
    Github JSON-LD Macro RDFStore-js Stack OverflowTwitter JSON-LD DOMNodes RDF Graph / DOM Tree declarative bindings (SemKO+SPARQL)