@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#> .
@prefix spex:<https://purl.expasy.org/sparql-examples/ontology#> .

ex:120_for_taxon_find_reference_proteomes a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "For a ncbi taxon identifier as a digit find it's reference proteome(s) if they exist"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """
PREFIX up:<http://purl.uniprot.org/core/>
PREFIX taxon:<http://purl.uniprot.org/taxonomy/>

SELECT ?taxon ?reference_proteome
WHERE
{
  VALUES (?taxid) {
    (623) # Shigella flexneri
    (633) # Yersinia pseudotuberculosis
  } 
  # Convert the digit to a correct IRI
  BIND(IRI(CONCAT(STR(taxon:), ?taxid)) AS ?taxon)
  ?taxon up:scientificName ?taxonName .
  OPTIONAL {
    ?reference_proteome a up:Reference_Proteome .
    ?reference_proteome up:organism ?taxon .
  }
}""" ;
    schema:target <https://sparql.uniprot.org/sparql> .
