-
Notifications
You must be signed in to change notification settings - Fork 0
sparql
learning sparql book tutorials
cambridge semantics sparql tutorial
also check out the SPARQL in 11 minutes
I had previously installed arq jena during my lab rotation. *I will have to install this on APHROS when it's back up see issue 12.
Running examples from the book, in my local computer path: /home/kai/Desktop/grad_school/marmic/master_thesis/sparql_exercises/learning_SPARQL_examples
arq --data ex002.ttl --query ex003.rq
works as in the book.
snorql example query is nice, I want to try my own.
"Find the birthdays of all Canadian rock guitarists."
PREFIX d: <http://dbpedia.org/ontology/>
PREFIX c: <http://dbpedia.org/page/Category/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX crg: <http://dbpedia.org/resource/Category:Canadian_rock_guitarists>
SELECT ?guitarist
WHERE
{
?guitarist dcterms:subject crg .
}
for whatever reason using http://dbpedia.org/resource/Category:Canadian_rock_guitarists works but: PREFIX c: http://dbpedia.org/page/Category/ and c:Canadian_rock_guitarists doesn't
PREFIX d: <http://dbpedia.org/ontology/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX crg: <http://dbpedia.org/resource/Category:Canadian_rock_guitarists>
SELECT ?guitarist
WHERE
{
?guitarist dcterms:subject crg: .
}
also works.
PREFIX d: <http://dbpedia.org/ontology/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX crg: <http://dbpedia.org/resource/Category:>
SELECT ?guitarist
WHERE
{
?guitarist dcterms:subject crg:Canadian_rock_guitarists .
}
Also works.
// to do add this bit d:birthDate
try a question like
"Get me all artists who played with the artist jimi hendrix, and where they were born.
PREFIX d: <http://dbpedia.org/ontology/>
SELECT ?artist ?place
WHERE
{
?artist d:associatedBand :Jimi_Hendrix.
?artist d:birthPlace ?place
}
this works
SELECT ?property ?hasValue ?isValueOf
WHERE {
{ <https://en.wikipedia.org/wiki/Glacier> ?property ?hasValue }
UNION
{ ?isValueOf ?property <http://dbpedia.org/ontology/Person> }
}
doesn't really work as expected because the results are patchy of random predicates.
Could try to explain the need to add a bit of ontological strutre to
Knowledge graphs are becoming more popular and useful, need to bridge the gap between patchy but growing resources such as Wikipedia, and expert knowledge (locked away in text books), using an ontology helps to bridge this, it can be applied to querying Wikipedia data and for improved semantic representation make data FAIR. Ontology for an agreed upon term structure, (could use the band name example this concept should be aggreed up but it is misused in annotation, jimi hendrix the person was annotated as a band in wikipedia).
what is the relationship between glacier and ice in dbpedia?
PREFIX d: <http://dbpedia.org/ontology/>
PREFIX crg: <http://dbpedia.org/resource/Category:>
SELECT ?p1 ?p2
WHERE {
{ :Glacier ?p1 crg:Bodies_of_ice .}
UNION
{:Ice ?p2 :Glacier .}
}
I had to manually search for this Bodies_of_ice object. Would need to write a query which tests for predicates which inherit ice. I'll have to learn how to do this.
Associated with the tutorial are the discussion forum and SPARQL Cheat Sheet
what rdf data looks like
Turtle - Terse RDF Triple Language
OpenJena's ARQ doesn't see to work
OpenLink's Virtuoso works use this one
example from the foaf tutorial foaf:name
Tim Berners-Lee cool guy invented the world wide web. Has some interesting seeming ted talks and essays. his friend john seely brown also has a cool site with some interesting videos.
Hexastore the code seems to be deprecated and I couldn't figure out how to get it to run.
d3sparql like a sophisticated sparql endpoint has some cool example tutorials where it queries data from a variety of places and creates visualizations such as charts and graphs.
Anything To Triples is a library, a web service and a command line tool that extracts structured data in RDF format from a variety of Web documents. Any23 is licensed under the Apache License v2.0. DOAP found here download page It can extract triples using the OpenIE System The Open IE system runs over sentences and creates extractions that represent relations in text, in the case of Any23, this results in triples.