Closed lu-pl closed 3 months ago
SPARQLModelAdapter.query_group_by should return some model instance instead of dict, else grouping results cannot be properly served over FastAPI.
SPARQLModelAdapter.query_group_by
It should return a list of GroupModel where GroupModel is something like this:
GroupModel
class GroupModel(BaseModel): group_by: str group_key: str group_value: list[BaseModel]
The existing defaultdict implementation can be used to initialize GroupModels from the group dict, so this shouldn't be too much work.
defaultdict
FastAPI derives the correct JSON schema and Swagger definitions from dicts, so this is obsolete. Closing.
SPARQLModelAdapter.query_group_by
should return some model instance instead of dict, else grouping results cannot be properly served over FastAPI.It should return a list of
GroupModel
whereGroupModel
is something like this:The existing
defaultdict
implementation can be used to initializeGroupModel
s from the group dict, so this shouldn't be too much work.