asami

2022-06-23T11:57:51.401719Z

So I'm curious, is this considered a bug?

(let [eg-db-uri "asami:"
      conn (asami/connect eg-db-uri)
      _ @(asami/transact conn {:tx-data [{:coord [0 0]}]})
      db (asami/db conn)]
  (asami/q
    '[:find [?e ...]
      :where
      [?e :coord [0 0]]]
    db))

#_=> ()
I'm aware you can do this:
(let [eg-db-uri "asami:"
      conn (asami/connect eg-db-uri)
      db (asami/db conn)
      new-node (zuko.node/new-node (asami/graph db))
      _ @(asami/transact conn {:tx-triples [[new-node :coord [0 0]]]})
      db (asami/db conn)]
  (asami/q
    '[:find [?e ...]
      :where
      [?e :coord [0 0]]]
    db))

#_=> (:a/node-65763)
I know it decomposes it, which is why it doesn't match and perhaps it's done for performance? However, this seems to fail the test of, I transact something in, I should be able to query it out. If there's some better way to query this that I'm missing, please tell me 😃...

quoll 2022-06-23T14:15:26.392599Z

No, it's not considered a bug. The first case is (currently) explicitly supposed to decompose the array into triples, and therefore the query is guaranteed to return nothing. The only time an array is not decomposed is if the property is :db/ident or :id

2022-06-23T15:10:26.572879Z

Hey @quoll, hope you're feeling better! Ok, so in which case I should probably work with triples explicitly then so I can query for stored structures.

quoll 2022-06-23T17:03:24.287149Z

Just to let people know… I had a private discussion with @folcon. Didn’t want people to think that I’m ignoring the channel 🙂

🙂 1