-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solving Einstein's riddle (zebra puzzle) #3
Comments
I will look into this after the Python3 version is properly released |
@nicholascar my understanding is that the expressivity of these two ontologies is just too high. Please, correct me if I'm wrong. |
@iherman what do you think? |
@blokhin I've been looking into how these zebra-puzzle ontologies work within this implementation of OWL-RL, why they don't produce a solution, and what it would take for this implementation to be able to solve this puzzle using those ontologies. I think it comes down to the restrictions of the specific flavour of OWL (RL) that is used. See this page: https://www.w3.org/TR/owl2-profiles/#OWL_2_RL
And in the Computational Properties section: https://www.w3.org/TR/owl2-profiles/#Computational_Properties
So by using a brute-force axiomatic rule-base approach (for performance, efficiency, and simplicity reasons), this implementation conforms to OWL-RL entailments/inferences but does not go as far as to automatically solve this kind of puzzle. It seems to me that solving this puzzle would require the integration of a backtracking-capable Constraint Solving Problem resolver (CSP) such as https://labix.org/python-constraint. The OWL inferencer could build the constraints using an OWL->CSP axiom mapping, then after the OWL inferencing has finished, it could run the CSP resolver to get the solutions and plug them into the graph. Unfortunately by doing this, it introduces a further layer of complexity to the OWL inferencer, and will significantly slow down the inferencing process. Furthermore, by doing this the problem is no longer solvable in PTIME, and is starting to stray away from the strictly rule-based approach of OWL-RL (correct me if I'm wrong). |
@ashleysommer many thanks for your kind explanation. Actually, @wrobell tried to solve this riddle as a case study for FaCT++ reasoning using his new Python bindings for rdflib and, although succeeded, found an uncontrolled performance degradation. So indeed this riddle is difficult. |
Well, it's not the Einstein's riddle is difficult, it's that the And as far as I understand, the only way to tackle this difficulty is to resolve for heuristics... causing sometimes the uncontrolled performance degradations... |
I think the package owlready might be a way to go. I achieved to load the above ontologies but they seem to be incompletely represented. See this notebook for details: I think, once the ontology is correctly loaded/represented the solution could be obtained via something like For Reference: I have two pending questions concerning this topic: |
Update: with the first ontology file I now get convincing results with the pellet-reasoner: |
So I guess owlread2 is using Pellet in DL mode underneath? I don't think we have a DL reasoner in Python, or at least not one for use with RDFlib! I now have a student looking at updating OWL-RL (and probably renaming it) and I want to see support for EL & QL, as well as the current RDFS & RL. I also want assurance that all RL reasoning is being carried out properly, but I don't have plans for DL reasoning as that's a very different thing. |
Out of rigorousness, here’s the solution using FaCT++ reasoner in Python. |
Dear all,
there are two known implementations of the famous Einstein's riddle (zebra puzzle) in OWL:
attached
Unlike Protégé, this brute-force reasoner fails to solve both of these implementations (an expanded graph does not contain any triples connecting zebra and Japanese, which is an answer).
Is it an expected behavior?
The text was updated successfully, but these errors were encountered: