#
# example SPARQL query 136
#

@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_136 a sh:SPARQLExecutable ;
    sh:prefixes _:sparql_examples_prefixes ;
    rdfs:comment """Some cell lines with a karyotypic comment"""@en ; 
    schema:keywords "kar" , "karyotype" ; 
    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 ?shortened_karyotypic_comment where {
  ?cl a / rdfs:subClassOf cello:CellLine .
  ?cl cello:recommendedName ?cl_name .
  ?cl cello:hasKaryotypicInfoComment ?annot.
  ?annot rdfs:comment ?comment .
  bind(
    if(
      strlen(?comment) > 140,
      concat( substr(?comment, 0, 140), "..."), ?comment) as ?shortened_karyotypic_comment)
}
limit 3000
    """
    .

