Fork me on GitHub
#datomic
<
2018-05-11
>
Flexes12:05:44

@hmaurer I am. And that container is running in a swarm.

hmaurer12:05:10

@pat839 where are you trying to access it from? I tried to run Datomic on Kubernetes a while ago. If I recall correctly I configured host=0.0.0.0 and I had to configure alt-host as well

Andreas Liljeqvist14:05:17

Tips for using Datomic with an SPA? At the moment using re-frame.

eraserhd14:05:17

Alright, so it seems in Datomic, you can use arbitrarily nested Clojure expressions, so long as any variables are used at the top-level. e.g., you can't do [(first (.split ?foo)) ?bar], but you can do [((fn [^String s] (first (.split s))) ?foo) ?bar].

jjfine16:05:56

how do i restart a peer after doing a restore-db without stopping the jvm? is datomic.api/shutdown sufficient?

misha18:05:00

did anyone try to "reify" datom? say, I need to save a fact that an entity e1 relies on [e2 :foo/bar :baz], what do I do?

favila18:05:33

if you can make it match along tx boundaries, you can reuse the TX itself as the reified object

favila18:05:23

if you need to be more granular, you need to explode the assertion into its own entity

favila18:05:18

e.g. {:db/id e2 :attr :foo/bar :valueKeyword :baz}

favila18:05:49

up to you whether the value of :attr is an actual datomic attribute or other ordinary entities

misha18:05:24

yeah, the second option fits better, but "explode" describes pretty well how I feel about it, since such dependencies are maybe ~5% out of all the data I expect, and impose this explosion on everything else – is daunting

favila18:05:51

you want to make arbitrary higher-order assertions?

favila18:05:34

would a weak reference be ok?

misha18:05:47

I need very diverse graph, where such dependencies are not predefined, but rather indicated by user

misha18:05:16

lots of nodes, of lots of "types".

favila18:05:30

datomic is not as flexible as RDF (if that is where you are coming from). the only reification datomic has is transactions

misha18:05:33

as opposed to lots of nodes of few types

favila18:05:09

are the types user-created?

misha18:05:44

I think I need transactions for something else, and "overloading" those with this use case is kinda shooting future myself in a foot

misha18:05:58

not all, but essentially yes

favila18:05:14

if they are user-created, exploding is probably a better idea--represent the types as data rather than schema

favila18:05:25

you don't want users transacting schema

misha18:05:44

yeah, that was my plan B opieop

misha18:05:57

but I had to doublecheck

favila18:05:34

something to consider: you can "lower" into datomic for ease-of-use

favila18:05:15

i.e. source of truth is is a higher-order db, but you can derive another one where user types are lowered into datomic attributes and the reification goes away

misha18:05:26

2 datomics one on top of the other?

favila18:05:45

you read one db to generate the other one

favila18:05:08

use the generated one as read-only

misha18:05:56

ah. the nature of user types would likely be volatile enough to make dynamically creating schema and DB - not an option

misha18:05:38

on the other hand, those db should be fairly small, so it might work...

favila19:05:15

the purpose would only be to remove the awkwardness of working with higher-order expressions

favila19:05:35

I guess a datomic rule can remove some of it

misha19:05:28

I will try hard, because I want datalog for this no matter what : )

misha19:05:36

sql will be nightmare, aql, cypher, etc. – life is too short for all those

favila19:05:43

`[(usermatch ?e ?a ?v) [?e :user/attr ?a] [?a :user.attr/type ?real-a] [?e ?real-a ?v]]`

favila19:05:57

something like that

favila19:05:00

instead of [?e ?a ?v] (attr-as-schema) you would use (usermatch ?e ?a ?v) (attr-as-user-data)

misha19:05:54

that might work

misha19:05:51

now need to consider the rest of the requirements. thank you again