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' : onto})
File "/usr/lib/python3.6/types.py", line 62, in new_class
return meta(name, bases, ns, **kwds)
TypeError: __new__() got an unexpected keyword argument 'namespace
I have no idea what went wrong there and after hours of debugging I am still clueless. I am using Python 3.6.6 and version 0.11 of owlready2