@prefix ex: <https://www.bgee.org/sparql/.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:022 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "List the labels and identifiers of pig-tailed macaque genes in bgee"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX obo: <http://purl.obolibrary.org/obo/>

SELECT DISTINCT ?geneId ?geneName
WHERE {
    ?gene a orth:Gene ;
        dcterms:identifier ?geneId ;
        orth:organism/obo:RO_0002162/up:commonName ?commonName .
    OPTIONAL { ?gene rdfs:label ?geneName .}
    FILTER ( LCASE(?commonName) = "pig-tailed macaque" ) .
}""" ;
    schema:target <https://www.bgee.org/sparql/> .
