a real-world implementation of linked data

58
A Real-World Implementation of Linked Data Dimitri van Hees, APIcon UK 2014

Upload: dimitri-van-hees

Post on 25-Jun-2015

474 views

Category:

Data & Analytics


3 download

DESCRIPTION

Learn how one organization put Linked Data to work for it by adding a sixth star - using APIs - to Sir Tim Berners-Lee's 5-Star Scale for implementing Linked Open Data. This session includes an introduction to Linked Open Data, Linked Closed Data, and Berners-Lee's 5 star scale and do a step-by-step walk-through of a successful implementation. It includes a frank discussion regarding the technical and organizational challenges encountered with a real-world Linked Data project and how those challenges were overcome. In this presentation, you will not only learn how to think about Linked Data APIs in real world terms, but also how to "sell" it to the organization."

TRANSCRIPT

Page 1: A Real-World Implementation of Linked Data

A Real-World Implementation of Linked Data

Dimitri van Hees, APIcon UK 2014

Page 2: A Real-World Implementation of Linked Data

About me

• Technical Architect• Data Specialist• Freshheads BV• API supporter

Page 3: A Real-World Implementation of Linked Data

About me

“The only bad thing about API is that it’s the inverse of IPA”

Page 4: A Real-World Implementation of Linked Data

About me

• Brewmaster• MQTT API driven brewery

“De Brouwtoren”

Page 5: A Real-World Implementation of Linked Data
Page 6: A Real-World Implementation of Linked Data

0641011744

• Number• Registration number• Telephone number• Flight number• Bank account

Page 7: A Real-World Implementation of Linked Data

0641011744

• Number• Registration number• Telephone number• Flight number• Bank account

Page 8: A Real-World Implementation of Linked Data

Dimitri

• String• Word• Place• Dimitri van Hees• Dimitri the Clown

Page 9: A Real-World Implementation of Linked Data

Dimitri

• String• Word• Place• Dimitri van Hees• Dimitri the Clown

Page 10: A Real-World Implementation of Linked Data

Linked Data

• Alias The Semantic Web, Web 3.0• Defines what the data means (government)• Provides links to external resources (apps)• Adds possibility to query multiple datasets

(marketing)

Page 11: A Real-World Implementation of Linked Data

Five stars of Sir Tim Berners-Lee

Page 12: A Real-World Implementation of Linked Data

“Make your stuff available on the Web (whatever format) under an

open license”

Page 13: A Real-World Implementation of Linked Data

★ ★

“Make it available as structured data (e.g., Excel instead of image

scan of a table)”

Page 14: A Real-World Implementation of Linked Data

★ ★ ★

“Use non-proprietary formats (e.g., CSV instead of Excel)”

Page 15: A Real-World Implementation of Linked Data

★ ★ ★ ★

“Use URIs to denote things, so that people can point at your

stuff (RDF)”

Page 16: A Real-World Implementation of Linked Data

★ ★ ★ ★ ★

“Link your data to other data to provide context (Linked Data)”

Page 17: A Real-World Implementation of Linked Data

Dutch Linked Open Data Program• Universities• Governments• Semi-governments• Freshheads (me)• Case 5: Linked Data for developers

Page 18: A Real-World Implementation of Linked Data

Data landscape

• Open Data community• Linked Open Data community• API community• Data publishers• Data consumers

Page 19: A Real-World Implementation of Linked Data

Data consumers

• Provide us the developer-friendliest way to access your data and we MIGHT use it

Page 20: A Real-World Implementation of Linked Data

Data publishers

• HOW should we publish our data?• What are the COSTS of doing it that way?• What are the BENEFITS of doing it that way?

Page 21: A Real-World Implementation of Linked Data

Open Data community

• We don’t care HOW the data is published• We only care IF the data is open

Page 22: A Real-World Implementation of Linked Data

API community

• Every publisher SHOULD provide RESTful JSON API’s• Because every consumer KNOWS RESTful JSON API’s• We DON’T believe in Linked Data

