Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

APIs and the Semantic Web: publishing information instead of data

546 views

Published on

Learn the difference between data and information and get Linked Data to work by adding a sixth star – using APIs – to Sir Tim Berners-Lee’s 5-Star model for publishing information on the Semantic Web. This session includes an introduction to Linked Open Data, Linked Closed Data, JSON-LD and the 5-Star model and provides a step-by-step walk-through of a successful technical implementation with your API.

Published in: Data & Analytics
  • Be the first to comment

APIs and the Semantic Web: publishing information instead of data

  1. 1. APIs and the Semantic Web Publishing information instead of data
  2. 2. About me • Data Specialist • API First fanatic • Co-Founder Apiwise • Ex-Freshheads • PostcodeAPI.nu • Apiranto Docs
  3. 3. About me “The only bad thing about API is that it’s the inverse of IPA”
  4. 4. About me • Brewmaster • MQTT API driven brewery “De Brouwtoren” • Crowdfunding starting next week (hint!)
  5. 5. 0641011744 • Registration number • Flight number • Bank account • Mobile phone number
  6. 6. 641.011.744 Remember phone numbers and Excel?
  7. 7. “0641011744” Now it’s a meaningless string!
  8. 8. Paris + Hilton
  9. 9. Semantics • Context • Meaning • Vocabularies & Ontologies
  10. 10. Vocabularies • Schema.org • FOAF (Friend-Of-A-Friend): VCard • XSD (XML Schema Definition Language)
  11. 11. Linked Data • Alias The Semantic Web, Web 3.0 • Defines what data means • Queries across multiple datasets • Provides links to external resources
  12. 12. Triples Subject ObjectPredicate
  13. 13. Triples Dimitri Apiwiseworks at
  14. 14. Triples Dimitri Endpointattends
  15. 15. Triples Endpoint Amsterdamheld in
  16. 16. Triples Amsterdam The Netherlands capital of
  17. 17. Triples Apiwise Tilburgresides in
  18. 18. Triples Tilburg The Netherlands located in
  19. 19. Tilburg The NetherlandsApiwise Amsterdam Endpoint Dimitri capitalof
  20. 20. URIs Subject Predicate Object dimitrivanhees.com schema.org/worksFor apiwise.nl dimitrivanhees.com schema.org/attends endpointcon.com endpointcon.com schema.org/location dbpedia.org/Amsterdam* apiwise.nl schema.org/foundingLocation dbpedia.org/Tilburg dbpedia.org/Tilburg dbpedia.org/ontology/country dbpedia.org/Netherlands dbpedia.org/Amsterdam dbpedia.org/ontology/capital dbpedia.org/Netherlands *Real DBPedia URL: http://dbpedia.org/resource/Amsterdam
  21. 21. DBPedia.org • Wikipedia as a Linked Open Dataset • http://dbpedia.org/resource/Amsterdam
  22. 22. Bank Account Name CoC Contact Address PC City Balance 54.31.23.650 Apiwise 62956787 D. van Hees Kronenburgersingel 49 6511AL Nijmegen € 100 Cadastre (Land Register) Number Street Number Postcode Place Value Surface Function 12345 Kronenburgersingel 49 6511AL Nijmegen € 100.000 65m² Living Chamber of Commerce Number Official name Type Founded Address 62956787 Apiwise V.O.F. V.O.F. 2015/04/01 Kronenburgersingel 49, 6511AL, Nijmegen Linking datasets
  23. 23. Bank Account Name CoC Contact Address PC City Balance 54.31.23.650 Apiwise 62956787 D. van Hees Kronenburgersingel 49 6511AL Nijmegen € 100 Chamber of Commerce Number Official name Type Founded Address 62956787 Apiwise V.O.F. V.O.F. 2015/04/01 Kronenburgersingel 49, 6511AL, Nijmegen Linking datasets Cadastre (Land Register) Number Street Number Postcode Place Value Surface Function 12345 Kronenburgersingel 49 6511AL Nijmegen € 100.000 65m² Living
  24. 24. Bank Account CoC Contact Balance 54.31.23.650 62956787 D. van Hees € 100 Chamber of Commerce Number Official name Type Founded Cadastre 62956787 Apiwise V.O.F. V.O.F. 2015/04/01 12345 Linking datasets Cadastre (Land Register) Number Street Number Postcode Place Value Surface Function 12345 Kronenburgersingel 49 6511AL Nijmegen € 100.000 65m² Living
  25. 25. Bank Contact CoC LinkedIn Facebook D. van Hees 62956787 dimitrivanhees dvanhees CoC Number Cadastre 62956787 12345 20106830 67890 Cadastre Street Place Kronenburgersingel Nijmegen Wilhelminapark Tilburg Facebook Residence Places Sports Nijmegen Tilburg Football LinkedIn Company Birthplace School Apiwise, Freshheads Nijmegen Tilburg University
  26. 26. Bank Contact CoC LinkedIn Facebook D. van Hees 62956787 dimitrivanhees dvanhees CoC Number Cadastre 62956787 12345 20106830 67890 Cadastre Street Place Kronenburgersingel Nijmegen Wilhelminapark Tilburg Facebook Residence Places Sports Nijmegen Tilburg Football LinkedIn Company Birthplace School Apiwise, Freshheads Nijmegen Tilburg University Open Data Location Province Avg. income Inhabitants Nijmegen Gelderland € 12.600 168.840 Tilburg Noord-Brabant € 13.900 191.275 Open Data Location Founded Rector Tilburg 1927 P. Eijlander Open Data Category Type Ball sport Team
  27. 27. Query for people who: • Live in a city with more than 170.000 inhabitants • Like team sports and went to a school that was founded before 1930 • Are connected to a V.O.F. company from Gelderland with a negative balance • Like ball games and own an office larger than 150m² in a place where the average value is less than € 200.000
  28. 28. “Linked Data makes it possible to get new insights in data which were technically impossible in the past. It’s up to marketing people to come up with challenging queries.”
  29. 29. “That’s awesome!” But… I want APIs…
  30. 30. Five stars of Sir Tim Berners-Lee
  31. 31. ★ “Make your stuff available on the Web (whatever format) under an open license”
  32. 32. ★ ★ “Make it available as structured data (e.g., Excel instead of image scan of a table)”
  33. 33. ★ ★ ★ “Use non-proprietary formats (e.g., CSV instead of Excel)”
  34. 34. ★ ★ ★ ★ “Use URIs to denote things, so that people can point at your stuff (RDF)”
  35. 35. ★ ★ ★ ★ ★ “Link your data to other data to provide context (Linked Data)”
  36. 36. Data landscape • Data consumers • Data publishers • Open Data community • API community • Linked Data community
  37. 37. Data consumers • Provide us the developer-friendliest way to access your data and we MIGHT use it
  38. 38. 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?
  39. 39. Open Data community • We don’t care HOW the data is published • We only care IF the data is open
  40. 40. API community • Every publisher SHOULD provide RESTful JSON APIs • Because every consumer KNOWS RESTful JSON APIs • We DON’T believe in Linked Data
  41. 41. Linked Data community • Every publisher SHOULD provide five star data • Every consumer SHOULD learn SPARQL* • So we DON’T need APIs *Linked Data query language
  42. 42. SPARQL And RDF Query Language ?S ?O?P
  43. 43. All Endpoint attendees ?S Endpointattends
  44. 44. All events I(’ve) attend(ed) Dimitri ?Oattends
  45. 45. Basic SPARQL Query PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX type: <http://dbpedia.org/class/yago/> PREFIX prop: <http://dbpedia.org/property/> SELECT ?country_name ?population WHERE { ?country a type:LandlockedCountries ; rdfs:label ?country_name ; prop:populationEstimate ?population . FILTER (?population > 15000000) . }
  46. 46. WTF is SPARQL?
  47. 47. Benefits According to EU studies the amount of apps being developed with Linked Open Government Data is negligible. https://joinup.ec.europa.eu/sites/default/files/85/31 /25/Study_on_business_models_for_Linked_Open_ Government_Data_BM4LOGD_v1.00.pdf
  48. 48. Costs • Knowledge investment (unknown technology) • Technical investment (hosting infrastructure) • Time investment (change management) • Low ROI
  49. 49. “The quality of many datasets is AT MOST three stars”
  50. 50. Five stars of Sir Tim Berners-Lee
  51. 51. Six stars of Dimitri van Hees
  52. 52. ★ ★ ★ ★ “Provide online access via webservices so developers can use your stuff the way they are used to (RESTful JSON API)”
  53. 53. ★ ★ ★ ★ ★ “Add context to your API so it can be linked to other datasets, developers know what the data means and LD guys can convert it to triples, store it in triplestores and use SPARQL if they want to (JSON-LD)”
  54. 54. ★ ★ ★ ★ ★ ★
  55. 55. JSON JSON-LD Triples
  56. 56. JSON { "id": 43274, "name": "Dimitri van Hees", “geslacht": "m", "birthDate": "1984-03-14", "birthPlace": "Nijmegen", "facebookLikes": [ 69116329538, 272002449634285, 114690771875816 ] }
  57. 57. JSON-LD Context "@context“: { "id": "@id", "name": "http://xmlns.com/foaf/0.1/name", “geslacht": "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" }
  58. 58. JSON-LD Context "@context": { "foaf": "http://xmlns.com/foaf/0.1/", "schema": "http://schema.org/", "dbo": "http://dbpedia.org/ontology/", "id": "@id", "name": "foaf:name", “geslacht": "foaf:gender", "birthDate": "schema:birthDate", "birthPlace": "dbo:birthPlace", "facebookLikes": "foaf:interest" }
  59. 59. JSON-LD { "id": "http://example.com/customers/43274", "type": "schema:Person", "name": "Dimitri van Hees", “geslacht": "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“ } ] }
  60. 60. Mapping through semantic APIs API Den Haag The Hague ‘s-Gravenhage http://dbpedia.org/resource/The_Hague
  61. 61. JSON-LD { "id": "http://example.com/customers/43274", "type": "schema:Person", "name": "Dimitri van Hees", “geslacht": "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“ } ] }
  62. 62. JsonLd2RDF() And there’s your Linked Data!
  63. 63. Step 1: JSON support
  64. 64. Step 2: JSON-LD support
  65. 65. Step 3: Triples support
  66. 66. Triplestore: Allegrograph • Database for triples • Free up to 5.000.000 triples • SPARQL 1.1 support • REST API • Local installation (privacy)
  67. 67. ★ ★ ★ ★ ★ ★
  68. 68. One more thing! It gets even better…
  69. 69. Data Information Property Value id AB-01-CD type ? brand AUDI kleur ROOD A?2JKs=- 1932 application/json Property Value id rdw.nl/AB-01-CD rdf:type schema.org/Car schema.org/brand dbpedia.org/Audi schema.org/color dbpedia.org/Red dbpedia.org/foundingYear 1932 application/ld+json
  70. 70. Structured Data
  71. 71. Gmail
  72. 72. Siri, Cortana, Now
  73. 73. Separation of concerns • It’s all about conversion • A website is just another representation of information • People WILL skip the restaurant’s website if they’re hungry and can get food by just yelling HUNGRY at their mobile phone • Publish information instead of data!
  74. 74. “The Semantic Web does exist and goes hand in hand with APIs. Using six stars instead of five, APIs are part of the deployment scheme while making live easier for both data publishers and consumers. Let’s bridge the gap, bring the best of both worlds, and let’s change the web together by publishing information instead of data.”
  75. 75. Thank you! • Twitter: @dvh • E-mail: dimitri@apiwise.nl • LinkedIn: linkedin.com/in/dimitrivanhees • GitHub: github.com/dvh • PostcodeAPI: github.com/apiwise/postcodeapi • Apiranto: github.com/apiwise/apiranto
  76. 76. Thank you! • Twitter: @dvh • E-mail: dimitri@apiwise.nl • LinkedIn: linkedin.com/in/dimitrivanhees • GitHub: github.com/dvh • PostcodeAPI: github.com/apiwise/postcodeapi • Apiranto: github.com/apiwise/apiranto • Brewery: www.brouwtoren.nlAd

×