0

How can I retrieve for each class in my ontology O all (inferred) existential restrictions?

My current approach is to iterate over all pairs of classes and object properties, and check if the restriction is satisfied:

  • for each subclass (C, D) in Classes(O) × Classes(O):
    • for each property P defined in Object properties(O):
      • if C and P some D is satisfiable:
        • yield (C, P, D)

This is pretty slow as I am working with the vaccine ontology which has 4557 classes and 107 object properties. Even it is a one-time computation, I may learn something from seeing better approaches.

Using the OWLKnowledgeExplorerReasoner from JFact as suggested here did not work because it crashed when retrieving the neighbour labels (see my test case)

Can you suggest any improved solution using OWLAPI, Protégé or any other tool? Also, it would be nice to only retrieve the most specific filler classes.

Thanks!

Community
  • 1
  • 1

1 Answers1

2

First of all, your check is wrong. For an empty ontology C and P some D would be satisfiable, which is not what you want. You have to check whether C and not (P some D) is unsatisfiable (alternatively, you can just check isSubsumedBy(C, P some D)).

You can improve the exploration time if you use some techniques that are used for classification, e.g.:

  • if C is a subclass of P some D, then so are all sub-classes of C
  • if C is not a subclass of P some D, then so are all super-classes of C
  • Similar rules for sub/super classes/properties of P and D
  • You can give names to all the P some Thing expressions. After classification you can restrict the search for C only to sub-classes of these concepts.

It also helps if you can narrow down the problem. Do you really need to check all pairs and all properties?

Using the OWLKnowledgeExplorerReasoner from JFact as suggested here did not work because it crashed when retrieving the neighbour labels (Exception Unreachable situation!).

Could you please provide a test case and a full stacktrace of the problem so we can fix it? Did you try to use the same with FaCT++?

Dmitry Tsarkov
  • 768
  • 4
  • 11
  • Thanks for your quick reply! I will try your suggestions. The narrowed-down version of my problem is the retrieval of all object property statements that are entailed for a set of classes. I would hope that this could be achieved more directly than looping over all class pairs and properties. I have further added a link to a test case with backtrace. – user1447265 Dec 08 '16 at 18:40
  • For your problem I'd create named classes for `P some Thing` for all `P` you are interested in. Then I would classify the enriched ontology and asked for a super-classes of a disjunction of all concepts from your set (this may take a while). Thanks for your example, I'll have a look. – Dmitry Tsarkov Dec 09 '16 at 22:45
  • Thanks again. I was able to extract the information about inferred object properties using you original answer (unsatisfiable `C and not (P some D)`) and some optimizations. (My [implementation](https://gist.github.com/benozol/20d84d5132152fe7d17966234d049257) of your second suggestion (`P some Thing` for all `P`) resulted only in `T` but that’s ok given the first solution.) – user1447265 Dec 12 '16 at 18:09