This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-20
Channels
- # announcements (1)
- # architecture (14)
- # asami (21)
- # babashka (1)
- # beginners (44)
- # biff (6)
- # calva (24)
- # clojure (16)
- # clojure-europe (12)
- # clojurescript (32)
- # cursive (23)
- # datascript (5)
- # honeysql (8)
- # hyperfiddle (1)
- # malli (1)
- # nextjournal (34)
- # nrepl (4)
- # off-topic (64)
- # re-frame (12)
- # reagent (1)
- # releases (2)
- # reveal (41)
- # shadow-cljs (137)
- # spacemacs (4)
- # xtdb (5)
Entities are just built out of triples, and you can look up triples in any direction, so yes. Maybe you're looking for a different type of API though?
trying to figure out how I ought to structure my data. I'm going to want to do a lot of back references - "this entity refers to that one, and these are all of the entities that refer it" - which in some dbs I could use reverse lookups. I could just transact those relations explicitly though I think
another question: I'd like to use a tuple [:foo "bar"]
as a :db/ident
. this doesn't seem to work when I try to do (d/entity db [:foo "bar"])
. haven't tried it any other way yet but, are complex data types like that allowed as idents?
Asami can store it, but I haven’t put it into the API yet because without a schema it's just looks like a nested structure that needs to be converted to triples
yeah I see it ends up in the (in-memory) structure as
{:graph {:spo {:node-19455 {:db/ident #:tg{:node-19456 {:t 2, :id 16}},
What I need is some way to get it through the asami.entities.writer/map->triples
operation without descending into the ID attributes.
Actually, that may not be hard at all, since they’re well known, and there is not reason to every have a triple-based structure on those attributes.
If they’re not converted into triples, then then in memory, they just get stored as the data for the node, and on disk then end up going straight to the Data Pool, and represented with a number (that is a pointed into the data pool).
Encoding happens in asami.durable.encoder/FlatFile
which is a protocol for storing things in the file that encodes the data pool. That protocol is extended onto ISeq
on line 282, onto IPersistentVector
on line 329, and IPersistentMap
on line 333.
Still in the middle of writing other code, but I guess I could try making a branch that does this, so it can happen sooner
I’m nearly there. I can store them and retrieve them, but searching for them isn’t working. Will try again in the morning
https://clojurians.slack.com/archives/C015AL9QYH1/p1645591820279359?thread_ts=1645588521.416369&channel=C015AL9QYH1&message_ts=1645591820.279359 It was mostly done already.
This is what I mean when I keep saying that I have “plans”. I have lots of nearly-done features that I need to connect up 🙂
I also do not understand this line in the docs about identity > However, using these ident values in `:db/add` statements has greater potential to interfere with tuples that should not be modified, so the use is discouraged.
last paragraph under this heading https://github.com/threatgrid/asami/wiki/4.-Transactions#identity-values