Skip to content

Commit

Permalink
fix: IRI generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ngrewe committed Feb 18, 2024
1 parent c44b5d0 commit dc48782
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
18 changes: 15 additions & 3 deletions src/main/clojure/de/halbordnung/ontologies/tqme/base.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,26 @@

(defonce ^String bfo-iri "http://purl.obolibrary.org/obo/bfo.owl")

(defn resource-iri "Get a reference to the local BFO copy" ^IRI []
(defonce ^String tawny-iri "http://www.purl.org/ontolink/tawny")


(defn bfo-resource-iri "Get a reference to the local BFO copy" ^IRI []
(IRI/create (clojure.java.io/resource "bfo.owl")))

(defn tawny-resource-iri "Get a reference to the local tawny.owl copy" ^IRI []
(IRI/create (clojure.java.io/resource "tawny.owl")))

(defn -scoped "Generate a v5 UUID in the tqme namespace" [^String n]
; The namespace here must be kept as is in order to keep IRIs stable
(uuid/v5 (uuid/v5 uuid/+namespace-url+ "http://www.halbordnung.de/ontologies/tqc.owl")
n))
(o/defno iri-generate
"Generate IRIs for the determinist names"
[o name]
(iri (str (.getOntologyIRI (.getOntologyID ^OWLOntology o)) "#" (-scoped name))))
(iri (str (.get (.getOntologyIRI (.getOntologyID ^OWLOntology o))) "#" (-scoped name))))

(r/defread bfo
:location (resource-iri)
:location (bfo-resource-iri)
:prefix "bfo"
:iri bfo-iri
:viri "http://purl.obolibrary.org/obo/bfo/2020/bfo.owl"
Expand All @@ -33,3 +39,9 @@
(clojure.core/comp r/stop-characters-transform
r/exception-nil-label-transform))
(tawny.memorise/remember bfo (clojure.java.io/resource "bfo_memo.clj"))

(r/defread tawny
:location (tawny-resource-iri)
:prefix "tawny"
:iri tawny-iri
)
3 changes: 2 additions & 1 deletion src/main/clojure/de/halbordnung/ontologies/tqme/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
:iri-gen b/iri-generate)

(owl-import b/bfo)
(owl-import b/tawny)

(defclass tqme
:label "temporally qualified material entity"
Expand Down Expand Up @@ -178,4 +179,4 @@
(ctor relation (owl-some min-tqme-of class)))

)
)
)

0 comments on commit dc48782

Please sign in to comment.