A set of SPARQL examples that are used in different TGX resources
Returns publication references directly attached to interactions in a given pathway, along with the participating data node labels. This example uses the default value (Pathway ID "WP5200"); 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 ?pubmed
WHERE {
?pathway a wp:Pathway ;
dc:identifier <https://identifiers.org/wikipathways/WP5200> . #filter for one pathway
?interaction dcterms:isPartOf ?pathway ;
a wp:Interaction ;
dcterms:references ?pubmed ;
wp:participants ?participants .
?participants a wp:DataNode ;
rdfs:label ?DataNodeLabel .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?DataNodeLabel")
v2("?interaction"):::projected
v4("?participants")
v1("?pathway"):::projected
v3("?pubmed"):::projected
c4([https://identifiers.org/wikipathways/WP5200]):::iri
c6(["wp:Interaction"]):::iri
c9(["wp:DataNode"]):::iri
c2(["wp:Pathway"]):::iri
v1 --"a"--> c2
v1 --"dc:identifier"--> c4
v2 --"dcterms:isPartOf"--> v1
v2 --"a"--> c6
v2 --"dcterms:references"--> v3
v2 --"wp:participants"--> v4
v4 --"a"--> c9
v4 --"rdfs:label"--> v5