#
# example SPARQL query 108
#

@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_108 a sh:SPARQLExecutable ;
    sh:prefixes _:sparql_examples_prefixes ;
    rdfs:comment """Cell lines with a South Asian genome ancestry greater than 30%"""@en ; 
    schema:keywords "anc" , "genome-ancestry" ; 
    schema:target <https://sparql.cellosaurus.org/sparql> ; 
    sh:select """
PREFIX cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
select ?cl ?cl_name ?population_name ?percentage ?pmid where {
        ?cl cello:hasGenomeAncestry ?annot .
  	?cl cello:recommendedName ?cl_name .
  	?annot cello:hasComponent ?pp .
    ?pp cello:hasPopulation / cello:name ?population_name .
  	?pp cello:percentage ?percentage .
    ?annot cello:hasSource / cello:originatesFrom / cello:pmid ?pmid .
  	filter (?population_name = "South Asian" && ?percentage > "30"^^xsd:float)
}
order by ?percent
    """
    .

