Skip to content

Implementation of new operations of sort "RELATIONSHIP" , "RELATIONSHIP_ARRAY"

Orsu Akhil requested to merge relationship-mapping-operations into master

With regards to handling wks transformation for the attributes of sort 'x-osdu-relationship' (ex ref ), have created new mapping operations of type "relationship" and "relationship_array" and implementations for the same in wks through this MR. These operations indicate the corresponding related wks of the related-id to be related to generated Wks.

To brief, say raw1 is related to raw2 (as field 'data.field1') and wks2 is the wks id for the raw2 ; upon wks transformation for raw1 say wks1 is to be generated then it would be related to wks2(as field 'data.transformedfield1' in wks1). Corresponding mapping operation that would trigger this transformation is

    {
      "identifier": "data.field1",
      "operations": [
        {
          "type": "RELATIONSHIP",
          "sourceProperty": "data.field1",
          "targetProperty": "data.transformedfield1"
        }
      ]
    }

The Transformation logic related to this sort of operation would follow the flow implemented in previous MR here in determining what value to be put in the targetProperty's field of wks record.

Currently in Wks, the relationship transformation and its logic would happen onto the Relationship-block (JsonObject pertaining to 'data.relationships' path in raw-record's json) which is hard-coded in Application logic. This 'data.relationships' fragment is not valid as per osdu schemas and hence through this MR would be removing this functionality and it shall be replaced by new mapping operations.

RELATIONSHIP_ARRAY would cater to operations involving properties of Array type.

    {
      "identifier": "data.field1",
      "operations": [
        {
          "type": "RELATIONSHIP_ARRAY",
          "sourceProperty": "data.field1[*]",
          "targetProperty": "data.transformedfield1[*]"
        }
      ]
    }

In this operation , transformation would happen for Json Array of path data.field1[] , here * indicates tranformation to happen for all the individual elements of this Array

Edited by Orsu Akhil

Merge request reports