Create new concept in an existing ontology

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

Create new concept in an existing ontology

kloud
Hi i'am a beginner in ontology domaine, I used protégé to build an ontology for my study project and then I want to create new class and populate it with a content from a csv file (format : name, age, phone)

1- can I do this with owlready2 ?

2- If yes, how can I do this ( create new class from csv file) ?

any help or tutorial to follow I will be greatful
Reply | Threaded
Open this post in threaded view
|

Re: Create new concept in an existing ontology

Jiba
Administrator
Hi,

> 1- can I do this with owlready2 ?

Yes

> 2- If yes, how can I do this ( create new class from csv file) ?

You can create a class dynamically, using a class name contained in a string variable, as explained here :

https://owlready2.readthedocs.io/en/latest/class.html#creating-classes-dynamically

You can use the "csv" Python module to read your CSV file, then create classes using the class names found in the CSV.

Jiba