From 445042a8271ba9548675a6fdec8edf98f26d4ef5 Mon Sep 17 00:00:00 2001 From: Slava Krauchanka Date: Wed, 3 Apr 2019 11:42:41 +0200 Subject: [PATCH 1/3] OWL print no longer crashes on anonymous ontologies --- src/tawny/owl_print.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tawny/owl_print.clj b/src/tawny/owl_print.clj index aad3e57..b0d3f35 100644 --- a/src/tawny/owl_print.clj +++ b/src/tawny/owl_print.clj @@ -235,9 +235,9 @@ "#[%s 0x%x %s %s:%s]" (name-for-class o) (System/identityHashCode o) - (shorten-iri - (.get - (.getOntologyIRI - (.getOntologyID o)))) + (let [o-iri (-> o .getOntologyID .getOntologyIRI)] + (if (.isPresent o-iri) + (shorten-iri (.get o-iri)) + "")) (.getAxiomCount o) (.getLogicalAxiomCount o)))) From 4583303694a3883c72d7d94831715c8a34b1d9e7 Mon Sep 17 00:00:00 2001 From: Slava Krauchanka Date: Wed, 3 Apr 2019 11:42:58 +0200 Subject: [PATCH 2/3] as-iri returns nil for anonymous ontologies --- src/tawny/owl.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tawny/owl.clj b/src/tawny/owl.clj index 45697ef..b35f566 100644 --- a/src/tawny/owl.clj +++ b/src/tawny/owl.clj @@ -174,16 +174,16 @@ string; use 'iri-for-name' to perform ontology specific expansion" ;; Extension of ~p/as-iri~ to ~OWLOntology~ is slightly questionable, since an ;; Ontology is identified *not* by an IRI but the combination of an IRI and ;; version IRI. +;; Also note that ~p/as-iri~ returns nil for anonymous ontologies. ;; #+begin_src clojure (extend-type OWLOntology p/IRIable (p/as-iri [entity] - (-> entity - .getOntologyID - .getOntologyIRI - .get))) + (let [o-iri (-> entity .getOntologyID .getOntologyIRI)] + (if (.isPresent o-iri) + (.get o-iri))))) (defn iriable? "Returns true iff entity is an IRIable." From ac7a0aa5db68b59f523d13b702bad9afd7e2224e Mon Sep 17 00:00:00 2001 From: Slava Krauchanka Date: Wed, 3 Apr 2019 11:43:37 +0200 Subject: [PATCH 3/3] using HTTPS for maven repo --- project.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.clj b/project.clj index d8a4303..8f1ef6b 100644 --- a/project.clj +++ b/project.clj @@ -1,7 +1,7 @@ (defproject uk.org.russet/tawny-owl "2.0.1-SNAPSHOT" :description "tawny-owl enables building OWL ontologies in a programmatic environment." :url "http://www.russet.org.uk/blog/tawny-owl" - :repositories [["maven" "http://repo1.maven.org/maven2"]] + :repositories [["maven" "https://repo1.maven.org/maven2"]] :scm {:url "https://github.com/phillord/tawny-owl.git" :name "git"}