sparql-examples

A set of SPARQL examples that are used in different TGX resources

View the Project on GitHub BiGCAT-UM/sparql-examples

069

rq turtle/ttl

Lists the pathways tagged with a particular ontology term, here PW_0000296 from the Pathway Ontology.

Use at

PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
PREFIX obo: <http://purl.obolibrary.org/obo/>

SELECT ?pathway (str(?titleLit) AS ?title)
WHERE {
  ?pathwayRDF wp:ontologyTag obo:PW_0000296 ;
              foaf:page ?pathway ;
              dc:title ?titleLit .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?pathway"):::projected 
  v1("?pathwayRDF")
  v4("?title")
  v3("?titleLit"):::projected 
  c2(["obo:PW_0000296"]):::iri 
  v1 --"wp:ontologyTag"-->  c2
  v1 --"foaf:page"-->  v2
  v1 --"dc:title"-->  v3
  bind0[/"str(?titleLit)"/]
  v3 --o bind0
  bind0 --as--o v4