#
# example SPARQL query 104
#

@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_104 a sh:SPARQLExecutable ;
    sh:prefixes _:sparql_examples_prefixes ;
    rdfs:comment """Cell lines from animals belonging the order 'carnivora'"""@en ; 
    schema:keywords "species" , "carnivora" ; 
    schema:target <https://sparql.cellosaurus.org/sparql> ; 
    sh:select """
PREFIX cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/>
PREFIX db: <https://purl.expasy.org/cellosaurus/rdf/db/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
# All cell lines with a child of TaxID: 33554
select ?cl ?cl_name ?xref_db ?xref_ac ?xref_label where {
  ?cl cello:derivedFromIndividualBelongingToSpecies ?species .
  ?cl cello:recommendedName ?cl_name .
  ?species  cello:isIdentifiedByXref ?xref .
  ?xref cello:more_specific_than+ ?generic_concept .
  ?generic_concept skos:notation "33554" ; skos:inScheme db:NCBI_TaxID . # Carnivore
  ?xref cello:accession ?xref_ac ; cello:database ?xref_db; skos:prefLabel ?xref_label .
}
limit 2000
    """
    .

