Thanks for the code Jiba
I have an issue:
Running the following gives me an error
#---------------code-----------
from owlready2 import *
onto = get_ontology("
http://test.org/onto.owl")
with onto:
class superclass1(Thing):
pass
class superclass2(Thing):
pass
NewClass = types.new_class("NewClassName", (superclass1, superclass2), kwds = {"namespace" : onto})
default_world.save()
onto.save(file=r".\test1.rdf", format="rdfxml")
========ERROR RETURNED===========
C:\XXXXXXXXX\venv\Scripts\python.exe C:/Users/Pedro/PycharmProjects/cpov-ap-scot/test1.py
Traceback (most recent call last):
File "C:/XXXXXXX/test1.py", line 10, in <module>
NewClass = types.new_class("NewClassName", (superclass1, superclass2), kwds = {"namespace" : onto})
File "C:\Python\Python37-32\lib\types.py", line 70, in new_class
return meta(name, resolved_bases, ns, **kwds)
TypeError: __new__() got an unexpected keyword argument 'namespace'
Process finished with exit code 1