Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing anonymous ontologies #69

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -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"}
Expand Down
8 changes: 4 additions & 4 deletions src/tawny/owl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
8 changes: 4 additions & 4 deletions src/tawny/owl_print.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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))))