From c834eab82dfa009eded8ed79659d521f5e11a6fa Mon Sep 17 00:00:00 2001 From: Nico Matentzoglu Date: Mon, 20 Apr 2026 16:00:45 +0300 Subject: [PATCH 1/3] Load gz files without catalog --- robot-core/src/main/java/org/obolibrary/robot/IOHelper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/robot-core/src/main/java/org/obolibrary/robot/IOHelper.java b/robot-core/src/main/java/org/obolibrary/robot/IOHelper.java index 4187b5833..0df4a1497 100644 --- a/robot-core/src/main/java/org/obolibrary/robot/IOHelper.java +++ b/robot-core/src/main/java/org/obolibrary/robot/IOHelper.java @@ -484,10 +484,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); } } From 2dc4cbcc07e97eaf2269203057509b2c28d63d81 Mon Sep 17 00:00:00 2001 From: "James A. Overton" Date: Mon, 20 Apr 2026 14:03:30 +0000 Subject: [PATCH 2/3] guessCatalogFile should return null if file does not exist --- .../java/org/obolibrary/robot/IOHelper.java | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/robot-core/src/main/java/org/obolibrary/robot/IOHelper.java b/robot-core/src/main/java/org/obolibrary/robot/IOHelper.java index 0df4a1497..4f041e258 100644 --- a/robot-core/src/main/java/org/obolibrary/robot/IOHelper.java +++ b/robot-core/src/main/java/org/obolibrary/robot/IOHelper.java @@ -288,7 +288,7 @@ 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(); @@ -296,7 +296,12 @@ public File guessCatalogFile(File ontologyFile) { 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; + } } /** @@ -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); } @@ -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); } From ab90f95ece93ddf6c6b681e8b8e7118ef9a6a700 Mon Sep 17 00:00:00 2001 From: "James A. Overton" Date: Mon, 20 Apr 2026 14:30:01 +0000 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8d7e2f5a..51bd20cfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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