Hi,
I encounter the problem of assignning the data property of an individual.
this seems work to me
from owlready2 import *
import types
onto = get_ontology('https://text.org/test/')
with onto:
cls = types.new_class('NewClass', (Thing, ))
data_prop = types.new_class('NewDataProp', (DataProperty, ))
data_prop.range = [int]
individual = cls('new-individual')
individual.NewDataProp.append(20)
But actually i need to something like this
from owlready2 import *
import types
onto = get_ontology('https://text.org/test/')
with onto:
cls = types.new_class('NewClass', (Thing, ))
data_prop = types.new_class('NewDataProp', (DataProperty, ))
data_prop.range = [int]
individual = cls('new-individual')
individual.data_prop.append(20)
i need to dynamically assign the data property of individual according to object of types.new_class(), is there any way to do that?