Developer Hub
Relation ProtocolRelation ONE APIRelation Graph API
中文
中文
  • 概述
  • 快速开始
    • 基于Relation Protocol 部署合约
    • 使用Graph Indexer部署Social Graph的查询服务
  • 关键概念
    • RDF
    • Semantic SBTs
    • Social Graph
  • Relation Protocol的架构
  • Schema Standard
    • 概述
    • schema如何约束智能合约
    • schema存储
    • schema列表
  • Contract Open Standard
    • 概述
    • Identity
      • Name Service
    • Relationship
      • Follow
      • Dao
    • Publication
      • Content
      • Privacy Content
  • Open Standard API
    • 介绍
    • EIP-6239
    • 业务接口
      • Identity
      • Relationship
      • Publication
  • Graph Indexer
    • 定义与用途
    • 事件监听
    • 解析数据
    • 构建图谱
  • 集成
    • 快速开始
    • 构建Relation Protocol社交图谱
    • Relation Protocol 资源列表
    • NameService 合约请求示例
    • Follow 合约请求示例
    • Dao 合约请求示例
    • Content 合约请求示例
    • PrivacyContent 合约请求示例
  • Relation Name Service
    • Name Service Api
  • 用例
  • 附录
    • 使用Hardhat部署合约
    • SemanticSBT部署工具
Powered by GitBook
On this page
  1. Open Standard API

EIP-6239

每个合约必须实现ISemanticSBT接口

  • 在有新的SBT产生的时候,需要发出CreateRDF事件

  • 在更新已有SBT的RDF的时候,需要发出UpdateRDF事件

  • 在销毁SBT的时候,需要发出RemoveRDF事件

  • 合约需要提供rdfOf方法

interface ISemanticSBT{
    /**
     * @dev This emits when minting a Semantic Soulbound Token.
     * @param tokenId The identifier for the Semantic Soulbound Token.
     * @param rdfStatements The RDF statements for the Semantic Soulbound Token. An RDF statement is the statement made by an RDF triple.
     */
    event CreateRDF (
        uint256 indexed tokenId,
        string  rdfStatements
    );
    /**
     * @dev This emits when updating the RDF data of Semantic Soulbound Token. RDF data is a collection of RDF statements that are used to represent information about resources.
     * @param tokenId The identifier for the Semantic Soulbound Token.
     * @param rdfStatements The RDF statements for the semantic soulbound token. An RDF statement is the statement made by an RDF triple.
     */
    event UpdateRDF (
        uint256 indexed tokenId,
        string  rdfStatements
    );
/**
     * @dev This emits when burning or revoking Semantic Soulbound Token.
     * @param tokenId The identifier for the Semantic Soulbound Token.
     * @param rdfStatements The RDF statements for the Semantic Soulbound Token. An RDF statement is the statement made by an RDF triple.
     */
    event RemoveRDF (
        uint256 indexed tokenId,
        string  rdfStatements
    );
    /**
     * @dev Returns the RDF statements of the Semantic Soulbound Token. An RDF statement is the statement made by an RDF triple.
     * @param tokenId The identifier for the Semantic Soulbound Token.
     */
    function rdfOf(uint256 tokenId) external view returns (string memory);
}

可以选择性的实现ISemanticRDFSchema接口,用于获取描述RDF数据的Schema URI。

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

可以选择性的实现ISemanticSBTUpdate接口,用于更新SBT的RDF数据

interface ISemanticSBTUpdate{
    /**
     * @notice Update the RDF data for Semantic Soulbound Token. Implementors can assign updaters as needed, for example, the token issuer.
     * @dev Emits the `UpdateRDF` event.
     * @param tokenId The identifier for the Semantic Soulbound Token.
     * @param rdfData RDF data is a collection of RDF statements that are used to represent information about resources.
     */
    function updateRDF(uint256 tokenId, RDFData memory rdfData) external;
}

可以选择性的实现ISemanticSBTPrivacy接口

interface ISemanticSBTPrivacy is ISemanticSBT {
    /**
     * @dev Returns if the `viewer` is allowed to view the `tokenId` .
     * @param viewer The viewer address
     * @param tokenId The token Id
     */
    function isViewerOf(address viewer, uint256 tokenId) external view returns (bool);
}

Last updated 2 years ago