Inverse property problem

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

Inverse property problem

griasmotorbusqueda
Hi,

I have a problem with inverse properties.

The problem is that the inverse property does not appear in owl file. In the owlready2 the inverse property and the direct property appear correctly (automatic way).

instance1 -> objectproperty1 -> instance2
instance2 -> objectproerty2(inverse_property) -> instance1



I want that instance2 has instance1:

instance2 -> objectproperty2 -> instance1
instance1 -> objectproperty1(inverser_property) -> instance2

i printed this:

onto.objectproperty1.get_relations()
[(Onto.instance1, Onto.Instance2)]

but with the objectproperty2 i have this:

onto.objectproperty2.get_relations()
[]

what should i do ?
Reply | Threaded
Open this post in threaded view
|

Re: Inverse property problem

Jiba
Administrator
Hi,

You are right, Property.get_relations() currently does not consider inverse property.

I fixed the problem in the development version of Owlready on Bitbucket, so you can now use get_relations() to obtain inversion relation too.

Jiba