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_00271

Polymorphisms located on ACE2 and TMPRSS2 and affecting proteins’ activity, structure, PTM...

Use at

PREFIX : <http://nextprot.org/rdf/>
PREFIX nextprot: <http://nextprot.org/rdf/entry/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT (str(?gn) as ?gene) ?pos (str(?snpac) as ?varid) (str(?orgaa) as ?orgAA) ?annot_type (str(?txt) as ?note) (str(?varaa) as ?varAA) ?freq where
{
 values ?entry {nextprot:NX_Q9BYF1 nextprot:NX_O15393} # proteins of interest (ACE2, TMPRSS2)
 ?entry :gene /:recommendedName / rdfs:label ?gn.
 ?entry :isoform ?iso .
 ?iso :swissprotDisplayed true; :variant ?var .
 ?var :start ?pos ; :original ?orgaa; :variation ?varaa .
 optional {?var :evidence / :alleleFrequency ?freq .}
 ?var :evidence / :reference ?xref .
 ?iso :positionalAnnotation ?annot .
 optional {?annot rdfs:comment ?txt .}
 ?annot a ?annot_type .
 {
 ?annot :start ?pos; :end ?pos.
 filter not exists {?annot a :Variant. }
 filter not exists {?annot a :SequenceConflict. }
 }
 union
 {
 ?annot a :DisulfideBond.
 {?annot :start ?pos. }
 union
 {?annot :end ?pos. }
 }
 } order by ?entry ?pos
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v10("?annot")
  v12("?annot_type"):::projected 
  v3("?entry")
  v8("?freq"):::projected 
  v13("?gene")
  v3("?gn"):::projected 
  v4("?iso")
  v16("?note")
  v15("?orgAA")
  v6("?orgaa"):::projected 
  v2("?pos"):::projected 
  v11("?txt"):::projected 
  v5("?var")
  v17("?varAA")
  v7("?varaa"):::projected 
  v14("?varid")
  v9("?xref")
  a1((" "))
  a2((" "))
  a3((" "))
  a4((" "))
  c17([":SequenceConflict"]):::iri 
  c20([":DisulfideBond"]):::iri 
  c6(["true^^xsd:boolean"]):::literal 
  c18([":Variant"]):::iri 
  bind0[/VALUES ?entry/]
  bind0-->v3
  bind00([":entry/NX_Q9BYF1"])
  bind00 --> bind0
  bind01([":entry/NX_O15393"])
  bind01 --> bind0
  v3 --":gene"-->  a1
  a1 --":recommendedName"-->  a2
  a2 --"rdfs:label"-->  v3
  v3 --":isoform"-->  v4
  v4 --":swissprotDisplayed"-->  c6
  v4 --":variant"-->  v5
  v5 --":start"-->  v2
  v5 --":original"-->  v6
  v5 --":variation"-->  v7
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v5 -.":evidence".->  a3
    a3 --":alleleFrequency"-->  v8
  end
  v5 --":evidence"-->  a4
  a4 --":reference"-->  v9
  v4 --":positionalAnnotation"-->  v10
  subgraph optional1["(optional)"]
  style optional1 fill:#bbf,stroke-dasharray: 5 5;
    v10 -."rdfs:comment".->  v11
  end
  v10 --"a"-->  v12
  subgraph union0[" Union "]
  subgraph union0l[" "]
    style union0l fill:#abf,stroke-dasharray: 3 3;
    v10 --"a"-->  c20
    subgraph union1[" Union "]
    subgraph union1l[" "]
      style union1l fill:#abf,stroke-dasharray: 3 3;
      v10 --":end"-->  v2
    end
    subgraph union1r[" "]
      style union1r fill:#abf,stroke-dasharray: 3 3;
      v10 --":start"-->  v2
    end
    union1r <== or ==> union1l
    end
  end
  subgraph union0r[" "]
    style union0r fill:#abf,stroke-dasharray: 3 3;
    f1[["not  "]]
    subgraph f1e0["Exists Clause"]
      e0v1 --"a"-->  e0c2
      e0v1("?annot"):::projected 
      e0c2([":SequenceConflict"]):::iri 
    end
    f1--EXISTS--> f1e0
    f1 --> v10
    f1 --> c16
    f1 --> c17
    v10 --"a"-->  c17
    f2[["not  "]]
    subgraph f2e1["Exists Clause"]
      e1v1 --"a"-->  e1c2
      e1v1("?annot"):::projected 
      e1c2([":Variant"]):::iri 
    end
    f2--EXISTS--> f2e1
    f2 --> v10
    f2 --> c16
    f2 --> c18
    v10 --"a"-->  c18
    v10 --":start"-->  v2
    v10 --":end"-->  v2
  end
  union0r <== or ==> union0l
  end
  bind3[/"str(?gn)"/]
  v3 --o bind3
  bind3 --as--o v13
  bind4[/"str(?snpac)"/]
  null --o bind4
  bind4 --as--o v14
  bind5[/"str(?orgaa)"/]
  v6 --o bind5
  bind5 --as--o v15
  bind6[/"str(?txt)"/]
  v11 --o bind6
  bind6 --as--o v16
  bind7[/"str(?varaa)"/]
  v7 --o bind7
  bind7 --as--o v17