# Schema

Our project's primary objective is to foster industry-wide data sharing by employing a common schema to define data structures. Simultaneously, each participating organization can maintain their own schema with variations from the common one, streamlining the process of transferring data to the Microscope protocol database.

1. [Meta Schema](https://github.com/openchainmeta/chainmetareader/blob/main/chainmeta_reader/schema/meta_schema.json): defines the common structure of blockchain label data in this project. We have designed the schema with primary objectives focused on enabling capabilities such as comprehensive blockchain label data sharing, version control for taxonomy iteration, contribution measurement, and potential tracking of data record consumption
2. Examples of per-organization schemas:
   * [Coinbase](https://github.com/openchainmeta/chainmetareader/blob/main/chainmeta_reader/schemas/coinbase_schema.json): <https://github.com/openchainmeta/chainmetareader/blob/main/chainmeta_reader/schemas/coinbase_schema.json>
   * [Chaintool](https://github.com/openchainmeta/chainmetareader/blob/main/chainmeta_reader/schemas/chaintool_schema.json): <https://github.com/openchainmeta/chainmetareader/blob/main/chainmeta_reader/schemas/chaintool_schema.json>

{% code lineNumbers="true" %}

```javascript
{
    "$schema": "<http://json-schema.org/draft-07/schema#>",
    "title": "ChainMeta",
    "description": "An object designed to uniformly describe blockchain metadata from different providers",
    "type": "object",
    "required": [
        "community",
        "provider",
        "version",
        "revision",
        "introduction",
        "chainmetadata"
    ],
    "properties": {
        "community": {
            "description": "The community name of this open source project",
            "type": "string",
            "enum": [
                "openchainmeta"
            ]
        },
        "provider": {
            "description": "Basic information of the data provider",
            "type": "object",
            "required": [
                "provider_name",
                "provider_id",
                "provider_signature"
            ],
            "properties": {
                "provider_name": {
                    "description": "Provider's name",
                    "type": "string"
                },
                "provider_id": {
                    "description": "Provider's unique id",
                    "type": "string",
                    "pattern": "^ocm[0-9]{6}$"
                },
                "provider_signature": {
                    "description": "Provider's signature",
                    "type": "string"
                }
            }
        },
        "version": {
            "description": "The version of provider's metadata",
            "type": "string"
        },
        "revision": {
            "description": "The revision of provider's metadata",
            "type": "integer"
        },
        "introduction": {
            "description": "Introduction of provider's metadata",
            "type": "string",
            "format": "uri"
        },
        "chainmetadata": {
            "description": "Details of provider's metadata",
            "type": "object",
            "required": [
                "schema",
                "artifact"
            ],
            "properties": {
                "schema": {
                    "description": "Schema of provider's metadata, explain how data is read",
                    "type": "string",
                    "format": "uri"
                },
                "artifact": {
                    "description": "Storage details of provider's metadata",
                    "type": "array",
                    "minItems": 1,
                    "items": {
                        "type": "object",
                        "required": [
                            "path",
                            "fileformat",
                            "signature"
                        ],
                        "properties": {
                            "artifact_type": {
                                "description": "Type of artifact",
                                "type": "string",
                                "enum": [
                                    "s3",
                                    "remote path",
                                    "local file"
                                ]
                            },
                            "path": {
                                "description": "Path of the metadata file",
                                "type": "string",
                                "format": "uri"
                            },
                            "fileformat": {
                                "description": "Format of the metadata file",
                                "type": "string",
                                "enum": [
                                    "json",
                                    "parquet",
                                    "csv"
                                ]
                            },
                            "signature": {
                                "description": "Signature of the metadata file",
                                "type": "string"
                            }
                        }
                    }
                }
            }
        }
    }
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.microscopeprotocol.xyz/onboarding/data/schema.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
