> For the complete documentation index, see [llms.txt](https://docs.openg2p.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openg2p.org/products/registry/registry/developer-zone/building-a-registry/concepts/registry-and-register-metadata/g2pregisterschema.md).

# G2PRegisterSchema

g2p\_register\_schemas - JSON schemas for datasets

The [`G2PRegisterSchema`](https://github.com/OpenG2P/registry-platform/blob/develop/core/openg2p-registry-core/src/openg2p_registry_core/models/g2p_register_schema.py) 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**           | Identifier of the register. References `g2p_register_definitions.register_id`.                         |
| **deduplicate\_schema**    | JSON defining attributes used by the deduplication algorithm to detect potential duplicate records.    |
| **search\_result\_schema** | JSON defining attributes displayed in the **Search Results** page (up to eight attributes per result). |
| **filter\_schema**         | JSON defining attributes available as **filter options** on the register list page.                    |

***

### UI Behavior

Applicable to datasets classified as **REGISTER** or **PROGRAM\_REGISTER**.

| Schema                     | UI function                                  |
| -------------------------- | -------------------------------------------- |
| **search\_result\_schema** | Attributes shown in the search results list. |
| **filter\_schema**         | Attributes shown in the filter panel.        |

***

### Related metadata

| Table                      | Document                                                                                                                                                 |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `g2p_register_definitions` | [G2PRegisterDefinition](/products/registry/registry/developer-zone/building-a-registry/concepts/registry-and-register-metadata/g2pregisterdefinition.md) |

***

## Reference Implementation

A reference implementation of `G2PRegisterSchema` can be found [here](https://github.com/OpenG2P/farmer-registry/blob/develop/farmer-extension/src/openg2p_registry_farmer_extension/db_scripts/register-metadata/g2p_register_schemas.sql) in the Farmer Extension repository.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.openg2p.org/products/registry/registry/developer-zone/building-a-registry/concepts/registry-and-register-metadata/g2pregisterschema.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
