The RelatedConditionMatches of the augmenter is not flexible
Current implementation of the RelatedConditionMatches in the augmenter has following limitations:
- The condition match is text match only. The following two cases demonstrate that the regular expression match is needed:
Case 1: Extend the properties from the related objects whose IDs are defined under data.LineageAssertions[].ID
{
"Name": "Document-IndexPropertyPathConfiguration",
"Code": "osdu:wks:work-product-component--Document:1.",
"AttributionAuthority": "OSDU",
"Configurations": [{
"Name": "AssociatedFacilityNames",
"Policy": "ExtractAllMatches",
"Paths": [{
"RelatedObjectsSpec": {
"RelationshipDirection": "ChildToParent",
"RelatedObjectID": "data.LineageAssertions[].ID",
"RelatedObjectKind": "osdu:wks:master-data--Wellbore:1.",
"RelatedConditionMatches": [
"^[\\w\\-\\.]+:master-data\\-\\-Wellbore:[\\w\\-\\.\\:\\%]+$"
],
"RelatedConditionProperty": "data.LineageAssertions[].ID"
},
"ValueExtraction": {
"ValuePath": "data.FacilityName"
}
}
]
}, {
"Name": "AssociatedProjectNames",
"Policy": "ExtractAllMatches",
"Paths": [{
"RelatedObjectsSpec": {
"RelationshipDirection": "ChildToParent",
"RelatedObjectID": "data.LineageAssertions[].ID",
"RelatedObjectKind": "osdu:wks:master-data--SeismicAcquisitionSurvey:1.",
"RelatedConditionMatches": [
"^[\\w\\-\\.]+:master-data\\-\\-SeismicAcquisitionSurvey:[\\w\\-\\.\\:\\%]+$"
],
"RelatedConditionProperty": "data.LineageAssertions[].ID"
},
"ValueExtraction": {
"ValuePath": "data.ProjectName"
}
}
]
}
]
}
]
}
Case 2: Match the reference data values in any data partition (or ignoring the data partition)
{
"Name": "WellLog-IndexPropertyPathConfiguration",
"Code": "osdu:wks:work-product-component--WellLog:1.",
"AttributionAuthority": "OSDU",
"Configurations": [{
"Name": "WellUWI",
"Policy": "ExtractFirstMatch",
"Paths": [{
"ValueExtraction": {
"RelatedConditionMatches": [
"^[\\w\\-\\.]+:reference-data--AliasNameType:UniqueIdentifier:$",
"^[\\w\\-\\.]+:reference-data--AliasNameType:RegulatoryName:$",
"^[\\w\\-\\.]+:reference-data--AliasNameType:PreferredName:$",
"^[\\w\\-\\.]+:reference-data--AliasNameType:CommonName:$",
"^[\\w\\-\\.]+:reference-data--AliasNameType:ShortName:$"
],
"RelatedConditionProperty": "data.NameAliases[].AliasNameTypeID",
"ValuePath": "data.NameAliases[].AliasName"
}
}
]
}
]
}
As required, to extend a property from a related record, the kind of the related record must be defined in the configuration. However, the Relationship type under ExtensionProperties does not define the kind of the target object. In some cases, the source record Example: Extend the related object's name to the document, name of the related objects
- RelatedConditionProperty is limited to be a property of one level nested object.
In the above examples, both
data.NameAliases[].AliasNameTypeID
anddata.ExtensionProperties.Relationships[].TargetID
are properties of one level nested object. In some cases, RelatedConditionProperty can be a property of multi-level nested object. For example
{
"Name": "WellLog-IndexPropertyPathConfiguration",
"Code": "osdu:wks:work-product-component--WellLog:1.",
"AttributionAuthority": "OSDU",
"Configurations": [{
"Name": "OrganisationNames",
"Policy": "ExtractAllMatches",
"Paths": [{
"RelatedObjectsSpec": {
"RelationshipDirection": "ChildToParent",
"RelatedObjectKind": "osdu:wks:master-data--Organisation:1.",
"RelatedObjectID": "data.TechnicalAssurances[].Reviewers[].OrganisationID"
"RelatedConditionMatches": [
"^[\\w\\-\\.]+:reference-data--ContactRoleType:ProjectManager:AccountOwner:$",
"^[\\w\\-\\.]+:reference-data--ContactRoleType:AccountOwner:$"
],
"RelatedConditionProperty": "data.TechnicalAssurances[].Reviewers[].RoleTypeID"
},
"ValueExtraction": {
"ValuePath": "data.OrganisationName"
}
}
]
}
]
}
Edited by Zhibin Mai