@prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .

ex:98_uniprot_entries_with_more_than_two_geneid_crossrefences a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Find GeneID's crosslinked to more than one human or mouse UniProtKB entry"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """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
""" ;
    schema:keywords "cross-reference" , "mapping" , "count" ;
    schema:target <https://sparql.uniprot.org/sparql/> .

