sparql-examples

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

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

008

What are the anatomical entities where the human gene APOC1 is expressed at the post-juvenile stage along with its expression score independently of the strain, sex, and cell type?

Use at

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 ?anatName ?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 obo:GO_0005575 ;
        genex:hasDevelopmentalStage ?stage ;
        genex:hasSex "any" ;
        genex:hasStrain ?strain .
    ?anat a genex:AnatomicalEntity ;
        rdfs:label ?anatName .
    ?stage rdfs:label ?stageName .
    ?strain rdfs:label "wild-type" .
    ?organism obo:RO_0002162  ?species .
    ?species a up:Taxon ;
        up:commonName "human" .
    FILTER (?anat !=  obo:GO_0005575)
    FILTER (CONTAINS(LCASE(?stageName), 'post-juvenile' ))
} ORDER BY DESC(?score)
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?anat"):::projected 
  v10("?anatName"):::projected 
  v7("?condition")
  v6("?expression")
  v5("?organism")
  v1("?score"):::projected 
  v4("?seq")
  v11("?species")
  v8("?stage"):::projected 
  v2("?stageName")
  v9("?strain")
  c8(["genex:Expression"]):::iri 
  c12(["genex:ExpressionCondition"]):::iri 
  c2(["obo:GO_0005575"]):::iri 
  c4(["orth:Gene"]):::iri 
  c16(["any"]):::literal 
  c21(["up:Taxon"]):::iri 
  c18(["genex:AnatomicalEntity"]):::iri 
  c6(["APOC1"]):::literal 
  c19(["wild-type"]):::literal 
  c23(["human"]):::literal 
  f0[["contains(lower-case(?stageName),'post-juvenile')"]]
  f0 --> v2
  f1[["?anat != 'obo:GO_0005575'"]]
  f1 --> v3
  v4 --"a"-->  c4
  v4 --"rdfs:label"-->  c6
  v4 --"orth:organism"-->  v5
  v6 --"a"-->  c8
  v6 --"genex:hasExpressionCondition"-->  v7
  v6 --"genex:hasExpressionLevel"-->  v1
  v6 --"genex:hasSequenceUnit"-->  v4
  v7 --"a"-->  c12
  v7 --"genex:hasAnatomicalEntity"-->  v3
  v7 --"genex:hasAnatomicalEntity"-->  c2
  v7 --"genex:hasDevelopmentalStage"-->  v8
  v7 --"genex:hasSex"-->  c16
  v7 --"genex:hasStrain"-->  v9
  v3 --"a"-->  c18
  v3 --"rdfs:label"-->  v10
  v8 --"rdfs:label"-->  v2
  v9 --"rdfs:label"-->  c19
  v5 --"obo:RO_0002162"-->  v11
  v11 --"a"-->  c21
  v11 --"up:commonName"-->  c23