Unify and manage your data

Mapping example 5

Mapping a DT Nested attribute to a CT Reference attribute

In this example, the AddressNested attribute in the DT is mapped to the Address reference attribute in the CT. Here the CT uses the Location entity and HasAddress relation type to store address details via reference attributes. The CT entity types and relation types may not exist in the DT and do not have to be created there. DTSS will resolve the mapping.

Reference attributes in the CT may exist either on the entity or the relationship type. The referenceObjectType property must be used to specify whether the target attribute is located on the entity or the relationship. If the target in the CT is on the entity type, the referenceObjectType property must be set to referenceEntity, and if the target in the CT is on a relation type, the referenceObjectType property must be set to referenceRelation.

{
  "copyFromDT": "configuration/entityTypes/HCP/attributes/AddressNested",
  "copyToCT": "configuration/entityTypes/HCP/attributes/Address",
  "attributes": [
    {
      "copyFromDT": "configuration/entityTypes/HCP/attributes/AddressNested/attributes/*",
      "copyToCT": [        "configuration/entityTypes/HCP/attributes/Address/attributes/*"
      ],
	"referenceObjectType": "referenceEntity"
    },
	{
      "copyFromDT": "configuration/entityTypes/HCP/attributes/AddressNested/attributes/AddressType",
      "copyToCT": [        "configuration/entityTypes/HCP/attributes/AddressType"
      ],
	"referenceObjectType": "referenceRelation"
    }
  ]
}

Or