Page 23: A Real-World Implementation of Linked Data

Linked Open Data community• Every publisher SHOULD provide five star data• Every consumer SHOULD learn SPARQL*• So we DON’T need API’s

*Linked Data query language

Page 24: A Real-World Implementation of Linked Data

WTF is SPARQL?

Page 26: A Real-World Implementation of Linked Data

Costs

• Knowledge investment (unknown technology)• Technical investment (hosting infrastructure)• Time investment (change management)• Low ROI

Page 27: A Real-World Implementation of Linked Data

“The quality of many datasets is AT MOST three stars”

Page 28: A Real-World Implementation of Linked Data

Five stars of Sir Tim Berners-Lee

Page 29: A Real-World Implementation of Linked Data
Page 30: A Real-World Implementation of Linked Data

★ ★ ★ ★

“Provide online access via webservices so developers can use your stuff the way they are

used to (RESTful JSON API)”

Page 31: A Real-World Implementation of Linked Data

★ ★ ★ ★ ★ “Add context to your API so it can be linked to other datasets, developers know what the data means and LOD guys can convert it to triples, store it in triplestores and use SPARQL if they

want to (JSON-LD)”

Page 32: A Real-World Implementation of Linked Data

★ ★ ★ ★ ★ ★

Page 33: A Real-World Implementation of Linked Data

Case

“Build a dashboard with which we are capable to better learn about our

fans and customers so that we can take action on that knowledge to win

sympathy for our brand”

Page 34: A Real-World Implementation of Linked Data

Data sources

• Facebook (likes, favorites, education, profile)• LinkedIn (skills, education, jobs, profile)• Twitter profiles• Website profiles

Page 35: A Real-World Implementation of Linked Data

Challenges

• Internal• External• Technical• Agile/rapid development

Page 36: A Real-World Implementation of Linked Data

JSON

JSON-LD

Triples

Page 37: A Real-World Implementation of Linked Data

JSON

{ "id": 43274, "name": "Dimitri van Hees", "gender": "m", "birthDate": "1984-03-14", "birthPlace": "Nijmegen", "facebookLikes": [ 69116329538, 272002449634285, 114690771875816 ]}

Page 38: A Real-World Implementation of Linked Data

JSON-LD Context

{

"id": "@id",

"name": "http://xmlns.com/foaf/0.1/name",

"gender": "http://xmlns.com/foaf/0.1/gender",

"birthDate": "http://schema.org/birthDate",

"birthPlace": "http://dbpedia.org/ontology/birthPlace",

"facebookLike": "http://xmlns.com/foaf/0.1/interest"

}

Page 39: A Real-World Implementation of Linked Data

JSON-LD Context{

"foaf": "http://xmlns.com/foaf/0.1/",

"schema": "http://schema.org/",

"dbo": "http://dbpedia.org/ontology/",

"id": "@id",

"name": "foaf:name",

"gender": "foaf:gender",

"birthDate": "schema:birthDate",

"birthPlace": "dbo:birthPlace",

"facebookLikes": "foaf:interest"

}

Page 40: A Real-World Implementation of Linked Data

