@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_09461 a sh:SPARQLExecutable, sh:SPARQLSelectExecutable ;
  sh:prefixes _:sparql_examples_prefixes ;
  rdfs:comment '''Check there are no entries with a ptm info annotation referring to glycosylation that do not have the keyword Glycoprotein (KW-0325)'''@en ;
  schema:keywords "QC", "keyword" ;
  schema:target <https://sparql.nextprot.org/sparql> ;
  sh:select '''PREFIX : <http://nextprot.org/rdf/>
PREFIX cv: <http://nextprot.org/rdf/terminology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX entry: <http://nextprot.org/rdf/entry/>

select distinct ?entry where {  # Include ?text if result is not 0 to identify problem site
  ?entry :isoform ?iso.
  ?iso :ptmInfo /rdfs:comment ?text.
  filter(contains(?text,"glycosylat")). # Finds glycosylated and glycosylation
  filter not exists {?iso :ptmInfo /:negativeEvidence ?negev} # No negative annotations from neXtProt
  filter not exists {?entry :isoform /:keyword /:term cv:KW-0325.}
  filter (?entry not in (entry:NX_O43866, entry:NX_P60827, entry:NX_O75452, entry:NX_P60033, entry:NX_Q01628, entry:NX_O75192, entry:NX_Q8TCT6, entry:NX_Q86TM6, entry:NX_Q8TC12, entry:NX_P49788, entry:NX_Q9NUD9, entry:NX_P47710, entry:NX_Q8IY95, entry:NX_Q02447, entry:NX_P49238, entry:NX_Q9BSG5, entry:NX_Q8TF71, entry:NX_P51811, entry:NX_Q9UBT3, entry:NX_Q9UBY8)) # Exceptions to rule (not glycosylated)
}''' .
