You can use rdflib for storing triples. You then have to make your own decisions about the kind of ontology you want to build. Look at the OWL format for that.
I toyed with python and ontologies during my PhD, so perhaps a quick scan through my thesis can give you some ideas. For instance a short OWL summary or a UML model of a plone ontology tool.