A set of SPARQL examples that are used in different TGX resources
Counts the pathways tagged with each ontology term. Pathways can be tagged with terms from the Pathway, Cell Line and Disease ontologies; wp:ontologyTag covers all of them, as well as the curation and community tags.
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
SELECT DISTINCT ?pwOntologyTerm (count(?pwOntologyTerm) as ?pathwayCount)
WHERE {
?pathwayRDF wp:ontologyTag ?pwOntologyTerm .
}
GROUP BY ?pwOntologyTerm
ORDER BY DESC(?pathwayCount)
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?pathwayCount")
v2("?pathwayRDF")
v3("?pwOntologyTerm"):::projected
v2 --"wp:ontologyTag"--> v3
bind1[/"count(?pwOntologyTerm)"/]
v3 --o bind1
bind1 --as--o v4