#
# example SPARQL query 148
#

@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_148 a sh:SPARQLExecutable ;
    sh:prefixes _:sparql_examples_prefixes ;
    rdfs:comment """Some cell lines with the name and cross-reference of their transformant"""@en ; 
    schema:keywords "tfor" , "transformant" ; 
    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 ?cl ?cl_name ?transformant_name ?xref_db ?xref_ac ?comment
  where {
  ?cl a / rdfs:subClassOf cello:CellLine .
  ?cl cello:recommendedName ?cl_name .
  ?cl cello:transformedBy ?annot.
  ?annot rdfs:label ?transformant_name .
  ?annot a ?annot_class .
  optional {?annot rdfs:comment ?comment . }
  optional {?annot cello:isIdentifiedByXref ?xr . ?xr cello:database ?xref_db ; cello:accession ?xref_ac .}
  #filter ( ! bound(?xr)) # uncomment to see only transformants not identified by a cross-reference
  #filter ( bound(?comment) )  # uncomment to see transformants with a non empty optional comment
}
limit 100
    """
    .

