This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-11
Channels
- # announcements (3)
- # aws (3)
- # babashka (79)
- # beginners (105)
- # calva (10)
- # chlorine-clover (22)
- # clj-kondo (12)
- # cljs-dev (39)
- # clojure (52)
- # clojure-europe (1)
- # clojure-spec (15)
- # clojure-uk (12)
- # clojurescript (47)
- # conjure (93)
- # data-science (1)
- # datomic (10)
- # emacs (6)
- # figwheel-main (14)
- # fulcro (30)
- # instaparse (3)
- # kaocha (2)
- # lambdaisland (3)
- # malli (2)
- # meander (6)
- # off-topic (27)
- # pathom (14)
- # perun (1)
- # reagent (15)
- # shadow-cljs (69)
- # slack-help (2)
- # spacemacs (5)
- # test-check (23)
- # vim (9)
I'm using datomic cloud and i get the exception "http://grow.de I dont understand what the that means? why isn't it allowed? i assume their is something wrong with the function. Backing up, the goal is to enforce that every floor has a building. This is just a learning exercise, so i'm open to any interperation of how it would be best to solve this. code:
(defn floor-has-one-building-v4?
[db eid]
(let [building (d/pull db '[{:building/_floor [:building/name]}] eid)]
(= (count building) 1)))
(def predicate
{:db/ident :floor/guard4
:db.entity/attrs [:floor/name]
:db.entity/preds 'grow.dev/floor-has-one-building-v4?})
(comment
(d/transact conn {:tx-data [predicate]}))
(d/transact conn {:tx-data [{:building/name "Big Building"
:building/floor [{:floor/name "bottom"
:db/ensure :floor/guard4}]}]})
I second what ghadi said. I just noticed that your "exception" message says "... by datomic/on/config". If that isn't a slack typo, it needs to be datomic/ion-config.edn
(per https://docs.datomic.com/cloud/ions/ions-reference.html#ion-config)
@drewverlee entity predicates need to be on the classpath of the primary compute group
you need to deploy them to the transactor using https://docs.datomic.com/cloud/ions/ions-reference.html#ion-config
entity preds do not run on the client submitting the transaction, they run on the server (the primary/transactor)
Below is from the datomic documentation -
The V-leading index VAET supports efficient queries for references between entities, analogous to a graph database.
The combination of EAVT and VAET supports arbitrary nested navigation among entities. This is like a document database but vastly more flexible. You can navigate in any direction at any time, instead of being limited to the containment hierarchy you selected when storing the document.
The above tells me that datomic is a good fit where the data is being modelled as a graph / document
.
Are there any examples of graph data / document data
being modelled in datomic ? Most examples I see is of relational / cloumnar
types.@murtaza52 There’s a lot of overlap there.
For a document store, you just need an entity identifier and some attributes on that entity.
For graphical data, you just need to reference other entities (via :db.type/ref
).
thanks @U07S8JGF7