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_09638

Check there are no entries where the isoform sequence starts with M and the variant at position 1 does not start with M

Use at

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

select distinct ?entry where {
  ?entry :isoform ?iso.
  ?iso :variant ?var.
  ?iso :sequence ?seq.
  filter (regex(?seq, "^M"))
  ?var :start 1 .
  ?var :original ?ori.
  filter (!regex(?ori, "^M"))
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?entry"):::projected 
  v4("?iso")
  v1("?ori")
  v2("?seq")
  v5("?var")
  c6(["1^^xsd:integer"]):::literal 
  f0[["not regex(?ori,'^M')"]]
  f0 --> v1
  f1[["regex(?seq,'^M')"]]
  f1 --> v2
  v3 --":isoform"-->  v4
  v4 --":variant"-->  v5
  v4 --":sequence"-->  v2
  v5 --":start"-->  c6
  v5 --":original"-->  v1