Clarify the relationship between two entities
When two entities are related in more than one way, nesting the entities inside each other is not enough to determine which path to follow. For example, an asset can be either the source or target of a relation or a user can be the creator or the lastModifier of a resource. Depending on the entity, there are two possibilities:
- The name of the child entity is changed. For example,
SourceAssetorTargetAssetshould be used underRelationinstead ofAsset. In this case, they act and behave just like normal assets and exist for the sole purpose of clarifying the relationship followed. - A special parameter called the
Parent Relationship Selectoris added to the child entity. For example,Relationhas aTypeparameter with possible values ofSOURCEorTARGET. This parameter determines the relationship between theRelationand the parentAsset.
The following example shows the query going two levels deep.
- JSON
- YAML
{
"ViewConfig": {
"Resources": {
"Asset": {
"Id": { "name": "id" },
"Signifier": { "name": "name" },
"Relation": {
"type": "SOURCE",
"TargetAsset": {
"Id": { "name": "relatedAssetLevelOneId" },
"Signifier": { "name": "relatedAssetLevelOne" },
"Relation": {
"type": "TARGET",
"SourceAsset": {
"Id": { "name": "relatedAssetLevelTwoId" },
"Signifier": { "name": "relatedAssetLevelTwo" }
}
}
}
}
}
}
}
}
---
ViewConfig:
Resources:
Asset:
Id:
name: "id"
Signifier:
name: "name"
Relation:
type: "SOURCE"
TargetAsset:
Id:
name: "relatedAssetLevelOneId"
Signifier:
name: "relatedAssetLevelOne"
Relation:
type: "TARGET"
SourceAsset:
Id:
name: "relatedAssetLevelTwoId"
Signifier:
name: "relatedAssetLevelTwo"
These special parameters and custom entity names only exist for a fraction of the available entities. For a complete list, see Entities, properties and relations.
To reduce the number of assets returned, the query example above is not filtered. Filtering would return a large amount of data and impact performance.