Skip To Content

Query Associated Objects

Description

The queryAssociatedObjects operation is performed on a schematic diagram template resource. The result of this operation is an array of schematic primary and secondary associations.

It is used to retrieve the primary and secondary associations for a set of schematic features contained in a schematic diagram. The associations object returned by the REST API gives the associations per schematic feature class ID as follows:

  • featureClassID: The schematic feature class ID (Long)

  • primaryAssociations: An array of <Association> objects

  • secondaryAssociations: An array of <Association> objects

    Each primary or secondary < Association> object being returned as follows:

    • objectID: The schematic feature ObjectID (Long)
    • associatedClass: The name of the feature class of the associated object (String)
    • associatedID: The ObjectID of the associated object (Long)

You can provide arguments to the queryAssociatedObjects operation as query parameters defined in the parameters table below.

Request parameters

ParameterDetails
f

The response format. The default response format is html.

Values: html | json

name

(Required)

The diagram name.

Syntax: name=<diagramName>

Example: name=Diagram1

selection

The list of the schematic feature names per schematic feature class ID for which the operation has to retrieve the primary and secondary associations.

Each schematic feature name corresponds to a value of the SCHEMATICTID field in the schematic feature class.

Syntax:

selection=[
     {
       "featureClassID" : <schFeatureClassID1>, 
       "objectNames" : ["<schFeatureClassID1_Name1>",..., "<schFeatureClassID1_NameN>"]
     },
     ...,
     {
       "featureClassID" : <schFeatureClassIDN>, 
       "objectNames" : ["<schFeatureClassIDN_Name1>",..., "<schFeatureClassIDN_NameM>"]
     }
]

Example: selection=[{"featureClassID": 2888, "objectNames": ["149-1608-0", "149-1111-0", "149-1323-0"]}]

Note:

When this parameter is NULL, the queryAssociatedObjects operation performs on all the schematic features contained in the specified diagram.

Caution:

When specifying this parameter, don't forget the '[' and ']' characters at the beginning and end. When they are not specified, the operation performs on all the schematic features contained in the specified diagram.

Example usage

Example 1: queryAssociatedObjects on the MPS_Goldmine diagram, based on the template which ID is 2 under the S1_Schematics Schematics sample service, with [{"featureClassID": 99, "objectNames": ["20-1554-0"]}] for the selection parameter, returns the primary and secondary associations for the PrimaryLine schematic feature which SCHEMATICTID is '20-1554-0'. This only schematic feature link is primarily associated with an edge, and secondarily with two other edges and two points, those elements being reduced in the MPS_Goldmine diagram.

https://servicesbeta6.esri.com/arcgis/rest/services/S1_Schematics/MapServer/exts/SchematicsServer/templates/2/queryAssociatedObjects?name=MPS_Goldmine&selection=%5B%7B%22featureClassID%22%3A+99%2C+%22objectNames%22%3A+%5B%2220-1554-0%22%5D%7D%5D&f=pjson

Example 2: queryAssociatedObjects on the Substation 08 diagram, based on the template which ID is 1, under the S1_Schematics Schematics sample service, with [{"featureClassID": 116,"objectNames": ["114-Node-43"]}] for the selection parameter, returns the associations for the Inside_Switch schematic feature which SCHEMATICTID is '114-Node-43'. This schematic feature node has no primary associations, it has only secondary associations.

https://servicesbeta6.esri.com/arcgis/rest/services/S1_Schematics/MapServer/exts/SchematicsServer/templates/1/queryAssociatedObjects?name=Substation+08&selection=%5B%7B%22featureClassID%22%3A+116%2C%22objectNames%22%3A+%5B%22114-Node-43%22%5D%7D%5D&f=pjson

JSON Response syntax


            {
  "associations" : [
    {
      "featureClassID" : <schfeatureClassID>,
      "primaryAssociations" : [
        {
          "objectID" : <schFeature1_ID>,
          "associatedClass" : "<schFeature1_AssociatedObjectClass>",
          "associatedID" : <schFeature1_AssociatedObjectID>
        },
        ...,
        {
          "objectID" : <schFeatureN_ID>,
          "associatedClass" : "<schFeatureN_AssociatedObjectClass>",
          "associatedID" : <schFeatureN_AAssociatedObjectID>
        }
      ],
      "secondaryAssociations" : [
        
      ]
    }
  ]
}

JSON Response example

The following is an example for a given diagram with selection = {"featureClassID": 885, "objectNames": ["859-3-0"]}


            //For the sample schematic diagram, the operation returns two GIS features with primary associations with the 859-3-0 input schematic feature:
{
   "associations": [
    {
     "featureClassID": 885,
     "primaryAssociations": [
      {
       "objectID": 806,
       "associatedClass": "ElecDemo.SDE.pug_PUG_gas_plants",
       "associatedID": 3
      }
     ],
     "secondaryAssociations": [
      
     ]
    },
    {
     "featureClassID": 893,
     "primaryAssociations": [
      {
       "objectID": 802,
       "associatedClass": "ElecDemo.SDE.pug_PUG_electric",
       "associatedID": 23
      }
     ],
     "secondaryAssociations": [
      
     ]
    }
   ]
}