Skip to content

Silencing import errors does not seem to work for OBO files #1123

Open
@reckart

Description

When loading an OBO file that contains an import (such as the example1.obo file from this project's test data), it fails with an exception if network access is not available.

Using a AutoIRIMapper and/or MissingImportHandlingStrategy.SILENT (as suggested here) does not seem to work.

        var manager = OWLManager.createOWLOntologyManager();

        // Does not seem to work for imports in OBO files....
        var iriMappers = manager.getIRIMappers();
        iriMappers.add(
                new AutoIRIMapper(new File(kbRepositoriesRoot, "materializedOntologies"), true));
        manager.getOntologyLoaderConfiguration()
                .setMissingImportHandlingStrategy(MissingImportHandlingStrategy.SILENT);
        manager.getOntologyConfigurator()
                .setMissingImportHandlingStrategy(MissingImportHandlingStrategy.SILENT);

        var ontology = manager.loadOntologyFromOntologyDocument(... input stream for OBO file ...);

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions