This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-30
Channels
- # announcements (5)
- # babashka (9)
- # beginners (48)
- # calva (300)
- # clj-kondo (9)
- # clojure (44)
- # clojure-austin (2)
- # clojure-europe (14)
- # clojure-uk (4)
- # clojurescript (1)
- # conjure (2)
- # datascript (3)
- # datomic (8)
- # exercism (5)
- # fulcro (1)
- # luminus (4)
- # music (1)
- # off-topic (12)
- # pathom (6)
- # rdf (18)
- # react (8)
- # sci (78)
- # shadow-cljs (12)
- # spacemacs (4)
- # tools-build (5)
- # tools-deps (26)
- # vim (4)
- # xtdb (8)
The project i’m working on is creating a knowledge graph of sorts, we’re pulling in data from variety of disparate sources, typically deeply nested JSON data, and it’s not immediately clear to me what the schema needs to be ahead-of-time, until we see more use cases, we only have a vague sense of which parts of the JSON will end up being useful, is this a good fit for datomic? I tend to think of schemaless databases as the ‘solution’ here, where retrospectively you can decide on what your indexes will be, speed up particular queries , as you acquire more requirements/use cases on the sorts of queries that matter.
If not datomic, what would you suggest, also needs to support graph query operations.
If datomic, the strategy is to break apart these deeply nested JSON structures at ingest time try and mapping to datomic primitives, e.g. json arrays into db.cardinality/many
or how would you go about that?
“Schemaless” just pushes the schema requirement to the read side. Dynamically generated schema is a rocky road. You need to really trust the data set to do such a thing. It sounds like you would be better off with a different database.
Postgres and other databases has better support for plain JSON-documents and other things. Still Datomic could link these documents and you could batch read and upsert your datomic schema at your own pace.
It is certainly possible to store serialized datastructures as byte arrays in Datomic, but they are no more than just byte arrays. Also, Datomic sometimes store data multiple times.
You might consider https://github.com/quoll/asami
how do i pass multiple rules in a single query?
(d/q '[:find ?t (count ?t2) (count ?t3)
:in $ % ?p1 ?p2
:where
(played2 ?p1 ?p2 ?t)
(wins ?p1 ?p2 ?t2)
(wins ?p2 ?p1 ?t3)
[(= ?t ?t2 ?t3)]]
atp wins played2 "Roger Federer" "Novak Djokovic" )
expected: [$ % ?p1 ?p2], got: 5