Currently, the group_by model config parameter is implemented to take a reference to a SPARQL binding.
The rationale for this behavior was, that grouping should also be possible by values that are not necessarily defined as fields of the model.
However, since grouping is primarily concerned with the shapes definition, i.e. with the model, grouping by a model field would arguably be more intuitive and conceptually more consistent.
Proposal
group_by should be able to take a model field reference as well as a SPARQL binding name, with model fields taking precedence over SPARQL bindings for grouping.
Although grouping by an excluded field of the model would allow to group by values that will not be part of the model serialization, also supporting grouping by SPARQL bindings is more convenient for that particular use case.
Currently, the
group_by
model config parameter is implemented to take a reference to a SPARQL binding.The rationale for this behavior was, that grouping should also be possible by values that are not necessarily defined as fields of the model.
However, since grouping is primarily concerned with the shapes definition, i.e. with the model, grouping by a model field would arguably be more intuitive and conceptually more consistent.
Proposal
group_by
should be able to take a model field reference as well as a SPARQL binding name, with model fields taking precedence over SPARQL bindings for grouping.Although grouping by an excluded field of the model would allow to group by values that will not be part of the model serialization, also supporting grouping by SPARQL bindings is more convenient for that particular use case.