Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

Class 2 advanced topics in semantic web cs 7820 01 (3)

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige

Hier ansehen

1 von 53 Anzeige

Weitere Verwandte Inhalte

Diashows für Sie (20)

Ähnlich wie Class 2 advanced topics in semantic web cs 7820 01 (3) (20)

Anzeige

Weitere von Amélie Gyrard (20)

Aktuellste (20)

Anzeige

Class 2 advanced topics in semantic web cs 7820 01 (3)

  1. 1. Advanced Topics in Semantic Web: CS 7820 01 - Fall 2018 Ohio Center of Excellence in Knowledge-Enabled Computing Amelie Gyrard, Amit Sheth Kno.e.sis Research Center Department of Computer Science and Engineering, Wright State University, Dayton, Ohio (USA) Class 2: Thursday 30 August 2018 SPARQL endpoints, triple stores, etc.
  2. 2. Reminder: Google + Community • URL: https://plus.google.com/u/0/communities/115916198691775602456 2
  3. 3. Reminder: When is the class? ● When: Tuesdays and Thursdays - 2:00 PM to 3:20 PM ● Where: 366 Joshi ● Bring your laptops for hands-on sessions ○ Usage of the tools at the same time 3
  4. 4. Legend 1. Assignments, things to do, and to test yourself 2. For a more interactive class, answer the questions 3. Group study (2-3 persons) to go deeply in the topic, set up the tools and use it for your research and understand the research behind (e.g., scientific publications) 4. Finalize the study at home 4
  5. 5. Agenda ● Basic knowledge about the semantic web query language: ○ SPARQL, SPARQL endpoints ○ DBpedia ● Lab: SPARQL Query Tutorial ○ Learning with Corese 5
  6. 6. Student’s Expectations: What would you like to learn during this Advanced Topics in Semantic Web?
  7. 7. What is SPARQL? SPARQL Protocol and RDF Query Language (SPARQL) is an RDF query language
  8. 8. SPARQL Code Example PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name WHERE { ?person foaf:name ?name . } => Usage of the FOAF vocabulary => variables: ?person, ?name => SPARQL keywords: PREFIX, SELECT, WHERE 8
  9. 9. Learning SPARQL with Corese ● Download Corese: ○ http://wimmics.inria.fr/doc/tutorial/corese-3.2.2.jar ● Download the dataset for the tutorial: ○ http://wimmics.inria.fr/doc/tutorial/human.ttl 9
  10. 10. Loading the RDF dataset under Corese 10 => Dataset loaded
  11. 11. What is the meaning of the .ttl extension? Terse RDF Triple Language (Turtle) is a syntax and file format for expressing data in the RDF data model
  12. 12. Syntaxes and file formats supported by Protege 12 File -> Save As
  13. 13. EasyRDF Converter http://www.easyrdf.org/converter 13 ● Example: Converting Turtle to RDF/XML
  14. 14. Executing a SPARQL query with Corese • Execute the default SPARQL query 14 => SPARQL query executed, result returned => SPARQL query
  15. 15. FILTER SPARQL Keyword - Example 1 Code example: PREFIX human: <http://www.inria.fr/human#> SELECT * WHERE { ?x a ?t FILTER (strstarts(?t, human:)) } 15
  16. 16. FILTER SPARQL Keyword - Example 2 Code example: PREFIX human: <http://www.inria.fr/human#> SELECT * WHERE { ?x human:age ?age FILTER (?age >= 18) } 16
  17. 17. ASK SPARQL Keyword PREFIX human: <http://www.inria.fr/human#>. ASK { ?x rdf:type human:Man } => returned a boolean (true or false) if results are found 17
  18. 18. CONSTRUCT SPARQL Keyword PREFIX human: <http://www.inria.fr/human#>. ASK { ?x rdf:type human:Man } => returned a boolean (true or false) if results are found 18
  19. 19. DESCRIBE SPARQL Keyword DESCRIBE <http://www.inria.fr/human/data#Alice> 19 => returned all information related to an URI
  20. 20. DESCRIBE SPARQL Keyword PREFIX human: <http://www.inria.fr/human#>. DESCRIBE ?x WHERE { ?x human:name "Alice" } 20
  21. 21. DESCRIBE SPARQL Keyword PREFIX human: <http://www.inria.fr/human#>. DESCRIBE ?x WHERE { ?x human:name "Alice" } 21
  22. 22. CONSTRUCT SPARQL Keyword PREFIX human: <http://www.inria.fr/human#>. CONSTRUCT { ?x rdfs:seeAlso ?z } WHERE { ?x human:hasFriend ?y . ?y human:hasFriend ?z } 22 <= Add new triples
  23. 23. CONSTRUCT, FILTER, OPTIONAL PREFIX vCard: <http://www.w3.org/2001/vcard-rdf/3.0#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> CONSTRUCT { ?X vCard:FN ?name . ?X vCard:URL ?url . ?X vCard:TITLE ?title . } FROM <http://www.w3.org/People/Berners-Lee/card> WHERE { OPTIONAL { ?X foaf:name ?name . FILTER isLiteral(?name) . } OPTIONAL { ?X foaf:homepage ?url . FILTER isURI(?url) . } OPTIONAL { ?X foaf:title ?title . FILTER isLiteral(?title) . } } 23 <= Add new triples
  24. 24. Literals @prefix xsd: • rdf:langString (literal avec language tag) • xsd:string • xsd:integer • xsd:double • xsd:decimal • xsd:boolean • xsd:date • Etc. 24
  25. 25. SPARQL W3C Documentations 25 https://www.w3.org/TR/rdf-sparql-query/ https://www.w3.org/TR/2013/REC-sparql11-update-20130321/
  26. 26. Querying a Remote SPARQL endpoint Code example: SELECT * WHERE { SERVICE <http://fr.dbpedia.org/sparql> { SELECT * WHERE { ?x rdfs:label "August"@fr . ?x ?p ?y } limit 100 } } 26 => query a remote SPARQL endpoint
  27. 27. Querying a remote SPARQL endpoint with Corese • Copy, paste and execute the previous query • Query DBpedia • SERVICE keyword 27 => Query a remote SPARQL endpoint
  28. 28. More SPARQL Tutorials ● Excellent Jena SPARQL tutorial: ○ https://jena.apache.org/tutorials/sparql.html 28
  29. 29. DBpedia • RDF Knowledge Base • Automatic Extraction from Wikipedia • Resources describes with URIS 29
  30. 30. DBpedia Live • DBpedia Live: http://live.dbpedia.org/fct/ 30
  31. 31. DBpedia Endpoints ● DBpedia SPARQL endpoint: ○ https://dbpedia.org/sparql 31
  32. 32. SPARQL Endpoint ● A SPARQL endpoint is a conformant SPARQL protocol service. ● A SPARQL endpoint enables users (human or other) to query a knowledge base via the SPARQL language. ● A SPARQL endpoint is mostly conceived as a machine-friendly interface towards a knowledge base. 32
  33. 33. BASIL 33 • Basil - Sharing and reusing SPARQL Queries as Web APIs • Pre-defined SPARQL queries ● [BASIL] Demo ● [BASIL] Basil code source ● [BASIL] Paper: BASIL: A Cloud Platform for Sharing and Reusing SPARQL Queries as Web APIs [Daga et al. ISWC-P&D 2015] ● [BASIL] Paper: A BASILar Approach for Building Web APIs on top of SPARQL Endpoints [Daga et al. SALAD Workshop ESWC 2015]
  34. 34. BASIL Tool - Example 34
  35. 35. BASIL Tool - Example 35
  36. 36. SPARQL Endpoint Status (SPARQLES) • SPARQLES: http://sparqles.ai.wu.ac.at/ • Paper: SPARQLES: Monitoring Public SPARQL Endpoints [Vandenbussche et al. 2016] 36
  37. 37. SPARQL Endpoint Status (SPARQLES) • SPARQLES Availability: http://sparqles.ai.wu.ac.at/availability 37 Availability of SPARQL endpoints SPARQL endpoints:
  38. 38. SPORTAL - SPARQL Endpoints ● SPORTAL: SPARQL PORTAL Demo ● Paper: SPORTAL: Profiling the Content of Public SPARQL Endpoints [Hasnain et al. IJSWIS Journal 2016] 38
  39. 39. SPORTAL - SPARQL Endpoints 39
  40. 40. YASGUI Paper: YASGUI: Not Just Another SPARQL Client [Rietveld et al. ESWC SALAD Workshop 2013] 40 List of SPARQL endpoints Demo: http://yasgui.org/
  41. 41. YASGUI Paper: YASGUI: Not Just Another SPARQL Client [Rietveld et al. ESWC SALAD Workshop 2013] 41 Auto-completion, syntax-coloring Demo: http://yasgui.org/
  42. 42. YASGUI Paper: YASGUI: Not Just Another SPARQL Client [Rietveld et al. ESWC SALAD Workshop 2013] 42 Auto-completion, usage of a new prefix (if registered on prefix.cc) Demo: http://yasgui.org/
  43. 43. prefix.cc http://prefix.cc/ 43
  44. 44. The Berlin SPARQL Benchmark ● The SPARQL Query Language for RDF and the SPARQL Protocol for RDF are implemented by a growing number of storage systems. ● As SPARQL is taken up by the community there is a growing need for benchmarks to compare the performance of storage systems that expose SPARQL endpoints via the SPARQL protocol. 44 Documentation: http://wifo5-03.informatik.uni-mannheim.de/bizer/berlinsparqlbenchmark/ Paper: The Berlin SPARQL Benchmark [Bizer et al. 2009]
  45. 45. Building and Querying a Triplestore ● A triple store enables to retrieve triples ● Popular triple store ○ Jena TDB ○ Sesame ○ Virtuoso 45
  46. 46. Commercial Triplestores ● Stardog, GraphDB, Oracle, Virtuoso ● Comparison: bulk loading, scalability, stability and query execution ● => Virtuoso is faster in querying and loading scenarios while GraphDB shows better results regarding stability. ● Paper: Benchmarking Commercial RDF Stores with Publications Office Dataset [Atemezing et al. ESWC Workshop 2018] 46
  47. 47. Jena TDB Triplestore ● TDB is a component of Jena for RDF storage and query. ● TDB can be used as a high performance RDF store on a single machine. ● Tutorial: https://jena.apache.org/documentation/tdb/ 47
  48. 48. Jena SDB - Compliance with Existing Databases ● SDB uses an SQL database for the storage and query of RDF data. Many databases are supported, both Open Source and proprietary. ● An SDB store can be accessed and managed with the provided command line scripts and via the Jena API. ● Tutorial: https://jena.apache.org/documentation/sdb/index.html 48
  49. 49. Jena Fuseki - Create your own SPARQL Endpoint ● Fuseki is a SPARQL server. It provides REST-style SPARQL HTTP Update, SPARQL Query, and SPARQL Update using the SPARQL protocol over HTTP. ● Jena framework supported by Apache ● Tutorial: https://jena.apache.org/documentation/fuseki2/ 49
  50. 50. D2RQ The D2RQ Platform is a system for accessing relational databases as virtual, read-only RDF graphs. It offers RDF-based access to the content of relational databases without having to replicate it into an RDF store. Using D2RQ you can: ● Query a non-RDF database using SPARQL ● Access the content of the database as Linked Data over the Web ● Create custom dumps of the database in RDF formats for loading into an RDF store ● Access information in a non-RDF database using the Apache Jena API 50 http://d2rq.org/
  51. 51. Neo4J • Neo4j is a graph database management system https://neo4j.com/
  52. 52. Acknowledgments ● Any pictures reused to improve the slides ● This work is partially funded by KHealth NIH 1 R01 HD087132-01, and Hazards SEES NSF Award EAR 1520870. The opinions expressed are those of the authors and do not reflect those of the sponsors. ● All research papers, books, websites, tools, documentation, existing classes that inspired us to build this class: ○ SPARQL By Example tutorial: https://www.w3.org/2009/Talks/0615-qbe/ ○ SPARQL Class, Inria, Sophia Antipolis: http://wimmics.inria.fr/doc/tutorial/egc.pdf 52
  53. 53. Advanced Topics in Semantic Web: CS 7820 01 - Fall 2018 Ohio Center of Excellence in Knowledge-Enabled Computing Amelie Gyrard and Amit Sheth Kno.e.sis Research Center Department of Computer Science and Engineering, Wright State University, Dayton, Ohio (USA) Class 2: Thursday 30 August 2018 SPARQL endpoints, triple stores, etc.

×