This is by documentation:
NewClass = types.new_class("NewClassName", (SuperClass,), kwds = { "namespace" : my_ontology })
I don't understand why the code doesn't work. I have written:
NewClass = types.new_class("NewClassName", (Example,), kwds = { "namespace" : onto })
I have also try the code that doesn't work from url: Owlready2 dynamic class generation
types.new_class("NewClassName", (onto["ParentClass"],))
I don't understand the expression (onto["ParentClass"],). Then I don't understand how to create dynamically individuals. It is possible to do it?
Can I have a short simple script of example that works with a class and an individual?