I downloaded the ChEBI .sql files from here: https://www.ebi.ac.uk/chebi/downloadsForward.do and they have the list of compounds and relationships between compounds, but I can't find anywhere in there the list of ontological classes. For example: Flavonoids: https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:47916 Biological roles: https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24432 Biomarkers: https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:59163
I need to get the whole tree of categories to go with the chemicals. I tried downloading the .OWL file but I haven't figured out if it contains these categories yet, because I can't load it into protege for some reason. Maybe because the file is so big. What would be the easiest way to get all of the categories and their relationships to the chemicals? I'm thinking of making a spider, and using webservices: http://www.ebi.ac.uk/chebi/webServices.do to first get all the categories by using getOntologyChildren and working my way down from the root parent categories (I don't know what they are yet, I know role is one of them though). Then I can loop through every chemical and using getOntologyParents to assign each chemical to categories. Is there an easier way to do this?
EDIT: Oh wait, I see that these ontological classes are stored in the compounds table. This makes things quite confusing because I don't know how to separate them from the compounds. Also there are lots of subgroups of compounds, like enantiomers that I don't need. I wanna scrape the compounds, not all the possible stereoisomers and ions of the compound. I wonder how I can filter all these subcompounds out.