A set of SPARQL examples that are used in different TGX resources
Counts the total number of signaling pathways in WikiPathways by filtering on the signaling pathway ontology tag.
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
SELECT (count(distinct ?pathway) as ?pathwaycount)
WHERE {
?tag1 a owl:Class ;
rdfs:label ?label .
?tag rdfs:subClassOf* ?tag1.
?pathway a wp:Pathway; wp:ontologyTag ?tag.
FILTER regex(str(?label), "signaling pathway")
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?label")
v4("?pathway"):::projected
v5("?pathwaycount")
v3("?tag")
v2("?tag1")
c6(["wp:Pathway"]):::iri
c3(["owl:Class"]):::iri
f0[["regex(str(?label),'signaling pathway')"]]
f0 --> v1
v2 --"a"--> c3
v2 --"rdfs:label"--> v1
v3 --"rdfs:subClassOf"--> v2
v4 --"a"--> c6
v4 --"wp:ontologyTag"--> v3
bind2[/"count(?pathway)"/]
v4 --o bind2
bind2 --as--o v5