Fork me on GitHub
#asami
<
2021-12-03
>
sb18:12:52

Is that possible drop the entity query drop after [?name :tg/contains ?h] line? My code is:

(map #(d/entity db-p6 %)
     (q '[:find [?h ...]
          :where [?full :p-id :user-id]
          [?full :p-tel ?name]
          [?name :tg/contains ?h]]
        db-p6))
; >> I get: ({..data..}{..data..}{..data..}) > that is ok 

sb18:12:11

as eg. [?h :tg/entity ..?i don't know?..] or that isn’t possible?

quoll18:12:27

sorry, I’m not clear on what you’re asking?

sb18:12:43

Sorry! I would like to get the data of the nodes without the first line ([:tg/node-59385] [:tg/node-59388] [:tg/node-59391]) is that possible add this at the end (:where part)?

quoll18:12:41

Can you explain what you mean please? That line doesn’t exist in that query

quoll18:12:51

And the query doesn’t return it

sb18:12:43

(q '[:find [?h ...]
          :where [?full :p-id :user-id]
          [?full :p-tel ?name]
          [?name :tg/contains ?h]
          --> can I add here [?h :tg/entity or similar here?]
        db-p6))

quoll18:12:15

OK… I can see that might return (:tg/node-59385 :tg/node-59388 :tg/node-59391)

sb18:12:44

Yes, this is what I get, therefore I added the first line. I’m new in datalog.. maybe my mistake

quoll18:12:53

you can add that. It will ensure that the object in the collection are only entities

quoll18:12:03

what are you looking for then?

sb18:12:08

I’m thinking about. I read the spec and I’m back.

quoll18:12:29

OK. Happy to help. I’m just trying to figure out what you’re looking for

sb18:12:19

I do apologise, I queried a bad key… always 😞 🤯 That was my mistake! everything ok!

👍 1