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_09647

Check there are no entries with a variant annotation having a xref starting with "rs" that do not have the keyword KW-0621 (Polymorphism)

Use at

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

select distinct ?entry where {
  ?entry :isoform /:variant /:evidence ?ev.
  ?ev :reference /:accession ?xref.
  filter (regex(?xref, "^rs"))
  filter not exists {?entry :isoform /:keyword /:term cv:KW-0621.}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?entry"):::projected 
  v3("?ev")
  v2("?xref")
  a3((" "))
  a4((" "))
  a5((" "))
  a1((" "))
  a2((" "))
  c4([":terminology/KW-0621"]):::iri 
  f0[["not  "]]
  subgraph f0e0["Exists Clause"]
    e0v1 --":isoform"-->  e0a1
    e0a1 --":keyword"-->  e0a2
    e0a2 --":term"-->  e0c4
    e0v1("?entry"):::projected 
    e0a1((" ")):::projected 
    e0a2((" ")):::projected 
    e0c4([":terminology/KW-0621"]):::iri 
  end
  f0--EXISTS--> f0e0
  f0 --> v1
  f0 --> c1
  f0 --> a1
  f0 --> c2
  f0 --> a2
  f0 --> c3
  f0 --> c4
  v1 --":isoform"-->  a1
  a1 --":keyword"-->  a2
  a2 --":term"-->  c4
  f1[["regex(?xref,'^rs')"]]
  f1 --> v2
  v1 --":isoform"-->  a3
  a3 --":variant"-->  a4
  a4 --":evidence"-->  v3
  v3 --":reference"-->  a5
  a5 --":accession"-->  v2