Fork me on GitHub
#datomic
<
2017-12-21
>
sova-soars-the-sora02:12:14

@luchini @daveeliepmann thank you and thank you. each tag can be authored by a different person. the reason i am keeping track of this is because: other users can "verify" a tag, which awards the original tagger a point. it's important to incentivize cooperative behavior in social platforms. I have a :tag/blurb and it sounds like you both agree I should put a schema property :blurb/tags with cardinality many... good idea and I agree.

luchini03:12:13

You should avoid duplicating bi-directional relationships manually. You can always use the reverse notation :blurb/tags or :tag/blurb depending on your scenario

sova-soars-the-sora03:12:26

Hmm I didn't know I could do that. That's cool. So if I have :tag/blurb ... then :blurb/_tag would return many of them, even if tag/blurb was a cardinality one?

luchini23:12:52

The way to reverse ir is to add _ to the keyword not to the namespace. So if you have a :tag/blurb of cardinality one, a :tag/_blurb will return you all tags that blurb has. It feels a bit upside down though (semantically speaking). You might just prefer to do :blurb/tags with a many cardinality and use :blurb/_tags to find all blurbs that have a certain tag.

adamfrey15:12:08

is it possible to update a datomic attribute from unique/value to unique/identity via transacting new schema?

adamfrey15:12:36

I just tried to do exactly that to a running datomic system, the schema attribute is listed as unique/identity now, but when I try to do an upsert, I still get a unique conflict.

adamfrey15:12:07

I see from this table that it should be possible http://docs.datomic.com/schema.html#altering-schema-attributes. I'll keep investigating why I'm not seeing the behavior I expect

eraserhd17:12:10

hmm, what's the easiest way to get datomic to unify with a constant value, for example in an or clause to handle a missing value.

eraserhd17:12:27

e.g (or [?thing :foo/bar ?value] [(str "(null)") ?value]) I guess?

eraserhd18:12:27

Oh, there's a bunch of new stuff, like ground.

gcast18:12:16

does anyone know if its possible to add new schema to a running db?

marshall18:12:01

you can assert new schema at any time

gcast18:12:58

do you per chance know where I may read about that? for some reason its not working for me.

marshall18:12:22

what specifically isnt working?

gcast18:12:23

well I transact and it appears to succeed but then I run this query,

[:find ?attr ?type ?card
               :in $
               :where
               [_ :db.install/attribute ?a]
               [?a :db/valueType ?t]
               [?a :db/cardinality ?c]
               [?a :db/ident ?attr]
               [?t :db/ident ?type]
               [?c :db/ident ?card]]

gcast18:12:32

and the new attributes are not there

marshall18:12:55

did you get a new value of the db after you transacted the schema?

gcast18:12:04

hmm well I just noticed that I do not do a blocking take when I transact

gcast18:12:13

I put the transact call in a do

marshall18:12:33

you’ll want to look at the returned value

marshall18:12:40

to make sure it was successful

gcast18:12:06

ok. thank you

gcast19:12:18

-_- forgot to request latest db before querying to confirm schema txs

souenzzo20:12:05

it's a great feature from datomic. 😄

marshall19:12:18

that’ll do it