@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_00139 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Protein kinases which are high-confidence drug targets according to CHEMBL"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX : <http://nextprot.org/rdf/>
PREFIX cco: <http://rdf.ebi.ac.uk/terms/chembl#>
PREFIX nextprot_cv: <http://nextprot.org/rdf/terminology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

SELECT DISTINCT ?entry (str(?gen) as ?gene) WHERE {
    SERVICE <https://idsm.elixir-czech.cz/sparql/endpoint/idsm> {
        SELECT DISTINCT ?protein WHERE {
            ?target cco:hasTargetComponent ?tarComp .
            ?target cco:taxonomy <http://identifiers.org/taxonomy/9606> . # human protein target
            ?tarComp cco:targetCmptXref ?protein .
            #?protein a cco:UniprotRef .
            FILTER(contains(str(?protein),"uniprot"))
            ?activity a cco:Activity ; cco:hasMolecule ?drug ; cco:hasAssay ?assay .
            ?drug cco:hasMechanism / cco:hasTarget ?target . # known drug action mechanism
            ?assay cco:hasTarget ?target; cco:targetConfScore ?score .
            FILTER(?score > 8) # high-confidence assay
        }
    }
    ?entry skos:exactMatch ?protein .
    ?entry :isoform / :uniprotKeyword / :term nextprot_cv:KW-0418. #kinase
    ?entry :gene / :recommendedName / rdfs:label ?gen.
}""" ;
    schema:keywords "drug",
        "enzyme",
        "federated query",
        "function",
        "quality",
        "tutorial" ;
    schema:target <https://sparql.nextprot.org/sparql> ;
    spex:federatesWith <https://idsm.elixir-czech.cz/sparql/endpoint/idsm>.
