asami

2024-11-07T11:01:04.986809Z

Probably silly question, but how do I avoid having to name attributes and just get all of them for each match? I'm schema-less for a reason ๐Ÿ™‚

quoll 2024-11-07T12:15:25.123919Z

Iโ€™m sorry, I donโ€™t follow what youโ€™re asking for here

2024-11-07T14:44:02.159299Z

(d/q '[:find  ?name ?adress :where [?m :name ?name] [?m :adress ?adress]] @asami-conn)

2024-11-07T14:45:04.735749Z

Can I avoid listing all attributes and just "select *"? ๐Ÿ™‚

quoll 2024-11-07T15:36:29.733899Z

Is this for every ?m in the system?

quoll 2024-11-07T15:41:24.967429Z

Because it looks like you want:

(->> (d/q '[:find ?e ?a ?v :where [?e ?a ?v]] @asami-conn)
     (reduce (fn [m [e a v]] (assoc-in m [a e] v)) {}))
Which would get you a map of the identifiers for all values of m, pointing to an attribute/value map. (this presumes single cardinality attributes)

quoll 2024-11-07T15:43:49.580079Z

i.e. a result like:

{:peter {:name "Peter"
         :address "123 Anywhere Ln"}
 :mary {:name "Mary"
        :age 18
        :address "1600 Pennsylvania Ave NW"}}

2024-11-07T16:05:02.372109Z

Woop! Thanks, I'll meditate on this and figure out if I'm asking the wrong question. ๐Ÿ˜„