A set of SPARQL examples that are used in different SIB resources
Genes expressed in the human pancreas and their annotations in UniProt.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX genex: <http://purl.org/genex#>
PREFIX lscr: <http://purl.org/lscr#>
PREFIX orth: <http://purl.org/net/orth#>
SELECT DISTINCT ?geneEns ?uniprot ?annotation_text {
{
SELECT ?geneEns {
?geneB a orth:Gene .
?geneB genex:isExpressedIn ?cond .
?cond genex:hasAnatomicalEntity ?anat .
?geneB lscr:xrefEnsemblGene ?geneEns .
?anat rdfs:label 'pancreas' .
?geneB orth:organism ?o .
?o obo:RO_0002162 ?taxon2 .
?taxon2 up:commonName 'human' .
} LIMIT 100
}
SERVICE <https://sparql.uniprot.org/sparql> {
?uniprot rdfs:seeAlso / up:transcribedFrom ?geneEns .
?uniprot up:annotation ?annotation .
?annotation rdfs:comment ?annotation_text .
}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?anat")
v8("?annotation")
v9("?annotation_text"):::projected
v2("?cond")
v1("?geneB")
v4("?geneEns"):::projected
v5("?o")
v6("?taxon2")
v7("?uniprot"):::projected
a1((" "))
c2(["orth:Gene"]):::iri
c7(["pancreas"]):::literal
c11(["human"]):::literal
v1 --"a"--> c2
v1 --"genex:isExpressedIn"--> v2
v2 --"genex:hasAnatomicalEntity"--> v3
v1 --"lscr:xrefEnsemblGene"--> v4
v3 --"rdfs:label"--> c7
v1 --"orth:organism"--> v5
v5 --"obo:RO_0002162"--> v6
v6 --"up:commonName"--> c11
subgraph s1["https://sparql.uniprot.org/sparql"]
style s1 stroke-width:4px;
v7 --"rdfs:seeAlso"--> a1
a1 --"up:transcribedFrom"--> v4
v7 --"up:annotation"--> v8
v8 --"rdfs:comment"--> v9
end