sparql-examples

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

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

Query_111

rq turtle/ttl

HLA typing of a chosen cell line

Use at


PREFIX cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/>
PREFIX cvcl: <https://purl.expasy.org/cellosaurus/rdf/cvcl/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?cl ?cl_name ?gene_name ?allele_id  where {
  	values ?cl { cvcl:CVCL_E549 }
        ?cl cello:hasHLAtyping ?hasHLAtyping .
  	?cl cello:recommendedName ?cl_name .
    ?hasHLAtyping cello:includesObservation ?obs .
        ?obs cello:hasTarget ?gene .
    ?gene rdfs:label ?gene_name .
    ?gene rdf:type ?gene_class .
    ?obs cello:detectedAllele ?allele .
    ?allele cello:alleleIdentifier ?allele_id .
}
order by ?gene_name
    
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v8("?allele")
  v9("?allele_id"):::projected 
  v2("?cl"):::projected 
  v4("?cl_name"):::projected 
  v6("?gene")
  v7("?gene_class")
  v1("?gene_name"):::projected 
  v3("?hasHLAtyping")
  v5("?obs")
  bind0[/VALUES ?cl/]
  bind0-->v2
  bind00([https://purl.expasy.org/cellosaurus/rdf/cvcl/CVCL_E549])
  bind00 --> bind0
  v2 --"cello:hasHLAtyping"-->  v3
  v2 --"cello:recommendedName"-->  v4
  v3 --"cello:includesObservation"-->  v5
  v5 --"cello:hasTarget"-->  v6
  v6 --"rdfs:label"-->  v1
  v6 --"a"-->  v7
  v5 --"cello:detectedAllele"-->  v8
  v8 --"cello:alleleIdentifier"-->  v9