Uniqueness
What this is
Run global duplicate detection for indexed business keys using SHACL-native uniqueness constraints.
When to use it
Use uniqueness when duplicates must be prevented across the full class population, for example:
- work order names or IDs
- operation names
- enterprise keys used by downstream analytics
Use this after single-instance and graph-consistency rules are in place.
Industrial examples
- Work order number must be unique across all active maintenance orders.
- Operation name must be unique within the operational domain.
- Equipment tag identifier must be unique for all assets in a plant.
Example (SHACL uniqueness constraint)
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix dqs: <http://purl.org/cognite/dqs#> .
@prefix sp: <http://purl.org/cognite/my_space/WorkOrder/> .
sp:WorkOrderUniquenessShape
a sh:NodeShape ;
sh:targetClass sp:WorkOrder ;
dqs:uniquenessConstraint [
dqs:property "workOrderNumber" ;
dqs:ruleId "WO_Number_Unique" ;
] .
Related guides
- Uniqueness validation — grouped uniqueness
externalIdis still per property, notruleId