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. Open Standard API

EIP-6239

Every contract of this kind should implement a ISemanticSBT interface.

  • When a new SBT is created, a CreateRDF should be triggered.

  • When a new SBT is updated, an UpdateRDF should be triggered.

  • When a new SBT is removed, a RemoveRDF should be triggered.

  • A contract of this kind should provide a method 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);
}

Developers can choose to implement an ISemanticRDFSchema interface to acquire the Schema URI describing the RDF data.

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

Developers can choose to implement an ISemanticSBTUpdate interface to update the RDF data of an SBT.

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;
}

Developers can choose to implement an ISemanticSBTPrivacy interface.

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