sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

Query_136

rq turtle/ttl

Some cell lines with a karyotypic comment

Use at


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
    
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?annot")
  v1("?cl"):::projected 
  v2("?cl_name"):::projected 
  v4("?comment")
  v5("?shortened_karyotypic_comment"):::projected 
  a1((" "))
  c3(["cello:CellLine"]):::iri 
  v1 --"a"-->  a1
  a1 --"rdfs:subClassOf"-->  c3
  v1 --"cello:recommendedName"-->  v2
  v1 --"cello:hasKaryotypicInfoComment"-->  v3
  v3 --"rdfs:comment"-->  v4
  bind0[/"if(string-length(?comment) > '140^^xsd:integer',concat(substring(?comment,'0^^xsd:integer','140^^xsd:integer'),'...'),?comment)"/]
  v4 --o bind0
  bind0 --as--o v5