A set of SPARQL examples for tutorials at SWAT4HCLS
What are the anatomical entities including cell types, if any, where the human gene APOC1 is expressed at the post-juvenile stage along with its expression score independently of the strain and sex?
PREFIX efo: <http://www.ebi.ac.uk/efo/>
PREFIX genex: <http://purl.org/genex#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT DISTINCT ?anat ?cellType ?anatName ?cellTypeName ?score ?stage WHERE {
?seq a orth:Gene ;
rdfs:label "APOC1" ;
orth:organism ?organism .
?expression a genex:Expression ;
genex:hasExpressionCondition ?condition ;
genex:hasExpressionLevel ?score ;
genex:hasSequenceUnit ?seq .
?condition a genex:ExpressionCondition ;
genex:hasAnatomicalEntity ?anat ;
genex:hasAnatomicalEntity ?cellType ;
genex:hasDevelopmentalStage ?stage .
?anat a genex:AnatomicalEntity ;
rdfs:label ?anatName .
?cellType rdfs:label ?cellTypeName .
?stage a efo:EFO_0000399 ;
rdfs:label "post-juvenile" .
?organism obo:RO_0002162 ?species .
?species a up:Taxon ;
up:commonName "human" .
FILTER (?anat != obo:GO_0005575)
FILTER (?anat != ?cellType)
} ORDER BY DESC(?score)
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?anat"):::projected
v9("?anatName"):::projected
v3("?cellType"):::projected
v10("?cellTypeName"):::projected
v7("?condition")
v6("?expression")
v5("?organism")
v1("?score"):::projected
v4("?seq")
v11("?species")
v8("?stage"):::projected
c7(["genex:Expression"]):::iri
c15(["efo:EFO_0000399"]):::iri
c16(["post-juvenile"]):::literal
c11(["genex:ExpressionCondition"]):::iri
c3(["orth:Gene"]):::iri
c18(["up:Taxon"]):::iri
c14(["genex:AnatomicalEntity"]):::iri
c5(["APOC1"]):::literal
c20(["human"]):::literal
f0[["?anat != ?cellType"]]
f0 --> v2
f0 --> v3
f1[["?anat != 'obo:GO_0005575'"]]
f1 --> v2
v4 --"a"--> c3
v4 --"rdfs:label"--> c5
v4 --"orth:organism"--> v5
v6 --"a"--> c7
v6 --"genex:hasExpressionCondition"--> v7
v6 --"genex:hasExpressionLevel"--> v1
v6 --"genex:hasSequenceUnit"--> v4
v7 --"a"--> c11
v7 --"genex:hasAnatomicalEntity"--> v2
v7 --"genex:hasAnatomicalEntity"--> v3
v7 --"genex:hasDevelopmentalStage"--> v8
v2 --"a"--> c14
v2 --"rdfs:label"--> v9
v3 --"rdfs:label"--> v10
v8 --"a"--> c15
v8 --"rdfs:label"--> c16
v5 --"obo:RO_0002162"--> v11
v11 --"a"--> c18
v11 --"up:commonName"--> c20