For this project, you can write a program to construct the hierarchy, because what is needed is just a light weight ontology, i.e., a simple hierarchy. It is easier to do it yourself.
A separate component should be provided for maintaining this knowledge base and providing certain access to this knowledge base.