Creating/Updating Relations Pipeline

Main Pipeline to Create/Update Relations

  1. Start segment: [RELATION_UPSERT_START] - provides basic validation of the initial context (existence of a relation, existence check of the left and right ends of the relation, correct record status of the relation being updated). Performs initial context setting.

  2. Segments of the Point type:

    • [RELATION_UPSERT_ACCESS] - checks user’s rights to create/update the relation;

    • [RELATION_UPSERT_MEASURED] - normalizes measurable attributes of the relation before saving;

    • [RELATION_UPSERT_PERIOD_CHECK] - checks if the boundaries of validity period of the created/updated relation are correct.

  3. Segment of the Selector type: [RELATION_UPSERT_SELECTOR] - defines on which pipeline branch the creating/updating process will go: draft [DRAFT] or regular [REGULAR] branch.

  4. Finish segment: [RELATION_UPSERT_FINISH] - returns the result of creating/updating the relation.

[DRAFT] branch:

  • [RELATION_UPSERT_MODBOX] - prepares the changes made before calculating the updated relation timeline;

  • [RELATION_UPSERT_TIMELINE] - calculates the updated relation timeline. Applies the changes made to the current relation timeline, calculates validity periods, creates the etalon record of relation;

  • [RELATION_UPSERT_DRAFT] - performs saving/updating of the relation draft;

  • [RELATION_UPSERT_POSTPROCESSING] - performs post-processing of relation attributes. Calculates attribute values of the “Enumeration” and “Link to lookup entity” types, fills in templates of links to web resources;

[REGULAR] branch:

  • [RELATION_UPSERT_VALIDATE] - performs validation of attributes of created/updated relation and checks data consistency.

  • [RELATION_UPSERT_INDEXING] - calculates changes in search index when creating/updating the relation.

  • [RELATION_UPSERT_PERSISTENCE] - applies the changes calculated when creating/updating the relation to the DB and the search index.

Completed pipeline

Figure 1. Completed pipeline