#80 Update documentation on non null parameters, add more checks

closed-fixed
None
5
2013-09-21
2012-10-22
No

Hello,

there seems to be a bug or API change in the 3.4.1 OWL-API release (via Maven).
So far, if you create a new ontology or ontology id, the ontology IRI had always a non-null value.
This has changed. Bug or error?

Please see attached JUnit test for details.

Discussion

  • Ignazio Palmisano

    The ontology iri should not be null unless the ontology is anonymous - I believe that's how it's intended to be, although having nulls hanging around is not great and I can be convinced otherwise.
    However I don't see a change in behavior: the no argument constructor has been passing nulls in for ontology and version iris for the last year at least. I have tried checking out older version of OntologyID and the first test does not pass.

    If you'd like to turn this into a feature request, can you elaborate on what should the IRI be for an anonymous ontology? I'm not sure how to treat this case.

     
  • Ignazio Palmisano

    • assigned_to: nobody --> ignazio1977
     
  • Heiko Dietze

    Heiko Dietze - 2012-10-22

    Hello,

    sorry for the confusion.
    I assumed this null value was the reason for an exception, thrown by the OWL-API.
    After further testing, the real reason is a different behavior in: OWLOntologyManager.createOntology(IRI ontologyIRI, Set<OWLOntology> ontologies)

    In the new release 3.4.1 this methods throws now an IllegalArgumentException, if the ontologyIRI is null.
    Before, I never noticed, that the IRI was null. I have modified the test and added two maven test projects (3.4 vs 3.4.1)

    P.S. Feel free to rename this issue.

     
  • Ignazio Palmisano

    Ok, I see - yes this is a change, and I would argue that check should not be done only inside containsIRI but at the beginning of the various createOntology() methods.
    I think the functionality you're looking for is already implemented in createOntology(Set<OWLAxiom>), which does not require an IRI and will return an anonymous ontology; the whole area is calling for a builder based approach, to be fair: there is a number of load and create methods which would be greatly reduced by having some of the parameters set on a builder, instead of an exponentially increasing number of variations.

     
  • Heiko Dietze

    Heiko Dietze - 2012-10-23

    we will change our code. That's no problem. It was just unexpected.
    You can close the issue, or keep it open as a reminder that this change needs to be added to the documentation.
    Thank you for your time.

     
  • Ignazio Palmisano

    • summary: New ontology ID with null ontology IRI --> Update documentation on non null parameters, add more checks
     
  • Heiko Dietze

    Heiko Dietze - 2012-10-23

    Similar issue for the documentation of:
    OWLOntologyManager#createOntology(IRI ontologyIRI)

    The IRI should not be null.

     
  • Ignazio Palmisano

    @Nonnull annotations and checks have been added to version 4

     
  • Ignazio Palmisano

    • status: open --> closed-fixed
    • Group: --> Next_Release_(example)
     

Log in to post a comment.