Fork me on GitHub
#datomic
<
2020-07-06
>
ataggart04:07:15

Is there a way to unify two logic variables together, similar to how ground unifies a logic variable with a constant? I tried =, but it doesn't appear to work, as this contrived example shows:

(def query '[:find ?x ?y
             :in $ % ?x
             :where
             (foo? ?x ?y)])

(def ground-y '[[(foo? ?x ?y)
                 [(ground :y) ?y]]])

(def unify-x-y '[[(foo? ?x ?y)
                  [(= ?x ?y)]]])

(d/q query (d/db conn) ground-y :x)
; #{[:x :y]}


(d/q query (d/db conn) unify-x-y :x)
; Execution error (Exceptions$IllegalArgumentExceptionInfo) at datomic.error/arg
; (error.clj:79). :db.error/insufficient-binding [?y] not bound in expression
; clause: [(= ?x ?y)]

favila13:07:55

the identity function

favila13:07:42

[(identity ?x) ?y]

favila13:07:31

I’m not sure what you want to do is called unification

favila13:07:32

you want a “alias” or “clone” of a set with a different name so you can avoid some unifications or unify in different clauses

favila13:07:18

this identity is also useful for self-joins:

favila13:07:16

[(identity ?x) ?y] [(!= ?x ?y)] [?x :foo/position ?xp] [?y :foo/position ?yp] [(> ?xp ?yp)] silly example

ataggart22:07:28

@U09R86PA4 That did it, thanks!

Ramon Rios10:07:28

:db.error/not-an-entity Unable to resolve entity: :policy-coverage/vt" Hello, what could be the reasons that my datomic is not founding this field?

marshall13:07:51

you have likely not installed an attribute :policy-coverage/vt

Ramon Rios13:07:16

I did it, it was that. Now my issue is convert the date type

Ramon Rios13:07:56

Now i'm looking after how to convert local-date to inst

Ertugrul Cetin11:07:16

Hi all, there is a Datomic migration library called conformity which supports only Peer API not Client API, so I was considering to use Datomic Cloud and is there any migration library that supports Client API?

kschltz12:07:47

Depending on how active is this repo, I would consider reaching out to conformity's maintainers and ask if there are any plans on supporting client api, if not, maybe asses how much work would be needed to add it yourself, If you're lucky, maybe it isnt much of a hassle

Ertugrul Cetin13:07:24

@UNAPH1QMN how are you guys handling migrations in Datomic Cloud? Just sending all edns to transact fn?

kschltz13:07:18

Basically, yes. We centered our schema in a exclusive repository, shared among the contexts where it is relevant and agreed upon only extend it, never removing fields, something along the lines of: https://docs.datomic.com/on-prem/best-practices.html#grow-schema

bamarco21:07:26

@U0UL1KDLN I am considering updating conformity for use with cloud (I am still not completely settled on migration). It should not be too difficult I rewrote the internals to work with datascript at one point (never submitted a pr though as it seemed pretty specific to our use case). I am trying to get my cloud instance up and running first though.

👍 3
bamarco21:07:03

@lanejo01 Thanks I got the logging working. I am back to the IAM permissions problem again unfortunately. I am getting arn:aws:sts::<42>:assumed-role/<my-datomic>-Compute-<compute-id>-us-east-1/i-<other-id> is not authorized to perform: dynamodb:PutItem on resource: arn:aws:dynamodb:us-east-1:<42>:table/sockets (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: AccessDeniedException; Request ID: <ABCDEFG>) in my lambda output I have attached arn:aws:iam::<42>:policy/sockets-lambda-policy to the Optional Configuration Existing IAM policy for instances for my <my-datomic> stack. (that is root stack, not the compute stack, I am not sure if that was correct, but when I went to update the compute stack it recommended I update the root stack) The policy is the following:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "dynamodb:BatchGetItem",
                "dynamodb:GetItem",
                "dynamodb:Query",
                "dynamodb:Scan",
                "dynamodb:PutItem",
                "dynamodb:DeleteItem"
            ],
            "Resource": "arn:aws:dynamodb:us-east-1:<42>:table/socket"
        }
    ]
}

Joe Lane21:07:47

You have to bounce the compute nodes before the policy is picked up, have you done that?

Joe Lane21:07:14

Also, your resource is socket but the error message is sockets

Joe Lane21:07:26

@mail524 ^ Maybe check that first?

bamarco21:07:14

I don't know what bounding the compute nodes means

Joe Lane21:07:24

Restarting the machines, either through a deployment, redeployment, an upgrade, or adjusting the EC2 ASG. A deployment would likely be simplest

Joe Lane21:07:14

But first I would check if the resource name in your policy is correct.

bamarco21:07:51

the names was in fact the problem

bamarco21:07:59

thanks again 🙂

souenzzo22:07:07

Hello I'm getting

(cast/dev {:msg "ok"})
Execution error (IllegalArgumentException) at datomic.ion.cast.impl/fn$G (impl.clj:14).

souenzzo22:07:30

When I look at datomic.ion.cast.impl/Cast There is no :impls key

souenzzo22:07:10

com.datomic/ion          {:mvn/version "0.9.43"}
com.datomic/client-cloud {:mvn/version "0.8.96"}

marshall22:07:02

Is this running locally or deployed in an ion?

souenzzo22:07:16

Wired:

(cast/initialize-redirect :stdout)

=> :stdout
(cast/initialize-redirect :stderr)

=> :stdout
(cast/initialize-redirect "out.txt")

=> :stdout

souenzzo22:07:49

datomic.ion.cast.impl/Cast
=>
{:on datomic.ion.cast.impl.Cast,
 :on-interface datomic.ion.cast.impl.Cast,
 :sigs {:-alert {:name -alert, :arglists ([_ alert-map]), :doc nil},
        :-event {:name -event, :arglists ([_ event-map]), :doc nil},
        :-dev {:name -dev, :arglists ([_ dev-map]), :doc nil},
        :-metric {:name -metric, :arglists ([_ metric-map]), :doc nil}},
 :var #'datomic.ion.cast.impl/Cast,
 :method-map {:-metric :-metric, :-event :-event, :-dev :-dev, :-alert :-alert},
 :method-builders {#'datomic.ion.cast.impl/-event #object[datomic.ion.cast.impl$fn__2905
                                                          0x3931e29f
                                                          "datomic.ion.cast.impl$fn__2905@3931e29f"],
                   #'datomic.ion.cast.impl/-alert #object[datomic.ion.cast.impl$fn__2918
                                                          0x74973c24
                                                          "datomic.ion.cast.impl$fn__2918@74973c24"],
                   #'datomic.ion.cast.impl/-dev #object[datomic.ion.cast.impl$fn__2931
                                                        0x39a0a1ce
                                                        "datomic.ion.cast.impl$fn__2931@39a0a1ce"],
                   #'datomic.ion.cast.impl/-metric #object[datomic.ion.cast.impl$fn__2944
                                                           0x34926735
                                                           "datomic.ion.cast.impl$fn__2944@34926735"]}}

marshall13:07:48

can you share the full stack trace when you called cast/dev please

souenzzo13:07:08

It's working today 😞 What should i do in the days that it's not working?