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_00004

Proteins expressed in brain with observed IHC expression "high" but not expressed in testis

Use at

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

SELECT DISTINCT ?entry WHERE {
 ?entry :isoform ?iso.
 # get all expression
 ?iso :expression ?e1.
 # highly expressed in brain
 ?e1 :term/:childOf nextprot_cv:TS-0095;:evidence/:observedExpression :High.
 # not expressed in testis
 ?iso :undetectedExpression ?e2.
 ?e2 :term nextprot_cv:TS-1030.
# Use the semicolon ';' to refer to the previous subject (?e1)
# Only IHC data has observed expression "High" so ECO is not specified.
#
# Note that we also exclude expression detected in testis.
 filter not exists { ?iso :detectedExpression / :term / :childOf nextprot_cv:TS-1030 }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?e1")
  v4("?e2")
  v2("?entry"):::projected 
  v1("?iso")
  a3((" "))
  a4((" "))
  a1((" "))
  a2((" "))
  c10([":High"]):::iri 
  c4([":terminology/TS-1030"]):::iri 
  c7([":terminology/TS-0095"]):::iri 
  f0[["not  "]]
  subgraph f0e0["Exists Clause"]
    e0v1 --":detectedExpression"-->  e0a1
    e0a1 --":term"-->  e0a2
    e0a2 --":childOf"-->  e0c4
    e0v1("?iso"):::projected 
    e0a1((" ")):::projected 
    e0a2((" ")):::projected 
    e0c4([":terminology/TS-1030"]):::iri 
  end
  f0--EXISTS--> f0e0
  f0 --> v1
  f0 --> c1
  f0 --> a1
  f0 --> c2
  f0 --> a2
  f0 --> c3
  f0 --> c4
  v1 --":detectedExpression"-->  a1
  a1 --":term"-->  a2
  a2 --":childOf"-->  c4
  v2 --":isoform"-->  v1
  v1 --":expression"-->  v3
  v3 --":term"-->  a3
  a3 --":childOf"-->  c7
  v3 --":evidence"-->  a4
  a4 --":observedExpression"-->  c10
  v1 --":undetectedExpression"-->  v4
  v4 --":term"-->  c4