From 24b1be80e6269ada51c4fca342b500190437bcaf Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Fri, 20 Mar 2026 15:12:01 -0700 Subject: [PATCH 1/8] Use short form when QNames are invalid --- .../org/stanford/ncbo/owlapi/wrapper/OntologyParser.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/stanford/ncbo/owlapi/wrapper/OntologyParser.java b/src/main/java/org/stanford/ncbo/owlapi/wrapper/OntologyParser.java index a8c2e50..74f005c 100644 --- a/src/main/java/org/stanford/ncbo/owlapi/wrapper/OntologyParser.java +++ b/src/main/java/org/stanford/ncbo/owlapi/wrapper/OntologyParser.java @@ -424,11 +424,12 @@ private void generateSKOSInOwl(Set allAxioms, OWLDataFactory fact, OWL b.replace(ind, ind + 1, ":"); prefixIRI = b.toString(); } - - OWLAnnotationProperty prop = fact.getOWLAnnotationProperty(IRI.create("http://data.bioontology.org/metadata/prefixIRI")); - OWLAxiom annAsse = fact.getOWLAnnotationAssertionAxiom(prop, cls.getIRI(), fact.getOWLLiteral(prefixIRI)); - allAxioms.add(annAsse); + } else { + prefixIRI = cls.getIRI().getShortForm(); } + OWLAnnotationProperty prop = fact.getOWLAnnotationProperty(IRI.create("http://data.bioontology.org/metadata/prefixIRI")); + OWLAxiom annAsse = fact.getOWLAnnotationAssertionAxiom(prop, cls.getIRI(), fact.getOWLLiteral(prefixIRI)); + allAxioms.add(annAsse); } } } From 6f08a8b43f7a19448de0efb0a87ef4fe1b538711 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Fri, 20 Mar 2026 15:21:18 -0700 Subject: [PATCH 2/8] Add Javadoc for generateSKOSInOwl --- .../stanford/ncbo/owlapi/wrapper/OntologyParser.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/org/stanford/ncbo/owlapi/wrapper/OntologyParser.java b/src/main/java/org/stanford/ncbo/owlapi/wrapper/OntologyParser.java index 74f005c..57a990c 100644 --- a/src/main/java/org/stanford/ncbo/owlapi/wrapper/OntologyParser.java +++ b/src/main/java/org/stanford/ncbo/owlapi/wrapper/OntologyParser.java @@ -376,6 +376,18 @@ private void deprecateBranch() { } } + /** + * Generates identifier annotations for named classes in OWL ontologies. + *

+ * Existing {@code skos:notation} annotations are preserved. If absent, {@code oboInOwl:id} + * is copied into {@code skos:notation}. Otherwise, BioPortal {@code prefixIRI} metadata is + * generated from the class IRI, using a prefixed form when available and the IRI short form + * as a fallback. + * + * @param allAxioms the set of axioms being accumulated for the target ontology + * @param fact the OWL data factory used to create annotation axioms + * @param sourceOnt the source ontology whose class identifiers are being processed + */ private void generateSKOSInOwl(Set allAxioms, OWLDataFactory fact, OWLOntology sourceOnt) { OWLDocumentFormat docFormat = this.sourceOwlManager.getOntologyFormat(sourceOnt); PrefixDocumentFormat prefixFormat = docFormat.asPrefixOWLOntologyFormat(); From 33bfbcf8dae0ae75f2ad1a00f8c6956d16e1ad48 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Fri, 20 Mar 2026 16:03:15 -0700 Subject: [PATCH 3/8] Correct the SNAPSHOT revision --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eeb84c3..05a2721 100644 --- a/pom.xml +++ b/pom.xml @@ -99,7 +99,7 @@ - 1.4.3-SNAPSHOT + 1.5.1-SNAPSHOT UTF-8 From 8baca8adfac0476d2aaf36dc995befdcf8787edf Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Fri, 20 Mar 2026 16:21:05 -0700 Subject: [PATCH 4/8] Remove duplicate dependency declaration --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index 05a2721..df2b4b6 100644 --- a/pom.xml +++ b/pom.xml @@ -154,12 +154,6 @@ 1.10.0 - - javax.xml.bind - jaxb-api - 2.3.0 - - From acc10db9af82ca01645c9b82963fa4bb2a8f5b06 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Fri, 20 Mar 2026 16:31:47 -0700 Subject: [PATCH 5/8] Bump logback to 1.5.32 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index df2b4b6..5c36c0a 100644 --- a/pom.xml +++ b/pom.xml @@ -139,13 +139,13 @@ ch.qos.logback logback-core - 1.4.14 + 1.5.32 ch.qos.logback logback-classic - 1.4.14 + 1.5.32 From 8a6e87890648a903145570e37d1461c9439ce1a2 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Fri, 20 Mar 2026 17:12:17 -0700 Subject: [PATCH 6/8] Add a contributors block --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 2a36606..a179a5f 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,7 @@ A command line utility that wraps the Java [OWL API](https://github.com/owlcs/owlapi) for parsing RDFS, OWL, and OBO ontologies. +## Contributors + + + \ No newline at end of file From 85300c7fbc8fa1dc08d67d1d5684ba5d75a01fb4 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Mon, 23 Mar 2026 12:54:33 -0700 Subject: [PATCH 7/8] Add proper licensing info --- LICENSE.md | 22 ++++++++++++++++++++++ pom.xml | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..711fa27 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,22 @@ +Copyright (c) 2012-2026, The Board of Trustees of Leland Stanford Junior University +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are +permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list + of conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY The Board of Trustees of Leland Stanford Junior University +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +EVENT SHALL The Board of Trustees of Leland Stanford Junior University OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pom.xml b/pom.xml index 5c36c0a..667a3c8 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ - BSD 2-clause + BSD-2-Clause https://opensource.org/licenses/BSD-2-Clause manual From 2b9975555b1e95ddf5650586f8919a979d83dec3 Mon Sep 17 00:00:00 2001 From: Jennifer Vendetti Date: Mon, 23 Mar 2026 14:12:36 -0700 Subject: [PATCH 8/8] Augment README with badges and summary text --- README.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a179a5f..6a4f238 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,29 @@ # owlapi_wrapper +[![Java Unit Tests](https://github.com/ncbo/owlapi_wrapper/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/ncbo/owlapi_wrapper/actions/workflows/unit-tests.yml) [![codecov](https://codecov.io/gh/ncbo/owlapi_wrapper/graph/badge.svg?token=HEt3yP8T0i)](https://codecov.io/gh/ncbo/owlapi_wrapper) +[![GitHub Release](https://img.shields.io/github/v/release/ncbo/owlapi_wrapper)](https://github.com/ncbo/owlapi_wrapper/releases) +[![License: BSD 2-Clause](https://img.shields.io/badge/License-BSD%202--Clause-blue.svg)](https://opensource.org/licenses/BSD-2-Clause) -A command line utility that wraps the Java [OWL API](https://github.com/owlcs/owlapi) for parsing RDFS, OWL, and OBO ontologies. +`owlapi_wrapper` is a small Java command-line tool built around the [OWL API](https://github.com/owlcs/owlapi). It parses OWL, RDF(S), SKOS, +and OBO ontologies and writes a normalized RDF/XML export plus a small metrics report. + +The project is used in the [BioPortal](https://bioportal.bioontology.org/) ecosystem to load ontologies and add a few BioPortal-oriented annotations +during serialization. + +## Features + +- Parses a master ontology file from a local repository of ontology files +- Writes a serialized RDF/XML output file named `owlapi.xrdf`. +- Writes a `metrics.csv` file with class, individual, property, and max-depth counts. +- Adds some normalization used by BioPortal, e.g., SKOS notation or prefix annotations for classes + +## License + +The 2-Clause BSD License. See [LICENSE.md](LICENSE.md) for more information. ## Contributors + - \ No newline at end of file +