@prefix ex:<https://purl.expasy.org/sparql-examples/neXtProt/> .
@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:NXQ_00300 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Proteins with protein existence \"At protein level\" (PE=1) that have no function annotated, are highly expressed in brain and have homologs in Drosophila melanogaster according to OrthoDB"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX : <http://nextprot.org/rdf/>
PREFIX nextprot_cv: <http://nextprot.org/rdf/terminology/>
PREFIX orthodb: <http://purl.orthodb.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>

select ?entry (str(?name) as ?human_name) (group_concat(distinct str(?fly_name); SEPARATOR = ",") as ?fly_names) where
{
?entry :isoform ?iso.
?entry :gene / :recommendedName / rdfs:label ?name.
?entry :existence :Evidence_at_protein_level .
filter not exists { ?iso :functionInfo ?_. }
filter not exists { ?iso :catalyticActivity ?_ .}
filter not exists { ?iso :transportActivity ?_ .}
filter not exists { ?iso :pathway ?_. }
filter not exists { ?iso :function / :term ?fterm . filter(?fterm != nextprot_cv:GO_0005524 && ?fterm != nextprot_cv:GO_0000287 && ?fterm != nextprot_cv:GO_0005515 && ?fterm != nextprot_cv:GO_0042802 && ?fterm != nextprot_cv:GO_0008270 && ?fterm != nextprot_cv:GO_0051260 && ?fterm != nextprot_cv:GO_0005509 && ?fterm != nextprot_cv:GO_0003676 && ?fterm != nextprot_cv:GO_0003824 && ?fterm != nextprot_cv:GO_0007165 && ?fterm != nextprot_cv:GO_0035556 && ?fterm != nextprot_cv:GO_0046914 && ?fterm != nextprot_cv:GO_0046872)}
?iso :expression ?e1.
?e1 :term/:childOf nextprot_cv:TS-0095;:evidence/:observedExpression :High.
{
SERVICE <https://sparql.orthodb.org/sparql>
{?gene rdfs:seeAlso ?entry; orthodb:memberOf ?og.
?og orthodb:ogBuiltAt [up:scientificName ?clade]
; orthodb:hasMember ?ortholog.
?ortholog orthodb:name ?fly_name; up:organism/a/up:scientificName 'Drosophila melanogaster'.
filter (?clade='Metazoa') }
}
} group by ?entry ?name""" ;
    schema:keywords "expression",
        "federated query",
        "function",
        "gene",
        "name",
        "phylogeny",
        "protein existence",
        "tutorial" ;
    schema:target <https://sparql.nextprot.org/sparql> ;
    spex:federatesWith <https://sparql.orthodb.org/sparql> .

