This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-05
Channels
- # announcements (1)
- # asami (21)
- # aws (19)
- # babashka (37)
- # beginners (38)
- # clj-kondo (7)
- # clj-otel (8)
- # clojure (29)
- # clojure-europe (54)
- # clojure-nl (3)
- # clojure-spec (2)
- # clojure-uk (2)
- # clojurescript (15)
- # conjure (1)
- # data-science (1)
- # datomic (21)
- # emacs (6)
- # events (3)
- # figwheel-main (1)
- # gratitude (13)
- # holy-lambda (11)
- # joyride (6)
- # klipse (3)
- # malli (14)
- # missionary (26)
- # nbb (31)
- # omni-trace (2)
- # pathom (3)
- # reagent (1)
- # reitit (1)
- # releases (1)
- # shadow-cljs (24)
- # sql (27)
- # tools-deps (4)
- # vim (21)
So… I’m trying to wrap my head around how to put stuff into Asami. My first usecase is medical ontologies/classifications/etc (ICD, Snomed, Loinc, and friends), fwiw. These are typically distributed as large XML files with their own internal logic using IDs for creating references.
So, my first thought is doing it lazily. Not sure if that means using transact? Or should I be first converting the master files into Asami-compatible EDN/Json/etc and then loading these? Appreciate anyones mental model on how to approach this. (I’ve been a developer for long enough but new in the Clojure world and haven’t used Asami-like databases before.)
Any chance you can share your approach, somehow? Not sure what the question should be, really, but any inspiration is appreciated 😋
I’m writing a ttl parser at the moment. n-triples is easy to convert, but I can’t generate the data with that
Otherwise, I’d just use the RIOT parsers from Jena and pull them in that way. But I’m writing my own parser because I want it to be pure Clojure
Oh, wow. Thanks for the replies. Do you happen to know any code samples using Asami you can point me to? (My GitHub-code-search-fu isn't what it should be…)
I'm using Asami and transact
with :tx-data
to load triples I've read from a ttl file. It's nothing fancy (I'm still a relative beginner too 😉) but it might help you out just enough
It's an open-source project too, so I can share it with you. Again, it's proof-of-concept maturity level code by a beginner, so take it with a grain of salt
In short:
• I read triples from TTL files using RDF4j and convert this to Clojure vectors of size 3 (that's the triples)
• I use transact
with :tx-data
to load them
• The "marking as entity" logic takes care of marking entities as top-level, which is necessary if you want to recursively fetch tree structures using d/entity
. You may not need that at all
Hope that's helpful