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_00099

Secreted proteins that have at least one PTM in a position of a variant

Use at

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

SELECT DISTINCT ?entry WHERE {
 values ?sloc {nextprot_cv:GO_0005576 nextprot_cv:SL-0243} # GO and SL values for secreted
 ?entry :isoform ?iso .
 ?iso :swissprotDisplayed true . # restricted to main isoform due to computing time (> 98% of sites)
 ?iso :cellularComponent ?anno .
 ?anno :quality :GOLD; :term /:childOf ?sloc. # secreted
 filter not exists { ?anno :negativeEvidence ?_ }
 # excludes "extracellular exosome"-only location, most of them evidenced only by large-scale proteomic analysis
 filter not exists {
	 ?iso :cellularComponent /:term nextprot_cv:GO_0070062 . # extracellular exosome
 	 filter not exists { ?iso :cellularComponent /:term /:childOf nextprot_cv:SL-0243 .}
 	}
 ?iso :variant /:start ?varpos.
 ?iso :ptm /:start ?varpos.
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?_")
  v2("?anno")
  v5("?entry"):::projected 
  v1("?iso")
  v4("?sloc")
  v6("?varpos")
  a4((" "))
  a3((" "))
  a1((" "))
  a2((" "))
  a5((" "))
  a6((" "))
  c11([":GOLD"]):::iri 
  c4([":terminology/SL-0243"]):::iri 
  c9(["true^^xsd:boolean"]):::literal 
  c5([":terminology/GO_0070062"]):::iri 
  f0[["not  "]]
  subgraph f0e0["Exists Clause"]
    e0f0[["not  "]]
    subgraph e0f0e0e0["Exists Clause"]
      e0e0v1 --":cellularComponent"-->  e0e0a1
      e0e0a1 --":term"-->  e0e0a2
      e0e0a2 --":childOf"-->  e0e0c4
      e0e0v1("?iso"):::projected 
      e0e0a1((" ")):::projected 
      e0e0a2((" ")):::projected 
      e0e0c4([":terminology/SL-0243"]):::iri 
    end
    e0f0--EXISTS--> e0f0e0e0
    e0f0 --> e0v1
    e0f0 --> e0c1
    e0f0 --> e0a1
    e0f0 --> e0c2
    e0f0 --> e0a2
    e0f0 --> e0c3
    e0f0 --> e0c4
    e0v1 --":cellularComponent"-->  e0a1
    e0a1 --":term"-->  e0a2
    e0a2 --":childOf"-->  e0c4
    e0v1 --":cellularComponent"-->  e0a3
    e0a3 --":term"-->  e0c5
    e0v1("?iso"):::projected 
    e0a3((" ")):::projected 
    e0a1((" ")):::projected 
    e0a2((" ")):::projected 
    e0c4([":terminology/SL-0243"]):::iri 
    e0c5([":terminology/GO_0070062"]):::iri 
  end
  f0--EXISTS--> f0e0
  f0 --> v1
  f0 --> c1
  f0 --> a1
  f0 --> c2
  f0 --> a2
  f0 --> c3
  f0 --> c4
  f0 --> a3
  f0 --> c5
  f1[["not  "]]
  subgraph f1e1["Exists Clause"]
    e1v1 --":cellularComponent"-->  e1a1
    e1a1 --":term"-->  e1a2
    e1a2 --":childOf"-->  e1c4
    e1v1("?iso"):::projected 
    e1a1((" ")):::projected 
    e1a2((" ")):::projected 
    e1c4([":terminology/SL-0243"]):::iri 
  end
  f1--EXISTS--> f1e1
  f1 --> v1
  f1 --> c1
  f1 --> a1
  f1 --> c2
  f1 --> a2
  f1 --> c3
  f1 --> c4
  v1 --":cellularComponent"-->  a1
  a1 --":term"-->  a2
  a2 --":childOf"-->  c4
  v1 --":cellularComponent"-->  a3
  a3 --":term"-->  c5
  f2[["not  "]]
  subgraph f2e2["Exists Clause"]
    e2v1 --":negativeEvidence"-->  e2v2
    e2v2("?_"):::projected 
    e2v1("?anno"):::projected 
  end
  f2--EXISTS--> f2e2
  f2 --> v2
  f2 --> c6
  f2 --> v3
  v2 --":negativeEvidence"-->  v3
  bind3[/VALUES ?sloc/]
  bind3-->v4
  bind30([":terminology/GO_0005576"])
  bind30 --> bind3
  bind31([":terminology/SL-0243"])
  bind31 --> bind3
  v5 --":isoform"-->  v1
  v1 --":swissprotDisplayed"-->  c9
  v1 --":cellularComponent"-->  v2
  v2 --":quality"-->  c11
  v2 --":term"-->  a4
  a4 --":childOf"-->  v4
  v1 --":variant"-->  a5
  a5 --":start"-->  v6
  v1 --":ptm"-->  a6
  a6 --":start"-->  v6