Fork me on GitHub
#datomic
<
2023-01-19
>
Dave01:01:23

Beginner Datomic question. What is the difference between this:

{:namespace :cartographer.entity/user,
 :added-in-app? true,
 :ident :user/country,
 :value-type :db.type/ref,
 :cardinality :db.cardinality/one,
 :attribute? true,
 :deprecated? false,
 :references-namespaces (:cartographer.entity/country)}
produced using https://schema-cartographer.com/ and this:
{:db/ident :user/country-ref
 :db/valueType :db.type/ref
 :db/cardinality :db.cardinality/one}
which is in my schema.cljc schema.edn file?

Jarrod Taylor (Clojure team)02:01:40

Hi Dave. It appears as though you are looking at the contents of the edn file that is expected to be loaded into the schema-cartographer ui and used by the app to build the visualizations. You get that file when clicking Download Schema File in the app options. Clicking Download Schema Transactions will give you schema that can be transacted in a repl to a db if that is what you are looking for.

Dave03:01:24

Thanks, Jarrod. I thought I understood what Datomic schema looks like, e.g., the format I see in https://docs.datomic.com/on-prem/schema/schema.html#composite-tuples, but it appears there is not a canonical format? With your help and (our developers') @U0D5RN0S1's and @U9MHWQFFW's help, I'm bound and determined to understand the nuances.

Dave03:01:13

Btw, I'll be at Clojure/Conj so hope to see you there.

Jarrod Taylor (Clojure team)13:01:42

With that attitude I’m sure you will be proficient very quickly. What specifically do you not understand about the schema? Although it doesn’t focus exclusively on schema you may want to take a loot at https://max-datom.com. Afterwards I would recommend installing dev-local and experiment with creating, transacting to and querying your own databases locally.

Dave13:01:06

Thanks, Jarrod. Couple of your colleagues, Dave who sold me on using Datomic in the poc Cognitect built for us, and Marshall who patiently fielded subsequent questions from me, did help me grasp the fundamentals. But there's lots I still don't understand. This is the result of me just not taking the time. As a non-coding founder (I'm a supply chain or problem domain guy) I've held back because the folks who are building our app do know this stuff. Perhaps this has been an excuse long enough. I need to have a good enough understanding of this stuff in order to convey the vision for what it is we're building. In order to do that, I need to learn how to "do". Thanks for the video.

Dave14:01:38

Cartographer question @U0508JRJC. Unique value doesn't seem to be an option as my only options are true and false with true defaulting to unique identity. So my workaround was to downloaded my Schema example file, change "identity" to "value", then upload into cartographer. I confirmed this change stuck by downloading the Schema example file again. However, when I download the Schema Transactions version of that same changed Schema file, I see that "value" has been changed back to "identity" which I don't want. Obviously I can use the same workaround for the Schema Transactions file but thought it worth checking if this is intentional behavior. Also, if I use the same workaround for the transactions file, do the :doc string annotations still hold. For example, if "identity" produces the following :annotation-attrs

{:db/ident :cartographer/entity,
   :db/valueType :db.type/keyword,
   :db/unique :db.unique/identity,
   :db/cardinality :db.cardinality/one,
   :db/doc
   "Creating an entity with this attr will cause its value to be considered an entity-grouping namespace in the application."}
would the doc string above still hold true if it became
{:db/ident :cartographer/entity,
   :db/valueType :db.type/keyword,
   :db/unique :db.unique/value,
   :db/cardinality :db.cardinality/one,
   :db/doc
   "?."}

Jarrod Taylor (Clojure team)18:01:38

Thanks for all the feedback @U01040R5CJY if you feel so inclined open up issues for the enhancements in the github repo. I will get around to adding them when I have some time to focus on the task https://github.com/JarrodCTaylor/schema-cartographer-ui.

Dave00:01:24

Been modeling away these last few days, @U0508JRJC. This is a great tool! Wish I had come across it sooner. The scope of https://edgewoodsoftwarecorp.s3.us-east-2.amazonaws.com/CoalesceIntroduction.mp4 is large and horizontal. I think sharing a complete picture of our entity groupings for MVP will be very helpful to my developers. I've figured out what not to do generally speaking so no issues to speak of. Thanks again for checking back. Cheers!

jdkealy17:01:54

is there some way to find all records where a specific attribtue was overwrittten once or more

favila17:01:55

What’s a “record”?

favila17:01:02

Also I guess what’s “overwriting”? Does this mean “asserted more than once”?

favila17:01:17

does retracting completely count as overwriting?

favila17:01:01

Assuming the attribute is not a noHistory attribute, you can do any of these with a history database and d/datoms or a query just looking at datom sets that share an A and E