#
# example SPARQL query 117
#

@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_117 a sh:SPARQLExecutable ;
    sh:prefixes _:sparql_examples_prefixes ;
    rdfs:comment """Count of cell lines by sex of the individual from which the cell line originates"""@en ; 
    schema:keywords "sx" , "sex" ; 
    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 ?sex (count(?cl) as ?cl_count) where {
  ?cl a / rdfs:subClassOf cello:CellLine.
  optional { ?cl cello:derivedFromIndividualWithSex ?sex. }
}
group by ?sex
order by ?sex
    """
    .

