sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

Query_170

rq turtle/ttl

Usage of name properties for instances of each class defined in cello: ontology

Use at


PREFIX cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select distinct ?entity_type ?sub_prop
where {
  # values ?entity_type { cello:CellLine } # uncomment to see name properties used for cello:CellLine instances
  ?sub_prop rdfs:subPropertyOf* rdfs:label .
  ?entity ?sub_prop ?_ .
  ?entity a ?entity_type .
  filter strstarts(str(?entity_type), (str(cello:)))
}
order by ?entity_type
limit 1000
    
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?_")
  v3("?entity")
  v1("?entity_type"):::projected 
  v2("?sub_prop"):::projected 
  c3(["rdfs:label"]):::iri 
  f0[["starts-with(str(?entity_type),str('cello:'))"]]
  f0 --> v1
  v2 --"rdfs:subPropertyOf"-->  c3
  v3 -->v2--> v4
  v3 --"a"-->  v1