# 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="https://2101283974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYeYon1a8IZta2Zm96hF1%2Fuploads%2Fgit-blob-fcf6efcc151bafe69e64c5da94627778148273f3%2Fgraph-data-model.png?alt=media" 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="https://2101283974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYeYon1a8IZta2Zm96hF1%2Fuploads%2Fgit-blob-d5ef5305e862945ffd0460281012c6a1c504be94%2Ffollow%20(2).png?alt=media" 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: 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:

```
GET https://relationlabs.gitbook.io/protocol/key-concepts/rdf.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
