#
# example SPARQL query 158
#

@prefix schema: <https://schema.org/> . 
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . 
@prefix sh: <http://www.w3.org/ns/shacl#> . 
@prefix cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/> .


cello:Query_158 a sh:SPARQLExecutable ;
    sh:prefixes _:sparql_examples_prefixes ;
    rdfs:comment """Some cell lines with a CDKN2A deletion"""@en ; 
    schema:keywords "gene" , "deletion" , "sequence variation" ; 
    schema:target <https://sparql.cellosaurus.org/sparql> ; 
    sh:select """
PREFIX cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?cl ?cl_name ?status ?seqvar_class ?seqvar_label ?zygozity ?gene_ac ?gene_name  where {
  values ( ?seqvar_class ?gene_ac_xsd ) { ( cello:GeneDeletion "HGNC:1787") } # HGNC accession of CDKN2A
  ?cl cello:recommendedName ?cl_name .
  ?cl cello:hasSequenceVariationInfo ?annot .
  ?annot cello:variationStatus ?status .
  ?annot cello:hasTarget ?seqvar .
  optional { ?seqvar cello:zygosity ?zygozity . }
  ?seqvar a ?seqvar_class .
  ?seqvar rdfs:label ?seqvar_label .
  ?seqvar cello:ofGene ?gene .
  ?gene cello:isIdentifiedByXref ?xref .
  ?xref cello:accession ?gene_ac .
  ?xref rdfs:label ?gene_name .
}
order by ?cl_name
limit 1000
    """
    .

