Fork me on GitHub
#datomic
<
2019-11-01
>
Quest00:11:35

Is it possible to use wildcard matching as part of a tuple value? example query against 2-element homogenous tuple:

[:find ?e
 :where [?e :nsm.entity/form [:todo _]]]
I want to match all entities with :todo as the first tuple element regardless of the value of the second element. Currently this query always returns an empty set.

onetom10:11:01

sorry, forgot to mention u. see my suggestion after your question

Quest22:11:25

I can confirm the [((comp #{:todo} first) ...)] solution as working. Thanks @U086D6TBN!

👍 4
Quest00:11:13

^Behavior reproduces on latest version datomic-pro-0.9.5981

onetom03:11:45

how about something like

[:find ?e
 :where
[?e :nsm.entity/form ?forms]
[((comp #{:todo} first) ?forms)]

Joe Lane04:11:09

I think you want untuple

Quest22:11:34

I can confirm untuple works in the following query:

'[:find ?e
  :where
  [?e :nsm.entity/form ?tup]
  [(untuple ?tup) [?a ?b]]
  [(= ?a :todo)]]
Thanks Joe!

Nems08:11:36

Hi everyone, after adding a private maven repo to my ions deps.edn I can't run the "clojure -A:dev -m datomic.ion.dev '{:op :push :creds-profile "dev" :region "eu-central-1"}'" command anymore. I always get the following error: Downloading: com/datomic/java-io/0.1.11/java-io-0.1.11.pom from <s3://datomic-releases-1fc2183a/maven/releases/>

{:command-failed
 "{:op :push :creds-profile \"rsdev\" :region \"eu-central-1\"}",
 :causes
 ({:message
   "Failed to read artifact descriptor for com.datomic:java-io:jar:0.1.11",
   :class ArtifactDescriptorException}
  {:message
   "Could not transfer artifact com.datomic:java-io:pom:0.1.11 from/to roots (): status code: 401, reason phrase: Unauthorized (401)",
   :class ArtifactResolutionException}
  {:message
   "Could not transfer artifact com.datomic:java-io:pom:0.1.11 from/to roots (): status code: 401, reason phrase: Unauthorized (401)",
   :class ArtifactTransferException}
  {:message "status code: 401, reason phrase: Unauthorized (401)",
   :class HttpResponseException})}
If I remove the private repo and the dependency of that repo it works again.

alexmiller12:11:15

By "private repo", I assume you mean one with creds in settings.xml? If so, can you successfully download deps using clj/deps.edn from it separately from the ion setup?

Nems08:11:17

Hi @U064X3EF3, yes a private repo with settings.xml. If we run clojure -A:dev all the dependencies get downloaded without an issue. It's only when we run clojure -A:dev datomic.ion.dev '{...}' that we run into this problem. I've tried following both links that @U05120CBV posted but they don't seem to solve the issue.

Nems08:11:27

Here's my deps.edn if that helps (with private maven repo)

{:mvn/repos {"datomic-cloud" {:url ""}
             "roots"         {:url ""}}
 :paths     ["src" "resources"]
 :deps      {org.clojure/clojure         {:mvn/version "1.10.0"}
             org.clojure/data.zip        {:mvn/version "0.1.3"}
             org.clojure/data.xml        {:mvn/version "0.2.0-alpha6"}
             org.clojure/core.async      {:mvn/version "0.3.442"
                                          :exclusions  [org.clojure/core.memoize]}
             org.clojure/core.memoize    {:mvn/version "0.7.2"}
             com.datomic/ion             {:mvn/version "0.9.35"}
             cheshire                    {:mvn/version "5.8.1"}
             clj-http                    {:mvn/version "3.10.0"}

             com.cognitect.aws/api       {:mvn/version "0.8.305"}
             com.cognitect.aws/endpoints {:mvn/version "1.1.11.559"}
             com.cognitect.aws/sqs       {:mvn/version "697.2.391.0"}
             com.cognitect.aws/s3        {:mvn/version "718.2.457.0"}
             com.cognitect.aws/ssm       {:mvn/version "718.2.451.0"}

             medley                      {:mvn/version "1.2.0"}
             camel-snake-kebab           {:mvn/version "0.4.0"}
             byte-transforms             {:mvn/version "0.1.4"}

             be.roots.mona/client        {:mvn/version "1.65.5-168"}
             }

 :aliases   {:dev    {:extra-deps {com.datomic/ion-dev            {:mvn/version "0.9.234"
                                                                   :exclusions  [org.slf4j/slf4j-nop]}
                                   com.amazonaws/aws-java-sdk-sts {:mvn/version "1.11.210"}}}
             :config {:extra-deps  {com.cognitect.aws/sts {:mvn/version "697.2.391.0"}}
                      :extra-paths ["config"]}
             :local  {:extra-deps    {com.datomic/client-cloud       {:mvn/version "0.8.78"}
                                      com.cognitect.aws/sts          {:mvn/version "697.2.391.0"}
                                      ch.qos.logback/logback-classic {:mvn/version "1.2.3"}
                                      ch.qos.logback/logback-core    {:mvn/version "1.2.3"}
                                      org.clojure/test.check         {:mvn/version "0.9.0"}
                                      org.clojure/tools.namespace    {:mvn/version "0.3.0-alpha4"}}
                      :extra-paths   ["dev" "sessions" "test-resources"]}}}

avfonarev09:11:33

What is the best approach when it comes to storing ordered data in Datomic? Say, someone wants to write yet another todo list app, where items can be reordered in a given list.

octahedrion11:11:06

@avfonarev assert each item like {:index i :item item}

refset13:11:16

@avfonarev to add to this suggestion, you may also want to consider using bisection keys rather than numbers e.g. https://github.com/Cirru/bisection-key (I've successfully used this with DataScript before, for modelling ordered lists)

avfonarev14:11:43

That is what I was leaning to. One can use amortization to reduce the number of writes per item this was.

bartuka13:11:10

I am using datomic analytics through presto and I deleted the database that was connected to it. After I recreate and populate the new database, presto cannot perform any query, always returning Datomic Client Exception error

marshall14:11:34

restart your presto server

marshall14:11:13

if you’re using cloud you can use the datomic-gateway script to restart the access gateway

marshall14:11:21

if you’re using on-prem, just kill and restart the presto server

bartuka19:11:31

I see, thanks marshal!! I will post your response into datomic dev forum so other people may benefit from this as well

bartuka13:11:24

the problem is certain related, but now sure how to proceed on that

ssdev16:11:34

Quick question: is there any restriction around using Lambdas & HTTP Direct at the same time?

dmarjenburgh16:11:27

An apigateway method integration has either a lambda proxy or a vpc link of course, but datomic supports both at the same time. Note that the apigw lambda event data will not be present in the http direct request

👍 4
drewverlee16:11:04

Attempting to call datomic.api/connect with my database uri string results in

Execution error (NullPointerException) at datomic.kv-cluster/kv-cluster (kv_cluster.clj:355).
null
if anyone has an idea what that implies it would be a big help. i assume i have a connection issue, configuration of the connection string or a networking issue.

Oleh K.16:11:45

Does datomic cloud have REST API?

chagas.vis18:11:49

Hello everyone, I am currently studying how I can use Clojure to a bioinformatics project. One of the first problems that I find is the lack of a library to work with data frames, I did some Google search but I did not find any information about some Clojure library that has any implementation like pandas (Python) or R.

zane21:11:25

Is anyone aware of open source compilers that compile a (subset, certainly) of SQL to Datalog?

Mark Addleman11:11:56

Not directly. I'm a fan of http://teiid.org/ which allows you to SQL-fy just about anything. I believe https://prestodb.github.io/ has similar capabilities.