#
# example SPARQL query 133
#

@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_133 a sh:SPARQLExecutable ;
    sh:prefixes _:sparql_examples_prefixes ;
    rdfs:comment """Title, year and type of publication referenced by some cell lines"""@en ; 
    schema:keywords "rx" , "rt" , "references" , "title" , "year" , "publication" , "patent" , "thesis" , "private" , "QC" ; 
    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#>
PREFIX fabio: <http://purl.org/spar/fabio/>
select ?cl ?cl_name ?ref_class ?in_year ?id ?title_shortened where {
  ?cl a / rdfs:subClassOf cello:CellLine .
  ?cl cello:recommendedName ?cl_name .
  ?cl cello:references ?ref .
  #values ?ref_class { fabio:ConferencePaper }  # uncomment to set constraint on reference class
  #values ?ref_class { fabio:JournalArticle }   # uncomment to set constraint on reference class
  ?ref a ?ref_class .
  ?ref cello:internalId ?id .
  ?ref cello:title ?title .
  ?ref cello:publicationYear ?year .
  bind(concat('in ', ?year) as ?in_year)
  bind(substr(?title,0,60) as ?title_shortened)
  #filter (strstarts(str(?id),"PubMed=") )     # uncomment to set constraint on internal id
  #filter (strstarts(str(?id),"DOI=") )        # uncomment to set constraint on internal id
  #filter (strstarts(str(?id),"Patent=") )     # uncomment to set constraint on internal id
  #filter (strstarts(str(?id),"CelloPub=") )   # uncomment to set constraint on internal id
}
limit 100
    """
    .

