sparql-examples

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

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

046

rq turtle/ttl

Exports pathway metadata including page URLs, titles, species, identifiers, and associated ontology tags for bulk download.

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#>

SELECT DISTINCT ?depicts (str(?titleLit) as ?title) (str(?speciesLabelLit) as ?speciesLabel) ?identifier ?ontology
WHERE {
	?pathway foaf:page ?depicts .
        ?pathway dc:title ?titleLit .
        ?pathway wp:organism ?species .
        ?pathway wp:organismName ?speciesLabelLit .
        ?pathway dc:identifier ?identifier .

        OPTIONAL {?pathway wp:ontologyTag ?ontology .}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?depicts"):::projected 
  v6("?identifier"):::projected 
  v7("?ontology"):::projected 
  v1("?pathway")
  v4("?species")
  v9("?speciesLabel")
  v5("?speciesLabelLit"):::projected 
  v8("?title")
  v3("?titleLit"):::projected 
  v1 --"foaf:page"-->  v2
  v1 --"dc:title"-->  v3
  v1 --"wp:organism"-->  v4
  v1 --"wp:organismName"-->  v5
  v1 --"dc:identifier"-->  v6
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v1 -."wp:ontologyTag".->  v7
  end
  bind0[/"str(?titleLit)"/]
  v3 --o bind0
  bind0 --as--o v8
  bind1[/"str(?speciesLabelLit)"/]
  v5 --o bind1
  bind1 --as--o v9