This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-01
Channels
- # bangalore-clj (1)
- # beginners (16)
- # bigdata (1)
- # boot (16)
- # cljs-dev (79)
- # cljsjs (37)
- # cljsrn (62)
- # clojars (1)
- # clojure (260)
- # clojure-austin (3)
- # clojure-dev (3)
- # clojure-dusseldorf (3)
- # clojure-italy (1)
- # clojure-russia (32)
- # clojure-serbia (2)
- # clojure-spec (8)
- # clojure-uk (146)
- # clojure-ukraine (16)
- # clojurescript (66)
- # cursive (27)
- # datomic (57)
- # dirac (124)
- # emacs (10)
- # hoplon (12)
- # juxt (6)
- # keechma (6)
- # lein-figwheel (18)
- # leiningen (6)
- # lumo (51)
- # off-topic (1)
- # om (66)
- # onyx (41)
- # perun (1)
- # play-clj (1)
- # protorepl (9)
- # re-frame (20)
- # reagent (11)
- # ring (4)
- # ring-swagger (10)
- # rum (22)
- # specter (8)
- # sql (2)
- # test-check (5)
- # untangled (27)
- # yada (29)
releasing Datomock 0.2.0, with support for the Log API: https://github.com/vvvvalvalval/datomock
I’m trying to reuse the rules and failing to produce the most basic working example:
(def rules '[[(doc-is [?x] ?e) [?e :db/doc ?x]]])
(d/q '[:find ?e :in $ % ?x :where [(doc-is ?x ?e)]] db rules “test-doc”)
The query compiler throws Unable to resolve symbol: doc-is in this context
- what am I doing wrong?ok, you’re not supposed to put the rule invocation inside square brackets - problem solved!
We are running on cassandra and I was trying to forward port 9042 to a local port and have console connect to datomic:
it seems this connection works, but as soon as you select a database Artemis will throw a ActiveMQNotConnectedException[errorType=NOT_CONNECTED message=AMQ119007: Cannot connect to server(s). Tried with all available servers.]
Is there a simple way to restrict a variable in a datalog query to all entities that are (or are not) referenced by any other entities, via any attribute?
How could I possibly solve this? Which connection is failing? From the transactor to the localhost? Or the other way around?
I assume it's from localhost to the transactor, but how does cassandra store the transactor's address?
Cassandra storage has written into it two transactor addresses, as provided by your transactor.properties file
@val_waeselynck sorry i missed your message yesterday. Do you have a small repro?
marshall: not seeing a leak at all, I just want to know if I can count on that to be the case for future versions - I don't want to be relying on an implementation detail
My use case is the implementation of Datomock forked connections, in which forked connections keep a reference to the Log of the original connection.
(d/q '[:find ?e
:where
[?vt :db/ident :db.type/ref]
[?a :db/valueType ?vt]
[_ ?a ?e]])
@donaldball you could put in a clause with the entity ID of your entity of interest in the v position
@donaldball or use (into #{} (map :v) (d/seek-datoms :vaet))
to get all referenced entities
Maybe you mean "any entity which has other assertions on it, but which is not referenced by other assertions"
I think this would do it, but I'm not sure it would run:
[:find ?e
:where
[?vt :db/ident :db.type/ref]
[?a :db/valueType ?vt]
(not [_ ?a ?e])
[?e]
I suppose I mean “there do not exist any datoms in the current database which have attributes which are references to the datom in question"
… yes
Sorry, I haven’t quite gotten the datomic language fully integrated yet 😛
[?vt :db/ident :db.type/ref]
[?a :db/valueType ?vt]
(not [_ ?a ?e])
will work, if you are able to bind ?e
earlier in the queryIf you want all unreferenced entities, you may not be able to query in a sensible amount of time in a query (you will need a table scan, and the query engine will not allow that)
@donaldball OK I think this will do it efficiently:
(let [partition-key-by (fn [f]
(fn [xf]
(let [last (volatile! (Object.))]
(fn
([] (xf))
([r] (vreset! last nil) (xf r))
([r x]
(let [k (f x)]
(if (= k @last)
r
(do
(vreset! last k)
(xf r k)))))))))]
(->> (sequence
(comp
(partition-key-by :e)
(remove #(first (d/seek-datoms db :vaet %))))
(d/datoms db :eavt))
;;; just so we don't explode
(take 10)))
with the 0.9.5530 peer server/clojure client, I’m getting an error {:datomic.client-spi/request-id 782ba011-a723-4f9e-b25c-93338d389785, :cognitect.anomalies/category :cognitect.anomalies/incorrect, :cognitect.anomalies/message :db.error/tempid-not-an-entity tempid used only as value in transaction, :dbs [{:database-id datomic:
, but this same transaction succeeds for me using an in-memory database
csm: using strings as tempids?
I think upgrading to 5544 has the fix. Check out this thread https://groups.google.com/forum/#!topic/datomic/m6vSa6CjqjQ
Hi everyone, I'm doing something interesting that uses time-querying. Basically, I want to know the users username when they posted a thing
since they can change their username (but never their email) i want to find out what they had their username set to at the time of posting
to stay historically consistent
firstly, thoughts? should i even bother? i think it's a cool feature, and an interesting practical use of datomic's capabilities...
secondly, if i were to do this, how do I query for it ? get the creation date of the item, query for the user's username at that db instant, and synthesize them, i think it's a winning approach...