Tags : cq:Tag Node Type
The declaration of a tag is captured in the repository in a node of type cq:Tag.
A tag can be a simple word (e.g. sky) or represent a hierarchical taxonomy (e.g. fruit/apple, meaning both the generic fruit and the more specific apple).
Tags are identified by a unique TagID.
Tag Characteristics
- node type is cq:Tag
- node name is a component of the TagId
- the TagId always includes a namespace
- optional jcr:title property (the Title to display in the UI)
- optional jcr:description property
- when containing child nodes, is referred to as a container tag
- is stored in the repository below a base path called the taxonomy root node.
TagID
A TagID identifies a path which resolves to a tag node in the repository.
Typically, the TagID is a shorthand TagID starting with the namespace or it can be an absolute TagID starting from the taxonomy root node.
The TagID consists of a namespace followed by the local TagID. Container tags have sub-tags that represent a hierarchical order in the taxonomy. Sub-tags can be used to reference tags same as any local TagID. For example tagging content with "fruit" is allowed, even if it is a container tag with sub-tags, such as "fruit/apple" and "fruit/banana".
The taxonomy root node is the base path for all tags in the repository. The taxonomy root node must not be a node of type cq:Tag.
Resolving TagIDs
The following table shows some sample TagIDs, their elements, and how the TagID resolves to an absolute path in the repository :
The following table shows some sample TagIDs, their elements, and how the TagID resolves to an absolute path in the repository :
The following table shows some sample TagIDs, their elements, and how the TagID resolves to an absolute path in the repository :
TagID | Namespace | Local ID | Container tag(s) | Leaf tag | Repository Absolute tag path |
dam:fruit/apple/braeburn | dam | fruit/apple/braeburn | fruit, apple | braeburn | /etc/tags/dam/fruit/apple/braeburn |
color/red | default | color/red | color | red | /etc/tags/default/color/red |
sky | default | sky | (none) | sky | /etc/tags/default/sky |
dam: | dam | (none) | (none) | (none, the namespace) | /etc/tags/dam |
/etc/tags/category/car | category | car | car | car | /etc/tags/category/car |