> For the complete documentation index, see [llms.txt](https://relationlabs.gitbook.io/semantic-sbt/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://relationlabs.gitbook.io/semantic-sbt/untitled/application-scenarios.md).

# Application Scenarios

## Example: Token 2049 event based on a Semantic contract

We will use an application scenario to demonstrate how to use a semantic contract.

The flow includes:

### **Initialize the contract**

```solidity
function initialize(
        address minter,
        string memory name_,
        string memory symbol_,
        string memory baseURI_,
        string memory schemaURI_,
        string[] memory classes_,
        Predicate[] memory predicates_
    ) public initializer onlyOwner {}
```

### Specify an event

```solidity
function addSubject(string memory value, string memory className_) 
external onlyMinter returns (uint256 sIndex) {}
```

### Mint a SBT medal

```solidity
function mint(address account, uint256 sIndex, 
        IntPO[] memory intPOList, 
        StringPO[] memory stringPOList,
        AddressPO[] memory addressPOList, 
        SubjectPO[] memory subjectPOList,
        BlankNodePO[] memory blankNodePOList
    ) external onlyMinter returns (uint256) {}
```

### Initialize the contract

#### It means that we will generate a medal for the Token2049 event.

* **The first parameter “owner.address” refers to the address which deployed the contract.**
* **The second parameter "Relation Activity Token2049" refers to the name of the contract**
* **The third parameter "SBT" refers to the symbol of this token.**
* **The fourth parameter "baseURI" refers to the address containing the metadata of this token.**
* **The fifth parameter "schemaURI" refers to the RDF schema address of this token.**
* **The sixth parameter "RelationActivity" refers to the Subject Class of this event.**
* **The seventh parameter "WinnerIs" refers to the Predicate of this event. The Predicate is a String type.**

### Define the Subject

#### Call the method addSubject("Token2049","RelationActivity").

* **The first parameter "Token2049" is the Subject of this event, meaning that this event is titled “RelationActivity\_Token2049”.**
* **The second parameter "RelationActivity" is the Class Name created when the contract was initialized.**
* **After the call is successful, it will generate a Subject Index to link to a PredicateAndObject. The return value is 1 in this instance.**

### Mint a SBT Medal

#### Call the method mint("address",1,\[],\[1,"address"],\[],\[],\[],\[],\[]) . Once the call is executed, we will have minted a SBT “RelationActivity\_Token2049 WinnerIs address”.

* **The first parameter "address" is the owner of the SBT.**
* **The second parameter 1 is the Subject Index corresponding to “Token2049”.**
* **The third parameter \[] is an Integer type PredicateAndObject. We have left it blank.**
* **The fourth parameter \[1,"address"] is a String type PredicateAndObject. The number 1 refers to the predicate “winner is” when the contract was initialized, and “address” is a String type Object.**
* **The fifth parameter \[] is an Address type PredicateAndObject. We have left it blank.**
* **The sixth parameter \[] is a Subject type PredicateAndObject. We have left it blank.**
* **The seventh parameter \[] is a BlankNode type PredicateAndObject. We have left it blank.**


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://relationlabs.gitbook.io/semantic-sbt/untitled/application-scenarios.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
