GET Requests to Smart P&ID's Metadata - Intergraph Smart P&ID - 2.0 - Customization & Programming - Hexagon

Intergraph Smart P&ID Web API Help

Language
English
Product
Intergraph Smart P&ID
Subproduct
Web API
Search by Category
Customization & Programming
Smart P&ID Web API Version
2.0
Smart Electrical Web Version
2.0.1

Before running the queries, make sure the variables in the URI are populated with your values. For example: {{baseUri}} should already include your value of apiservername.domain.com set in your selected environment.

Common metadata

This request exposes the Smart P&ID EDM (Entity Data Model). The response is in XML format.

  • Select the request 02.02 Common metadata and click Send.

    The URL is:

    https://apiservername.domain.com/WebApi/SPID/V2/$metadata

  1. Collapse the rows for a minimized version. Alternatively, you can copy and paste this response into any XML editor to view and manipulate the information.

    Part of the returned response looks like this:

  2. Copy and paste the link in row #2: Oasis Consortium (http://docs.oasis-open.org/odata/ns/edmx) into a browser address bar to open the Oasis Consortium Website for more information about the XML schema definition.


    The Annotations reference defines the metadata of the exposed model and is common to all Smart P&ID sites.

    <edmx:Reference Uri="https://apiservername.domain.com/WebApi/SPID/V2/Annotations/$metadata">

    The Annotations maps the property name in the metadata with a meaningful display name, which is used in the desktop software.

    The next set of references ends with the names of the plants under the site, with the URI for each plant's metadata. In this example: /Sites('WEBAPISITE001')/Plants('PLANT001').

    The Vocabularies reference enables extension and customization of the model. It must be included as part of the EDM compliance.

    <edmx:Reference Uri="https://apiservername.domain.com/WebApi/SPID/V2/Vocabularies/Core/$metadata">

    The last group is Edmx:DataServices, which represent the ComplexTypes, EntityTypes, Functions, and Actions.

  3. Expand the row above (marked with a black arrow) to reveal all the entity types that are discoverable.

    The entity types are the discoverable item types in Smart P&ID. When you expand each entity type, the property SP_ID is revealed, followed by the navigation properties. The navigation properties reveal the relations between the entity and other entity types.

    For example, under the 'Vessel' entity type, the following relations appear:

Plant metadata

The plant metadata exposes the properties for each Smart P&ID item type.

  1. Select the request 02.03 Plant metadata and click Send.

    https://apiservername.domain.com/WebApi/SPID/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/
    $metadata

  2. At the top right corner of the payload section, click to open a search box and type Vessel:

    The 'Vessel' entity type's properties are displayed in the payload:

    The properties displayed in the results do not include case data properties.

Plant annotations

The API for Smart P&ID uses annotations to define additional information about plant properties.

  1. Select the request 02.04 Plant annotations and click Send.

    https://apiservername.domain.com/WebApi/SPID/V2/Sites('WEBAPISITE001')/Plants('PLANT001')/
    Annotations/$metadata

  2. In the top right corner of the payload section, click to open a search box and type SP_ID.

    There are 6 results of this property for the different entity types for which this property applies.

  3. Click the down arrow to cycle through each occurrence of the search results.

    The example below shows three of the results for this property:

    The DisplayName annotation shows the text string for the display name that appears in the desktop application.

    For some entities, there is also a Description annotation whose value is identical to DisplayName.