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_09424

Check there are no entries whose gene does not have a beginning position which has an end position

Use at

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

select distinct ?entry where {
  ?entry :gene ?gene.
  ?gene :begin ?begin.
  ?gene :end ?end.
  filter (?begin = 0)
  filter (?end > 0)
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?begin")
  v1("?end")
  v3("?entry"):::projected 
  v4("?gene")
  f0[["?end > '0^^xsd:integer'"]]
  f0 --> v1
  f1[["?begin = '0^^xsd:integer'"]]
  f1 --> v2
  v3 --":gene"-->  v4
  v4 --":begin"-->  v2
  v4 --":end"-->  v1