A set of SPARQL examples that are used in different SIB resources
Protein kinases involved in cancer pathways according to wikipathways
PREFIX : <http://nextprot.org/rdf/>
PREFIX cv: <http://nextprot.org/rdf/terminology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
PREFIX dcterms: <http://purl.org/dc/terms/>
select distinct ?entry ?gen ?pathwayname where {
SERVICE <https://sparql.wikipathways.org/sparql> {
SELECT DISTINCT ?pathwayname ?gen WHERE
{
{?geneProduct a wp:Protein}
union
{?geneProduct a wp:GeneProduct}
?geneProduct rdfs:label ?gen .
?geneProduct dcterms:isPartOf ?pathway .
?pathway a wp:Pathway .
?pathway wp:organism ?organism .
FILTER(contains(str(?organism),"9606"))
?pathway dc:title ?pathwayname .
FILTER(regex(?pathwayname,"cancer","i")). }
}
?entry a :Entry .
?entry :gene / :name / rdfs:label ?gen .
?entry :isoform / :enzymeClassification / :term /:childOf cv:2_7_-_- . # protein kinase activity
}
order by ?gen
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?entry"):::projected
v1("?gen"):::projected
v4("?geneProduct")
v3("?organism")
v5("?pathway")
v2("?pathwayname"):::projected
a1((" "))
a2((" "))
a3((" "))
a4((" "))
a5((" "))
c6(["wp:Protein"]):::iri
c20([":terminology/2_7_-_-"]):::iri
c10(["wp:Pathway"]):::iri
c7(["wp:GeneProduct"]):::iri
c13([":Entry"]):::iri
subgraph s1["https://sparql.wikipathways.org/sparql"]
style s1 stroke-width:4px;
f0[["regex(?pathwayname,'cancer','i')"]]
f0 --> v2
f1[["contains(str(?organism),'9606')"]]
f1 --> v3
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v4 --"a"--> c7
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v4 --"a"--> c6
end
union0r <== or ==> union0l
end
v4 --"rdfs:label"--> v1
v4 --"dcterms:isPartOf"--> v5
v5 --"a"--> c10
v5 --"wp:organism"--> v3
v5 --http://purl.org/dc/elements/1.1/title--> v2
end
v6 --"a"--> c13
v6 --":gene"--> a1
a1 --":name"--> a2
a2 --"rdfs:label"--> v1
v6 --":isoform"--> a3
a3 --":enzymeClassification"--> a4
a4 --":term"--> a5
a5 --":childOf"--> c20