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_00082

Proteins whose genes are on chromosome 21 that have "gold" variants not associated with a disease

Use at

PREFIX : <http://nextprot.org/rdf/>
PREFIX nextprot_cv: <http://nextprot.org/rdf/terminology/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?entry WHERE {
 ?entry :gene / :chromosome "21"^^xsd:string; :isoform / :variant ?variant.
 ?variant :evidence / :quality :GOLD.
 filter not exists { ?variant :disease ?disease. }
 filter ( not exists {
	?entry :isoform / :proteoform ?pf.
	?pf :difference ?variant.
	?variant :evidence / :negative false. # variant with positive evidence
	?pf :diseaseRelatedVariant / :term nextprot_cv:ME_0000013 . # variant is causing disease
 } )
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?disease")
  v1("?entry"):::projected 
  v2("?pf")
  v3("?variant")
  a4((" "))
  a5((" "))
  a6((" "))
  a1((" "))
  a2((" "))
  a3((" "))
  c6(["false^^xsd:boolean"]):::literal 
  c9([":terminology/ME_0000013"]):::iri 
  c16([":GOLD"]):::iri 
  c13(["21"]):::literal 
  f0[["not  "]]
  subgraph f0e0["Exists Clause"]
    e0v1 --":isoform"-->  e0a1
    e0a1 --":proteoform"-->  e0v2
    e0v2 --":difference"-->  e0v3
    e0v3 --":evidence"-->  e0a2
    e0a2 --":negative"-->  e0c6
    e0v2 --":diseaseRelatedVariant"-->  e0a3
    e0a3 --":term"-->  e0c9
    e0v1("?entry"):::projected 
    e0v2("?pf"):::projected 
    e0v3("?variant"):::projected 
    e0a1((" ")):::projected 
    e0a2((" ")):::projected 
    e0a3((" ")):::projected 
    e0c6(["false^^xsd:boolean"]):::literal 
    e0c9([":terminology/ME_0000013"]):::iri 
  end
  f0--EXISTS--> f0e0
  f0 --> v1
  f0 --> c1
  f0 --> a1
  f0 --> c2
  f0 --> v2
  f0 --> c3
  f0 --> v3
  f0 --> c4
  f0 --> a2
  f0 --> c5
  f0 --> c6
  f0 --> c7
  f0 --> a3
  f0 --> c8
  f0 --> c9
  v1 --":isoform"-->  a1
  a1 --":proteoform"-->  v2
  v2 --":difference"-->  v3
  v3 --":evidence"-->  a2
  a2 --":negative"-->  c6
  v2 --":diseaseRelatedVariant"-->  a3
  a3 --":term"-->  c9
  f1[["not  "]]
  subgraph f1e1["Exists Clause"]
    e1v1 --":disease"-->  e1v2
    e1v2("?disease"):::projected 
    e1v1("?variant"):::projected 
  end
  f1--EXISTS--> f1e1
  f1 --> v3
  f1 --> c10
  f1 --> v4
  v3 --":disease"-->  v4
  v1 --":gene"-->  a4
  a4 --":chromosome"-->  c13
  v1 --":isoform"-->  a5
  a5 --":variant"-->  v3
  v3 --":evidence"-->  a6
  a6 --":quality"-->  c16