@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_00282 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Proteins with an interaction mapping encompassing a coiled coil or bZip region "@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX : <http://nextprot.org/rdf/>
PREFIX nextprot_cv: <http://nextprot.org/rdf/terminology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?entry (str(?gen) as ?gene) ?itlen ?coilen (str(?gen2) as ?partnergene) WHERE {
 ?entry :isoform ?iso; :gene / :recommendedName / rdfs:label ?gen .
 ?iso :swissprotDisplayed true; :interactionMapping ?itmap .
 ?itmap :interactant ?entry2; :start ?its; :end ?ite .
 bind(?ite - ?its + 1 as ?itlen)
 ?entry2 :isoform? ?iso2; :gene / :recommendedName / rdfs:label ?gen2.
 ?iso2 :swissprotDisplayed true.
 {?iso :coiledCoilRegion ?coil . }
 union
 {?iso :region ?coil .
 ?coil :term nextprot_cv:DO-00078 # bzip
 }
 ?coil :start ?cs; :end ?ce .
 bind(?ce - ?cs + 1 as ?coilen)
 filter (?cs >= ?its -15 && ?ce <= ?ite + 15) # overlap
 filter(xsd:float(?itlen) / xsd:float(?coilen) < 2.0) # itlen no more than 2 coilen
} order by ?entry""" ;
    schema:keywords "PPI",
        "domain",
        "region",
        "tutorial" ;
    schema:target <https://sparql.nextprot.org/sparql> .

