@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:006 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "What are the anatomical entities where the human gene APOC1 is expressed in the post-juvenile stage?"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX efo: <http://www.ebi.ac.uk/efo/>
PREFIX genex: <http://purl.org/genex#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT DISTINCT ?anatName ?anat ?stageName ?stage WHERE {
    ?seq a orth:Gene ;
        rdfs:label "APOC1" ;
        genex:isExpressedIn ?condition ;
        orth:organism ?organism .
    ?condition a genex:ExpressionCondition ;
        genex:hasAnatomicalEntity ?anat ;
        genex:hasAnatomicalEntity obo:GO_0005575 ;
        genex:hasDevelopmentalStage ?stage .
    ?anat a genex:AnatomicalEntity ;
        rdfs:label ?anatName .
    ?stage a efo:EFO_0000399 ;
        rdfs:label ?stageName .
    ?organism obo:RO_0002162  ?species .
    ?species a up:Taxon ;
        up:commonName "human" .
    FILTER (CONTAINS(LCASE(?stageName), 'post-juvenile' ))
}""" ;
    schema:target <https://www.bgee.org/sparql/> .
