A set of SPARQL examples that are used in different SIB resources
List the proteins encoded by a gene that is located in an organelle other than the nucleus, or on a plasmid rather than a chromosome. In these cases the gene location is stored with encodedIn properties. Note that if a plasmid has several names, they are listed as multiple rdfs:label properties.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT
?protein
?plasmidOrOrganelle
?label
WHERE {
?protein a up:Protein ;
up:encodedIn ?plasmidOrOrganelle .
OPTIONAL {
?plasmidOrOrganelle rdfs:label ?label .
}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?label"):::projected
v2("?plasmidOrOrganelle"):::projected
v1("?protein"):::projected
c2(["up:Protein"]):::iri
v1 --"a"--> c2
v1 --"up:encodedIn"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."rdfs:label".-> v3
end