> 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/key-concepts/rdf.md).

# RDF

[RDF (Resource Description Framework)](https://www.w3.org/RDF/) is a semantic standard used to describe structured knowledge, which is an international standard published by W3C for knowledge graph. It is a logical and well-developed data model.

The social data in Relation Protocol is written following the RDF standard, including:

## [Graph data model](https://www.w3.org/TR/rdf-concepts/#section-data-model)

> The underlying structure of any expression in RDF is a collection of triples, each consisting of a subject, a predicate and an object. A set of such triples is called an RDF graph (defined more formally in section 6). This can be illustrated by a node and directed-arc diagram, in which each triple is represented as a node-arc-node link (hence the term "graph").

<figure><img src="/files/QnOwqObN8QDcsWHEqXoQ" alt=""><figcaption><p>Figure 2-1 RDF triples</p></figcaption></figure>

> Each triple represents a statement of a relationship between the things denoted by the nodes that it links. Each triple has three parts:
>
> 1. a [subject](https://www.w3.org/TR/rdf-concepts/#dfn-subject),
> 2. an [object](https://www.w3.org/TR/rdf-concepts/#dfn-object), and
> 3. a [predicate](https://www.w3.org/TR/rdf-concepts/#dfn-predicate) (also called a [property](https://www.w3.org/TR/rdf-concepts/#dfn-property)) that denotes a relationship.
>
> The direction of the arc is significant: it always points toward the object.

## [RDF Schema](https://www.w3.org/TR/rdf-schema/#ch_introduction)

> RDF Schema provides a data-modelling vocabulary for RDF data.
>
> The RDF Schema class and property system is similar to the type systems of object-oriented programming languages such as Java.

## [RDF triples](https://www.w3.org/TR/rdf-concepts/#section-triples)

> An RDF triple contains three components:
>
> * the subject, which is an [RDF URI reference](https://www.w3.org/TR/rdf-concepts/#dfn-URI-reference) or a [blank node](https://www.w3.org/TR/rdf-concepts/#dfn-blank-node)
> * the predicate, which is an [RDF URI reference](https://www.w3.org/TR/rdf-concepts/#dfn-URI-reference)
> * the object, which is an [RDF URI reference](https://www.w3.org/TR/rdf-concepts/#dfn-URI-reference), a [literal](https://www.w3.org/TR/rdf-concepts/#dfn-literal) or a [blank node](https://www.w3.org/TR/rdf-concepts/#dfn-blank-node)
>
> An RDF triple is conventionally written in the order subject, predicate, object.
>
> The predicate is also known as the property of the triple.

## [RDF graph](https://www.w3.org/TR/rdf-concepts/#section-rdf-graph)

> An RDF graph is a set of RDF triples.
>
> The set of nodes of an RDF graph is the set of subjects and objects of triples in the graph.

## For example

Alice follow Bob, described by RDF is:

```sparql
<http://relationlabs.ai/entity/Alice> <http://relationlabs.ai/property/follow> <http://relationlabs.ai/entity/Bob> .
```

<figure><img src="/files/Wkr2na0xp2IT6o1rQBiI" alt=""><figcaption><p>Figure 2-2 Follow graph</p></figcaption></figure>

## References

* <https://www.w3.org/TR/rdf-schema/>
* <https://www.w3.org/TR/rdf-concepts/>


---

# 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/key-concepts/rdf.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.
