asami

Asami, the graph database https://github.com/threatgrid/asami
simongray 2021-04-26T12:39:37.265600Z

Loom is still alive! 😄 https://github.com/aysylu/loom/commits/master

kj 2021-04-26T14:18:12.267400Z

possibly a stupid question: does asami allow you to associate weights (or other properties) to edges? (Like setting properties on a relationship in Neo4j: (:Person {person_id:'123'})-[:FRIEND {date:'1972-01-01'}]->(m:Person {person_id:'456'}) [I.e. Person 123 and Person 456 have been friends since 1972-01-01] )

quoll 2021-04-26T17:21:37.268200Z

If you use the in-memory multi graph then yes

quoll 2021-04-26T17:22:35.269400Z

URL scheme is asami:multi:

quoll 2021-04-26T17:24:28.271600Z

You can add edges multiple times, or if you use the graph update function on a connection, you can update the graph with another function that lets you set the number more directly

quoll 2021-04-26T17:25:23.272600Z

(The index keeps a count value for edges. It does not store multiple edges)

quoll 2021-04-26T17:26:19.274Z

Cisco was using this specifically to weight edges that were being displayed, so the plotting algorithm could make useful decisions on layout

quoll 2021-04-26T17:36:45.274200Z

This is done by passing a connection to the function asami.storage/transact-update along with a function that receives a graph and a transaction number to use. That function can then call asami.multi-graph/multi-graph-add e.g.

(storage/transact-update my-connection
  (fn [graph txid]
    (multi-graph/multi-graph-add graph entity attribute value txid weight)))

quoll 2021-04-26T17:47:52.274900Z

Oh, sorry @kiran.joshi. I was on my phone and didn’t read the full question about other properties.

quoll 2021-04-26T17:48:03.275300Z

For now, multigraphs have weight

quoll 2021-04-26T17:49:20.276600Z

Durable storage has allocated an ID for every statement (i.e. each individual edge), and properties can be given to these. BUT… I haven’t exposed it, because I don’t know what the API should look like yet

quoll 2021-04-26T17:49:45.277100Z

I thought that this was a decision I could put off for a while longer, because no one had asked for it 🙂

quoll 2021-04-26T17:54:56.278300Z

This isn’t an afterthought. It would be slightly cheaper to not have these IDs. But I wanted to support reification on edges, specifically like this, so I built it in

quoll 2021-04-26T17:55:45.279200Z

If anyone has ideas on how they want to access this (specifically, by querying), then please let me know.

quoll 2021-04-26T17:56:34.280200Z

At this point, the easiest way would be as a 4th element in a pattern in the :where clause. But I’ve been reluctant to do that because that has a completely different meaning in Datomic