This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-03
Channels
- # announcements (1)
- # babashka (22)
- # beginners (176)
- # calva (10)
- # cider (4)
- # circleci (5)
- # cljsrn (20)
- # clojure (28)
- # clojure-europe (11)
- # clojure-italy (5)
- # clojure-nl (5)
- # clojure-spec (1)
- # clojure-sweden (2)
- # clojure-uk (29)
- # clojuredesign-podcast (4)
- # clojurescript (38)
- # code-reviews (25)
- # conjure (1)
- # core-typed (1)
- # data-science (16)
- # datomic (23)
- # figwheel-main (16)
- # fulcro (48)
- # helix (9)
- # jobs (3)
- # juxt (5)
- # kaocha (17)
- # malli (19)
- # mount (9)
- # nrepl (4)
- # off-topic (35)
- # pathom (7)
- # re-frame (28)
- # reagent (26)
- # reitit (1)
- # releases (1)
- # remote-jobs (5)
- # sci (6)
- # shadow-cljs (36)
- # spacemacs (3)
- # sql (8)
- # tools-deps (13)
- # unrepl (1)
- # vim (4)
- # xtdb (8)
I'm in need for some suggestions. I need to be able to create, manipulate, and serialize a graph. This graph can have cycles, each node is a map where keys are just keywords and values are either regular values of any kind or a link to a node or a vector/map of links to nodes. Possible manipulations include everything - changing/adding/removing nodes and node attributes, without any assumptions. The serialization needs to be fully controlled - a thirdparty library will be the recipient of the data. A very nice thing to have would be a nice user-friendly interface. I'm porting a Python library to Clojure and it would be great if the users could manipulate the graph easily, without me having to write wrappers for all operations. Are there projects that do something like that? Or maybe it's actually pretty simple to implement and I just don't see it?
As an additional complication - all isolated nodes need to be automatically removed on each graph change. E.g. if I have a graph like
{:root {:children [(node :A)]}
:A {:x (node :B)}
:B {:text "hello"}}
and then do (assoc-in graph [:A :x] 1)
or something equivalent (but probably using the interface of some graph library), the node :B
must be removed.All that together doesn't sound simple. My first guess would be a graph db would be a good starting point. https://github.com/gorillalabs/neo4j-clj/blob/master/example/src/example/core.clj but might be overkill. Also depends on size/availability etc.
Thanks! Oh, it all has to be in memory. Availability and everything around it is not a concern as I'm trying to create a library and not a framework or a platform.
you may want to check out loom and loom compatible libraries like ubergraph. https://github.com/aysylu/loom https://github.com/Engelberg/ubergraph there's even an function for finding isolated nodes: https://cljdoc.org/d/aysylu/loom/1.0.2/api/loom.alg#loners
I believe you can even use your own representation and still have all the algorithmic functions apply if you implement the appropriate interfaces, https://cljdoc.org/d/aysylu/loom/1.0.2/api/loom.graph
Yep, those were easy to find, so I've checked them out. But using them would really just be shoehorning a library only because it has the word "graph" in its description IMO. You see, it doesn't distinguish between different kinds of edges. Consider this graph, for example (using capitalized keywords to denote nodes):
{:Plot {:left [:Axis], :right [:Axis, :ColorBar]}
:Axis {}
:ColorBar {}}
Modeling this in terms of nodes and edges as loom
and ubergraph
think about them would be... problematic.edges can have attributes
and you can use your own representation and still use the loom algorithms
mapgraph might be more up your alley: https://github.com/stuartsierra/mapgraph
it's less general than loom or ubergraph but more in the realm of what you seem to be looking for: talking about simple data that happens to be a graph
@U7RJTCH6J Mmm, yeah, then my statement about "different kinds of edges" is incorrect. Still though - it would be quite hard to model that simple map as a loom
graph.
@U4YGF4NGM Thanks, I'll check it out!
yea, I'm still not sure it's a good fit for your use case, but if that was the only thing holding you back, it still might have been
there's a couple other libs out there similar to it. something like datascript could also be nice, if you want advanced query-ability
like this one has a more specific (and complex) API but it's still all about data, less about graphs: https://keechma.com/guides/entitydb/
Nice, thanks. I definitely want to avoid DataScript, I'm trying to keep it as close to the real data as possible.
I don't understand what you're saying. The code blocks that I have provided above already form a graph. Just not in a way that various graph libraries might want.
The way the target library wants it. Every node will be assigned an ID and put in a id->node
map, and every node reference will be replaced with {:id id}
.
That has nothing to do with the aforementioned "ways to implement a graph", if that's what you're hinting at.
regarding the video streaming topic: discord is IMO the worst option here. We recently switched from googleMeet to discord at work but it keeps crashing big times on a lot of machines here (mostly linux)… Jitsi is also an option to consider. Its open source so it’s even possible to host it yourself if one is keen to do it.
yeah jitsi is the best
I feel most happy with Jitsi too. The fact that you can host it yourself, you can read the code, and it seems to respect your privacy. Nice feature: see time every participants has spoken.
oh yeah - that feature promotes a "competition" to see who can do the most listening :D
I love Jitsi too. Just note that E2E encryption isn't enabled by default. You have to set a key manually, and it only works on Chrom* 83+. See https://jitsi.org/security/
Hi all, is there a command to bump all dependencies in project.clj to their latest version?
you might try in #lein but I think lein ancient
has an option for this
Fantastic thank you