No way to bind aggregate to variable in query #11

Open
opened 2020-08-06 14:55:46 +00:00 by gburd · 2 comments
gburd commented 2020-08-06 14:55:46 +00:00 (Migrated from github.com)

The datomic docs have an example query of the form:

[:find ?year (median ?namelen) (avg ?namelen) (stddev ?namelen)
 :with ?track
 :where [?track :track/name ?name]
        [(count ?name) ?namelen]
        [?medium :medium/tracks ?track]
        [?release :release/media ?medium]
        [?release :release/year ?year]]

Our query syntax doesn't allow the [(count ?name) ?namelen] clause.

Between this and https://github.com/mozilla/mentat/issues/647 I'm not sure we can implement a top-sites like query directly. (That might not be true, and could just a reflection of my ignorance, though!)

Original by @thomcc

The [datomic docs](https://docs.datomic.com/on-prem/query.html) have an example query of the form: ```edn [:find ?year (median ?namelen) (avg ?namelen) (stddev ?namelen) :with ?track :where [?track :track/name ?name] [(count ?name) ?namelen] [?medium :medium/tracks ?track] [?release :release/media ?medium] [?release :release/year ?year]] ``` Our query syntax doesn't allow the `[(count ?name) ?namelen]` clause. Between this and https://github.com/mozilla/mentat/issues/647 I'm not sure we can implement a top-sites like query directly. (That might not be true, and could just a reflection of my ignorance, though!) Original by @thomcc
gburd commented 2020-08-06 14:55:48 +00:00 (Migrated from github.com)

Possibly a duplicate of #750?

Original by @thomcc

Possibly a duplicate of #750? Original by @thomcc
gburd commented 2020-08-06 14:55:49 +00:00 (Migrated from github.com)

Yep, dupe of that.

Original by @rnewman

Yep, dupe of that. Original by @rnewman
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: greg/mentat#11
No description provided.