Linked Data APIs (Funding Circle May 2015)

Preview:

Citation preview

Linked Data APIs

May 2015

Linked Open Data in 1 slide

1. URIs2. Uniform access3. Uniform representation4. Links

Web of linked documents

1. URLs2. HTTP GET/POST3. HTML (DOM tree)4. href

Web of linked data

1. Use URIs to name things2. 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 RDFGET http://mexicans.mx/Carlos#meAccept: application/json+ld

GET http://mexicans.mx/CarlosAccept: 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 RDFGET http://britons.co.uk/Jill#meAccept: text/n3

GET http://britons.co.uk/JillAccept: 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:agefoaf:age

foaf:name

foaf:name Jill

LD API architecture

ABox / Data (RDF)

TBox / Schema (OWL,FOAF,FIBO)

Relational DB

Triple Store

Physical Mapping (R2RML)

Conceptual RDF graph

Linked Resource

Graph partition

HTTPS

CRUD Semantics / SPARQL

REST Semantics / Linked Data Platform (LDP)

Representation

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

Demohttps://github.com/antoniogarrote/geektalk

Github

JSON-LD Macro

RDFStore-js

Stack OverflowTwitter

JSON-LD

DOM Nodes

RDF Graph / DOM Tree declarative bindings (SemKO+SPARQL)

Recommended