need help with owlready and python specifically with adding dynamic data properties

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

need help with owlready and python specifically with adding dynamic data properties

Madiha
I need help with owlready and data properties as i am new to owlready ontologies and python and have to meet deadline for my reserach. I have a list of nouns like city name bamberg which i want to enter in ontology class entity and assign it to data property how can i do it using owl ready?

Secondly i would like to have all the relations displayed like bamberg is a city so can i do that using owlready and python
Your help will be highly appreciated
Reply | Threaded
Open this post in threaded view
|

Re: need help with owlready and python specifically with adding dynamic data properties

Jiba
Administrator
Hello,

> I need help with owlready and data properties as i am new to owlready
> ontologies and python and have to meet deadline for my reserach. I have a
> list of nouns like city name bamberg which i want to enter in ontology class
> entity and assign it to data property how can i do it using owl ready?

I think you need to create the City class (if not yet existing), and then to create City individuals:

        onto.City(name = "Bamberg")http://owlready2.readthedocs.io/en/latest/class.html

See the documentation of Owlready2 here :

        http://owlready2.readthedocs.io/en/latest/class.html

> Secondly i would like to have all the relations displayed like bamberg is a
> city so can i do that using owlready and python
> Your help will be highly appreciated

You can list city individuals with: onto.City.instances()

Best regards,
Jean-Baptiste Lamy
MCF, LIMICS, Université Paris 13
Reply | Threaded
Open this post in threaded view
|

Re: need help with owlready and python specifically with adding dynamic data properties

Madiha
Thankyou for your reply ... one more question can instead of bamberg can it be a variable ? that changes values all the times
Reply | Threaded
Open this post in threaded view
|

Re: need help with owlready and python specifically with adding dynamic data properties

Jiba
Administrator
Hello,

Yes, it can be a variable :

                onto.City(name = city_name_variable)

Best regards,
Jean-Baptiste Lamy
MCF, LIMICS, Université Paris 13

> Thankyou for your reply ... one more question can instead of bamberg can it
> be a variable ? that changes values all the times
>
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://owlready.8326.n8.nabble.com/need-help-with-owlready-and-python-specifically-with-adding-dynamic-data-properties-tp211p213.html
> To start a new topic under Owlready, email [hidden email]
> To unsubscribe from Owlready, visit