A set of SPARQL examples that are used in different TGX resources
Counts the metabolite data nodes per pathway, with the pathways with the most metabolites first.
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
SELECT ?pathway (count(distinct ?mb) as ?mbCount)
WHERE {
?mb a wp:Metabolite ;
dcterms:isPartOf ?pathway .
}
GROUP BY ?pathway
ORDER BY DESC(?mbCount)
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?mb"):::projected
v4("?mbCount")
v3("?pathway"):::projected
c2(["wp:Metabolite"]):::iri
v2 --"a"--> c2
v2 --"dcterms:isPartOf"--> v3
bind1[/"count(?mb)"/]
v2 --o bind1
bind1 --as--o v4