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_09416

Check there are no entries whose gene is located on a band which does NOT start with "p" or "q", is not "unknown" or null

Use at

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

select distinct ?entry ?band where {
  ?entry :gene / :band ?band .
   filter (!regex (?band,"^p"))
   filter (!regex (?band,"^q"))
   filter (!regex (?band,"unknown"))
   filter (!regex (?band,""))
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?band"):::projected 
  v2("?entry"):::projected 
  a1((" "))
  f0[["not regex(?band,'')"]]
  f0 --> v1
  f1[["not regex(?band,'unknown')"]]
  f1 --> v1
  f2[["not regex(?band,'^q')"]]
  f2 --> v1
  f3[["not regex(?band,'^p')"]]
  f3 --> v1
  v2 --":gene"-->  a1
  a1 --":band"-->  v1