autogram-is/spidergram

Break property-summary query builder into dedicated helper

Closed this issue · 2 comments

eaton commented

property-summary.ts and its getPropertySummary() function have a lot of grunt work code for converting a configuration object with assorted flags and properties into a full AQL query. That would be useful in other places where we need arbitrary filtering, but would like to avoid exposing raw 'filter' parameters.

  • Abstract property-summary query generation, adding FILTER support in addition to COLLECT, AGGREGATE, etc.
  • Update the GraphWorker class to use the same code for its filtering
  • Rough out a 'report definition' JSON structure, and allow projects to save them as canned .json files for reuse.
eaton commented

The query-builder has been split into a dedicated project, AQL Builder. V 0.9.0 of Spidergram uses the more capable builder in its spidergram report CLI tool.

Among other things, it now supports

  • AQL filters on properties (aka, COUNT(foo) in addition to foo)
  • Subqueries (results can be assigned to a variable, or used inline as part of the parent query)
  • Fully serializability for query definitions, so complex reports can be defined in reusable JSON files

GraphWorker hasn't been updated to use it yet, but that will be coming before the official 0.9.0 release.

eaton commented

All of these are happily complete in v0.9.0.