Title: Semantic Web Basics
1Semantic Web Basics
- Dominic DiFranzo
- PhD Student/Research Assistant
- Rensselaer Polytechnic Institute
- Tetherless World Constellation
2http//tw.rpi.edu/portal/Mashathon
3Interwebs?
- 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.
4RDF
- Triple Subject Predicate Object
- Use URI for universal naming
- New York has the postal abbreviation NY
- lturnx-statesNew20Yorkgt
lthttp//purl.org/dc/terms/alternativegt "NY" .
5Linked Open Data
6serialize in many ways
ltrdfRDF xmlnsrdf"http//www.w3.org/1999/02/22-
rdf-syntax-ns" xmlnsdcterms"http//purl.org/d
c/terms/"gt ltrdfDescription
rdfabout"urnx-statesNew20York"gt
ltdctermsalternativegtNYlt/dctermsalternativegt
lt/rdfDescriptiongt lt/rdfRDFgt
7Linking
- I found a new dataset and it has the following
triple - lthttp//dbpedia.org/page/New_Yorkgt
lthttp//dbpedia.org/ontology/Place/otherNamegt
The Empire State .
8owlsameAS
- lturnx-statesNew20Yorkgt lthttp//www.w3.org/2002/
07/owlsameAsgt lthttp//dbpedia.org/page/New_Yorkgt
.
9Semantic Mashup Workflow
- Take data (CSV, XSL)
- Convert it to RDF
- Load in triple store
- Query with Sparql
- Visualize results using standard off-the-shelf
visualization tools (Google viz, Exhibit, etc)
10(No Transcript)
11Conversion to RDF
12Sparql
- SPARQL is a query language for the Semantic Web.
13Sparql
SELECT ?node ?title WHERE  ?node
lthttp//purl.org/dc/elements/1.1/titlegt ?title .
LIMIT 1
14Long!
SELECT ?node ?name WHERE  ?node
lthttp//xmlns.com/foaf/0.1/givennamegt ?name .
 ?node lthttp//www.w3.org/1999/02/22-rdf-syntax-ns
typegt lthttp//xmlns.com/foaf/0.1/Persongt .
LIMIT 10
15Prefix
PREFIX foaf lthttp//xmlns.com/foaf/0.1/gt PREFIX
rdf lthttp//www.w3.org/1999/02/22-rdf-syntax-nsgt
SELECT ?node ?name WHERE  ?node
foafgivenname ?name .  ?node rdftype
foafPerson . LIMIT 10
16Shortcuts
PREFIX foaf lthttp//xmlns.com/foaf/0.1/gt
PREFIX rdf lthttp//www.w3.org/1999/02/22-rdf-synt
ax-nsgt SELECT ?node ?name WHERE  ?node
foafgivenname ?name rdftype
foafPerson . LIMIT 10
17Graphs
18Named Graph
PREFIX dc lthttp//purl.org/dc/elements/1.1/gt
SELECT ?graph ?node ?title WHERE
GRAPH ?graph  ?node dctitle ?title .
LIMIT 3
19Named Graph
PREFIX dc lthttp//purl.org/dc/elements/1.1/gt
SELECT Â ?node8Â ?desc8Â ?node401Â ?desc401 WHERE
GRAPH lthttp//data-gov.tw.rpi.edu/vocab/Dataset_4
01gt  ?node401 dcdescription ?desc401 .
GRAPH lthttp//data-gov.tw.rpi.edu/vocab/Datas
et_8gt  ?node8 dcdescription ?desc8 .
LIMIT 3
20Union
PREFIX dc lthttp//purl.org/dc/elements/1.1/gt
SELECT Â ?node8Â ?desc8Â ?node401Â ?desc401 WHERE
GRAPH lthttp//data-gov.tw.rpi.edu/vocab/Da
taset_401gt  ?node401 dcdescription ?desc40
1 . UNION GRAPH
lthttp//data-gov.tw.rpi.edu/vocab/Dataset_8gt
 ?node8 dcdescription ?desc8 .
LIMIT 3
21Optional
PREFIX foaf lthttp//xmlns.com/foaf/0.1/gt
SELECT  ?node ?name ?givenname WHERE
 ?node foafname ?name . OPTIONAL
 ?node foafgivenname ?givenname .
22Filter
PREFIX foaf lthttp//xmlns.com/foaf/0.1/gt
SELECT  ?node ?name ?givenname WHERE
 ?node foafname ?name .  ?node
foafgivenname ?givenname . FILTER
regex(?name, "Biden") .
23Try some on your own
24(No Transcript)
25Questions?