# Store schema

As a declarative list of data models, the size of data to be stored via a schema is unknown. We did not choose to store schema through EVM for it may involve high gas fees and reaching gas limit when the size of data exceeds certain thresholds.

Also, in the Relation Protocol, the schema and the data structure declared in the smart contract using that schema should be the same. Namely, a schema can not be modified after the contract is initialized.

To address this, Relation stores schemas in a distributed storage system. In this field, [Arweave](https://www.arweave.org/) has the following advantages compared to [IPFS](https://ipfs.tech/):

* Persistence: Arweave stores data permanently whereas IPFS only stores them when a node chooses to. In the latter, a file could be deleted if no nodes are willing to persist it. So storing data on Arweave is more secure and reliable.
* Accessibility: Data on Arweave can be accessed via a permanent link without accessing specific nodes. However, to access a file on IPFS, you need to know the address of a node storing the file. That means Arweave has higher accessibility.

Considering the above factors, Relation stores schema data on Arweave, with the transaction hash as the schemaURI to be passed to the contract during its initialization stage. No modification after that point will be allowed.

If a contract implements the IsemanticRDFSchema interface in the Semantic SBT specification, we can use schemaURI to query the schema address:

```solidity
interface ISemanticRDFSchema {
    /**
    * @notice Get the URI of schema for this contract.
    * @return The URI of the contract which points to a configuration profile.
    */
    function schemaURI() external view returns (string memory);
}
```


---

# 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://relationlabs.gitbook.io/protocol/schema-standard/store-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.
