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 ;
genex:hasSex "any" ;
genex:hasStrain ?strain .
?anat a genex:AnatomicalEntity ;
rdfs:label ?anatName .
?cellType rdfs:label ?cellTypeName .
?stage rdfs:label "post-juvenile" .
?strain a efo:EFO_0005135 ;
rdfs:label "wild-type" .
?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
v10("?anatName"):::projected
v3("?cellType"):::projected
v11("?cellTypeName"):::projected
v7("?condition")
v6("?expression")
v5("?organism")
v1("?score"):::projected
v4("?seq")
v12("?species")
v8("?stage"):::projected
v9("?strain")
c7(["genex:Expression"]):::iri
c18(["post-juvenile"]):::literal
c11(["genex:ExpressionCondition"]):::iri
c19(["efo:EFO_0005135"]):::iri
c3(["orth:Gene"]):::iri
c15(["any"]):::literal
c22(["up:Taxon"]):::iri
c17(["genex:AnatomicalEntity"]):::iri
c5(["APOC1"]):::literal
c20(["wild-type"]):::literal
c24(["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
v7 --"genex:hasSex"--> c15
v7 --"genex:hasStrain"--> v9
v2 --"a"--> c17
v2 --"rdfs:label"--> v10
v3 --"rdfs:label"--> v11
v8 --"rdfs:label"--> c18
v9 --"a"--> c19
v9 --"rdfs:label"--> c20
v5 --"obo:RO_0002162"--> v12
v12 --"a"--> c22
v12 --"up:commonName"--> c24