A set of SPARQL examples that are used in different TGX resources
Counts the number of PubMed publication references per pathway, sorted by descending reference count.
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
SELECT DISTINCT ?pathway (COUNT(?pubmed) AS ?numberOfReferences)
WHERE
{?pubmed a wp:PublicationReference .
?pubmed dcterms:isPartOf ?pathway }
GROUP BY ?pathway
ORDER BY DESC(?numberOfReferences)
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?numberOfReferences")
v3("?pathway"):::projected
v2("?pubmed"):::projected
c2(["wp:PublicationReference"]):::iri
v2 --"a"--> c2
v2 --"dcterms:isPartOf"--> v3
bind1[/"count(?pubmed)"/]
v2 --o bind1
bind1 --as--o v4