Summary
Add support in Query Builder for aggregation (e.g. count) and grouping so users can surface blocks with the highest number of tags / page refs.
User problem
Users want to identify their “best” or most-important blocks by how heavily they tag/reference them. Today, Query Builder can filter and sort, but cannot:
- count refs/tags per block
- group results by block
- sort blocks by aggregate values (e.g. tag count)
This makes it impossible to answer questions like:
- “Which blocks in my graph have the most tags?”
- “Show me my most-referenced blocks”
- “Rank blocks by number of page refs”
Concrete use case (from James D)
“I’d like a query that shows me the blocks in my graph with the most tags. The blocks I tag the most are the best ones. I need to get all those together somehow.”
Proposed capabilities
-
Aggregate functions:
-
Grouping:
-
Sorting:
- order results by aggregate values (descending / ascending)
-
Optional filters:
- exclude specific tags/pages from counts
Example (conceptual syntax)
FIND node
WHERE node has references
GROUP BY node
SELECT count(references) AS tag_count
ORDER BY tag_count DESC
Why this matters
- Enables ranking, curation, and sense-making workflows
- Aligns Query Builder with core datalog capabilities
- Unlocks advanced “knowledge gardening” use cases without JS or custom queries
- High leverage for power users without increasing UI complexity (can be progressive / advanced mode)
Related
- No current workaround in Query Builder
- Requires raw datalog or external processing today
Summary
Add support in Query Builder for aggregation (e.g.
count) and grouping so users can surface blocks with the highest number of tags / page refs.User problem
Users want to identify their “best” or most-important blocks by how heavily they tag/reference them. Today, Query Builder can filter and sort, but cannot:
This makes it impossible to answer questions like:
Concrete use case (from James D)
Proposed capabilities
Aggregate functions:
countcount-distinctGrouping:
Sorting:
Optional filters:
Example (conceptual syntax)
Why this matters
Related