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

ex:16 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Find statistics on translated sequence length for genes matching both IPR002117 and GO:0008219"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX GO: <http://purl.obolibrary.org/obo/GO_>
PREFIX interpro: <http://www.ebi.ac.uk/interpro/entry/>
PREFIX : <http://purl.orthodb.org/>

SELECT
    (count(?gene) as ?count_genes)
    (min(?aa_seq_length) as ?min_aa_length)
    (avg(?aa_seq_length) as ?avg_aa_length)
    (max(?aa_seq_length) as ?max_aa_length)
WHERE {
    ?gene a :Gene; :geneTranslatedLength ?aa_seq_length.
    ?gene :xref [a :Xref; :xrefResource interpro:IPR002117].
    ?gene :xref [a :Xref; :xrefResource GO:0008219].
}
""" ;
    schema:target <https://sparql.orthodb.org/sparql/> .
