Semantic Web Basics Dominic DiFranzo PhD Student/Research Assistant Rensselaer Polytechnic Institute Tetherless World Constellation
shathon
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.
RDF Triple: Subject Predicate Object Use URI for universal naming New York has the postal abbreviation NY "NY".
Linked Open Data
serialize in many ways <rdf:RDF xmlns:rdf=" xmlns:dcterms=" n rdf:about="urn:x-states NY
Linking I found a new dataset and it has the following triple “The Empire State”. Name
owl:sameAS. Ashttp://dbpedia.org/page/New_York
Semantic 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)
Conversion to RDF
Sparql SPARQL is a query language for the Semantic Web.
Sparql SELECT ?node ?title WHERE{ ?node ?title. } LIMIT 1
Long! SELECT ?node ?name WHERE{ ?node ?name. ?node.ntax-ns#type> < } LIMIT 10
Prefix PREFIX foaf: PREFIX rdf: 22-rdf- syntax-ns#> SELECT ?node ?name WHE WHERE{ ?node foaf:givenname ?name. ?node rdf:type foaf:Person. } LIMIT 10
Shortcuts PREFIX foaf: PREFIX rdf: 22-rdf- syntax-ns#> SELECT ?node ?name WHE WHERE{ ?node foaf:givenname ?name ; rdf:type foaf:Person. } LIMIT 10
Graphs
Named Graph PREFIX dc: SELECT ?graph ?node ?title WHERE{ GRAPH ?graph{ ?node dc:title ?title. } LIMIT 3
Named Graph PREFIX dc: SELECT ?node8 ?desc8 ?node401 ?desc401 WHERE{ GRAPH {/Dataset_401>{ ?node401 dc:description ?node401 dc:description ?desc401. } GRAPH { ?node8 dc:description ?desc8.c8. } LIMIT 3
Union PREFIX dc: SELECT ?node8 ?desc8 ?node401 ?desc401 WHERE{ { GRAPH {/Dataset_401>{ ?node401 dc:descriptio ?node401 dc:description ?desc401. } }UNION{ GRAPH { ?node8 dc:description ?desc8.esc8. } LIMIT 3
Optional PREFIX foaf: SELECT ?node ?name ?givenname WHERE{ ?node foaf:name ?name. OPTIONAL{ ?node foaf:givenname ?givenname. }
Filter PREFIX foaf: SELECT ?node ?name ?givenname WHERE{ ?node foaf:name ?name. ?node foaf:givenname ?givenname. FILTER regex(?name, "Biden"). }
Try some on your own
Questions?