Fork me on GitHub
#datomic
<
2016-12-08
>
Matt Butler11:12:32

How do you pass a inputn created via collection binding to a rule

(myRule ?artist ?artist-name
[?artist :artist/name ?artist-name])

[:find ?release-name
 :in $ [?artist-name ...]
 :where 
        (myRule ?artist ?artist-name)
        [?release :release/artists ?artist]
        [?release :release/name ?release-name]]

Matt Butler11:12:39

It seems that it loses its orness when passed as a plain old variable same question applies for when passing it into a not-join, (the query i wish to use it on is a not-join wrapped in a rule) so not sure how to construct the args to the not-join

(myRule ?artist ?artist-name
(not-join [?artist ?artist-name]
[?artist :artist/name ?artist-name]))

erichmond16:12:18

Can anyone recommend a good tool for visualizing a schema?

erichmond16:12:35

It doesn't need to be automated or datomic specific

erichmond16:12:54

The last time I used one, I was using ERWin and writing EJBs

tjtolton18:12:25

in the return value of a pull from datomic, what kind of data is indicated by the #:keyword symbols? e.g.

tjtolton18:12:54

what is #:inv

tjtolton18:12:35

is that a normal clojure datatype?

tjtolton18:12:42

i dont think ive seen that before

pesterhazy18:12:59

neither have I

rauh18:12:03

That's the new namespaced keywords in 1.9

tjtolton18:12:24

was two colons not good enough?

tjtolton18:12:30

so that resolves to

{:inv/color {:db/ident :db/blue},
 :inv/size {:db/ident :db/large},
 :inv/type {:db/ident :db/dress}}

rauh18:12:14

Yes, see the last comment in the ticket on how to disable it

tjtolton18:12:57

no, what I just said is wrong, only the keys are expanded

tjtolton18:12:17

{:inv/color {:db/ident :blue},
 :inv/size {:db/ident :large},
 :inv/type {:db/ident :dress}}

tjtolton18:12:26

that's what it expands to

rafaelzlisboa18:12:39

should :db.type/instant fields be indexed if i’m going to query for a time period? e.g.

[:find ?action
 :where [?action :action/started-at ?started-at] [(> ?started-at ?last-week)]]

camdez18:12:08

@rauh @tjtolton: thanks for explaining that. Even if the syntax hurts my brain a little (hoping that will change with time).

timgilbert19:12:28

@tjtolton: I think it's actually this:

{:inv/color {:db/ident :db/blue},
 :inv/size {:db/ident :db/large},
 :inv/type {:db/ident :db/dress}}
...the #:db{ ... } syntax means the namespace will be applied to every key in the map

timgilbert19:12:05

Oh oops, never mind, you were right the second time, just the keys, not the values

christianromney23:12:24

Just bumped the Datomic Pro Starter Docker container (https://hub.docker.com/r/pointslope/datomic-pro-starter/) to version 0.9.5544