This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-27
Channels
- # announcements (11)
- # asami (7)
- # babashka (140)
- # beginners (58)
- # calva (12)
- # clj-kondo (5)
- # cljsrn (9)
- # clojure (60)
- # clojure-australia (8)
- # clojure-boston (1)
- # clojure-europe (35)
- # clojure-france (2)
- # clojure-germany (5)
- # clojure-italy (8)
- # clojure-nl (7)
- # clojure-sweden (14)
- # clojure-uk (23)
- # clojurescript (16)
- # community-development (2)
- # cursive (7)
- # datomic (6)
- # docker (1)
- # emacs (4)
- # fulcro (11)
- # graalvm (5)
- # honeysql (6)
- # jobs (6)
- # jobs-discuss (36)
- # lsp (19)
- # malli (7)
- # meander (8)
- # off-topic (18)
- # pathom (16)
- # practicalli (33)
- # re-frame (43)
- # react (2)
- # remote-jobs (11)
- # sci (83)
- # shadow-cljs (55)
- # tools-deps (48)
Thanks for the detailed answer @quoll. Weighted edges with a multigraph should be good enough for what I'm trying to do at the moment - though my use-case definitely isn't important enough for to you move anything up your to-do list(!)
Re: how to access edge properties - I'm probably not qualified to answer, I'm very new to Clojure, never used Datomic and have only been looking into asami for the past ~24 hours.
Coming from Neo4j, i've always found the Cypher syntax to be very intuitive
MATCH (p1:Person {name:'alice'})-[f:FRIEND]-(p2:Person {name:'bob'})
RETURN f.date
But no idea how to turn that into something Datomic-y...
Stick another variable in front of the edge to let you use it later on in the :where
? 🤷
'[:find ?date
:where [?p ?f:friend ?p2 ]
[?p :name 'alice']
[?p2 :name 'bob' ]
[?f :date ?date ]
That’s possible. I’m a bit uncomfortable pulling apart symbols more than I already do.
One other approach is metadata on the pattern. After all, it’s not the :friend
attribute that you’re talking about, it’s the edge between 2 nodes that uses the :friend
attribute for the edge
'[:find ?date
:where ^?f [?p :friend ?p2 ]
[?p :name 'alice']
[?p2 :name 'bob' ]
[?f :date ?date ]]