SPARQL example query
◀
◀
96_Get_tautomer_of_a_given_chebi_compound: Get tautomer of a given chebi compound
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 . }Use97_Get_structural_data_of_a_given_ChEBI_compound: Get structural data of a given ChEBI compound (CHEBI:29985 L-glutamate)
# # get structural data of a given ChEBI compound # PREFIX rh:<http://rdf.rhea-db.org/> PREFIX CHEBI:<http://purl.obolibrary.org/obo/CHEBI_> PREFIX chebihash:<http://purl.obolibrary.org/obo/chebi/> SELECT ?chebi ?formula ?charge ?mass ?monoisotopicmass ?inchikey ?smiles ?inchi WHERE { BIND (CHEBI:29985 AS ?chebi) ?chebi chebihash:inchi ?inchi ; chebihash:smiles ?smiles ; chebihash:formula ?formula ; chebihash:mass ?mass ; chebihash:charge ?charge ; chebihash:inchikey ?inchikey ; chebihash:monoisotopicmass ?monoisotopicmass . }Use98_Get_chebi_compound_of_a_given_InChI: Get chebi compound of a given InChI
PREFIX rh:<http://rdf.rhea-db.org/> PREFIX obo:<http://purl.obolibrary.org/obo/> PREFIX chebihash:<http://purl.obolibrary.org/obo/chebi/> SELECT ?chebi ?inchi WHERE { BIND("InChI=1S/C5H9NO4/c6-3(5(9)10)1-2-4(7)8/h3H,1-2,6H2,(H,7,8)(H,9,10)/t3-/m0/s1" AS ?inchi) ?chebi chebihash:inchi ?inchi . }Use99_Get_the_list_of_reactions_involving_a_ChEBI_participant_with__has_role_antifungal_agent: Get the list of reactions involving a ChEBI participant with has role antifungal agent (CHEBI:35718)
PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX obo: <http://purl.obolibrary.org/obo/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh:<http://rdf.rhea-db.org/> PREFIX chebihash:<http://purl.obolibrary.org/obo/chebi#> SELECT (count(distinct ?reaction) as ?reactionCount) WHERE { ?reaction rdfs:subClassOf rh:Reaction . ?reaction rh:status rh:Approved . ?reaction rh:equation ?reactionEquation . ?reaction rh:side ?reactionSide . ?reactionSide rh:contains ?participant . ?participant rh:compound ?compound . ?compound rh:chebi ?chebiInRhea . { ?chebiInRhea rdfs:subClassOf ?chebiRestrictionRole . ?chebiRestrictionRole a owl:Restriction . ?chebiRestrictionRole owl:onProperty obo:RO_0000087 . ?chebiRestrictionRole owl:someValuesFrom CHEBI:35718 . } UNION { ?chebi rdfs:subClassOf ?chebiRestrictionRole . ?chebiRestrictionRole a owl:Restriction . ?chebiRestrictionRole owl:onProperty obo:RO_0000087 . ?chebiRestrictionRole owl:someValuesFrom CHEBI:35718 . ?chebi rdfs:subClassOf ?chebiRestrictionPH . ?chebiRestrictionPH a owl:Restriction . ?chebiRestrictionPH owl:onProperty chebihash:has_major_microspecies_at_pH_7_3 . ?chebiRestrictionPH owl:someValuesFrom ?chebiInRhea . } }Use
