Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Semantic Web Bootcamp Dominic DiFranzo PhD Student/Research Assistant Rensselaer Polytechnic Institute Tetherless World Constellation."— Presentation transcript:

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

2 http://tw.rpi.edu/portal/Ma shathon

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

5 128.21.52.3 122.121.53.1 3 138.41.32.13 122.11.32.43 125.71.26.73

6 128.21.52.3 122.121.53.1 3 138.41.32.13 122.11.32.43 125.71.26.73

7 128.21.52.3 122.121.53.1 3 138.41.32.13 122.11.32.43 125.71.26.73 Example.com Cat.com/new.ht ml dog.com/dog.html Hat.com/hog.html Dig.net/log.html

8 http://difranzo.com/indexhttp://rpi.edu/~hendler

9 http://difranzo.com/indexhttp://rpi.edu/~hendler http://example.com/isAdvised By

10 Example.com Cat.com/new.ht ml dog.com/dog.html Hat.com/hog.html Dig.net/log.html

11 RDF Triple: Subject Predicate Object Use URI for universal naming New York has the postal abbreviation NY "NY".http://purl.org/dc/terms/alternative

12 urn:x-states:New%20York “NY” http://purl.org/dc/terms/alternativ e

13 serialize in many ways <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns:dcterms="http://purl.org/dc/terms/">http://purl.org/dc/terms/ n rdf:about="urn:x-states NY

14 Linking I found a new dataset and it has the following triple “The Empire State”.http://dbpedia.org/page/New_Yorkhttp://dbpedia.org/ontology/Place/other Name

15 http://dbpedia.org/page/New_York “The Empire State” http://dbpedia.org/ontology/Place/otherNa me

16 owl:sameAS.http://www.w3.org/2002/07/owl#same Ashttp://dbpedia.org/page/New_York

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

18

19

20

21

22 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.

23

24

25 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

26

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

28 Sparql SELECT ?node ?title WHERE{ ?node ?title. } LIMIT 1

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

30 Long! SELECT ?node ?name WHERE{ ?node ?name. ?node. } LIMIT 10

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

32 Prefix PREFIX foaf: PREFIX rdf: SELECT ?node ?name WHERE{ ?node foaf:givenname ?name. ?node rdf:type foaf:Person. } LIMIT 10

33 Shortcuts PREFIX foaf: PREFIX rdf: SELECT ?node ?name WHERE{ ?node foaf:givenname ?name ; rdf:type foaf:Person. } LIMIT 10

34 Graphs

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

36 Named Graph PREFIX dc: SELECT ?node8 ?desc8 ?node401 ?desc401 WHERE{ GRAPH {http://data-gov.tw.rpi.edu/vocab/Dataset_401 ?node401 dc:description ?desc401. } GRAPH { ?node8 dc:description ?desc8. } LIMIT 3

37 Union PREFIX dc: SELECT ?node8 ?desc8 ?node401 ?desc401 WHERE{ { GRAPH { ?node401 dc:description ?desc401. } }UNION{ GRAPH { ?node8 dc:description ?desc8. } LIMIT 3

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

39 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"). }

40 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.

41 SPARQLProxy http://logd.tw.rpi.edu/sparqlhttp://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)

42 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

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

44 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);

45 Try some on your own

46 Questions?


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

Similar presentations


Ads by Google