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_00294

Variants in MECP2 causing Rett Syndrome

Use at

PREFIX : <http://nextprot.org/rdf/>
PREFIX nextprot: <http://nextprot.org/rdf/entry/>
PREFIX nextprot_cv: <http://nextprot.org/rdf/terminology/>

SELECT DISTINCT ?start ?stop ?original ?modified WHERE {
 nextprot:NX_P51608 :isoform ?iso. #MECP2 entry
 ?iso :swissprotDisplayed true. #Swissprot canonical isoform
 {
 ?iso :variant ?v.
 ?v :disease nextprot_cv:DI-00999. #UniProtKB term for Rett Syndrome
 ?v :start ?start.
 ?v :end ?stop.
 filter((?stop - ?start) = 0) #single amino acid variants (SAAVs)
 ?v :original ?original.
 ?v :variation ?modified.
 }
 union
 {
 ?iso :proteoform ?pf.
 ?pf :diseaseRelatedVariant ?ann.
 filter not exists {?ann :negativeEvidence ?negev} # No negative disease evidence
 ?ann :impactedObject /:term nextprot_cv:C75488. #NCI Thesaurus term for Rett Syndrome
 ?pf :difference ?v.
 ?v :start ?start.
 ?v :end ?stop.
 filter((?stop - ?start) = 0)
 ?v :original ?original.
 ?v :variation ?modified.
 }
}
order by asc(?start)
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v7("?ann")
  v2("?iso")
  v6("?modified"):::projected 
  v8("?negev")
  v5("?original"):::projected 
  v9("?pf")
  v1("?start"):::projected 
  v3("?stop"):::projected 
  v4("?v")
  a1((" "))
  c1([":entry/NX_P51608"]):::iri 
  c8([":terminology/DI-00999"]):::iri 
  c18([":terminology/C75488"]):::iri 
  c4(["true^^xsd:boolean"]):::literal 
  c1 --":isoform"-->  v2
  v2 --":swissprotDisplayed"-->  c4
  subgraph union0[" Union "]
  subgraph union0l[" "]
    style union0l fill:#abf,stroke-dasharray: 3 3;
    f0[["?stop - ?start = '0^^xsd:integer'"]]
    f0 --> v3
    f0 --> v1
    f1[["not  "]]
    subgraph f1e0["Exists Clause"]
      e0v1 --":negativeEvidence"-->  e0v2
      e0v1("?ann"):::projected 
      e0v2("?negev"):::projected 
    end
    f1--EXISTS--> f1e0
    f1 --> v7
    f1 --> c13
    f1 --> v8
    v7 --":negativeEvidence"-->  v8
    v2 --":proteoform"-->  v9
    v9 --":diseaseRelatedVariant"-->  v7
    v7 --":impactedObject"-->  a1
    a1 --":term"-->  c18
    v9 --":difference"-->  v4
    v4 --":start"-->  v1
    v4 --":end"-->  v3
    v4 --":original"-->  v5
    v4 --":variation"-->  v6
  end
  subgraph union0r[" "]
    style union0r fill:#abf,stroke-dasharray: 3 3;
    f2[["?stop - ?start = '0^^xsd:integer'"]]
    f2 --> v3
    f2 --> v1
    v2 --":variant"-->  v4
    v4 --":disease"-->  c8
    v4 --":start"-->  v1
    v4 --":end"-->  v3
    v4 --":original"-->  v5
    v4 --":variation"-->  v6
  end
  union0r <== or ==> union0l
  end