sparql-examples

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

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

neXtProt/NXQ_00208

Proteins which are ion channels and are associated with a disease

Use at

PREFIX : <http://nextprot.org/rdf/>
PREFIX nextprot_cv: <http://nextprot.org/rdf/terminology/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?entry WHERE {
 ?entry :isoform ?iso.
 ?iso :uniprotKeyword /:term nextprot_cv:KW-0407. #ion channel
 {
 ?iso :medical / rdf:type :Disease.
 } union {
 ?iso :uniprotKeyword / :term ?kw .
 ?kw :termType "Disease"^^xsd:string
 filter (?kw != nextprot_cv:KW-0656)
 }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?entry"):::projected 
  v2("?iso")
  v3("?kw")
  a1((" "))
  a2((" "))
  a3((" "))
  c4([":terminology/KW-0407"]):::iri 
  c10(["Disease"]):::literal 
  c7([":Disease"]):::iri 
  v1 --":isoform"-->  v2
  v2 --":uniprotKeyword"-->  a1
  a1 --":term"-->  c4
  subgraph union0[" Union "]
  subgraph union0l[" "]
    style union0l fill:#abf,stroke-dasharray: 3 3;
    f0[["?kw != ':terminology/KW-0656'"]]
    f0 --> v3
    v2 --":uniprotKeyword"-->  a3
    a3 --":term"-->  v3
    v3 --":termType"-->  c10
  end
  subgraph union0r[" "]
    style union0r fill:#abf,stroke-dasharray: 3 3;
    v2 --":medical"-->  a2
    a2 --"a"-->  c7
  end
  union0r <== or ==> union0l
  end