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_09469

Check there are no entries with a localization keyword that do not have the corresponding subcellular location annotation and/or GO cellular component annotatio

Use at

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

select distinct ?entry ?kw ?subcell ?gocc where {
  ?entry :isoform /:keyword /:term ?kw.
  ?subcell a :UniprotSubcellularLocationCv.
  ?kw :related ?subcell.
  ?gocc a :GoCellularComponentCv.
  ?kw :related ?gocc.
  ?entry :isoform /:goCellularComponent ?comp.
  filter not exists {?comp :negativeEvidence ?negev} # No negative evidence
  filter not exists {?comp :term ?gocc.}
  ?entry :isoform /:subcellularLocation ?comp.
  filter not exists {?comp :negativeEvidence ?negev} # No negative evidence
  filter not exists {?comp :term ?gocc.}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?comp")
  v4("?entry"):::projected 
  v2("?gocc"):::projected 
  v5("?kw"):::projected 
  v3("?negev")
  v6("?subcell"):::projected 
  a1((" "))
  a2((" "))
  a3((" "))
  a4((" "))
  c8([":GoCellularComponentCv"]):::iri 
  c6([":UniprotSubcellularLocationCv"]):::iri 
  f0[["not  "]]
  subgraph f0e0["Exists Clause"]
    e0v1 --":term"-->  e0v2
    e0v1("?comp"):::projected 
    e0v2("?gocc"):::projected 
  end
  f0--EXISTS--> f0e0
  f0 --> v1
  f0 --> c1
  f0 --> v2
  v1 --":term"-->  v2
  f1[["not  "]]
  subgraph f1e1["Exists Clause"]
    e1v1 --":negativeEvidence"-->  e1v2
    e1v1("?comp"):::projected 
    e1v2("?negev"):::projected 
  end
  f1--EXISTS--> f1e1
  f1 --> v1
  f1 --> c2
  f1 --> v3
  v1 --":negativeEvidence"-->  v3
  f2[["not  "]]
  subgraph f2e2["Exists Clause"]
    e2v1 --":term"-->  e2v2
    e2v1("?comp"):::projected 
    e2v2("?gocc"):::projected 
  end
  f2--EXISTS--> f2e2
  f2 --> v1
  f2 --> c1
  f2 --> v2
  v1 --":term"-->  v2
  f3[["not  "]]
  subgraph f3e3["Exists Clause"]
    e3v1 --":negativeEvidence"-->  e3v2
    e3v1("?comp"):::projected 
    e3v2("?negev"):::projected 
  end
  f3--EXISTS--> f3e3
  f3 --> v1
  f3 --> c2
  f3 --> v3
  v1 --":negativeEvidence"-->  v3
  v4 --":isoform"-->  a1
  a1 --":keyword"-->  a2
  a2 --":term"-->  v5
  v6 --"a"-->  c6
  v5 --":related"-->  v6
  v2 --"a"-->  c8
  v5 --":related"-->  v2
  v4 --":isoform"-->  a3
  a3 --":goCellularComponent"-->  v1
  v4 --":isoform"-->  a4
  a4 --":subcellularLocation"-->  v1