#
# example SPARQL query 137
#

@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_137 a sh:SPARQLExecutable ;
    sh:prefixes _:sparql_examples_prefixes ;
    rdfs:comment """Some cell lines with a gene knockout"""@en ; 
    schema:keywords "ko" , "knockout" , "gene" ; 
    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 ?method ?gene_name ?gene_ac ?comment where {
  ?cl cello:hasGeneKnockout ?annot.
  ?annot cello:hasGenomeModificationMethod ?method .
  ?annot cello:ofGene ?gene .
  ?gene cello:isIdentifiedByXref / cello:accession ?gene_ac  .
  ?gene cello:name ?gene_name .
  optional {?annot rdfs:comment ?comment . }
  #filter (bound(?comment)) # uncomment to get only ko annotations with a comment
}
limit 100
    """
    .

