Exposing relationships - HxGN SDx - Update 63 - Administration & Configuration - Hexagon

HxGN SDx API Services Configuration

Language
English
Product
HxGN SDx
Search by Category
Administration & Configuration
SmartPlant Foundation / SDx Version
10

When two or more API Entry Points have been configured, the OData API Metadata generation process automatically seeks out and configures relationship definitions and edge definitions between those exposed types. These are dynamically generated in the OData metadata document on the entities as navigation properties on each side of the relationship definition, or only on the starting side when used with an edge definition. For more information, see .OData metadata generation.

Relationship definitions between two exposed entity types are automatically exposed as OData navigation properties. The end entities must be exposed in the metadata for the navigation properties to be exposed. You can also expose the end entities by relating them to the API Group. Any access to the underlying relationship definition or edge definition is based on a user's access permissions to the access groups, and their ability to determine the correct type found at each end of the navigation.

For example, if ISPFPlant and ISPFFunctionalArea interface definitions are exposed by an API Entry Point, the underlying SPFPlantAreas relationship definition is used to create a navigation property on both the Plant and Area types.

SHARED Tip The process of exposing relationships as navigation properties is exactly the same for both Web API v2 and the Web API v3.

How to stop a relationship or edge definition being exposed in Web API v3

By default, relationship and edge definitions are exposed in Web API v3 by the SPFRelDefIsExposed property on the relationship definition and the SPFEdgeDefIsExposed property on the edge definition being set to True. However,you can stop relationship or edge definitions being exposed by setting these properties to False.

The process for locating relationship and edge definitions to add to the metadata depends on whether an entity type is exposed as an interface definition or as a class definition:

  • If a class definition is exposed as an entity type, the process examines all the realized interfaces of the class definition to find the relationships. Each relationship found is added to the metadata.

  • If an interface definition is exposed as an entity type, the process examines all the implied interfaces of the interface definition to find the relationships. Each relationship found is added to the metadata.

  • Edge definitions that have the following properties as values cannot be exposed using API services:

    • SPFPostHandlerUIDAndOrMethodDefUID

    • SPFPostRelDefExpansion

    • SPFPreRelDefExpansion.

    These edge definitions require special preceding and post expansion activity, which is not supported through API Services. To navigate to the paths represented by the edge definitions, you must create a new edge definition with the preceding and post navigation properties in the path.

  • You cannot expose object types in the OData metadata using abstract relationship definitions to define the navigation as they are not supported. This is because they can have a significant performance impact on the generation of the OData model as you log on.