ontodev / robot

ROBOT is an OBO Tool
http://robot.obolibrary.org
BSD 3-Clause "New" or "Revised" License
264 stars 74 forks source link

Attempt 1: replacing DLExpressivity by DLExpressivityChecker #1207

Open matentzn opened 4 months ago

matentzn commented 4 months ago

This is try to sort out the problem that the previous solution shows gibberish expressivity levels:

"expressivity": "RRESTRCUCINTUNIVRESTREROIF(D)". But it does not work..

Resolves [#ISSUE, resolves #ISSUE]

[DESCRIPTION, mentioning relevant #ISSUE]

ckindermann commented 4 months ago

A workaround might be using Collection<Languages> languages = checker.expressibleInLanguages(); The documentation states that the returned languages are minimal w.r.t. isSubLanguageOf. So, if the set is not a singleton, we could impose an order and return the first result. Here is a snippet:

    Collection<Languages> languages = checker.expressibleInLanguages();

    if (languages == null || languages.isEmpty()) {
      System.err.println("No language found");
    } else {
      Languages[] array = languages.toArray(new Languages[languages.size()]);
      Arrays.sort(array);
      System.err.println(array[0]);
    }
ckindermann commented 4 months ago

Your commit message is not correct: expressibleInLanguages() does not return all languages. Each language in the collection

However, there may be multiple languages satisfying these criteria. In this case, sorting just makes the output deterministic.

matentzn commented 4 months ago

Thank you @ckindermann - I will make sure to rectify the commit message when its time to create a squash merge.

ckindermann commented 4 months ago

Thanks! In any case, getDescriptionLogicName() is the correct function to call. The OWL API currently implements this incorrectly by concatenating the set of constructors used in the ontology (see here in version 4 and here in version 5).