sparql-examples

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

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

95_Get_uniprot_name_of_a_given_chebi_compound

rq turtle/ttl

Get uniprot name of a given chebi compound

Use at

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")
}
as
rdfs:label
a
owl:annotatedSource
owl:annotatedProperty
owl:annotatedTarget
oboInOwl:hasDbXref
?axiom
?chebi
?chebiName
?chebiUniprotName
?dbXref
oboInOwl:hasRelatedSynonym
owl:Axiom
?dbXref = 'UniProt'
'CHEBI:57416'