Developer Hub
Relation ProtocolRelation ONE APIRelation Graph API
English
English
  • Overview
  • QUICK START
    • Deploy a Semantic SBT contract leveraging Relation Protocol
    • Deploying query services using Graph Indexer
  • KEY CONCEPTS
    • RDF
    • Semantic SBTs
    • Social Graph
  • Architecture
  • Schema Standard
    • Overview
    • How schemas limit smart contracts
    • Store schema
    • List of schemas
  • Contract Open Standard
    • Overview
    • Identity
      • Name Service
    • Relationship
      • Follow
      • Dao
    • Publication
      • Content
      • Privacy Content
  • Open Standard API
    • Introduction
    • EIP-6239
    • Business Interface
      • Identity
      • Relationship
      • Publication
  • Graph Indexer
    • Definition and usage
    • Listen to events
    • To parse RDF data
    • To build a social graph
  • Integrations
    • Quick start
    • Construct a social graph with Relation Protocol
    • List of resources
    • NameService contract guide
    • Follow contract guide
    • Dao contract guide
    • Content contract guide
    • PrivacyContent contract guide
  • Relation Name Service
    • Name Service Api
  • Use Case
  • APPENDIX
    • Deploy a contract using Hardhat
    • SemanticSBT Deployment tool
Powered by GitBook
On this page
  1. Schema Standard

Store schema

Last updated 2 years ago

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, has the following advantages compared to :

  • 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:

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);
}
Arweave
IPFS