dynamic create individual and DataProperty

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

dynamic create individual and DataProperty

Totte
"Hello!

I want to automatically convert a DataFrame into an ontology file, so I created classes, individuals, and Dataproperties using types.new_class, getattr, and setattr.
However, when I checked it using Protege, the Dataproperty did not go in as a list.
I want to put it in as a list or tuple format for Dataproperty. What should I do?"



Reply | Threaded
Open this post in threaded view
|

Re: dynamic create individual and DataProperty

Jiba
Administrator
Hello,

What do you exactely mean by "the Dataproperty did not go in as a list" ?
Did you expect to get something like "box_list [259.43, 812.88, 678.41]" ?

Protégé displays each property value on a separate line, while Owlready "group" them in a list. However, it is the same : only the presentation differ.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: dynamic create individual and DataProperty

Totte
This post was updated on .
Thank you
i have another problem
I dynamically created object classes, DataProperties, and individuals and saved them as an Owl file. However, when I loaded the saved file and checked the DataProperty of the individual, I found that the order of the list had changed.

The first picture shows the values in the DataFrame before creating the Owl file,



and the second picture shows the output after loading the Owl file.



Is it possible to save without changing the order of the list?