sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

98_uniprot_entries_with_more_than_two_geneid_crossrefences

Find GeneID's crosslinked to more than one human or mouse UniProtKB entry

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX taxon:<http://purl.uniprot.org/taxon/>
SELECT 
  ?geneid 
  ?organism 
  (GROUP_CONCAT(?protein; separator=', ') AS ?entries)
WHERE
{
  VALUES ?organism {taxon:9606 taxon:10090}
  ?geneid up:database <http://purl.uniprot.org/database/GeneID> .
  ?protein rdfs:seeAlso ?geneid ; 
           up:organism ?organism
} GROUP BY ?geneid ?organism HAVING (COUNT(?protein) > 1) ORDER BY ?organism ?geneid

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?_anon_524857e97b124dceaa8a4ecc8d1a18276094")
  v5("?entries")
  v2("?geneid"):::projected 
  v3("?organism"):::projected 
  v3("?protein"):::projected 
  a1((" "))
  c3([http://purl.uniprot.org/database/GeneID]):::iri 
  f0[[" > '1^^xsd:integer'"]]
  f0 --> a1
  bind1[/VALUES ?organism/]
  bind1-->v3
  bind10([http://purl.uniprot.org/taxon/9606])
  bind10 --> bind1
  bind11([http://purl.uniprot.org/taxon/10090])
  bind11 --> bind1
  v2 --"up:database"-->  c3
  v3 --"rdfs:seeAlso"-->  v2
  v3 --"up:organism"-->  v3
  bind4[/"count(?protein)"/]
  v3 --o bind4
  bind4 --as--o v4
  bind5[/"?protein"/]
  v3 --o bind5
  bind5 --as--o v5