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_00087

Proteins whose genes are on chromosome X and which do not have a ortholog in mouse

Use at

PREFIX : <http://nextprot.org/rdf/>
PREFIX db: <http://nextprot.org/rdf/db/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?entry WHERE {
 ?entry :gene / :chromosome "X"^^xsd:string .
 filter not exists { ?entry :reference / :provenance db:MGI . }
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?entry"):::projected 
  a2((" "))
  a1((" "))
  c6(["X"]):::literal 
  c3([":db/MGI"]):::iri 
  f0[["not  "]]
  subgraph f0e0["Exists Clause"]
    e0v1 --":reference"-->  e0a1
    e0a1 --":provenance"-->  e0c3
    e0v1("?entry"):::projected 
    e0a1((" ")):::projected 
    e0c3([":db/MGI"]):::iri 
  end
  f0--EXISTS--> f0e0
  f0 --> v1
  f0 --> c1
  f0 --> a1
  f0 --> c2
  f0 --> c3
  v1 --":reference"-->  a1
  a1 --":provenance"-->  c3
  v1 --":gene"-->  a2
  a2 --":chromosome"-->  c6