A set of SPARQL examples that are used in different SIB resources
Get uniprot name of a given chebi compound
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rh:<http://rdf.rhea-db.org/>
PREFIX CHEBI:<http://purl.obolibrary.org/obo/CHEBI_>
PREFIX oboInOwl:<http://www.geneontology.org/formats/oboInOwl#>
PREFIX owl:<http://www.w3.org/2002/07/owl#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
SELECT
?chebi
?chebiName
?chebiUniprotName
WHERE {
BIND(CHEBI:57416 AS ?chebi)
?chebi rdfs:label ?chebiName .
?chebi oboInOwl:hasRelatedSynonym ?chebiUniprotName .
?axiom a owl:Axiom .
?axiom owl:annotatedSource ?chebi .
?axiom owl:annotatedProperty oboInOwl:hasRelatedSynonym .
?axiom owl:annotatedTarget ?chebiUniprotName .
?axiom oboInOwl:hasDbXref ?dbXref .
FILTER (?dbXref="UniProt")
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?axiom")
v2("?chebi"):::projected
v3("?chebiName"):::projected
v4("?chebiUniprotName"):::projected
v1("?dbXref")
c3(["oboInOwl:hasRelatedSynonym"]):::iri
c5(["owl:Axiom"]):::iri
f0[["?dbXref = 'UniProt'"]]
f0 --> v1
bind1[/"'CHEBI:57416'"/]
bind1 --as--o v2
v2 --"rdfs:label"--> v3
v2 -->c3--> v4
v5 --"a"--> c5
v5 --"owl:annotatedSource"--> v2
v5 --"owl:annotatedProperty"--> c3
v5 --"owl:annotatedTarget"--> v4
v5 --"oboInOwl:hasDbXref"--> v1