Tags add semantic information to business entities.
Tags are often defined as a crowd ontology without enforced schemas.
Invest in domain modeling to define and maintain tags, and you will move tags to full-fledged ontology into your domain models.
This ontology supports meaningful search, segmentation, and reporting over historical and geographical raw data.
Tags with associated values are also used to decorate unrelated entities with orthogonal information.
For example, you can associate geographical coordinates – GIS – to pictures, meetings, or addresses.
-
An optional namespace to classify the tag in the overall ontology.
-
A mandatory name to uniquely identify the tag in the context of its optional namespace.
-
An optional value providing details to the tag.
For example, we could define a tag such as geo:longitude=50.167958 to provide the meta-information of longitude to an entity.
This tag has a namespace geo, a name longitude and a double value 50.167958.
Additional information is available under the link:../../../docs/core/models/ Below the source code in modern Java is
public record Tag(String namespace, @NotNull String name, String value) {}
You should strongly consider the introduction of tag types to constrain the possible values of a specific tag.
For example, you can define that the namespace geo contains only the longitude and latitude tags.
Both these tags have mandatory values of type double.
Once your design supports tag types, you can add generic validation rules in the user interface and in business logic for all existing tags.
The ontology enforcement allows consistent reporting and data drilling over departments in your company and over time.