Question on Property Restriction .value() and HermiT

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

Question on Property Restriction .value() and HermiT

Fabian
Hey, I've been working with Owlready for a project recently, working great so far! Still, I have two open questions.

http://owlready2.readthedocs.io/en/latest/restriction.html 
In this part of the documentation you can see that there is a property restriction called value(). I have the assumption that it is used to check if a specific property exists, but I can't figure out how to use it. What exactly is meant by "Range_Individual / Literal value"?

Second question concern the HermiT Reasoner. Let's say I have some individuals with certain properties and I do some reasoning with those based on the rules I defined. Based on the results, I remove some individuals / properties of certain individuals. Now, I want to do another reasoning.

However, it appears to me as if the results of the reasoning stay the same, even though the underlying data has changed. Is it supposed to be like this?

Many thanks in regards!
Fabian
Reply | Threaded
Open this post in threaded view
|

Re: Question on Property Restriction .value() and HermiT

Jiba
Administrator
Hi,

Thank you for your feedback!

"Value" restrictions are used to assert that all instances of a class have a given property with a given value. It corresponds to "value" keyword in Protégé. It is similar to "some" restriction, but instead have having a target class, it has a target individual (or datatype value).

For example, you can create a "Vehicle" class with a "number_of_wheel" integer property. Then, "Bike" is a subclass of "Vehicle". Finally, you can assert that all bikes have 2 wheels using a value restriction.


> However, it appears to me as if the results of the reasoning stay the same,
> even though the underlying data has changed. Is it supposed to be like this?

Cumulating the results of several reasoning is something I have not tested yet... I think it is OK as long as the second reasoning only * add * new facts.

In OwlReady, the inferred fact are stored in a "pseudo" ontology named "http://inferrences/". Before performing the second reasoning, you may need to clear it (else, you will still have the inferrence of the previous reasoning). This can be done as follows:

inferrence = get_ontology("http://inferrences/")
inferrence.destroy()

However, any entities loaded from the ontology will not be updated (i.e. inferred facts that have been loaded are still in memory).

The only way to workaround this problem is to use world: if you create a new World, you can reload the entities, without the destroyed inferred facts.

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

Re: Question on Property Restriction .value() and HermiT

Fabian
Hi,

thanks for the detailed explanation. The inference.destroy() method was exactly what I was looking for.

Your further description of the value restriction has also helped me figuring out my problems.

Best Regards,
Fabian