semantic web bootcamp
DESCRIPTION
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 - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/1.jpg)
Semantic Web Bootcamp
Dominic DiFranzoPhD Student/Research AssistantRensselaer Polytechnic InstituteTetherless World Constellation
![Page 2: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/2.jpg)
http://tw.rpi.edu/portal/Mashathon
![Page 3: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/3.jpg)
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.
![Page 4: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/4.jpg)
![Page 5: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/5.jpg)
128.21.52.3
122.121.53.13
138.41.32.13
122.11.32.43
125.71.26.73
![Page 6: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/6.jpg)
128.21.52.3
122.121.53.13
138.41.32.13
122.11.32.43
125.71.26.73
![Page 7: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/7.jpg)
128.21.52.3
122.121.53.13
138.41.32.13
122.11.32.43
125.71.26.73
Example.com
Cat.com/new.html dog.com/dog.html
Hat.com/hog.html
Dig.net/log.html
![Page 8: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/8.jpg)
http://difranzo.com/index http://rpi.edu/~hendler
![Page 9: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/9.jpg)
http://difranzo.com/index http://rpi.edu/~hendler
http://example.com/isAdvisedBy
![Page 10: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/10.jpg)
Example.com
Cat.com/new.html dog.com/dog.html
Hat.com/hog.html
Dig.net/log.html
![Page 11: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/11.jpg)
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" .
![Page 12: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/12.jpg)
urn:x-states:New%20York
“NY”http://purl.org/dc/terms/alternative
![Page 13: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/13.jpg)
serialize in many ways
<rdf:RDF xmlns: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>
![Page 14: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/14.jpg)
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” .
![Page 15: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/15.jpg)
http://dbpedia.org/page/New_York
“The Empire State”
http://dbpedia.org/ontology/Place/otherName
![Page 16: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/16.jpg)
owl:sameAS
•<urn:x-states:New%20York> <http://www.w3.org/2002/07/owl#sameAs> <http://dbpedia.org/page/New_York> .
![Page 17: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/17.jpg)
urn:x-states:New%20York http://dbpedia.org/page/New_York
http://www.w3.org/2002/07/owl#sameAs
“NY” “The Empire State”
![Page 18: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/18.jpg)
![Page 19: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/19.jpg)
![Page 20: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/20.jpg)
![Page 21: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/21.jpg)
![Page 22: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/22.jpg)
Linked Datadecentralized - 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.
![Page 23: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/23.jpg)
![Page 24: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/24.jpg)
![Page 25: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/25.jpg)
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
![Page 26: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/26.jpg)
![Page 27: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/27.jpg)
Sparql
•SPARQL is a query language for the Semantic Web.
![Page 28: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/28.jpg)
SparqlSELECT ?node ?title WHERE{ ?node <http://purl.org/dc/elements/1.1/title> ?title . } LIMIT 1
![Page 30: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/30.jpg)
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
![Page 31: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/31.jpg)
?node
http://purl.org/dc/elements/1.1/title
?title
foaf:Person
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
![Page 32: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/32.jpg)
PrefixPREFIX 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:type foaf:Person . } LIMIT 10
![Page 33: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/33.jpg)
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:type foaf:Person . } LIMIT 10
![Page 34: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/34.jpg)
Graphs
![Page 35: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/35.jpg)
Named GraphPREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?graph ?node ?title WHERE{ GRAPH ?graph{ ?node dc:title ?title . } } LIMIT 3
![Page 36: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/36.jpg)
Named GraphPREFIX 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
![Page 37: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/37.jpg)
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
![Page 38: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/38.jpg)
OptionalPREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?node ?name ?givenname WHERE{ ?node foaf:name ?name . OPTIONAL{ ?node foaf:givenname ?givenname . } }
![Page 39: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/39.jpg)
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") . }
![Page 40: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/40.jpg)
SPARQLProxyThis 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.
![Page 41: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/41.jpg)
SPARQLProxyhttp://logd.tw.rpi.edu/sparql?Paramiters:query: [required] encoded String of SPARQL queryquery-uri :[required] URI of SPARQL query (use as an
alternative to "query" parameter. These two parameters are mutul-exclusive)
![Page 42: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/42.jpg)
SPARQLProxyservice-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
![Page 43: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/43.jpg)
Examplehttp://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=
![Page 44: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/44.jpg)
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);
![Page 45: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/45.jpg)
Try some on your own
![Page 46: Semantic Web Bootcamp](https://reader035.vdocuments.net/reader035/viewer/2022081604/5681637d550346895dd45d04/html5/thumbnails/46.jpg)
Questions?