From df4c6bbcc758f8b95ed9586cc3f5b92501d7ee3e Mon Sep 17 00:00:00 2001 From: Jim Balhoff Date: Tue, 19 Nov 2024 11:39:47 -0500 Subject: [PATCH 1/3] Update owl-diff dependency for stable ordering and to avoid large string creation. --- robot-core/pom.xml | 2 +- .../src/main/java/org/obolibrary/robot/DiffOperation.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/robot-core/pom.xml b/robot-core/pom.xml index 18af7b0e2..49e35b24d 100644 --- a/robot-core/pom.xml +++ b/robot-core/pom.xml @@ -269,7 +269,7 @@ org.geneontology owl-diff_${scala.version} - 1.2.2 + 1.3.0 net.sourceforge.owlapi diff --git a/robot-core/src/main/java/org/obolibrary/robot/DiffOperation.java b/robot-core/src/main/java/org/obolibrary/robot/DiffOperation.java index c08428cb4..cdb0de596 100644 --- a/robot-core/src/main/java/org/obolibrary/robot/DiffOperation.java +++ b/robot-core/src/main/java/org/obolibrary/robot/DiffOperation.java @@ -123,7 +123,7 @@ public static boolean compare( switch (format) { case "plain": - writer.write(BasicDiffRenderer.renderPlain(diff)); + BasicDiffRenderer.renderPlainWriter(diff, writer); break; case "pretty": DefaultPrefixManager pm = ioHelper.getPrefixManager(); @@ -137,15 +137,15 @@ public static boolean compare( OBOShortenerShortFormProvider iriProvider = new OBOShortenerShortFormProvider(pm); DoubleShortFormProvider doubleProvider = new DoubleShortFormProvider(iriProvider, labelProvider); - writer.write(BasicDiffRenderer.render(diff, doubleProvider)); + BasicDiffRenderer.renderWriter(diff, doubleProvider, writer); break; case "markdown": Differ.GroupedDiff groupedForMarkdown = Differ.groupedDiff(diff); - writer.write(MarkdownGroupedDiffRenderer.render(groupedForMarkdown, ontologyProvider)); + MarkdownGroupedDiffRenderer.renderWriter(groupedForMarkdown, ontologyProvider, writer); break; case "html": Differ.GroupedDiff groupedForHTML = Differ.groupedDiff(diff); - writer.write(HTMLDiffRenderer.render(groupedForHTML, ontologyProvider)); + HTMLDiffRenderer.renderWriter(groupedForHTML, ontologyProvider, writer); break; default: throw new IOException("Unknown diff format: " + format); From e58f3b3e5257416461be77430745e964d2579abf Mon Sep 17 00:00:00 2001 From: Jim Balhoff Date: Tue, 19 Nov 2024 11:56:37 -0500 Subject: [PATCH 2/3] Avoid unnecessary flush(), which will error if the stream is closed. --- .../src/main/java/org/obolibrary/robot/DiffCommand.java | 1 - 1 file changed, 1 deletion(-) diff --git a/robot-command/src/main/java/org/obolibrary/robot/DiffCommand.java b/robot-command/src/main/java/org/obolibrary/robot/DiffCommand.java index c77f8d4fa..28ddecdb3 100644 --- a/robot-command/src/main/java/org/obolibrary/robot/DiffCommand.java +++ b/robot-command/src/main/java/org/obolibrary/robot/DiffCommand.java @@ -161,7 +161,6 @@ public CommandState execute(CommandState state, String[] args) throws Exception options.put("format", CommandLineHelper.getDefaultValue(line, "format", "plain")); DiffOperation.compare(leftOntology, rightOntology, ioHelper, writer, options); - writer.flush(); writer.close(); return state; From 0ae683d66d6afd8ed56a00e26abf98767166ea34 Mon Sep 17 00:00:00 2001 From: Jim Balhoff Date: Tue, 19 Nov 2024 11:56:46 -0500 Subject: [PATCH 3/3] Update CHANGELOG. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61e4439be..d1373e114 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ## Fixed +- Update owl-diff dependency for stable ordering and to avoid large string creation [#1227] - Improve disambiguation of properties in QuotedEntityChecker [#1226] - Skip "non-robot" columns in templates for the purposes of axiom annotations [#1216] - Add missing filter for deprecated in lowercase_definition check [#1220]