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_00008

Proteins whose genes are less than 50000 bp away from the location of the gene coding for protein p53

Use at

PREFIX : <http://nextprot.org/rdf/>
PREFIX nextprot: <http://nextprot.org/rdf/entry/>

SELECT DISTINCT ?entry WHERE {
 nextprot:NX_P04637 :gene /:begin ?s;:gene/:chromosome ?chr.
 ?entry :gene/:begin ?gs;:gene/:chromosome ?chr.
 filter ( ?gs > (?s -50000) && ?gs <= (?s +50000) && ?entry != nextprot:NX_P04637 )
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?chr")
  v3("?entry"):::projected 
  v1("?gs")
  v2("?s")
  a1((" "))
  a2((" "))
  a3((" "))
  a4((" "))
  c3([":entry/NX_P04637"]):::iri 
  f0[["?gs > ?s + '-50000^^xsd:integer'?gs <= ?s + '+50000^^xsd:integer'?entry != ':entry/NX_P04637'"]]
  f0 --> v1
  f0 --> v2
  f0 --> v3
  c3 --":gene"-->  a1
  a1 --":begin"-->  v2
  c3 --":gene"-->  a2
  a2 --":chromosome"-->  v4
  v3 --":gene"-->  a3
  a3 --":begin"-->  v1
  v3 --":gene"-->  a4
  a4 --":chromosome"-->  v4