@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_00025 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Proteins with at least 50 interactors that are not associated with a disease"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX : <http://nextprot.org/rdf/>
PREFIX nextprot_cv: <http://nextprot.org/rdf/terminology/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?entry WHERE {
 ?entry :isoform ?iso.
 ?iso :binaryInteraction/:interactant ?interactant.

 # with no disease
 filter not exists {
 {
 ?iso :medical / rdf:type :Disease.
 } union {
 ?iso :uniprotKeyword / :term ?kw .
 ?kw :termType "Disease"^^xsd:string
 filter (?kw != nextprot_cv:KW-0656)
 }
 }

} group by ?entry ?iso having (count(?interactant) >= 50)""" ;
    schema:keywords "PPI",
        "disease",
        "tutorial" ;
    schema:target <https://sparql.nextprot.org/sparql> .

