sparql-examples

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

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

014

What is all the metadata related to the ENSG00000130208 gene, where ENSG00000130208 is the identifier of the APOC1 human gene.

Use at

PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX lscr: <http://purl.org/lscr#>
PREFIX orth: <http://purl.org/net/orth#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?symbol ?description ?id
?links ?organism ?uniprot ?ensembl ?ncbi WHERE {
    ?seq a orth:Gene ;
        rdfs:label ?symbol ;
        rdfs:seeAlso ?links ;
        dcterms:description ?description ;
        dcterms:identifier ?id ;
        orth:organism ?organism .
    OPTIONAL{?seq lscr:xrefUniprot ?uniprot .}
    OPTIONAL{?seq lscr:xrefEnsemblGene ?ensembl .}
    OPTIONAL{?seq lscr:xrefNCBIGene ?ncbi .}
    FILTER (?id = "ENSG00000130208")
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v5("?description"):::projected 
  v8("?ensembl"):::projected 
  v1("?id"):::projected 
  v4("?links"):::projected 
  v9("?ncbi"):::projected 
  v6("?organism"):::projected 
  v2("?seq")
  v3("?symbol"):::projected 
  v7("?uniprot"):::projected 
  c3(["orth:Gene"]):::iri 
  f0[["?id = 'ENSG00000130208'"]]
  f0 --> v1
  v2 --"a"-->  c3
  v2 --"rdfs:label"-->  v3
  v2 --"rdfs:seeAlso"-->  v4
  v2 --"dcterms:description"-->  v5
  v2 --"dcterms:identifier"-->  v1
  v2 --"orth:organism"-->  v6
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v2 -."lscr:xrefUniprot".->  v7
  end
  subgraph optional1["(optional)"]
  style optional1 fill:#bbf,stroke-dasharray: 5 5;
    v2 -."lscr:xrefEnsemblGene".->  v8
  end
  subgraph optional2["(optional)"]
  style optional2 fill:#bbf,stroke-dasharray: 5 5;
    v2 -."lscr:xrefNCBIGene".->  v9
  end