sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

NXQ_00252

rq turtle/ttl

Protein kinases involved in cancer pathways according to wikipathways

Use at

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
https://sparql.wikipathways.org/sparql
Union
a
a
rdfs:label
dcterms:isPartOf
a
wp:organism
http://purl.org/dc/elements/1.1/title
a
:gene
:name
rdfs:label
:isoform
:enzymeClassification
:term
:childOf
or
regex(?pathwayname,'cancer','i')
?pathwayname
contains(str(?organism),'9606')
?organism
?gen
?pathway
wp:Pathway
wp:Protein
wp:GeneProduct
?geneProduct
?entry
:terminology/2_7_-_-
:Entry