JSON-LD{ "id": "http://example.com/customers/43274", "type": "schema:Person", "name": "Dimitri van Hees", "gender": "m", "birthDate": "1984-03-14", "birthPlace": { "id": "http://dbpedia.org/resource/Nijmegen", "type": "schema:City" }, "facebookLikes": [ { "id": "http://graph.facebook.com/69116329538", "type": "schema:MusicGroup“ }, { "id": "http://graph.facebook.com/272002449634285", "type": "schema:TVSeries“ }, { "id": "http://graph.facebook.com/114690771875816", "type": "schema:City“ } ]}

Page 41: A Real-World Implementation of Linked Data

JSON-LD{ "id": "http://example.com/customers/43274", "type": "schema:Person", "name": "Dimitri van Hees", "gender": "m", "birthDate": "1984-03-14", "birthPlace": { "id": "http://dbpedia.org/resource/Nijmegen", "type": "schema:City" }, "facebookLikes": [ { "id": "http://dbpedia.org/resource/The_Beatles", "type": "schema:MusicGroup“ }, { "id": "http://dbpedia.org/resource/Monty_Python", "type": "schema:TVSeries“ }, { "id": "http://dbpedia.org/resource/Nijmegen", "type": "schema:City“ } ]}

Page 42: A Real-World Implementation of Linked Data

TriplesSubject Predicate Object

http://example.com/customers/43274

http://xmlns.com/foaf/0.1/name

"Dimitri van Hees"

http://example.com/customers/43274

http://xmlns.com/foaf/0.1/gender

"m"

http://example.com/customers/43274

http://dbpedia.org/ontology/birthPlace

http://dbpedia.org/resource/Nijmegen

http://example.com/customers/43274

http://xmlns.com/foaf/0.1/interest

http://dbpedia.org/resource/The_Beatles

http://example.com/customers/43274

http://xmlns.com/foaf/0.1/interest

http://dbpedia.org/resource/Monty_Python

http://example.com/customers/43274

http://xmlns.com/foaf/0.1/interest

http://dbpedia.org/resource/Nijmegen

Page 43: A Real-World Implementation of Linked Data

Triplestore: AllegroGraph

• Database for triples• Free up to 5.000.000 triples• SPARQL 1.1 support• REST API• Local installation (privacy)• Help from LOD community

Page 44: A Real-World Implementation of Linked Data
Page 45: A Real-World Implementation of Linked Data
Page 46: A Real-World Implementation of Linked Data

SPARQL

• SPARQL Protocal And RDF Query Language• SPARQL Endpoint !== API• SPARQL looks like SQL but isn’t

Page 47: A Real-World Implementation of Linked Data

SPARQL

• SPARQL Protocal And RDF Query Language• SPARQL Endpoint !== API• SPARQL looks like SQL but isn’t

• Just like Dutch looks like German but isn’t… Again, it’s all about context!

Page 48: A Real-World Implementation of Linked Data

SPARQL 1.1: federated queries• Which people older than 40 live in a capital?• Which people live in a city with more than 600.000

inhabitants?• Which people live in another country than they

were born and like The Beatles?• Which people like a movie from a certain director?• Etc.

Page 49: A Real-World Implementation of Linked Data

SPARQL

Page 50: A Real-World Implementation of Linked Data

In depth view, statistics

Page 51: A Real-World Implementation of Linked Data

One API, three purposes

• Conversion to Linked Data• Export possibilities using content-negotiation:

JSON, JSON-LD, CSV, Triples• Orchestration layer for the app

Page 52: A Real-World Implementation of Linked Data

Step 1: JSON support

Page 53: A Real-World Implementation of Linked Data

Step 2: JSON-LD support

Page 54: A Real-World Implementation of Linked Data

Step 3: Triples support

Page 55: A Real-World Implementation of Linked Data

Used technologies

• AngularJS frontend• RAML modeling language• MongoDB raw data store• AllegroGraph triplestore• Symfony2 PHP API

Page 56: A Real-World Implementation of Linked Data

“The Semantic Web does exist and goes hand in hand with API’s. Using six stars instead of five, API’s are actually part of

the deployment scheme while making live easier for data publishers and data

consumers. Let’s bridge the gap, bring the best of both worlds, and let’s change the

web together.”

Page 57: A Real-World Implementation of Linked Data

Thank you!

• Twitter: http://twitter.com/dvh• E-mail: [email protected]• GitHub: http://github.com/dvh• LinkedIn: https://linkedin.com/in/dimitrivanhees

Page 58: A Real-World Implementation of Linked Data

Thank you!

• Twitter: http://twitter.com/dvh• E-mail: [email protected]• GitHub: http://github.com/dvh• LinkedIn: https://linkedin.com/in/dimitrivanhees

• Brewery: http://facebook.com/brouwtoren