Permalink
Browse files

Type hints added to all namespaces.

All namespaces now load without reflection warnings.
Tests added to ensure this does not revert.
  • Loading branch information...
phillord committed Dec 12, 2013
1 parent d8d0cc6 commit 09789064fb7260ac9555c1f5c30c51c7186be33e
@@ -21,10 +21,17 @@ Release Notes
- Unqualified cardinality is now supported without using of `owl-thing`
- The JFact reasoner is now supported.
- New aliases have been added to `tawny.english`.
- All namespaces now load without reflection warnings, having been heavily
type-hinted. This should introduce no changes but many namespaces run much
faster; `tawny.owl` about 2x, `tawny.render` perhaps 5x for very
approximate benchmarks.

## Breaking Changes
- `disjoint-classes` list has been removed, and `disjoint-classes-list` has
been renamed to `disjoint-classes`!
- `tawny.protege-nrepl` has now been removed; its had dependencies that were
not explicitly specified as it ran inside protege. It is now in a project
of its own, called `tawny.protege`.

## Bug Fixes
- `datatype` equivalents were limited to other datatypes. Now any datarange
@@ -23,7 +23,7 @@
]
(println "Default ontology used")
(doseq
[l (take 30 st)
[^StackTraceElement l (take 30 st)
:when (every?
#(not
(.contains
@@ -79,7 +79,7 @@ NAMESPACE"
(clojure.string/join
"\n"
(map
#(.toString %)
#(.toString ^Object %)
classes)))

(defn get-unsatisfiable [namespace]
@@ -74,6 +74,7 @@ space, if it the var is not in the current namespace."
"Given an OWLNamedObject, return the IRI."
[entity]
(-> entity
tawny.owl/as-named-object
(.getIRI)
(.toString)))

@@ -25,7 +25,8 @@


(def
^{:doc "Root of IRI that is used for temporary IRIs"}
^{:doc "Root of IRI that is used for temporary IRIs"
:tag 'String}
obo-pre-iri
"http://purl.org/ontolink/preiri/")

@@ -58,7 +59,7 @@ in :name-to-iri-current, while IDs loaded from file are stored in
assoc
:name-to-iri-current
(assoc current name iri)))
(IRI/create iri)))
(tawny.owl/iri iri)))

(defn obo-read-map
"Read a properties file, and return a hashmap of Clojure identifier to IRI."
@@ -81,7 +82,7 @@ in :name-to-iri-current, while IDs loaded from file are stored in

(defn preiri?
"Return true if the (string) IRI is a auto-generated 'pre' IRI."
[iri]
[^String iri]
(.startsWith iri obo-pre-iri))

(defn obo-sort
@@ -163,11 +164,10 @@ longer exist in the ontology. There are, effectively, obsolete terms."
"Assigns new permanent identifiers to map. In detail, this expects an map
between identifiers and IRI. For all those IRIs which return true for preiri?,
a new numeric identifier is created, incrementing from the current largest."

[name-to-iri prefix]
[name-to-iri ^String prefix]
(let ;; fetch the numeric part of IDs beginning with the prefix.
[ids
(map (fn [[name iri]]
(map (fn [[name ^String iri]]
(if (.startsWith iri prefix)
(Integer/parseInt (.substring iri (.length prefix)))
0))
Oops, something went wrong.

0 comments on commit 0978906

Please sign in to comment.