#
# example SPARQL query 160
#

@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_160 a sh:SPARQLExecutable ;
    sh:prefixes _:sparql_examples_prefixes ;
    rdfs:comment """Mouse cell lines with a sequence variation"""@en ; 
    schema:keywords "gene" , "mutation" , "sequence variation" , "species" , "mouse" ; 
    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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
select distinct ?cl ?cl_name ?species_ac ?species_label ?seqvar_class ?gene_ac  ?gene_name  where {
  values ( ?generic_species_notation ) { ( "10090") } # NCBI_TaxID accession of Mouse
  ?cl cello:recommendedName ?cl_name .
  ?cl cello:derivedFromIndividualBelongingToSpecies ?species .
  ?species  cello:isIdentifiedByXref ?species_xref .
  ?species cello:name ?species_label .
  ?species_xref cello:accession ?species_ac .
  ?species_xref cello:more_specific_than* ?generic_concept .
  ?generic_concept skos:notation ?generic_species_notation ; skos:inScheme db:NCBI_TaxID . # Mouse = 10090
  ?cl cello:hasSequenceVariationInfo ?annot .
  ?annot cello:hasTarget ?seqvar .
  ?seqvar a ?seqvar_class .
  ?seqvar cello:ofGene ?gene .
  ?gene cello:isIdentifiedByXref ?gene_xref .
  ?gene_xref cello:accession ?gene_ac .
  ?gene_xref rdfs:label ?gene_name .
}
order by ?cl_name
limit 1000
    """
    .

