# Relation Protocol的架构

Relation Protocol是一个高度开放的去中心化社交图谱协议，任何开发者都可以基于Semantic SBTs规范开发智能合约、构建自己的Dapp。

用户在使用Dapp的同时会在链上产生大量的行为数据，这些数据都是标准化的、可机器识别的RDF数据。

用户对自己的数据拥有控制权和治理权，并可以控制数据的共享范围。

此时，大家共同构建了一个区块链原生的社交图谱的数据层。

### 协议组成

Relation Protocol分为4个部分：

<figure><img src="/files/6XNQH72dvOR1qUS6fDxf" alt=""><figcaption><p>图 3-1 Relation Protocol</p></figcaption></figure>

**Schema Standard**

Schema Standard 是Relation Protocol中的社交数据存储的Schema标准，它约定了所有基于Relation protocol构建的社交数据格式。

Schema Standard中约定了RelationProtocol的 Base Schema，所有基于Relation Protocol的RDF的构建都需要符合Base Schema的数据定义。

Base Schema由若干个存储在Arweave上的TTL文件组成，它由Relation DAO管理和更新。[Base Schema列表](/protocol/protocol-zh/schema-standard/schema-list.md)

**Contract Open Standard**

Contract Open Standard是Relation Protocol约定的智能合约标准，标准包含一下两部分约定：

* 合约需要符合Open Standard API中所定义的数据格式和接口规范
* 合约构建的RDF数据需要符合Schema Standard

**Open Standard API**

Open Standard API是Relation Protocol的API规范，Open Standard API是Contact Open Standard的基础，开发者通过实现Open Standard API，即可接入Relation Protocol。

**Graph Indexer**

Graph Indexer是Relation Protocol中索引SBT数据的解析器标准，任何人都可以基于Graph Indexer的标准部署数据监听服务。其主要功能是将Ethereum和Arweave中的SBT数据组装，构建出可以在图数据库中被社交应用所使用的Social Graph。

### 协议部署

Relation协议中的合约都部署在以太坊网络或L2中，基于Relation Protocol构建的社交应用可以自己部署特定场景的Semantic SBTs合约，也可以调用设计已经完成部署的合约。

Relation 协议中的Schema由若干个存储在Arweave上的TTL文件组成，它被用于约束Semantic SBT合约的RDF数据规范。

基于隐私的Semantic SBTs有独特的Schema和存储方式，隐私SBT的RDF数据在存储前，需要使用隐私协议（如Lit Protocol）进行加密或解密，用户管理和控制RDF数据的可访问权限。

<figure><img src="/files/qUdMgEi2i3iN2TiZWaHT" alt=""><figcaption><p>图 3-2 Relation Protocol 是如何运行的</p></figcaption></figure>


---

# 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/protocol-zh/architecture.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.
