a real-world implementation of linked data

Post on 25-Jun-2015

474 Views

Category:

Data & Analytics

3 Downloads

Preview:

Click to see full reader

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

A Real-World Implementation of Linked Data

Dimitri van Hees, APIcon UK 2014

About me

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

About me

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

About me

• Brewmaster• MQTT API driven brewery

“De Brouwtoren”

0641011744

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

0641011744

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

Dimitri

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

Dimitri

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

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)

Five stars of Sir Tim Berners-Lee

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

open license”

★ ★

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

scan of a table)”

★ ★ ★

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

★ ★ ★ ★

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

stuff (RDF)”

★ ★ ★ ★ ★

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

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

Data landscape

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

Data consumers

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

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?

Open Data community

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

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

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

WTF is SPARQL?

Costs

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

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

Five stars of Sir Tim Berners-Lee

★ ★ ★ ★

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

used to (RESTful JSON API)”

★ ★ ★ ★ ★ “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)”

★ ★ ★ ★ ★ ★

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”

Data sources

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

Challenges

• Internal• External• Technical• Agile/rapid development

JSON

JSON-LD

Triples

JSON

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

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"

}

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"

}

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“ } ]}

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“ } ]}

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

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

SPARQL

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

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!

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.

SPARQL

In depth view, statistics

One API, three purposes

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

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

Step 1: JSON support

Step 2: JSON-LD support

Step 3: Triples support

Used technologies

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

“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.”

Thank you!

• Twitter: http://twitter.com/dvh• E-mail: dimitri@freshheads.com• GitHub: http://github.com/dvh• LinkedIn: https://linkedin.com/in/dimitrivanhees

Thank you!

• Twitter: http://twitter.com/dvh• E-mail: dimitri@freshheads.com• GitHub: http://github.com/dvh• LinkedIn: https://linkedin.com/in/dimitrivanhees

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

top related