A set of SPARQL examples that are used in different TGX resources
Returns all interactions in a given pathway along with the participating data nodes and their labels. This example uses the default value (Pathway ID "WP1425"); the WikiPathways SNORQL UI lets you change it.
PREFIX dc: <http://purl.org/dc/elements/1.1/>
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 ?interaction ?participants ?DataNodeLabel
WHERE {
?pathway a wp:Pathway ;
dc:identifier <https://identifiers.org/wikipathways/WP1425> .
?interaction dcterms:isPartOf ?pathway ;
a wp:Interaction ;
wp:participants ?participants .
?participants a wp:DataNode ;
rdfs:label ?DataNodeLabel .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?DataNodeLabel"):::projected
v2("?interaction"):::projected
v3("?participants"):::projected
v1("?pathway"):::projected
c6(["wp:Interaction"]):::iri
c8(["wp:DataNode"]):::iri
c2(["wp:Pathway"]):::iri
c4([https://identifiers.org/wikipathways/WP1425]):::iri
v1 --"a"--> c2
v1 --"dc:identifier"--> c4
v2 --"dcterms:isPartOf"--> v1
v2 --"a"--> c6
v2 --"wp:participants"--> v3
v3 --"a"--> c8
v3 --"rdfs:label"--> v4