#
# example SPARQL query 114
#

@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_114 a sh:SPARQLExecutable ;
    sh:prefixes _:sparql_examples_prefixes ;
    rdfs:comment """Some antibody producing cell lines with their antibody target"""@en ; 
    schema:keywords "MoAb" , "mabt" , "protein" , "chemical" ; 
    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 ?target_class (substr(?target_name,0,30) as ?target_name_truncated) ?target_ac  ?comment where {
   ?cl cello:hasMoAbTarget ?annot.
   ?cl cello:recommendedName ?cl_name .
   ?annot a ?target_class .
   ?annot rdfs:label ?target_name .
   optional {?annot rdfs:comment ?comment }
   optional {
    ?annot cello:isIdentifiedByXref ?xref .
    ?xref cello:accession ?target_ac .
  	}
    filter (bound(?comment)) # comment this filter to also retrieve those without comment
    filter (bound(?xref))    # comment this filter to also retrieve targets not identified by a cross-reference
}
limit 100
    """
    .

