0

I am trying to access information about completion graph, but everytime it ends with error uk.ac.manchester.cs.jfact.helpers.UnreachableSituationException: Unreachable situation! when I call getObjectLabel(rootNode, false/true). I was trying it on every class expression from the ontology but always ended up with the error message.

Set<OWLClassExpression> types = classSet2classExpSet(hybridSolver.ontology.classesInSignature().collect(toSet()));
for (OWLClassExpression e : types) {
    OWLKnowledgeExplorerReasoner.RootNode rootNode = loader.getReasoner().getRoot(e);
    System.out.println(loader.getReasoner().getObjectLabel(rootNode, false)); //problem UnreachableSituation !!
    Node<OWLObjectProperty> propertyNode = (Node<OWLObjectProperty>) loader.getReasoner().getObjectNeighbours(rootNode, false);
    for (OWLObjectProperty p : propertyNode.getEntities()) {
                Collection<OWLKnowledgeExplorerReasoner.RootNode> rootNodes = loader.getReasoner().getObjectNeighbours(rootNode, p);
                ...
    }
}

Other method getObjectNeighbours(rootNote, false) works fine.

Can somebody help? Is there any way to access completion graph with OWLAPI? Why it might end with this error?

bobo3
  • 1
  • 1
  • 1
    Can you add the ontology you're using? The two methods have a similar name but the implementation is very different, the exception might be due to the ontology or to a bug. (The problem here is not OWLAPI but JFact + ontology) – Ignazio Apr 10 '22 at 21:26
  • Thank you for your reply. Of course, here is the ontology: https://www.st.fmph.uniba.sk/~boborova3/ontology/familyX.owl – bobo3 Apr 11 '22 at 13:10

1 Answers1

0

The labels found for the nodes in question are not named class expressions (e.g., they are AND nodes. These cannot be translated back to OWLClass and there's no current implementation for translating back class expressions. Tweaking the code to remove the exceptions is doable but for your ontology example you'd always get back empty nodes, which isn't very informative.

I have removed the exception throwing in the latest version 5 branch, however I doubt this is sufficient for your needs.

Ignazio
  • 10,504
  • 1
  • 14
  • 25
  • Thank you very much. It's a big help to know what is going on and yes, empty nodes would not be very informative. If I didn't use OWLAPI but used JFact directly, would I be able to access that information? My goal is basically to get a completion graph so I can read a model of ontology from it. – bobo3 Apr 18 '22 at 06:15
  • @bobo3 It's possible but you'd have to edit JFact's code, it's not designed to be used except via OWLAPI interfaces, so you'd have to look at JFactReasoner.java and change it to allow you to access its member attributes. – Ignazio Apr 18 '22 at 18:54