A set of SPARQL examples that are used in different SIB resources
List all UniProtKB proteins annotated to be related to a genetic disease.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT
?uniprot ?disease ?diseaseComment ?mim
WHERE
{
GRAPH <http://sparql.uniprot.org/uniprot> {
?uniprot a up:Protein ;
up:annotation ?diseaseAnnotation .
?diseaseAnnotation up:disease ?disease .
}
GRAPH <http://sparql.uniprot.org/diseases> {
?disease a up:Disease ;
rdfs:comment ?diseaseComment .
OPTIONAL {
?disease rdfs:seeAlso ?mim .
?mim up:database <http://purl.uniprot.org/database/MIM> .
}
}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?disease"):::projected
v2("?diseaseAnnotation")
v4("?diseaseComment"):::projected
v5("?mim"):::projected
v1("?uniprot"):::projected
c6(["up:Disease"]):::iri
c11([http://purl.uniprot.org/database/MIM]):::iri
c2(["up:Protein"]):::iri
v1 --"a"--> c2
v1 --"up:annotation"--> v2
v2 --"up:disease"--> v3
v3 --"a"--> c6
v3 --"rdfs:comment"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."rdfs:seeAlso".-> v5
v5 --"up:database"--> c11
end