G2PRegisterSchema

g2p_register_schemas - JSON schemas for datasets

The G2PRegisterSchemaarrow-up-right metadata table stores JSON-based configuration schemas used by the platform to control deduplication, search results, and filtering behavior for each register.

While ORM models define the structure of the data and Pydantic schemas define validation and API contracts, this metadata table allows the platform to dynamically configure UI behavior and search functionality without requiring changes to application code.

Each register can have a corresponding schema definition that specifies:

  • Attributes used for duplicate detection

  • Attributes displayed in search results

  • Attributes available for UI filtering


Attributes

Attribute
Description

register_id

The identifier of the register to which this schema configuration belongs. This references the register defined in the g2p_register_definition table.

deduplicate_schema

Stored in JSON format. Defines the attributes that should be used by the platform’s deduplication algorithm to detect potential duplicate records in the register.

search_result_schema

Stored in JSON format. Defines the attributes that should be displayed in the Search Results page in the Registry Staff UI. The UI displays up to eight attributes for each search result entry. All attributes of the register become visible when the user opens the detailed view of a specific record.

filter_schema

Stored in JSON format. Defines the attributes that should be available as filter options in the UI. The filter section on the register list page is rendered dynamically based on this configuration.


UI Behavior Driven by the Schema

The Registry Staff UI uses this metadata to dynamically construct search and filtering interfaces.

This configuration is applicable only to datasets classified as:

  • REGISTER

  • PROGRAM_REGISTER

Schema
UI Function

search_result_schema

Defines which attributes appear in the Search Results List.

filter_schema

Determines which attributes appear in the Filter panel on the register list page.

This approach allows implementation teams to customize UI behavior without modifying frontend code.


Reference Implementation

A reference implementation of G2PRegisterSchema can be found herearrow-up-right in the Farmer Extension repository.

Last updated

Was this helpful?