> For the complete documentation index, see [llms.txt](https://relationlabs.gitbook.io/protocol/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/protocol/indexer/introduction.md).

# Definition and usage

As a part of the Relation Protocol, the main function of the Graph Indexer is to construct a social graph:

[Events](https://ethereum.org/en/glossary/#events) are the atomic units in the Relation social graph. The general technical [specification](http://eips.ethereum.org/EIPS/eip-6239) of the Relation Protocol defines three events:

* CreateRDF: Triggered when a SBT containing RDF semantics is created.
* UpdateRDF: Triggered when a SBT containing RDF semantics is updated.
* RemoveRDF: Triggered when a SBT containing RDF semantics is removed.

The Graph Indexer parses these three events by listening to transactions on the blockchain. Users' social interactions are then stored in a graph database, thus constructing a social graph(see Figure: 7-1). This helps individual developers and companies to build a more meaningful user relationship in Dapps and other decentralized projects. It can foster a more user-friendly social network experience.

<figure><img src="/files/AEjX0pnSopmYL3QR1UZl" alt=""><figcaption><p>Figure 7-1</p></figcaption></figure>

This chapter will show you how to construct a `Graph Indexer`:

1. [Listen to events on the blockchain.](/protocol/indexer/event-listener.md): Listens to all events conforming to the [EIP6239](http://eips.ethereum.org/EIPS/eip-6239) specification on the blockchain.
2. [Parse RDF data](/protocol/indexer/parse-data.md): Parse the RDF from the event conforming to the [Schema specification](/protocol/schema-standard/how-schema-limit-contract.md) and construct it into data structure in a graph.
3. [Build the social graph](/protocol/indexer/build-graph.md): Store the data into the graph database.

{% embed url="<https://youtu.be/8X420sNwygI>" %}


---

# 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/protocol/indexer/introduction.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.
