Skip to content

Commit 6aa9b4b

Browse files
docs: update docs around entity relationships for root entities
1 parent 8f5e1ae commit 6aa9b4b

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

‎docs/user_guidance/entity_relationships.md‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,27 @@ In order to perform these validations, how to link normalised entities needs to
3737

3838
To allow the DVE to link between normalised assets, the following information should be provided (per linkable entity):
3939

40-
- parent_entity: the immediate parent of the entity
41-
- join_fields: how to join the entity with its parent in dictionary form (parent_field_name: child_field_name)
42-
- mandatory: whether the child entity is a mandatory field in the immediate parent
40+
- `parent_entity`: the immediate parent of the entity
41+
- `join_fields`: how to join the entity with its parent in dictionary form (parent_field_name: child_field_name)
42+
- `is_root_entity`: indicates that the entity is a root node in a hierarchical model
43+
- `mandatory`: whether the child entity is a mandatory field in the immediate parent
4344

4445
There is also the functionality to customise errors related to either missing parent or group rejections:
4546

46-
- missing_parent_id_error_code: the error code to display if a record is rejected as it has no valid parent record
47-
- missing_parent_id_error_message: the error message to display if a record is rejected as it hs no valid parent record
48-
- no_valid_records_error_code: the error code to display if parent records are removed due to no valid children in a mandatory field
49-
- no_valid_records_error_message: the error message to display if parent records are removed due to no valid children in a mandatory field
47+
- `missing_parent_id_error_code`: the error code to display if a record is rejected as it has no valid parent record
48+
- `missing_parent_id_error_message`: the error message to display if a record is rejected as it has no valid parent record
49+
- `no_valid_records_error_code`: the error code to display if parent records are removed due to no valid children in a mandatory field
50+
- `no_valid_records_error_message`: the error message to display if parent records are removed due to no valid children in a mandatory field
51+
- `empty_entity_error_code`: the error code to display if a __mandatory__ entity has any records post filtering
52+
- `empty_entity_error_message`: the error message to display if a __mandatory__ entity has any records post filtering
5053

5154
!!! note
52-
For root entities, you don't need to specify entity relationships - this will be inferred based on their absence.
53-
But you may wish to so that error codes and messages can be customised. Ensure that for root entities the parent_entity
54-
abd join_fields values are left blank.
55-
55+
Specifying root entities is __optional__. Root entities will be inferred based on their absence.
56+
You may wish to specify root entities so that error codes and messages can be customised (e.g. empty entity).
57+
58+
When specifying root entities you should ensure that parent_entity and join_fields values are left blank.
5659

5760
## Entity Hierarchy Object
5861

59-
60-
6162
The details provided in the entity_relationships section of the dischema are used to create an EntityHierarchy object.
6263
Please refer to [Advanced User Guidance: Entity Hierarchy](../advanced_guidance/package_documentation/entity_hierarchy.md).

0 commit comments

Comments
 (0)