Skip to content
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

Attempt 1: replacing DLExpressivity by DLExpressivityChecker #1207

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

matentzn
Copy link
Contributor

@matentzn matentzn commented Jun 21, 2024

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]

  • docs/ have been added/updated
  • tests have been added/updated
  • mvn verify says all tests pass
  • mvn site says all JavaDocs correct
  • CHANGELOG.md has been updated

[DESCRIPTION, mentioning relevant #ISSUE]

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

"expressivity": "RRESTRCUCINTUNIVRESTREROIF(D)". But it does not work..
@ckindermann
Copy link

ckindermann commented Jun 21, 2024

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]);
    }

…culation

@ckindermann has suggested this approach. I relies on the fact that expressibleInLanguages() give the set of all languages, and the sorting sorts by whether one is contained in another.
@ckindermann
Copy link

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

  • allows for all necessary constructors (meaning the ontology can be expressed in the language),
  • is minimal regarding sublanguages (meaning the set does not include more expressive languages than necessary).

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

@matentzn
Copy link
Contributor Author

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

@ckindermann
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants