@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#> .

ex:NXQ_00286 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Protein domains or regions that frequently occur in interaction mappings"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX : <http://nextprot.org/rdf/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT (str(?rlab) as ?rlab1) (count(distinct ?itid) as ?itcnt) WHERE {
 ?entry :isoform ?iso; :gene / :name / rdfs:label ?gen .
 ?iso :swissprotDisplayed true; :interactionMapping ?itmap .
 ?itmap :entryAnnotationId ?itid; :start ?its; :end ?ite .
 bind(?ite - ?its + 1 as ?itlen)
 ?iso :region ?reg .
 ?reg :start ?rs; :end ?re; :term ?rterm .
 ?rterm rdfs:label ?rlab .
 bind(?re - ?rs + 1 as ?rlen)
 filter (?rs >= ?its - 15 && ?re <= ?ite + 15)
 filter(xsd:float(?itlen) / xsd:float(?rlen) < 2.0)
} group by ?rlab having(count(distinct ?itid) >= 10)
order by desc(?itcnt)""" ;
    schema:keywords "PPI",
        "domain",
        "region",
        "tutorial" ;
    schema:target <https://sparql.nextprot.org/sparql> .

