asami

Asami, the graph database https://github.com/threatgrid/asami
kj 2021-04-27T08:59:02.287800Z

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  ] 

quoll 2021-04-27T16:47:11.290600Z

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

quoll 2021-04-27T16:49:12.291400Z

'[:find ?date
  :where ^?f [?p   :friend  ?p2    ]
             [?p   :name    'alice']
             [?p2  :name    'bob'  ]
             [?f   :date    ?date  ]]

quoll 2021-04-27T16:50:00.292100Z

Right now, it’s trivial to just make it: [?p :friend ?p2 ?f]

quoll 2021-04-27T16:50:16.292500Z

But just because it’s easy doesn’t mean I should do it that way

quoll 2021-04-27T16:51:35.293800Z

There are some incompatibilities between Datascript, Datomic and Asami. If I did this final one (the easiest one), then I would be creating a much bigger incompatibility

refset 2021-04-27T20:56:51.296500Z

you could always use a map 🙂 [?p :friend ?p2 ?f] -> {:entity ?p :attribute :friend :value ?p2 :edge ?f}