@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_00108 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Proteins that have a 3D structure in PDB that overlap by at least 50 amino acids with a SH3 domain"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX : <http://nextprot.org/rdf/>
PREFIX nextprot_cv: <http://nextprot.org/rdf/terminology/>

SELECT DISTINCT ?entry WHERE {
 ?entry :isoform ?isoform.
 ?isoform :pdbMapping ?struc.
 ?struc :start ?s1 ; :end ?s2.
 ?isoform :region ?dom.
 ?dom :term nextprot_cv:DO-00615 ; :start ?d1 ; :end ?d2.
 bind ( if(?d2<?s2, ?d2, ?s2) - if(?d1>?s1, ?d1, ?s1) as ?overlap) .
 filter (?overlap>50)
}""" ;
    schema:keywords "3D structure",
        "domain",
        "region",
        "tutorial" ;
    schema:target <https://sparql.nextprot.org/sparql> .

