sparql-examples

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

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

96_Get_tautomer_of_a_given_chebi_compound

rq turtle/ttl

Get tautomer of a given chebi compound

Use at

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rh:<http://rdf.rhea-db.org/>
PREFIX obo:<http://purl.obolibrary.org/obo/>
PREFIX CHEBI:<http://purl.obolibrary.org/obo/CHEBI_>
PREFIX chebihash:<http://purl.obolibrary.org/obo/chebi#>
PREFIX owl:<http://www.w3.org/2002/07/owl#>
select
  ?chebi
  ?chebiName
  ?chebiTautomer
  ?chebiTautomerName
where {
  BIND(CHEBI:57416 AS ?chebi)
  ?chebi rdfs:subClassOf ?chebiRestriction .
  ?chebiRestriction a owl:Restriction .
  ?chebiRestriction owl:onProperty chebihash:is_tautomer_of .
  ?chebiRestriction owl:someValuesFrom ?chebiTautomer .
  ?chebi rdfs:label ?chebiName .
  ?chebiTautomer rdfs:label ?chebiTautomerName .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?chebi"):::projected 
  v4("?chebiName"):::projected 
  v2("?chebiRestriction")
  v3("?chebiTautomer"):::projected 
  v5("?chebiTautomerName"):::projected 
  c3(["owl:Restriction"]):::iri 
  c5(["obo:chebi#is_tautomer_of"]):::iri 
  bind0[/"'obo:CHEBI_57416'"/]
  bind0 --as--o v1
  v1 --"rdfs:subClassOf"-->  v2
  v2 --"a"-->  c3
  v2 --"owl:onProperty"-->  c5
  v2 --"owl:someValuesFrom"-->  v3
  v1 --"rdfs:label"-->  v4
  v3 --"rdfs:label"-->  v5