rdf & sparql introduction dongfang xu ph.d student, school of information, university of arizona...
DESCRIPTION
Semantic Web The Limits of today’s Web (2.0): 1.High recall and low precision; 2. Low recall and even on recall; 3. Results are highly sensitive to vocabulary. 4. Single Web pages. Reference: Antoniou, G., & Van Harmelen, F. (2008). A semantic web primer (2 nd ed.). Cambridge, Mass: MIT press.TRANSCRIPT
![Page 1: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/1.jpg)
RDF & SPARQLIntroduction
Dongfang XuPh .D student, School of Information, University of Arizona
Sept 10, 2015
![Page 2: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/2.jpg)
Catalog
Semantic Web
RDF
RDF Schema
SPARQL
![Page 3: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/3.jpg)
Semantic Web
The Limits of today’s Web (2.0):
1.High recall and low precision;
2. Low recall and even on recall;
3. Results are highly sensitive to vocabulary.
4. Single Web pages.
Reference: Antoniou, G., & Van Harmelen, F. (2008). A semantic web primer (2nd ed.). Cambridge, Mass: MIT
press.
![Page 4: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/4.jpg)
Semantic Web What can be done?
![Page 5: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/5.jpg)
Semantic Web
The Semantic Web Technologies(standard technologies ):
1.Format the web content.
2.Relate the data
Machine-processable web information
![Page 6: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/6.jpg)
Semantic Web
<company> <treatmentOffered>Physiotherapy</treatment Offered> <companyName>Agilitas Physiotherapy Centre</companyName> <staff> <therapist>Lisa Davenport</therapist> <therapist>Steve Matthews</therapist> <secretary>Kelly Townsend</secretary> <staff></company>
![Page 7: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/7.jpg)
XML & RDF<course name=“Discrete Mathematics”> <lecturer>David Billing</lecturer></course>
<lecturer name=“lecturer>David Billing”> <teaches> Discrete Mathematics</teaches></lecturer>
<teachingOffering> <lecturer>David Billing</lecturer> <courses> Discrete Mathematics</courses></teachingOffering>
XML does not provide any means of talking about the semantics (meaning) of data
![Page 8: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/8.jpg)
Catalog
Semantic Web
RDF
RDF Schema
SPARQL
![Page 9: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/9.jpg)
What is RDF?• A data model for objects (“resources”) and relations
between them; • Provides a simple semantics for the data model;• The model can be represented in an xml syntax.
Basic building block is an object-attribute-value triple, called statement.
RDF
![Page 10: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/10.jpg)
RDF
<?xml version="1.0"?><River id="Yangtze" xmlns="http://www.geodesy.org/river"> <length>6300 kilometers</length> <startingLocation>western China's Qinghai-Tibet Plateau</startingLocation> <endingLocation>East China Sea</endingLocation></River>
XML
Modify the following XML document so that it is also a valid RDF document:
<?xml version="1.0"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.geodesy.org/river#"> <rdf:Description rdf:ID="Yangtze" <uni:length>6300 kilometers</uni:length> <uni:startingLocation>western China's Qinghai-Tibet Plateau</uni:startingLocation> <uni:endingLocation>East China Sea</uni:endingLocation> </rdf: Description></rdf: RDF>
RDF
Yangtze.xml
Yangtze.rdf
"convert to"
![Page 11: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/11.jpg)
RDF Data Model• As you read the RDF literature you may see
the following terminology:• Subject: this term refers to the item that is playing
the role of the resource.• predicate: this term refers to the item that is playing
the role of the property. • Object: this term refers to the item that is playing
the role of the value.
Subject Objectpredicate
Resource ValuepropertyEquivalent!
<rdf:Description rdf:ID="Yangtze" <uni:length>6300 kilometers</uni:length></rdf: Description>
![Page 12: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/12.jpg)
RDF resource A Resource is any object identifiable by a URI.1.Resources can use any URI, e.g.: http://www.example.org/file.xml#element(home) http://www.example.org/file.html#home http://www.example.org/file2.xml#xpath1(//q[@a=b])
2. URI-s can also use different forms: CIT11111 =(http://www.example.org/file.xml# CIT11111) 3525346
3. The resource is defined like below, with <rdf: Description>
Usually <rdf: Description rdf: about=“” >means referencing an existing resource;<rdf: Description rdf: ID=“” >means creating a new resource;
![Page 13: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/13.jpg)
RDF resource
<rdf:Description rdf:about=“CIT1111”> <uni:courseName>Discrete Mathematics</uni:courseName> <uni:isTaughtBy rdf:resourse=“#949318”/></ rdf:Description >
<rdf:Description rdf:ID=“949318”> <uni:name>David Bill</uni:name> <uni:title> Associate Professor</uni:title></ rdf:Description >
Resource reference
![Page 14: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/14.jpg)
RDF property & valueProperty value must be a Literal or a Resource
<uni:courseName>Discrete Mathematics</uni:courseName>
propertyValue
<rdf:type rdf:resource =“&uni;lecturer“/>
![Page 15: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/15.jpg)
RDF element
1. Root element <rdf: RDF namespace><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://www.recshop.fake/cd#">
2. Description element define resource
3. Property eelement define attribute
4. Bag/Seq/Alt element define a few attributes within the property.
See more: http://www.w3schools.com/webservices/ws_rdf_main.asp
![Page 16: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/16.jpg)
Catalog
Semantic Web
RDF
RDF Schema
SPARQL
![Page 17: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/17.jpg)
RDF Schema
RDF schema is a vocabulary description language for describing properties and classes of RDF resources, with a semantics for generalization hierarchies of such properties and classes.
RDF Schema is a primitive ontology language.
RDFS will use RDF itself to define the semantics of particular domain.
![Page 18: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/18.jpg)
RDF Schema
![Page 19: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/19.jpg)
Catalog
Semantic Web
RDF
RDF Schema
SPARQL
![Page 20: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/20.jpg)
SPARQL
SPARQL is the query language to search resource & value;
It is based on matching graph patterns ( like RDF triple pattern, but the resource and value can be variable) ?res uni:phone ?pho
use “?” to define variable, for both string and numeric type
Like in SQL, it has a Select-From-Where structure.
![Page 21: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/21.jpg)
SPARQL
PREFIX rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# >PREFIX uni:<http://www.mydomain.org/uni-ns#>(namespace make quries shorter and easier to read)
Select ?XWhere { ?x uni: phone : 520-543-2340.}
![Page 22: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/22.jpg)
SPARQL
Select ?X ?YWhere { ?x uni: phone ?y}
![Page 23: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/23.jpg)
SPARQL
Select ?name ?YWhere { ?X rdf:type uni:Lecturer; uni: name ?name. ?X uni: phone ?Y.}
![Page 24: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/24.jpg)
SPARQL
Select ?name ?YWhere { ?X rdf:type uni:Lecturer; uni: name ?name. ?X uni: phone ?Y. OPTIONAL{?X uni:phone ?Y}}
![Page 25: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/25.jpg)
SPARQL
Select ?YWhere { ?X rdf:type uni:Lecturer; uni: name :David Bill. ?C uni: phone ?Y. Filter(?X=?C)}
![Page 26: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/26.jpg)
SPARQL
![Page 27: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/27.jpg)
SPARQL
![Page 28: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/28.jpg)
SPARQL
![Page 29: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/29.jpg)
SPARQL
![Page 30: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/30.jpg)
SPARQL1. SPARQL has several query
forms. 2. The CONSTRUCT query
form returns an RDF graph.
![Page 31: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/31.jpg)
SPARQL
More resources:
http://www.w3.org/TR/rdf-sparql-query/#docResultDesc
http://rdf.myexperiment.org/howtosparql
https://jena.apache.org/tutorials/sparql.html
![Page 32: RDF & SPARQL Introduction Dongfang Xu Ph.D student, School of Information, University of Arizona Sept 10, 2015](https://reader035.vdocuments.site/reader035/viewer/2022062905/5a4d1adf7f8b9ab0599768a8/html5/thumbnails/32.jpg)
Thank you!
Q&A