Why OWLReady sets data property with "float" range as "decimal"?
I am trying to assign an existed data property to an individual, but OWLReady sets the range of data prop to "decimal", while the original range of data prop is "float" and also in the python, the data type is "float".
I am using the following line of code:
>> setattr(new_instance, data_prop, value)
Could you please tell me how can I fix this problem?
By default, Owlready uses decimal to represent Python float, in order to keep the compatibility between int and float: Python accepts an int as a float, but OWL does not. It does accept a decimal, though.
You can use the following command to make Owlready use float instead of decimal:
Re: Why OWLReady sets data property with "float" range as "decimal"?
It was a big problem for me because "Pellet" reasoner in Protege gave an error that "decimal value does not belong to datatype float". Anyway, your suggested command line solves this problem for me. Thank you.