|
Hi, I'm wondering if the following is possible:
I have a list of existing object properties and I would like to dynamically create several relations between two instances. The only way that I found is with python_name, but the problem is that also creating python_name dynamically is not possible. do you have any solution for this?
obj_prop = ['has_for_ingredient', 'has_side_efect', ...]
with onto:
class Drug(Thing): pass
my_drug = Drug("my_drug")
my_drug2 = Drug("my_drug2")
for prop in obj_prop :
prop_entity= onto[prop]
prop_entity.python_name = 'temp'
my_drug .temp = [my_drug2] # this does not work, only first relation will be created.
Thanks
|