Hi,
I'm trying to plot my ontology as a graph. For this I need to add explicit property relations for inverse properties. E.g. I have the following object properties: A, B; A is the inverse of B And the individuals: Ind1, Ind2 The ontology contains the following information: Ind1 A Ind2 Implicitly, it also contains Ind2 B Ind1. How do I make this explicit? I tried using the reasoners, which works in Protege, but didn't help in OR2. I also have tried using the new infer_property_values (Even though I don't quite understand what it's supposed to do), but that just gave me an error message. I also tried exporting my inferred relations from protege somehow, which would be an acceptable workaround, but didn't manage to do that, either. |
Administrator
|
Hi,
In ontologies, it is usually common to not store explicitely invert property values (to save space). What kind of error do you get with infer_property_values ? I think it is the right approach (although I might prevented saving the invert property values for saving space, I need to check that). Best regards, Jiba |
Hi,
Thank you for your quick response. > In ontologies, it is usually common to not store explicitely invert property values (to save space). As an alternative, a way to query implicit property relations would work, too. I've been using get_properties(), and going with the example above, it would only return A when querying from Ind1, but not B when querying from Ind2. When trying to use infer_property_values, I get the following error: Traceback (most recent call last): File "<PATH>/main.py", line 106, in <module> or2.sync_reasoner(infer_property_values=True) File "<PATH>/venv/lib/python3.5/site-packages/owlready2/reasoning.py", line 177, in sync_reasoner_hermit a, b = pair[1:-1].split(">, <", 1) ValueError: not enough values to unpack (expected 2, got 1) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<PATH>/main.py", line 106, in <module> or2.sync_reasoner(infer_property_values=True) File "<PATH>/venv/lib/python3.5/site-packages/owlready2/namespace.py", line 666, in __exit__ Namespace.__exit__(self, exc_type, exc_val, exc_tb) File "<PATH>/venv/lib/python3.5/site-packages/owlready2/namespace.py", line 68, in __exit__ if self.world.graph: self.world.graph.release_write_lock() File "<PATH>/venv/lib/python3.5/site-packages/owlready2/triplelite.py", line 373, in release_write_lock self.lock.release() RuntimeError: cannot release un-acquired lock |
Administrator
|
Hi,
get_properties() does not return inverse properties, but that was never intended -- it is more a bug or a missing feature. I fixed it in the development version on Bitbucket : get_properties() now considers inverse properties. Regarding the reasoning error, could you send me some ontology that I can use to reproduce the problem ? Best regards, Jiba |
Administrator
|
Hi,
There was a bug in the parsing of the HermiT results. I fixed it in the development version. (NB Pellet was not affected by this bug). Thank you for reporting this problem. Best regards, Jiba |
Free forum by Nabble | Edit this page |