sparql-examples

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

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

Query_157

rq turtle/ttl

Some cell lines with a BCR ABL1 fusion

Use at


PREFIX cello: <https://purl.expasy.org/cellosaurus/rdf/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?cl ?cl_name ?status ?seqvar_class ?seqvar_label ?zygozity ?gene_ac1 ?gene_name1 ?gene_ac2 ?gene_name2  where {
  values ( ?gene_ac_xsd1 ?gene_ac_xsd2 ) { ( "HGNC:76" "HGNC:1014" ) } # accession of gene ABL1 and BCR
  ?cl cello:recommendedName ?cl_name .
  ?cl cello:hasSequenceVariationInfo ?annot .
  ?annot cello:variationStatus ?status .
  ?annot cello:hasTarget ?seqvar .
  ?seqvar a ?seqvar_class .
  optional { ?seqvar cello:zygosity ?zygozity . }
  ?seqvar rdfs:label ?seqvar_label .
  ?seqvar cello:ofGene ?gene1 .
  ?seqvar cello:ofGene ?gene2 .
  ?gene1 cello:isIdentifiedByXref ?xref1 .
  ?xref1 cello:accession ?gene_ac1 .
  ?xref1 rdfs:label ?gene_name1 .
  ?gene2 cello:isIdentifiedByXref ?xref2 .
  ?xref2 cello:accession ?gene_ac2 .
  ?xref2 rdfs:label ?gene_name2 .
}
order by ?cl_name
limit 1000
    
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v5("?annot")
  v4("?cl"):::projected 
  v1("?cl_name"):::projected 
  v11("?gene1")
  v12("?gene2")
  v14("?gene_ac1"):::projected 
  v17("?gene_ac2"):::projected 
  v2("?gene_ac_xsd1")
  v3("?gene_ac_xsd2")
  v15("?gene_name1"):::projected 
  v18("?gene_name2"):::projected 
  v7("?seqvar")
  v8("?seqvar_class"):::projected 
  v10("?seqvar_label"):::projected 
  v6("?status"):::projected 
  v13("?xref1")
  v16("?xref2")
  v9("?zygozity"):::projected 
  bind0[/VALUES ?gene_ac_xsd1 ?gene_ac_xsd2/]
  bind0-->v2
  bind0-->v3
  bind00(["HGNC:76"])
  bind00 --> bind0
  bind01(["HGNC:1014"])
  bind01 --> bind0
  v4 --"cello:recommendedName"-->  v1
  v4 --"cello:hasSequenceVariationInfo"-->  v5
  v5 --"cello:variationStatus"-->  v6
  v5 --"cello:hasTarget"-->  v7
  v7 --"a"-->  v8
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v7 -."cello:zygosity".->  v9
  end
  v7 --"rdfs:label"-->  v10
  v7 --"cello:ofGene"-->  v11
  v7 --"cello:ofGene"-->  v12
  v11 --"cello:isIdentifiedByXref"-->  v13
  v13 --"cello:accession"-->  v14
  v13 --"rdfs:label"-->  v15
  v12 --"cello:isIdentifiedByXref"-->  v16
  v16 --"cello:accession"-->  v17
  v16 --"rdfs:label"-->  v18