Configuring Navigation Properties
Navigation properties in OData are the reference attributes of an entity that points to another entity. By default, navigation properties are not available on an entity representation when it is accessed by an OData client. The OData client must expand these properties explicitly if they want the associated entities to be available when the entity is being accessed. Windchill REST Services reads the navigation property, which is a JSON array, from the <Entity JSON> file. Each entry in the navigations section defines one navigation property for the entity being configured. The navigation property consists of the following parameters:
name—Name of the navigation property. Property name is always defined in camel case.
target—OData entity set which is the target of this navigation. The entity being configured is the source entity. The entity set to which the navigation is being configured is the target entity.
type—OData type of the target entity set.
isCollection—Boolean which checks if the navigation to the target entity results in an entity set.
containsTarget—Boolean which checks if the navigation property is a containment navigation property. A containment navigation property in OData enables the read URL of a navigation property to be implicitly treated as an entity set.
traversal—A traversal string for navigation between two entities. You must create alias attribute mapping. You can navigate from one Windchill object type to another using the alias attribute mapping. Search for alias attribute mapping in the Windchill help center.
Use this parameter to apply a filter on a navigation property. This parameter is mandatory if you want to filter entity sets.
For example, consider the Parts.json file, where traversal is defined for the Uses navigation property. In this case, you can apply the filter on the Uses navigation property to filter the Parts entity set.
{
"name": "Uses",
"target": "PartUses",
"type": "PartUse",
"isCollection": true,
"containsTarget": true,
"traversal":"usedBy@wt.part.WTPartUsageLink"
}
See the section Support for $filter on Navigation Properties for examples on how to use $filter on navigation properties.