> For the complete documentation index, see [llms.txt](https://docs.rainbird.ai/rainbird/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rainbird.ai/rainbird/knowledge-modelling/modelling-features/rblang-reference/xml-structure-and-namespaces.md).

# XML structure and namespaces

Every RBlang document starts with the XML declaration and the root knowledge base element.

```xml
<?xml version="1.0" encoding="utf-8"?>
<rbl:kb xmlns:rbl="http://rbl.io/schema/RBLang">
    <!-- knowledge base content -->
</rbl:kb>
```

### Required structure

* `<?xml version="1.0" encoding="utf-8"?>`
* `<rbl:kb>` as the root element
* `xmlns:rbl="http://rbl.io/schema/RBLang"` on the root element

Use UTF-8 encoding.

{% hint style="warning" %}
The `xmlns:rbl` namespace is required.
{% endhint %}

### Recommended definition order

Define elements in this order:

1. Concepts
2. Relationships
3. Concept instances for `string` concepts
4. Relationship instances and rules

### Core elements

RBlang uses these core elements:

* `<concept>` for concept definitions
* `<rel>` for relationship definitions
* `<concinst>` for string concept instances
* `<relinst>` for facts and rules
* `<condition>` for rule conditions

### Skeleton template

```xml
<?xml version="1.0" encoding="utf-8"?>
<rbl:kb xmlns:rbl="http://rbl.io/schema/RBLang">
    <concept name="Person" type="string"/>
    <concept name="Age" type="number"/>

    <rel name="has age" subject="Person" object="Age"/>

    <concinst name="John Smith" type="Person"/>
    <relinst type="has age" subject="John Smith" object="25"/>
</rbl:kb>
```

### Type naming in RBlang

RBlang uses the type name `truth` for boolean concepts.

```xml
<concept name="Is Eligible" type="truth"/>
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rainbird.ai/rainbird/knowledge-modelling/modelling-features/rblang-reference/xml-structure-and-namespaces.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
