@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_00297 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "PDB structures spanning the complete sequence of the mature protein"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX : <http://nextprot.org/rdf/>
PREFIX db: <http://nextprot.org/rdf/db/>

select ?entry (group_concat(distinct str(?pdbac); SEPARATOR = ",") as ?pdbacs) WHERE {
 ?entry :isoform ?iso.
 ?iso :pdbMapping ?pdbmap.
 ?pdbmap :evidence /:reference ?ref.
 ?ref :provenance db:PDB.
 ?ref :accession ?pdbac.
 ?pdbmap :start ?pdbstart ; :end ?pdbend.
 ?iso :matureProtein [ :start ?mstart ; :end ?mend]
 filter (?mend-?mstart > 0)
 filter ((?pdbstart <= ?mstart) && (?pdbend >= ?mend))
} group by ?entry""" ;
    schema:keywords "3D structure",
        "processing",
        "sequence",
        "tutorial" ;
    schema:target <https://sparql.nextprot.org/sparql> .

