Owlready2 dynamic class generation
问题 I am trying to dynamically create a class for an owlready2 ontology. The documentation suggests the following line of code: NewClass = types.new_class("NewClassName", (SuperClass,), kwds = { "namespace" : my_ontology }) In my case this equals types.new_class("NewClassName", (onto["ParentClass"],), kwds={'namespace' : onto}) However, when I run the above code, I get the following exception: Traceback (most recent call last): (onto[object.get('owl_dataProperty_parent')],), kwds={'namespace' :