Fork me on GitHub
#datomic
<
2019-04-21
>
joshkh11:04:03

Anyone up for helping me with a Datalog query? 🙂 Given a collection of "group" entities with references to "item" entities:

[{:label "group1"
  :items [{:kind :hat} {:kind :scarf} {:kind :shoe}]}
 {:label "group2"
  :items [{:kind :shoe}]}
 {:label "group3"
  :items [{:kind :hat} {:kind :shoe}]}]
Is it possible to bind all group entities, and any related entities of :kind :hat, resulting in something like:
=>
[
 ["group1" [{:kind :hat}]]
 ["group2" [nil]]
 ["group3" [{:kind :hat}]]
]
I can't do :where [?group :items ?items] [?items :kind :hat] because that excludes groups without :hat items, and I want all groups regardless. I could use map specifications in the pull syntax and then filter items for just :hats outside of the query, but I'm curious if there's a way to handle the scenario in pure datalog.

johanatan19:04:05

is anyone running datomic on java 11? i had been resolving the java.xml.bind missing issue with DATOMIC_JAVA_OPTS="--add-modules java.xml.bind" but that seems to no longer be working. any other workarounds/fixes?

😞 4
favila21:04:27

This trick only works up to 10. At 11 that package is removed from the jdk and you need the actual jar

johanatan21:04:12

So I need to download the jar, place it on the filesystem and modify the classpath to reference it?

favila21:04:43

You are likely to have other issues though

favila21:04:52

We run peers on java 11 but gave up running the txor on 11. We are sticking to 8 until it’s explicitly supported

favila21:04:18

There was some ssl netty issue, details hazy

favila21:04:34

Probably a dep update would have fixed

johanatan21:04:44

Hmm, well the weird part here is I have no idea how my underlying Java was even upgraded. It’s a light sail instance that’s been up for months and I didn’t explicitly reboot or ask it to update java

johanatan21:04:36

I suppose Java 8 is somewhere still on the system so I could conceivably explicitly reference it from my cron tab

johanatan21:04:58

(For nightly backups to s3 via bin/datomic)

favila21:04:02

What is the base OS?

favila21:04:35

Of a Lightsail instance. What is everything running on top of?

favila21:04:09

update-java-alternatives -l will show you what Java’s are installed and let you pick a different default

favila21:04:05

Warning, what Ubuntu calls openjdk11 is actually java 10 for...reasons

johanatan21:04:55

Seems like 8 is the safest choice here though yea?