Tags Basics
Tags Basics
Tags and Tagging
Tagging is a method of marking schema with a metadata object known as a Tag to make schema easier to find or link to. By using List Tagged Schema_ you can retrieve all schema associated with a specific Tag.
A single schema can be associated with multiple Tags. Similarly, a single Tag can be associated with multiple schemas. at a high level. So, Tags give you a flexible way of classifying schema.
One of the marquee uses of Tags is the Forge Schema Repository. Tags make schema discoverable by listing schema under the categories they are tagged. Some Tags define what categories the schema belongs to, while others define what filters they react to.
Tag Collections and Tag Categories
A Tag Collection is a framework to store and manipulate a group of Tags. You can have only one Tag Collection per namespace and one Tag Collection per company. Only users or services with NAMESPACE_ADMIN privileges can create Tag Collections.
A schema can only be associated with Tags that belong to the Tag Collection of the namespace or company that the schema belongs to. You must be at least a SCHEMA_AUTHOR to associate Tags to a schema.
Within a Tag Collection, Tags can be grouped by category. Only Users or services with admin privileges can create Tag Categories. They can also assign Tags to Tag Categories. When you create a Tag Collection, a hidden Tag Category known as the default category is also created. Tags that have not been explicitly assigned to a Category are automatically assigned to the “default” category.
The userData Object
Tags and Tag Category objects contain an attribute named userData. This is an object to hold custom data relating to a Tag or Tag Category. It can hold any key-value pair. The only validation the system performs on this object is to make sure that it is a valid JSON object.
In the Forge Schema Repository project, the userData object is used to hold metadata about each Tag that contains schema.