A set of SPARQL examples that are used in different TGX resources
Lists all proteins found in pathways tagged with a selected community. This example uses the default value (Community "AOP"); the WikiPathways SNORQL UI lets you change it.
PREFIX cur: <http://vocabularies.wikipathways.org/wp#Curation:>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
SELECT DISTINCT ?pathway (str(?label) AS ?Protein)
WHERE {
?pathway wp:ontologyTag cur:AOP ;
a wp:Pathway .
?protein a wp:Protein ;
rdfs:label ?label ;
dcterms:isPartOf ?pathway .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?Protein")
v3("?label"):::projected
v1("?pathway"):::projected
v2("?protein")
c2(["wp:Curation:AOP"]):::iri
c5(["wp:Protein"]):::iri
c4(["wp:Pathway"]):::iri
v1 --"wp:ontologyTag"--> c2
v1 --"a"--> c4
v2 --"a"--> c5
v2 --"rdfs:label"--> v3
v2 --"dcterms:isPartOf"--> v1
bind0[/"str(?label)"/]
v3 --o bind0
bind0 --as--o v4