Implementation:Datahub project Datahub HasStructuredProperties Mixin
| Knowledge Sources | |
|---|---|
| Domains | Java_SDK, Metadata_Management |
| Last Updated | 2026-02-10 00:00 GMT |
Overview
Description
HasStructuredProperties is a mixin interface in the DataHub Java SDK V2 that provides structured property operations for entities. Entities implementing this interface can have typed key-value properties attached for extensible metadata. Structured properties are identified either by a qualified property name (e.g., io.acryl.dataManagement.replicationSLA) or a full URN (e.g., urn:li:structuredProperty:io.acryl.dataManagement.replicationSLA).
All mutations use the StructuredPropertiesPatchBuilder for patch-based operations, supporting string values, single number values, and multiple number values. The interface uses the self-bounded generic pattern (T extends Entity & HasStructuredProperties<T>) for fluent API chaining.
Usage
Entity classes implement this interface to gain structured property management capabilities. Properties can be set with string or numeric values (single or multi-valued), and removed by URN. The StructuredPropertyUrns utility normalizes both qualified names and full URNs to proper URN format.
Code Reference
Source Location
metadata-integration/java/datahub-client/src/main/java/datahub/client/v2/entity/HasStructuredProperties.java
Signature
public interface HasStructuredProperties<T extends Entity & HasStructuredProperties<T>> {
@Nonnull
default T setStructuredProperty(@Nonnull String propertyUrn, @Nonnull String value)
@Nonnull
default T setStructuredProperty(@Nonnull String propertyUrn, @Nonnull List<String> values)
@Nonnull
default T setStructuredProperty(@Nonnull String propertyUrn, @Nonnull Number value)
@Nonnull
default T setStructuredProperty(
@Nonnull String propertyUrn,
@Nonnull Number value1,
@Nonnull Number value2,
@Nonnull Number... additionalValues)
@Nonnull
default T removeStructuredProperty(@Nonnull String propertyUrn)
}
Import
import datahub.client.v2.entity.HasStructuredProperties;
I/O Contract
Inputs
| Method | Parameter | Type | Description |
|---|---|---|---|
| setStructuredProperty | propertyUrn |
String |
Qualified property name or full URN |
| setStructuredProperty | value |
String |
Single string value to set |
| setStructuredProperty | values |
List<String> |
Multiple string values to set |
| setStructuredProperty | value |
Number |
Single numeric value to set |
| setStructuredProperty | value1, value2, additionalValues |
Number, Number, Number... |
Two or more numeric values to set (varargs) |
| removeStructuredProperty | propertyUrn |
String |
Qualified property name or full URN to remove |
Outputs
| Method | Return Type | Description |
|---|---|---|
| setStructuredProperty | T |
The entity itself for fluent chaining |
| removeStructuredProperty | T |
The entity itself for fluent chaining |
Usage Examples
Dataset dataset = Dataset.builder()
.platform("snowflake")
.name("my_table")
.build();
// Set single string values
dataset.setStructuredProperty("io.acryl.dataManagement.replicationSLA", "24h");
// Set single number values
dataset.setStructuredProperty("io.acryl.dataQuality.qualityScore", 95.5);
// Set multiple string values
dataset.setStructuredProperty("io.acryl.dataManagement.certifications",
Arrays.asList("SOC2", "HIPAA", "GDPR"));
// Set multiple number values
dataset.setStructuredProperty("io.acryl.privacy.retentionDays", 90, 180, 365);
// Remove a property
dataset.removeStructuredProperty("io.acryl.dataManagement.deprecated");
Related Pages
- Datahub_project_Datahub_HasOwners_Mixin - Mixin for ownership management
- Datahub_project_Datahub_HasGlossaryTerms_Mixin - Mixin for glossary term management
- Datahub_project_Datahub_HasDomains_Mixin - Mixin for domain assignment
- Datahub_project_Datahub_PatchTransformer - Interface for transforming patch MCPs