A set of SPARQL examples that are used in different TGX resources
Counts in how many pathways each metabolite data node occurs. The results are per data node, not per unique metabolite, because no identifier mapping is applied.
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
SELECT ?mb (count(distinct ?pathway) as ?pwCount)
WHERE {
?mb a wp:Metabolite ;
dcterms:isPartOf ?pathway .
}
GROUP BY ?mb
ORDER BY DESC(?pwCount)
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?mb"):::projected
v3("?pathway"):::projected
v4("?pwCount")
c2(["wp:Metabolite"]):::iri
v2 --"a"--> c2
v2 --"dcterms:isPartOf"--> v3
bind1[/"count(?pathway)"/]
v3 --o bind1
bind1 --as--o v4