Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Fix problem with catalog file for compressed ontologies [#1281]

## [1.9.10] - 2026-02-18

### Fixed
Expand Down
23 changes: 10 additions & 13 deletions robot-core/src/main/java/org/obolibrary/robot/IOHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,20 @@ protected static boolean cleanTDB(String tdbDir) {
* file for a catalog file.
*
* @param ontologyFile the
* @return the guessed catalog File; may not exist!
* @return the guessed catalog File or null if it does not exist
*/
public File guessCatalogFile(File ontologyFile) {
String path = ontologyFile.getParent();
String catalogPath = "catalog-v001.xml";
if (path != null) {
catalogPath = path + "/catalog-v001.xml";
}
return new File(catalogPath);
File catalogFile = new File(catalogPath);
if (catalogFile.isFile()) {
return catalogFile;
} else {
return null;
}
}

/**
Expand All @@ -309,10 +314,6 @@ public File guessCatalogFile(File ontologyFile) {
public OWLOntology loadOntology(String ontologyPath) throws IOException {
File ontologyFile = new File(ontologyPath);
File catalogFile = guessCatalogFile(ontologyFile);
if (!catalogFile.isFile()) {
// If the catalog file does not exist, do not use catalog
catalogFile = null;
}
return loadOntology(ontologyFile, catalogFile);
}

Expand Down Expand Up @@ -387,10 +388,6 @@ public OWLOntology loadOntology(String ontologyPath, String catalogPath, String
*/
public OWLOntology loadOntology(File ontologyFile) throws IOException {
File catalogFile = guessCatalogFile(ontologyFile);
if (!catalogFile.isFile()) {
// If the catalog file does not exist, do not use catalog
catalogFile = null;
}
return loadOntology(ontologyFile, catalogFile);
}

Expand Down Expand Up @@ -484,10 +481,10 @@ public OWLOntology loadOntology(File ontologyFile, File catalogFile, String inpu
}
// Maybe unzip
if (ontologyFile.getPath().endsWith(".gz")) {
if (catalogFile == null) {
return loadCompressedOntology(ontologyFile, null, inputFormat);
} else {
if (catalogFile != null && catalogFile.isFile()) {
return loadCompressedOntology(ontologyFile, catalogFile.getAbsolutePath(), inputFormat);
} else {
return loadCompressedOntology(ontologyFile, null, inputFormat);
}
}

Expand Down
Loading