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_09417

Check there are no entries whose gene is not located on the plus or minus strand or where the strand is unknown

Use at

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

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