> For the complete documentation index, see [llms.txt](https://news.telosys.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://news.telosys.org/version-3.3.0/dsl-model-tags.md).

# DSL model "Tags"

Although Telosys now has many annotations for customizing entities, not all use cases can be predicted in advance and it is not possible to define enough annotations to meet all needs.

This is why the "tags" have been added.&#x20;

The user can now add information to the attributes of an entity by definig tags of his choice.

Tags are an important advance in the adaptability and flexibility of models.

### General principles for tags:

* a tag starts with the character "#"
* it is placed in the same block as the annotations (between {and})
* it can have any name
* it may or may not have a value&#x20;
* in the templates we can check if a tag is present or not and possibly use its value
  * $attrib.**hasTag**("tagName") \
    Check if "tagName" is defined for $attrib
  * $attrib.**tagValue**("tagName")\
    Get "tagName" value

### Example 1 - Simple tag without value :

Tag "**mytag**" in entity file :

```
MyEntity {
  id  : int { @Id } ;

  // tag "mytag" (without value) :
  comment : string { #mytag } ;
}
```

Usage in a template :

```
#if ( $attrib.hasTag("mytag") )  
## do something ...
#end
```

### Example 2 - Tag with value :

Tag "**OpenAPIFormat**" in entity file :

```
MyEntity {
  id  : int { @Id } ;

  // tag "OpenAPIFormat" with value :
  val : long  { #OpenAPIFormat(int64) } ;
}
```

Usage in a template :

```
#if ( $attrib.hasTag("OpenAPIFormat") )  
$attrib.tagValue("OpenAPIFormat")
#end
```


---

# 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://news.telosys.org/version-3.3.0/dsl-model-tags.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.
