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_09648

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

Use at

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

select distinct ?entry where {
  ?entry :isoform /:keyword /:term cv:KW-0621.
  ?entry :isoform /:variant /:evidence ?ev.
  {?ev :assignedBy source:dbSNP.}
  union
  {?ev :assignedBy source:UniProt.}
  ?ev :reference /:accession ?xref.
  filter (!regex(?xref, "^rs"))
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?entry"):::projected 
  v3("?ev")
  v1("?xref")
  a1((" "))
  a2((" "))
  a3((" "))
  a4((" "))
  a5((" "))
  c10([":source/UniProt"]):::iri 
  c9([":source/dbSNP"]):::iri 
  c5([":terminology/KW-0621"]):::iri 
  f0[["not regex(?xref,'^rs')"]]
  f0 --> v1
  v2 --":isoform"-->  a1
  a1 --":keyword"-->  a2
  a2 --":term"-->  c5
  v2 --":isoform"-->  a3
  a3 --":variant"-->  a4
  a4 --":evidence"-->  v3
  subgraph union0[" Union "]
  subgraph union0l[" "]
    style union0l fill:#abf,stroke-dasharray: 3 3;
    v3 --":assignedBy"-->  c10
  end
  subgraph union0r[" "]
    style union0r fill:#abf,stroke-dasharray: 3 3;
    v3 --":assignedBy"-->  c9
  end
  union0r <== or ==> union0l
  end
  v3 --":reference"-->  a5
  a5 --":accession"-->  v1