1 / 46

Semantic Web Bootcamp

Semantic Web Bootcamp. Dominic DiFranzo PhD Student/Research Assistant Rensselaer Polytechnic Institute Tetherless World Constellation. http://tw.rpi.edu/portal/Mashathon. Interwebs?. Internet – graph of computers connected to one another

otto
Download Presentation

Semantic Web Bootcamp

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Semantic Web Bootcamp Dominic DiFranzo PhD Student/Research Assistant Rensselaer Polytechnic Institute Tetherless World Constellation

  2. http://tw.rpi.edu/portal/Mashathon

  3. Interwebs? Internet – graph of computers connected to one another Web – graph of documents hyper-linked to one another Semantic web – graph of concepts/ideas/data linked together by named relations.

  4. 122.121.53.13 128.21.52.3 138.41.32.13 122.11.32.43 125.71.26.73

  5. 122.121.53.13 128.21.52.3 138.41.32.13 122.11.32.43 125.71.26.73

  6. 122.121.53.13 Hat.com/hog.html 128.21.52.3 138.41.32.13 Example.com Dig.net/log.html 122.11.32.43 125.71.26.73 Cat.com/new.html dog.com/dog.html

  7. http://difranzo.com/index http://rpi.edu/~hendler

  8. http://difranzo.com/index http://rpi.edu/~hendler http://example.com/isAdvisedBy

  9. Hat.com/hog.html Example.com Dig.net/log.html Cat.com/new.html dog.com/dog.html

  10. RDF Triple: Subject Predicate Object Use URI for universal naming New York has the postal abbreviation NY <urn:x-states:New%20York> <http://purl.org/dc/terms/alternative> "NY" .

  11. urn:x-states:New%20York “NY” http://purl.org/dc/terms/alternative

  12. serialize in many ways <rdf:RDFxmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/"> <rdf:Description rdf:about="urn:x-states:New%20York"> <dcterms:alternative>NY</dcterms:alternative> </rdf:Description> </rdf:RDF>

  13. Linking I found a new dataset and it has the following triple <http://dbpedia.org/page/New_York> <http://dbpedia.org/ontology/Place/otherName> “The Empire State” .

  14. http://dbpedia.org/page/New_York “The Empire State” http://dbpedia.org/ontology/Place/otherName

  15. owl:sameAS <urn:x-states:New%20York> <http://www.w3.org/2002/07/owl#sameAs> <http://dbpedia.org/page/New_York> .

  16. urn:x-states:New%20York http://dbpedia.org/page/New_York http://www.w3.org/2002/07/owl#sameAs “NY” “The Empire State”

  17. Linked Data • decentralized - sources may be spread out and referenced across the Web • modular - linked without advance planning or coordination • scalable - once store in place, it’s easy to extend • advantages hold even when definitions and structure of the data changes over time.

  18. Other Sem Web Tech • Resource Description Framework Schema (RDFS) • Defining the vocabularies intended to be used in RDF • class, property, type, subClassOf, range, and domain • Allows for reasoning over data • Web Ontology Language (OWL) • more expressive ontologies and more complex reasoning of them

  19. Sparql SPARQL is a query language for the Semantic Web.

  20. Sparql SELECT ?node ?title WHERE{  ?node <http://purl.org/dc/elements/1.1/title> ?title . } LIMIT 1

  21. ?node ?title http://purl.org/dc/elements/1.1/title

  22. Long! SELECT ?node ?name WHERE{  ?node <http://xmlns.com/foaf/0.1/givenname> ?name .  ?node <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . } LIMIT 10

  23. ?node ?title http://purl.org/dc/elements/1.1/title foaf:Person http://www.w3.org/1999/02/22-rdf-syntax-ns#type

  24. Prefix PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?node ?name WHERE{  ?node foaf:givenname ?name .  ?node rdf:typefoaf:Person . } LIMIT 10

  25. Shortcuts PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> SELECT ?node ?name WHERE{  ?node foaf:givenname ?name ; rdf:typefoaf:Person . } LIMIT 10

  26. Graphs

  27. Named Graph PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?graph ?node ?title WHERE{ GRAPH ?graph{  ?node dc:title ?title . } } LIMIT 3

  28. Named Graph PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT  ?node8 ?desc8 ?node401 ?desc401 WHERE{ GRAPH <http://data-gov.tw.rpi.edu/vocab/Dataset_401>{  ?node401 dc:description ?desc401 . } GRAPH <http://data-gov.tw.rpi.edu/vocab/Dataset_8>{  ?node8 dc:description ?desc8 . } } LIMIT 3

  29. Union PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT  ?node8 ?desc8 ?node401 ?desc401 WHERE{ { GRAPH <http://data-gov.tw.rpi.edu/vocab/Dataset_401>{  ?node401 dc:description ?desc401 . } }UNION{ GRAPH <http://data-gov.tw.rpi.edu/vocab/Dataset_8>{  ?node8 dc:description ?desc8 . } } } LIMIT 3

  30. Optional PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT  ?node ?name ?givenname WHERE{  ?node foaf:name ?name . OPTIONAL{  ?node foaf:givenname ?givenname . } }

  31. Filter PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT  ?node ?name ?givenname WHERE{  ?node foaf:name ?name .  ?node foaf:givenname ?givenname . FILTER regex(?name, "Biden") . }

  32. SPARQLProxy • This is a web service that allows you to query any SPARQL endpoint, and get back the results in any format you want. • A RESTful way to query any endpoint in any environment.

  33. SPARQLProxy http://logd.tw.rpi.edu/sparql? Paramiters: query: [required] encoded String of SPARQL query query-uri :[required] URI of SPARQL query (use as an alternative to "query" parameter. These two parameters are mutul-exclusive)

  34. SPARQLProxy service-uri: [required] URI of SPARQL Endpoint – default is the LOGD endpoint output: output format. ''xml'' - SPARQL/XML (default) : ''exhibit'' - JSON for MIT Exhibit : ''gvds'' - JSON for Google Visualization : ''csv'' - CSV : ''html'' - HTML table : “sparql” - SPARQL JSON

  35. Example • http://logd.tw.rpi.edu/sparql.php?query-option=text&query=PREFIX+conversion%3A+%3Chttp%3A%2F%2Fpurl.org%2Ftwc%2Fvocab%2Fconversion%2F%3E%0D%0ASELECT+%3Fg+sum%28+%3Ftriples+%29+as+%3Festimated_triples%0D%0AWHERE+{%0D%0A++GRAPH+%3Fg++{%0D%0A+++%3Fg+void%3Asubset+%3Fsubdataset+.%0D%0A+++%3Fsubdataset+conversion%3Anum_triples+%3Ftriples+.%0D%0A++}%0D%0A}+%0D%0AGROUP+BY+%3Fg%0D%0A&service-uri=&output=html&callback=&tqx=&tp=

  36. Example // compose query $sparqlproxy_uri = "http://logd.tw.rpi.edu/ws/sparqlproxy.php" $params = array(); $params["query-uri"] = "http://logd.tw.rpi.edu/demo/retrieving-sparql-results/datagov-list-loaded-dataset.sparql"; $params["service-uri"] = "http://services.data.gov/sparql"; $params["output"] = "gvds"; $query= $sparqlproxy_uri."?". http_build_query($params,,'&') ; //specific for Drupal //show query result echo file_get_contents($query);

  37. Try some on your own

  38. Questions?

More Related