Successfully reported this slideshow.

09 Linked Data Engineering - 4

598 Aufrufe

Veröffentlicht am

Lecture 09, Information Service Engineering, Summer Semester 2017, KIT Karlsruhe

Veröffentlicht in: Bildung
  • Als Erste(r) kommentieren

09 Linked Data Engineering - 4

  1. 1. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Information Service Engineering Lecture 9: Linked Data Engineering - 4 Prof. Dr. Harald Sack FIZ Karlsruhe - Leibniz Institute for Information Infrastructure AIFB - Karlsruhe Institute of Technology Summer Semester 2017 This file is licensed under the Creative Commons Attribution-NonCommercial 3.0 (CC BY-NC 3.0)
  2. 2. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Information Service Engineering Last Lecture: Linked Data Engineering - 3 3.1 Knowledge Representations and Ontologies 3.2 Semantic Web and the Web of Data 3.3 Linked Data Principles 3.4 How to name Things - URIs 3.5 Resource Description Framework (RDF) 3.6 Creating new Models with RDFS 3.7 Querying RDF(S) with SPARQL 3.8 More Expressivity with Web Ontology Language (OWL) 3.9 Wikipedia, DBpedia, and Wikidata 3.10 Linked Data Programming ● SPARQL Protocol ● SPARQL with Regular Expressions ● SPARQL Aggregations ● SPARQL Federate Queries ● OWL Building Blocks ● OWL Complex Class Definitions 2
  3. 3. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology :Book a owl:Class . :Writer a owl:Class . :SoundRecording a owl:Class . :author a owl:ObjectProperty ; rdfs:domain :Book ; rdfs:range :Writer . :publicationYear a owl:DatatypeProperty ; rdfs:domain :Book ; rdfs:range xsd:integer . :GeorgeOrwell a Writer . :NineteenEightyFour a :Book ; :author :GeorgeOrwell ; :publicationYear 1948 . 3 OWL Example (1/3) 3. Linked Data Engineering / 3.8 More Expressivity with Web Ontology Language (OWL)
  4. 4. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology 4 OWL Example (2/3) 3. Linked Data Engineering / 3.8 More Expressivity with Web Ontology Language (OWL) :AudioBook a owl:Class ; owl:equivalentClass [ owl:intersectionOf ( :Book, :SoundRecording ) ] . OWL complex Classes :TalkingBook owl:equivalentClass :AudioBook . :Writer owl:disjointClass :AudioBook . OWL Class Equivalence :CharlesDickens a :Writer ; owl:differentFrom :GeorgeOrwell . :GeorgeOrwell owl:sameAs wikidata:Q3335 . OWL Instance Identity
  5. 5. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology 5 OWL Example (3/3) 3. Linked Data Engineering / 3.8 More Expressivity with Web Ontology Language (OWL) :DickensBooks a owl:Class ; rdfs:subClassOf :Books ; owl:oneOf (:OliverTwist, :HardTimes, :ATaleOfTwoCities, :DavidCopperfield, :BleackHouse, :LittleDorrit ) ] . OWL complex Classes
  6. 6. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology ○ OWL property restrictions are used to describe complex classes via properties ○ restrictions on values: ○ owl:hasValue ○ owl:allValuesFrom ○ owl:someValuesFrom ○ restrictions on cardinality: ○ owl:cardinality ○ owl:minCardinality ○ owl:maxCardinality OWL Property Restrictions 3. Linked Data Engineering / 3.8 More Expressivity with Web Ontology Language (OWL)
  7. 7. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology ● Class :OrwellsBooks is described via fixed value assignment (=constant) of the individual :GeorgeOrwell to the property :author :OrwellsBooks a owl:Class ; rdfs:subClassOf [ a owl:Restriction ; owl:onProperty :author ; owl:hasValue :GeorgeOrwell ] . OrwellsBooks ⊑ author.(GeorgeOrwell) OWL Property Restrictions with Constants 3. Linked Data Engineering / 3.8 More Expressivity with Web Ontology Language (OWL)
  8. 8. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology :OrwellsBooks a owl:Class ; rdfs:subClassOf [ a owl:Restriction ; owl:onProperty :author ; owl:hasValue :GeorgeOrwell ] . OWL Property Restrictions with Constants 3. Linked Data Engineering / 3.8 More Expressivity with Web Ontology Language (OWL) :AnimalFarm :GeorgeOrwell :author :OrwellBooks :rdf:type owl:Class :rdf:type
  9. 9. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology ● Class :Poetry is described by fixing all instances of this class to the only allowed range :Poet for the property :author (strict binding) :Poetry a owl:Class ; rdfs:subClassOf [ a owl:Restriction ; owl:onProperty :author ; owl:allValuesFrom :Poet ] . Poetry ⊑ ∀author.Poet OWL Propertys Restriction with Strict Binding 3. Linked Data Engineering / 3.8 More Expressivity with Web Ontology Language (OWL)
  10. 10. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology :Poetry a owl:Class ; rdfs:subClassOf [ a owl:Restriction ; owl:onProperty :author ; owl:allValuesFrom :Poet ] . OWL Propertys Restriction with Strict Binding 3. Linked Data Engineering / 3.8 More Expressivity with Web Ontology Language (OWL) :SheWalksInBeauty :LordByron :author :Poetry :rdf:type :Poet :rdf:type
  11. 11. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology ● Class :Reader is described by fixing all instances of this class to an allowed range :Book (amongst others) for the property :reads (loose binding) :Reader a owl:Class ; rdfs:subClassOf [ a owl:Restriction ; owl:onProperty :reads ; owl:someValuesFrom :Book ] . Reader ⊑ ∃reads.Book OWL Property Restriction with Loose Binding 3. Linked Data Engineering / 3.8 More Expressivity with Web Ontology Language (OWL)
  12. 12. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology :Reader a owl:Class ; rdfs:subClassOf [ a owl:Restriction ; owl:onProperty :reads ; owl:someValuesFrom :Book ] . OWL Property Restriction with Loose Binding 3. Linked Data Engineering / 3.8 More Expressivity with Web Ontology Language (OWL) :Harald :AnimalFarm :reads :Reader :rdf:type :Book :rdf:type :DieZEIT :Newspaper :rdf:type :reads
  13. 13. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Loose or Strict Binding? 3. Linked Data Engineering / 3.8 More Expressivity with Web Ontology Language (OWL) ○ Vegetarian a owl:Class ; rdfs:subClassOf [ a owl:Restriction ; owl:onProperty :eats ; owl:allValuesFrom [ owl:complementOf :Animal . ] . ]
  14. 14. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Loose or Strict Binding? 3. Linked Data Engineering / 3.8 More Expressivity with Web Ontology Language (OWL) ○ Driver a owl:Class ; rdfs:subClassOf [ a owl:Restriction ; owl:onProperty :drives ; owl:someValuesFrom :Car . ]
  15. 15. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Information Service Engineering Lecture 9: Linked Data Engineering - 4 3.1 Knowledge Representations and Ontologies 3.2 Semantic Web and the Web of Data 3.3 Linked Data Principles 3.4 How to name Things - URIs 3.5 Resource Description Framework (RDF) as simple Data Model 3.6 Creating new Models with RDFS 3.7 Querying RDF(S) with SPARQL 3.8 More Expressivity with Web Ontology Language (OWL) 3.9 Wikipedia, DBpedia, and Wikidata 3.10 Linked Data Programming 15
  16. 16. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology The Web of Data 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata Linked Data ● Linked Open Data (LOD) denote publicly available (RDF) Data in the Web, identified via URI and accessible via HTTP. Linked data link to other data via URI. The Web of Data ● 9,960 datasets ● >149 billion facts ● >800 million links (April 2017) http://stats.lod2.eu/ http://lod-cloud.net/
  17. 17. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Linked Data Principles 1. Use URIs as names for things. 2. Use HTTP URIs, so that people can look up those names. 3. When someone looks up a URI, provide useful information, using the standards (RDF, SPARQL) 4. Include links to other URIs, so that they can discover more things. (Tim Berners-Lee, Linked Data, 2006, http://www.w3.org/DesignIssues/LinkedData.html)
  18. 18. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Advantages of Linked Open Data vs. APIs ○ Simple and generic API for various heterogeneous data sources enables simple reuse and data sharing among applications ○ RDF Data model guarantees (simple) extensibility ○ Transport via http, standard Port 80, prevents firewall adaption ○ Ontologies enable meaningful connections between data sources ○ Reasoning over Linked Data enables to generate new knowledge, i.e. inference from implicit to explicit knowledge 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata
  19. 19. Semantic Web Technologies , Dr. Harald Sack, Hasso Plattner Institute, University of Potsdam Linked Data Ontologies ● Ontologies that keep the Linked Data Cloud together ● OWL owl:sameAs connects identical individuals owl:equivalentClass connects equivalent classes 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata dbr:Neil_Armstrong owl:sameAs wd:Q1615 .
  20. 20. Semantic Web Technologies , Dr. Harald Sack, Hasso Plattner Institute, University of Potsdam ● SKOS ○ „Simple Knowledge Organization System“ ○ based on RDF and RDFS ○ applied for definitions and mappings of vocabularies and ontologies ■ skos:Concept (classes) ■ skos:narrower ■ skos:broader ■ skos:related ■ skos:exactMatch, skos:narrowMatch, skos:broadMatch, skos:relatedMatch Linked Data Ontologies 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata ● Ontologies that keep the Linked Data Cloud together
  21. 21. Semantic Web Technologies , Dr. Harald Sack, Hasso Plattner Institute, University of Potsdam ● umbel ○ „Upper Mapping and Binding Exchange Layer“ ○ Subset of OpenCyces RDF Triples based on SKOS and OWL2 ○ Upper Ontology with 28.000 concepts (skos:Concept) ○ 46.000 Mappings into DBpedia, geonames, e.a. (owl:equivalentClass, rdfs:subClassOf) ○ Links to more than 2 Mio Wikipedia pages Linked Data Ontologies 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata ● Ontologies that keep the Linked Data Cloud together
  22. 22. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology DBpedia and the Web of Data 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata ● a central hub in the Web of Data
  23. 23. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology DBpedia 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata English version of the DBpedia knowledge base (as by June 2017) ● describes 4.58 million things, ● of which 4.22 million are classified in a consistent ontology ● including 1,445,000 persons, ● 735,000 places (including 478,000 populated places), ● 411,000 creative works ○ including 123,000 music albums, ○ 87,000 films and ○ 19,000 video games, ● 241,000 organizations ○ including 58,000 companies and 49,000 educational institutions, ● 251,000 species and ● 6,000 diseases.
  24. 24. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology DBpedia 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata Overall there are 125 regional language versions of DBpedia ● 38.3 million things are described, ○ of which 23.8 million are localized descriptions of things that also exist in the English version of DBpedia. ○ with 25.2 million links to images ○ 29.8 million links to external web pages, ○ 80.9 million links to Wikipedia categories, ○ and 41.2 million links to YAGO categories. ● DBpedia is linked with other Linked Datasets by 50 million RDF links. ● DBpedia 2014 release consists of 3 billion RDF triples ○ out of which 580 million were extracted from the English edition of Wikipedia, ○ 2.46 billion were extracted from other language editions.
  25. 25. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology DBpedia Naming Conventions 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata https://en.wikipedia.org/wiki/Pluto http://dbpedia.org/resource/Pluto Entity Identifier http://dbpedia.org/page/Pluto HTML version http://dbpedia.org/data/Pluto RDF/XML version
  26. 26. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology DBpedia Category System - Wikipedia Categories 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata dbr:Pluto dct:subject Prefixes: dct: <http://purl.org/dc/terms/subject> dbr: <http://dbpedia.org/resource/> dbc: <http://dsbpedia.org/resource/Category:> skos: <http://www.w3.org/2004/02/skos/core#> dbc:Planets dbc:Objects_formerly_considered_Planets skos:broader dbc:Astronomical_objects skos:broader dbc:Physical_objects skos:broader
  27. 27. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology DBpedia Category System - YAGO Categories 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata dbr:Pluto rdf:type Prefixes: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> dbr: <http://dbpedia.org/resource/> yago: <http://dbpedia.org/class/yago/> rdfs <http://www.w3.org/2000/01/rdf-schema#> yago:NaturalObject100019128 yago:CelestialBody109239740 rdfs:subClassOf yago:Whole100003553 yago:Object100002684 rdfs:subClassOf rdfs:subClassOf
  28. 28. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology DBpedia Category System - DBpedia Ontology Classes 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata dbr:Pluto rdf:type Prefixes: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> dbr: <http://dbpedia.org/resource/> owl: <http://www.w3.org/2002/07/owl#> rdfs <http://www.w3.org/2000/01/rdf-schema#> dbo:CelestialBody dbo:Planet rdfs:subClassOf dbo:Place owl:Thing rdfs:subClassOf rdfs:subClassOf
  29. 29. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology From Wikipedia to DBpedia 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata http://dbpedia.org/resource/Pluto http://en.wikipedia.org/wiki/Pluto
  30. 30. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Wikipedia Infoboxes 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata
  31. 31. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology DBpedia Infobox Extraction - Infobox Properties 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata http://dbpedia.org/property/discoverer http://dbpedia.org/resource/Pluto http://dbpedia.org/resource/Clyde_Tombaugh
  32. 32. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology DBpedia Infobox Extraction - Mapping Based Properties 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata Infobox Template: Planet https://en.wikipedia.org/wiki/Template:Infobox_planet DBpedia Ontology Class dbo:Planet dbo:discoverer rdfs:domain owl:Thing ; rdfs:range dbo:Person . http://dbpedia.org/resource/Pluto http://dbpedia.org/ontology/discoverer http://dbpedia.org/resource/Clyde_Tombaugh
  33. 33. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology DBpedia Infobox Extraction - Mapping Based Properties 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata Find all who have discovered something and were also astrologers. SPARQL query
  34. 34. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Wikidata 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata Collaboratively edited knowledge base operated by the Wikimedia Foundation https://www.wikidata.org/
  35. 35. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Wikidata 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata Identifier statements property value qualifiers reference https://www.wikidata.org/wiki/Q339
  36. 36. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Wikidata - SPARQL Query Service 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata SPARQL query
  37. 37. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Wikidata - SPARQL Query Service 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata SPARQL query 1 SPARQL query 2
  38. 38. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Wikidata - More sophisticated SPARQL Queries 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata Which politicians have died not of natural causes? SPARQL query
  39. 39. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Wikidata - More sophisticated SPARQL Queries 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata Popular occupations of fictional characters displayed as bubble chart SPARQL query
  40. 40. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Wikidata - More sophisticated SPARQL Queries 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata Timeline of the Apollo Space Program SPARQL query
  41. 41. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Wikidata - More sophisticated SPARQL Queries 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata Timeline of all Roman emperors SPARQL query
  42. 42. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Wikidata - More sophisticated SPARQL Queries 3. Linked Data Engineering / 3.9 Wikipedia, DBpedia, and Wikidata Map of archaeological sites in Germany SPARQL query
  43. 43. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Information Service Engineering Lecture 9: Linked Data Engineering - 4 3.1 Knowledge Representations and Ontologies 3.2 Semantic Web and the Web of Data 3.3 Linked Data Principles 3.4 How to name Things - URIs 3.5 Resource Description Framework (RDF) as simple Data Model 3.6 Creating new Models with RDFS 3.7 Querying RDF(S) with SPARQL 3.8 More Expressivity with Web Ontology Language (OWL) 3.9 Wikipedia, DBpedia, and Wikidata 3.10 Linked Data Programming 43
  44. 44. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Linked Data Driven Web Applications ● Required Components: ○ Local RDF Store ■ caching of results ■ permanent storage M.Hausenblas: Linked Data Applications, DERI Technical Report, 2009 3. Linked Data Engineering / 3.10 Linked Data Programming
  45. 45. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Linked Data Driven Web Applications ● Required Components: ○ Logic (Controller) and ○ User Interface ■ (=Business Logic) ■ (not LOD specific) M.Hausenblas: Linked Data Applications, DERI Technical Report, 2009 3. Linked Data Engineering / 3.10 Linked Data Programming
  46. 46. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Linked Data Driven Web Applications ● Required Components: ● Data Integration component ○ get data directly from LOD-Cloud or ○ via Semantic Indexer M.Hausenblas: Linked Data Applications, DERI Technical Report, 2009 3. Linked Data Engineering / 3.10 Linked Data Programming
  47. 47. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Linked Data Driven Web Applications ● Required Components: ● Data Re-/Publishing component ○ write back application dependent data into the Web of Data M.Hausenblas: Linked Data Applications, DERI Technical Report, 2009 3. Linked Data Engineering / 3.10 Linked Data Programming
  48. 48. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Linked Data Driven Web Applications ● Required Components: ○ Local RDF Store ■ caching of results ■ permanent storage ○ Logic (Controller) and ○ User Interface (=Business Logic) ■ (not LOD specific) ○ Data Integration component ■ get data directly from LOD-Cloud or ■ via Semantic Indexer ○ Data Re-/Publishing component ■ write back application dependent data into the Web of Data M.Hausenblas: Linked Data Applications, DERI Technical Report, 2009 3. Linked Data Engineering / 3.10 Linked Data Programming
  49. 49. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology ● The easiest way is to make use of a suitable library: ○ SPARQL Javascript Library http://www.thefigtrees.net/lee/blog/2006/04/sparql_calendar_demo_a_sparql.html ○ ARC for SPARQL (PHP) https://github.com/semsol/arc2/wiki ○ dotNetRDF (C#) https://dotnetrdf.github.io/ ○ Jena/ARQ (Java) http://jena.apache.org/ ○ Sesame (Java) http://rdf4j.org/ ○ SPARQL Wrapper (Python) http://rdflib.github.io/sparqlwrapper/ Linked Data Driven Web Applications 3. Linked Data Engineering / 3.10 Linked Data Programming
  50. 50. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology ● The easiest way is to make use of a suitable library: ○ SPARQL Wrapper (Python) http://rdflib.github.io/sparqlwrapper/ ● Access to Linked Data via SPARQL endpoints ○ let‘s choose DBpedia (just for simplicity...) http://dbpedia.org/sparql ● ...now we have to think of a simple example... Linked Data Programming Example 3. Linked Data Engineering / 3.10 Linked Data Programming
  51. 51. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology ● Example Application: ○ Build a simple application that looks for today‘s birthdays of famous people, as e.g. authors ○ Create a list of authors, whose birthday is today including some additional information, as e.g. ■ Year of Birth ■ Short description ○ Let‘s create a simple (local) web page for the task (i.e. encode results in HTML), which can be displayed in the browser ○ we use Python and the SPARQL Wrapper library Linked Data Programming Example 3. Linked Data Engineering / 3.10 Linked Data Programming
  52. 52. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Prerequisites - (Manual) Data Analysis http://dbpedia.org/page/Alexandre_Dumas ● Choose a representative example: ○ E.g. Alexandre Dumas from DBpedia 3. Linked Data Engineering / 3.10 Linked Data Programming
  53. 53. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology ● Data Analysis via SPARQL ○ What kind of entities are you looking for? ■ ?author rdf:type dbo:Writer . ○ What information do you need? ■ ?author dbo:birthDate ?birthdate . ■ ?author rdfs:label ?name . ■ ?author rdfs:comment ?description . ■ OPTIONAL { ?author dbo:thumbnail ?thumbnail } ○ Any filter criteria? ■ (lang(?name)="en") && (lang(?description)="en") ■ (SUBSTR(STR(?birthdate),6)="11-04") ■ More sophisticated: (SUBSTR(STR(bif:curdate('')),6) Prerequisites - (Manual) Data Analysis 3. Linked Data Engineering / 3.10 Linked Data Programming Virtuoso triple store builtin function for current date
  54. 54. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Prerequisites - SPARQL Queries SPARQL query at dbpedia.org 3. Linked Data Engineering / 3.10 Linked Data Programming
  55. 55. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Prerequisites - Download & Install ● You should have Python installed on your computer ○ https://www.python.org/downloads/ ● Download SPARQL Wrapper for Python ○ http://rdflib.github.io/sparqlwrapper/ ● Follow the instructions for Installation 3. Linked Data Engineering / 3.10 Linked Data Programming
  56. 56. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology
  57. 57. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Linked Data Programming Example 3. Linked Data Engineering / 3.10 Linked Data Programming
  58. 58. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology import com.hp.hpl.jena.query.*; String service = "..."; // address of the SPARQL endpoint String query = " SELECT ..."; // your SPARQL query QueryExecution e = QueryExecutionFactory. sparqlService(service, query) ResultSet results = e. execSelect(); while ( results.hasNext() ) { QuerySolution s = results. nextSolution(); // ... } e.close(); ● Alternative: simple example with Jena ARQ and Java: http://jena.apache.org/ Linked Data Programming Example 3. Linked Data Engineering / 3.10 Linked Data Programming
  59. 59. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology You may also try out Wikidata... 3. Linked Data Engineering / 3.10 Linked Data Programming SPARQL query at wikidata.org
  60. 60. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology Information Service Engineering Next Lecture: Linked Data Engineering - 4 3.1 Knowledge Representations and Ontologies 3.2 Semantic Web and the Web of Data 3.3 Linked Data Principles 3.4 How to name Things - URIs 3.5 Resource Description Framework (RDF) as simple Data Model 3.6 Creating new Models with RDFS 3.7 Querying RDF(S) with SPARQL 3.8 More Expressivity with Web Ontology Language (OWL) 3.9 Wikipedia, DBpedia, and Wikidata 3.10 Linked Data Programming 60
  61. 61. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology 3. Linked Data Engineering - 4 Bibliography ● P. Hitzler, M. Krötzsch, B. Parsia, P. F. Patel-Schneider, S. Rudolph, OWL 2 Web Ontology Language , Primer (Second Edition), W3C Recommendation, 11 December 2012, https://www.w3.org/TR/2012/REC-owl2-primer-20121211/ ● S. Hitzler, S. Rudolph, Foundations of Semantic Web Technologies, Chapman / Hall, 2009. ● The DBpedia Dataset 2014, at DBpedia Extraction Framework, github, https://github.com/dbpedia/extraction-framework/wiki/The-DBpedia-Data-Set ● M.Hausenblas: Linked Data Applications, DERI Technical Report, 2009 61
  62. 62. Information Service Engineering , Prof. Dr. Harald Sack, FIZ Karlsruhe - Leibniz Institute for Information Infrastructure & AIFB - Karlsruhe Institute of Technology 3. Linked Data Engineering - 4 Syllabus Questions ● Explain the Linked Data Principles ● What kind of links glue the Web of Data (Linked Data Cloud) together? ● How is DBpedia created from Wikipedia content? ● How is Wikidata created? ● What are the benefits and drawbacks when comparing DBpedia and Wikidata? ● Explain the components needed for Linked Data Driven Web Applications 62

×