When trying to create classes and individuals dynamically, I'm getting a TypeError: class_name() takes no arguments error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

When trying to create classes and individuals dynamically, I'm getting a TypeError: class_name() takes no arguments error

Totte
"Hi, I'm trying to dynamically create classes and individuals, but I'm running into an issue.
The process works well until I try to create a 'cap' class, at which point the process stops and I get a TypeError: class_name() takes no arguments error.
I'm not sure why this happens only with the 'cap' class, as I can create other classes and individuals without any problem.
The class seems to have been created properly, so I'm not sure what's causing the issue. I'm attaching a screenshot from PyCharm's debugger for reference."

Reply | Threaded
Open this post in threaded view
|

Re: When trying to create classes and individuals dynamically, I'm getting a TypeError: class_name() takes no arguments error

Totte
Good job on solving the problem! It seems like the issue was caused by declaring a DataProperty with the same name, and changing the DataProperty name resolved the problem. If someone else encounters a similar issue, it might be worth checking if they have declared a DataProperty with the same name to avoid conflicts.