A set of SPARQL examples that are used in different SIB resources
Some cell lines with the name and cross-reference of their transformant
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
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?annot")
v5("?annot_class")
v1("?cl"):::projected
v2("?cl_name"):::projected
v6("?comment"):::projected
v4("?transformant_name"):::projected
v7("?xr")
v9("?xref_ac"):::projected
v8("?xref_db"):::projected
a1((" "))
c3(["cello:CellLine"]):::iri
v1 --"a"--> a1
a1 --"rdfs:subClassOf"--> c3
v1 --"cello:recommendedName"--> v2
v1 --"cello:transformedBy"--> v3
v3 --"rdfs:label"--> v4
v3 --"a"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."rdfs:comment".-> v6
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."cello:isIdentifiedByXref".-> v7
v7 --"cello:database"--> v8
v7 --"cello:accession"--> v9
end