> For the complete documentation index, see [llms.txt](https://developer.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.collibra.com/api/guides/introduction/the-output-module-query-language/getting-started.md).

# Getting started

The format of the query language is either JSON or YAML. For simplicity, this example starts with a basic query and builds from there.

Select the `Id` and `Name` for all communities as a flat list. The object representing the query is called ViewConfig, as it defines a particular view, which is a selection of the data. The object containing the graph part of the query is called Resources.

The following example shows the `Community` entity along with its `Id` and `Name` properties.

{% tabs %}
{% tab title="JSON" %}

```json
{
  "ViewConfig": {
    "Resources": {
      "Community": {
        "name": "Communities",                   <---\
        "Id": { "name": "community id" },             ---- a node can (or must) have a name. Thus the community own 'name' property must be uppercased to avoid conflicts.
        "Name": { "name": "community name" }     <---/
      }
    }
  }
}
```

{% endtab %}

{% tab title="YAML" %}

```yaml
---
ViewConfig:
  Resources:
    Community:
      name: "Communities"           <---\   
      Id:                                ---- a node can (or must) have a name. Thus the community own 'name' property must be uppercased to avoid
        name: "community id"
      Name:                         <---/
        name: "community name"
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}

* Entity and property keys are case insensitive, so `Community` and `Id` can be written in any case.
* The other keys are case sensitive. For example, `ViewConfig`, `Resources` or `Name` must be written as shown.
* If a property is spelled out the same way as a reserved keyword, you must use a different casing than the reserved key. For example, you use lowercase `name` as the node name and capitalized `Name` as the community name.
  {% endhint %}

## Test the API

To test the API, use a REST client, such as the Postman plugin for Chrome. Many output formats are available, but the JSON tree is the format that most resembles the query.

This example uses the following endpoint on the OutputView resource:

* `{{domain}}/rest/2.0/outputModule/export/json`

Use a POST call with the following body.

{% tabs %}
{% tab title="JSON" %}

```json
{
  "ViewConfig": {
    "Resources": {
      "Community": {
        "Id": {
          "name": "community id"
        },
        "Name": {
          "name": "community name"
        }
      }
    }
  }
}
```

{% endtab %}

{% tab title="YAML" %}

```yaml
---
ViewConfig:
  Resources:
    Community:
      Id:
        name: "community id"
      Name:
        name: "community name"
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Remember to set the content type header.
{% endhint %}

{% tabs %}
{% tab title="JSON" %}

```json
'Content-Type': 'application/json'
```

{% endtab %}

{% tab title="YAML" %}

```yaml
'Content-Type': 'application/x-yaml'
```

{% endtab %}
{% endtabs %}

The output is formatted as an array of communities.

```json
{
  "view": {
    "Community0": [
      {
        "communityId": "c87f166e-041f-4bea-8ff7-c1ffbab2ceeb",
        "communityName": "First Community"
      },
      {
        "communityId": "86a745f5-7e87-4851-a107-a3a272ccea0b",
        "communityName": "Second Community"
      }
    ]
  }
}
```

You can use the ViewConfig queries with the following endpoints:

* `{{domain}}/rest/2.0/outputModule/export/{{xml | json}}`
* `{{domain}}/rest/2.0/outputModule/export/{{xml | json}}-file`
* `{{domain}}/rest/2.0/outputModule/export/{{xml | json}}-job`


---

# 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:

```
GET https://developer.collibra.com/api/guides/introduction/the-output-module-query-language/getting-started.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.
