This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-30
Channels
- # aleph (2)
- # announcements (8)
- # babashka (12)
- # beginners (34)
- # calva (36)
- # cherry (3)
- # cider (1)
- # clj-kondo (11)
- # clj-otel (6)
- # cljdoc (31)
- # clojure (121)
- # clojure-conj (1)
- # clojure-czech (2)
- # clojure-europe (109)
- # clojure-nl (1)
- # clojure-norway (5)
- # clojure-uk (3)
- # cursive (3)
- # datahike (1)
- # datomic (9)
- # deps-new (6)
- # docker (5)
- # emacs (21)
- # fulcro (4)
- # hoplon (16)
- # introduce-yourself (2)
- # london-clojurians (5)
- # lsp (87)
- # malli (17)
- # missionary (1)
- # nbb (27)
- # off-topic (257)
- # pathom (4)
- # portal (42)
- # practicalli (1)
- # rdf (3)
- # releases (2)
- # shadow-cljs (49)
- # slack-help (3)
- # timbre (2)
@eric.d.scott So it turns out that what I need is really a way to write legible qnames inline that either convert to keywords or RDF resource IRIs (since those are what Aristotle likes), but I couldn’t find anything in ont-app vocabulary that did these conversions, so now I have written this:
(defn qname-kw
"Safely convert a QName `s` into a Clojure keyword."
[s]
(let [[prefix identifier :as parts] (str/split s #":")]
(if (= (count parts) 2)
(keyword (fmt/encode-kw-ns prefix) (fmt/encode-kw-name identifier))
(throw (ex-info (str "bad qname: " s) {:input s
:parts parts})))))