Detect annotations in engineering diagrams

Detect annotations in engineering diagrams. Note: All users in a CDF project with assets read-all and files read access to the requested files can access data sent to this endpoint. Supported input file mime_types are application/pdf, image/jpeg, image/png, image/tiff. Also note that the header of a successful response contains an X-Job-Token which allows to fetch the result of the job at /context/diagram/detect/{jobId} without requiring 'assetsAcl:READ'.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
Request Body schema: application/json
required
Array of objects or objects or objects (FileReferenceWithPageRange) [ 1 .. 50 ] items

Files to run entity detection on.

entities
required
Array of objects (DiagramDetectEntities) [ 1 .. 500000 ] items

If not pattern mode: A list of entities to look for. For example, all the assets under a root node. The searchField determines the strings that identify the entities. If pattern mode: The entities represent different types of entities, and detections will follow the same patterns as the samples provided. Letters can be replaced with letters and digits with digits. Brackets indicate strings that must be present, and the pipe symbol indicates alternatives.

searchField
string (DiagramSearchField)

This field determines the string to search for and to identify object entities.

partialMatch
boolean (DiagramPartialMatch)

Allow partial (fuzzy) matching of entities in the engineering diagrams. Creates a match only when it is possible to do so unambiguously.

minTokens
integer (DiagramMinTokens)

Each detected item must match the detected entity on at least this number of tokens. A token is a substring of consecutive letters or digits.

object (DiagramDetectBetaConfig)

Configuration for diagram detect that is only available in beta.

patternMode
boolean (PatternMode)

Only available in beta. If true, entities are not required to contain the search field. Instead they require a field called 'sample'. The sample field can be string, or list of alternative strings. Each string defines a pattern. E.g. 21-PT-1019 enables detecting tags consisting of 2 digits, 2 letters and 4 digits. Special characters are not necessary for detecting, but will be included in the detected string. It is possible to mark parts of the sample as constant strings by enclosing them in square brackets. Within square brackets, a | character can be used to separate alternative constants. Alternative constants must be either all digits or all letters. If false, regular diagram detect is performed, searching for occurrences of the search strings of the entities.

Responses
200

Success

400

The response for a failed request.

post/context/diagram/detect
Request samples
application/json
{
  • "items": [
    • {
      }
    ],
  • "entities": [
    • {
      },
    • {
      },
    • {
      },
    • {
      }
    ],
  • "searchField": "userDefinedField",
  • "partialMatch": false,
  • "minTokens": 2,
  • "configuration": {
    • "annotationExtract": true,
    • "caseSensitive": true,
    • "connectionFlags": [
      ],
    • "customizeFuzziness": {
      },
    • "directionDelta": 180,
    • "directionWeights": {
      },
    • "minFuzzyScore": 0.85,
    • "readEmbeddedText": true,
    • "removeLeadingZeros": true,
    • "substitutions": {
      }
    },
  • "patternMode": true
}
Response samples
application/json
{
  • "items": [
    • {
      }
    ],
  • "jobId": 123,
  • "status": "Queued",
  • "createdTime": 1730204346000,
  • "startTime": 1730204346000,
  • "statusTime": 1730204346000,
  • "errorMessage": null,
  • "searchField": "userDefinedField",
  • "partialMatch": false,
  • "minTokens": 2,
  • "configuration": {
    • "annotationExtract": true,
    • "caseSensitive": true,
    • "connectionFlags": [
      ],
    • "customizeFuzziness": {
      },
    • "directionDelta": 180,
    • "directionWeights": {
      },
    • "minFuzzyScore": 0.85,
    • "readEmbeddedText": true,
    • "removeLeadingZeros": true,
    • "substitutions": {
      }
    },
  • "patternMode": true
}