Skip to main content
Version: v5.3

IafAOSvc

Use the IafAOSvc API to work with AO Service resources, such as an ontology's impact analysis reports.

abandonPromotionRequest​

Abandons an open promotion request so a different version can be put forward. Needs the action on the ontology.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
requestIdYesStringPass the promotion request's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcPromotionRequest> - A promise with the promotion request.

Examples
const request = await IafAOSvc.abandonPromotionRequest('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'req-1', ctx);

acquireOntologyLock​

Acquires an ontology's edit lock. Fails with 409 when another user holds it. Reports when the ontology is not lock-protected.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcOntologyLock> - A promise with the lock status.

Examples
const lock = await IafAOSvc.acquireOntologyLock('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);
if (lock._changedByAnother) console.log('Someone edited the ontology while you were away.');

addPropertyMapping​

Adds a field to property mapping to a class.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
mappingYesAosvcPropertyMappingCreatePass a property mapping. is required.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcPropertyMapping> - A promise with the created property mapping.

Examples
const mapping = await IafAOSvc.addPropertyMapping('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', { _itemsvcField: 'properties.flowRate', _ontologyProperty: 'flowRate' }, ctx);

addReadings​

Appends telemetry readings to one individual (telemetry item) of a Telemetry-rooted class.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
individualIdYesStringPass the individual's id.
readingsYes(JSON | Array<JSON>)Pass one reading object or an array of readings.
criteriaNoAosvcAddReadingsCriteriaPass a JSON object with "sourceId" and "transactional" parameters.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.addReadings('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', 'sensor-1', [{ _ts: '2026-09-30T10:00:00Z', value: 21.4 }], { transactional: true }, ctx);

addReadingsBatch​

Appends telemetry readings to several individuals (telemetry items) of a Telemetry-rooted class.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
readingsYes(JSON | Array<JSON>)Pass one reading object or an array of readings. Each reading identifies its individual.
criteriaNoAosvcAddReadingsCriteriaPass a JSON object with a "transactional" parameter.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.addReadingsBatch('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', readings, { transactional: false }, ctx);

applyChangeSet​

Atomically applies an ordered set of add, update and delete schema operations as one new revision. Pass the header to guard against concurrent changes.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
changeSetYesAosvcChangeSetPass an object with an ordered array.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcRevision> - A promise with the new revision manifest.

Examples
const revision = await IafAOSvc.applyChangeSet('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {
operations: [
{ op: 'update', collection: 'entity_classes', id: '5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', document: updatedClassDocument }
]
}, ctx, { headers: { 'If-Match': '"6"' } });

bindStateMachineClasses​

Binds additional classes to a state machine's . Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
machineIdYesStringPass the state machine's id.
bindingYesAosvcStateMachineClassBindingPass an object with the to bind.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcStateMachine> - A promise with the updated state machine.

Examples
const machine = await IafAOSvc.bindStateMachineClasses('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'machine-1', { _classIds: ['valve-cls'] }, ctx, { headers: { 'X-Ontology-Draft': 2 } });

bulkAddIndividualRelationships​

Bulk-adds individual relationships asynchronously. The call returns a task id immediately; validation and the submit run on a worker. Poll the task with getBulkRelationshipsStatus. The batch is validated all-or-nothing.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
relationshipsYesArray<AosvcIndividualRelationship>Pass a JSON array of relationship edges (maximum 10 MB). Each entry needs , and .
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<JSON> - A promise with the accepted task: , (QUEUED) and .

Examples
const task = await IafAOSvc.bulkAddIndividualRelationships('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', [
{ _relatedFromId: 'pump-1', _userType: 'locatedIn', _relatedToIds: ['room-1'] }
], ctx);

confirmPromotionRequest​

Confirms a promotion request: step two, which makes the version live. Needs the action on the ontology; is not enough. The version is applied by a queued job that runs as the caller, so the service answers 202 with no body and a header, the URL of the promotion request.When the request has an impact analysis report, is required: it must be this request's report, it must be , and the live version must not have changed since it was made — otherwise the call fails (400 when missing, 409 otherwise). A first promotion has no report and needs no body.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
requestIdYesStringPass the promotion request's id.
confirmNoAosvcPromotionConfirmPass an object with the of the request's report.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<(AosvcPromotionRequest | String)> - A promise with the promotion request (200, when the service applies it at once). When the job was queued (202) there is no body, so the promise resolves with the request's absolute URL; poll the request with getPromotionRequests until its is PROMOTED or FAILED.

Examples
const request = await IafAOSvc.confirmPromotionRequest('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'req-1',
{ _reportId: '7e2b4f19-6c8a-4d05-9e31-2a8f6c1d9b47' }, ctx);

createAction​

Creates an action. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
actionYesAosvcActionCreatePass an action object. and are required.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcAction> - A promise with the created action.

Examples
const action = await IafAOSvc.createAction('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {
_name: 'Notify on fault', _actionType: 'NOTIFICATION', _params: { template: 'pump_fault' }
}, ctx, { headers: { 'X-Ontology-Draft': 2 } });

createClasses​

Creates one or more entity classes in an ontology. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
classesYes(AosvcEntityClassCreate | Array<AosvcEntityClassCreate>)Pass one entity class or an array of entity classes to create.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<JSON> - A promise with the created class, or an array of the created classes.

Examples
const created = await IafAOSvc.createClasses('a1b2c3d4-e5f6-7890-abcd-ef1234567890', [
{ _name: 'Pump', _parentClass: { _id: 'Equipment' }, _pluralName: 'Pumps' }
], ctx, { headers: { 'X-Ontology-Draft': 2 } });

createConstraints​

Adds one or more property constraints to an ontology. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
constraintsYes(AosvcConstraintCreate | Array<AosvcConstraintCreate>)Pass one constraint or an array of constraints.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<JSON> - A promise with the created constraint, or an array of the created constraints.

Examples
const created = await IafAOSvc.createConstraints('a1b2c3d4-e5f6-7890-abcd-ef1234567890', [{
_constraintId: 'pump-name-required',
_targetClass: { _id: 'pump-cls' },
_constraintsJson: JSON.stringify({ _name: { minCount: 1 } })
}], ctx, { headers: { 'X-Ontology-Draft': 2 } });

createDraft​

Creates a draft by copying a version. Copies the live version unless names another. Use the draft number in the header for schema writes.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
draftYesAosvcDraftCreateOptionally pass an object with the to copy.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcOntologyVersion> - A promise with the draft version.

Examples
const draft = await IafAOSvc.createDraft('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {}, ctx);
// Then write to the draft
await IafAOSvc.createClasses('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { _name: 'Valve', _parentClass: { _id: 'Equipment' } }, ctx, { headers: { 'X-Ontology-Draft': draft._versionNumber } });

createIndividualRelationship​

Creates a relationship from an individual to one or more target individuals. The relationship is validated against the ontology.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
individualIdYesStringPass the individual's id.
relationshipYesAosvcIndividualRelationshipPass the relationship type in and the targets in .
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcIndividualRelationship>> - A promise with the relationship edges of the individual.

Examples
const edges = await IafAOSvc.createIndividualRelationship('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', 'pump-1', { _userType: 'locatedIn', _relatedToIds: ['room-1'] }, ctx);

createIndividuals​

Creates one or more individuals of a class. The individuals are validated against the ontology first and stored in ItemSvc. A non-conforming body is rejected with 422.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
individualsYes(JSON | Array<JSON>)Pass one individual or an array of individuals. Inline are created with them.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<JSON> - A promise with the created individual, or an array of the created individuals.

Examples
const created = await IafAOSvc.createIndividuals('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', [
{ _name: 'Pump A', _relationships: [{ _userType: 'locatedIn', _relatedToIds: ['room-1'] }] },
{ _name: 'Pump B' }
], ctx);

createOntology​

Creates an application ontology.

ParameterRequiredTypeDescription
ontologyYesAosvcOntologyCreatePass an ontology object. is required. Set to opt in to edit locking.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcOntology> - A promise with the created ontology.

Examples
const ontology = await IafAOSvc.createOntology({
_name: 'Plant Ontology',
_description: 'Pumps, valves and rooms of the plant.',
_editLockTimeoutSeconds: 21600
}, ctx);

createOrUpdatePermissions​

Idempotently creates or updates ontology or ontology class permissions. Class permission changes, and ontology permissions that grant (or stop granting) or , reconcile downstream Item Service grants in the background; the service then answers 202 instead of 200, with the same body. The task is identified by the response header (), which this method returns as the non-enumerable property of the response: pass its last path segment to getAsyncTask and poll until the task is COMPLETED or FAILED.

ParameterRequiredTypeDescription
permissionsYesArray<Permission>Pass an array of Permission objects whose is an aosvc ontology or ontology class IRN.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<CreatePermissionsResponse> - A promise with the created and failed permissions, for both 200 and 202. Check : it is the only place a failed grant is reported. On a 202, holds the task's absolute URL.

Examples
const response = await IafAOSvc.createOrUpdatePermissions([{
_namespace: 'plant_ns',
_resourceDesc: { _irn: 'aosvc:ontology:a1b2c3d4-e5f6-7890-abcd-ef1234567890' },
_user: { _id: 'f1e2d3c4-b5a6-4789-8abc-def012345678', _type: 'usergroup' },
_actions: ['READ']
}], ctx);

createPromotionRequest​

Requests a promotion of a published version: step one, which runs the checks and reports what they found. Needs the action on the ontology; is not enough.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
requestYesAosvcPromotionRequestCreatePass an object with the to promote.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .The request carries an impact analysis report on the version against the live one, as — an
existing matching report or a new one being generated. A first promotion, with nothing live yet, has none.
Returns

Promise<AosvcPromotionRequest> - A promise with the promotion request, including .

Examples
const ontologyId = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890';
const request = await IafAOSvc.createPromotionRequest(ontologyId, { _versionNumber: 2 }, ctx);
if (request._reportId) {
// Review the report once it is READY, then confirm with it.
let report = await IafAOSvc.getImpactAnalysisReport(ontologyId, request._reportId, ctx);
while (report._status === 'PENDING') {
await new Promise(resolve => setTimeout(resolve, 2000));
report = await IafAOSvc.getImpactAnalysisReport(ontologyId, request._reportId, ctx);
}
}
await IafAOSvc.confirmPromotionRequest(ontologyId, request._requestId, { _reportId: request._reportId }, ctx);

createRelationship​

Adds an object property relationship between two classes. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
relationshipYesAosvcEntityRelationshipCreatePass a relationship object. , and are required.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcEntityRelationship> - A promise with the created relationship.

Examples
const relationship = await IafAOSvc.createRelationship('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {
_sourceClassId: 'pump-cls', _targetClassId: 'room-cls', _type: 'locatedIn'
}, ctx, { headers: { 'X-Ontology-Draft': 2 } });

createRules​

Adds one or more rules to an ontology. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
rulesYes(AosvcRuleCreate | Array<AosvcRuleCreate>)Pass one rule or an array of rules. is required.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<JSON> - A promise with the created rule, or an array of the created rules.

Examples
const created = await IafAOSvc.createRules('a1b2c3d4-e5f6-7890-abcd-ef1234567890', [
{ _ruleType: 'SubClassOf', _subClassId: 'pump-cls', _superClassId: 'equipment-cls' }
], ctx, { headers: { 'X-Ontology-Draft': 2 } });

createStateMachine​

Creates a complete state machine. Exactly one state must be marked — the state a new individual of a bound class starts in (422 otherwise). Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
stateMachineYesAosvcStateMachinePass the complete state machine: name, class ids, states, events and transitions.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcStateMachine> - A promise with the created state machine.

Examples
const machine = await IafAOSvc.createStateMachine('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {
_name: 'Pump status',
_classIds: ['pump-cls'],
_states: [{ _id: 's-on', _name: 'On', _value: 'ON', _initial: true }, { _id: 's-off', _name: 'Off', _value: 'OFF' }],
_events: [{ _id: 'e-stop', _name: 'Stop' }],
_transitions: [{ _name: 'Stop pump', _fromStateId: 's-on', _toStateId: 's-off', _eventIds: ['e-stop'], _actions: [] }]
}, ctx, { headers: { 'X-Ontology-Draft': 2 } });

deleteAction​

Deletes an action. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
actionIdYesStringPass the action's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.deleteAction('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'action-1', ctx, { headers: { 'X-Ontology-Draft': 2 } });

deleteAsyncTask​

Deletes a task row. Note: this route is disabled in aosvc 5.3 (its controller is commented out), so the service currently answers 404.

ParameterRequiredTypeDescription
idYesStringPass the resource's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.deleteAsyncTask('f3b1c2d4-0000-4000-8000-000000000002', ctx);

deleteClass​

Deletes an entity class. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
classIdYesStringPass the entity class's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.deleteClass('a1b2c3d4-e5f6-7890-abcd-ef1234567890', '5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', ctx, { headers: { 'X-Ontology-Draft': 2 } });

deleteCollectionMapping​

Removes the binding and property mappings of a class. Also deletes the ItemSvc collection and its items unless another class still maps to it.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.deleteCollectionMapping('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', ctx);

deleteConstraint​

Deletes a property constraint. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
constraintIdYesStringPass the constraint's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.deleteConstraint('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'pump-name-required', ctx, { headers: { 'X-Ontology-Draft': 2 } });

deleteImport​

Undoes an import by deleting the individuals it created. The deletes run asynchronously in ItemSvc, so the result is not a completion receipt.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
asyncTaskIdYesStringPass the import's async task id (the _asyncTaskId of its result).
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcImportCleanupResult> - A promise with what was dispatched.

Examples
const result = await IafAOSvc.deleteImport('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'f3b1c2d4-0000-4000-8000-000000000002', ctx);

deleteIndividual​

Deletes an individual.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
individualIdYesStringPass the individual's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.deleteIndividual('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', 'pump-1', ctx);

deleteIndividualRelationship​

Removes one relationship edge from an individual.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
individualIdYesStringPass the individual's id.
userTypeYesStringPass the relationship type name.
targetIndividualIdYesStringPass the target individual's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcIndividualRelationship>> - A promise with the remaining relationship edges of the individual.

Examples
const edges = await IafAOSvc.deleteIndividualRelationship('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', 'pump-1', 'locatedIn', 'room-1', ctx);

deleteMcpConfig​

Removes the MCP tool configuration of a class.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.deleteMcpConfig('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', ctx);

deleteOntology​

Deletes an application ontology.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.deleteOntology('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

deletePropertyMapping​

Removes a field to property mapping from a class.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
mappingIdYesStringPass the property mapping's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.deletePropertyMapping('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', 'mapping-1', ctx);

deleteRelationship​

Removes an object property relationship. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
relationshipIdYesStringPass the relationship's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.deleteRelationship('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'rel-1', ctx, { headers: { 'X-Ontology-Draft': 2 } });

deleteRule​

Deletes a rule. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ruleIdYesStringPass the rule's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.deleteRule('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'rule-1', ctx, { headers: { 'X-Ontology-Draft': 2 } });

deleteStateMachine​

Deletes a state machine definition. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
machineIdYesStringPass the state machine's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.deleteStateMachine('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'machine-1', ctx, { headers: { 'X-Ontology-Draft': 2 } });

discardDraft​

Discards a draft and deletes its schema rows.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
versionNumberYesNumberPass the ontology version's number.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.discardDraft('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 2, ctx);

explainOwl​

Returns bounded proof availability and reasoner metadata for an axiom of an OWL preview.

ParameterRequiredTypeDescription
requestYesAosvcOwlExplanationRequestPass the and the preview request it came from.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcOwlExplanationResponse> - A promise with the explanation.

Examples
const explanation = await IafAOSvc.explainOwl({ contractVersion: 1, axiomId: preview.axioms[0].id, preview: previewRequest }, ctx);

generateModel​

Build with AI: proposes an application model (subclasses, relationships and rules) through aisvc.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
requestYesAosvcGenerateModelRequestPass a request with the , and optionally a team, the current model, conversation history and file attachments.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcGenerateModelResponse> - A promise with the proposed model.

Examples
const response = await IafAOSvc.generateModel('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { _prompt: 'Model a water treatment plant with pumps, valves and tanks.' }, ctx);

getAction​

Gets an action by its id.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
actionIdYesStringPass the action's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcAction> - A promise with the action.

Examples
const action = await IafAOSvc.getAction('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'action-1', ctx);

getActions​

Gets the actions defined in an ontology.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcAction>> - A promise with the actions.

Examples
const actions = await IafAOSvc.getActions('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

getAsyncTask​

Gets the state of a queued aosvc task, such as a bulk import, a bulk relationship add, a promotion or a permission reconciliation.

ParameterRequiredTypeDescription
idYesStringPass the resource's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcAsyncTask> - A promise with the task.

Examples
const task = await IafAOSvc.getAsyncTask('f3b1c2d4-0000-4000-8000-000000000002', ctx);

getBaseClasses​

Gets the core classes defined in the base platform ontology.

ParameterRequiredTypeDescription
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcCoreClass>> - A promise with the core classes.

Examples
const coreClasses = await IafAOSvc.getBaseClasses(ctx);

getBaseOntology​

Gets the base platform ontology files: the ontology, its rules and its constraints.

ParameterRequiredTypeDescription
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<JSON> - A promise with the base ontology files.

Examples
const base = await IafAOSvc.getBaseOntology(ctx);

getBaseOntologyVersions​

Gets the available base platform ontology versions, newest first.

ParameterRequiredTypeDescription
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcBaseOntologyVersion>> - A promise with the base ontology versions.

Examples
const versions = await IafAOSvc.getBaseOntologyVersions(ctx);

getBulkRelationshipsStatus​

Gets the status of a bulk relationship task: the aosvc status while it is queued, validating or rejected, and then the ItemSvc task status once submitted.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
taskIdYesStringPass the task's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<JSON> - A promise with the task status.

Examples
const status = await IafAOSvc.getBulkRelationshipsStatus('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', task._taskId, ctx);

getClass​

Gets an entity class by its id.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
classIdYesStringPass the entity class's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcEntityClass> - A promise with the entity class.

Examples
const entityClass = await IafAOSvc.getClass('a1b2c3d4-e5f6-7890-abcd-ef1234567890', '5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', ctx);

getClasses​

Gets the entity classes of an ontology that the caller may read.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcEntityClass>> - A promise with the entity classes.

Examples
const classes = await IafAOSvc.getClasses('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

// Read the classes of a draft version
const draftClasses = await IafAOSvc.getClasses('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx, { headers: { 'X-Ontology-Draft': 2 } });

getClassPermissions​

Gets the Passport permissions granted on an entity class.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<Permission>> - A promise with the permissions.

Examples
const permissions = await IafAOSvc.getClassPermissions('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', ctx);

getClassReadings​

Gets the telemetry readings of all the individuals (telemetry items) of a Telemetry-rooted class, newest first.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
criteriaNoAosvcReadingsCriteriaPass a JSON object with "from", "to", "offset", "limit" and "ascending" parameters.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcReadingsPage> - A promise with a page of readings.

Examples
const page = await IafAOSvc.getClassReadings('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', { ascending: true, limit: 200 }, ctx);

getCollectionMapping​

Gets the ItemSvc collection a class is bound to.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcCollectionMapping> - A promise with the collection mapping.

Examples
const mapping = await IafAOSvc.getCollectionMapping('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', ctx);

getConstraints​

Gets the property constraints defined for an ontology.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcConstraint>> - A promise with the constraints.

Examples
const constraints = await IafAOSvc.getConstraints('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

getEffectiveClassSchema​

Gets the effective schema of a class: its properties (including inherited ones), constraints and state machines. Pass 'base' as the ontologyId to read a base platform class.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
classIdYesStringPass the entity class's id.
criteriaNoAosvcEffectiveSchemaCriteriaPass a JSON object with "inherited" and "baseVersion" filters.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcEffectiveClassSchema> - A promise with the effective schema.

Examples
const schema = await IafAOSvc.getEffectiveClassSchema('a1b2c3d4-e5f6-7890-abcd-ef1234567890', '5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', {}, ctx);

// Only the properties the class declares itself
const own = await IafAOSvc.getEffectiveClassSchema('a1b2c3d4-e5f6-7890-abcd-ef1234567890', '5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', { inherited: false }, ctx);

getImpactAnalysisReport​

Gets an impact analysis report by its id, including once it is , or if it .

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
reportIdYesStringPass the report's id.
ctxNoCtxContext, such as namespaces and authentication token information.
Returns

Promise<ImpactAnalysisReport> - A promise with the ImpactAnalysisReport object.

Examples
const report = await IafAOSvc.getImpactAnalysisReport('d4721098-9c7f-4e7d-84f4-84bea8f21ca2', '7e2b4f19-6c8a-4d05-9e31-2a8f6c1d9b47', ctx);

getImpactAnalysisReports​

Gets an ontology's impact analysis reports that match your criteria, newest first. Reports in the page do not include ; get a report by its id for that.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
criteriaNoImpactAnalysisReportCriteriaPass a JSON object with a filter, such as by or .
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcOptionsPass a JSON object for optional control parameters, such as pagination options.
Returns

Promise<Page<ImpactAnalysisReport>> - A promise with a page that contains the ImpactAnalysisReport objects, without .

Examples
// Get the latest reports
const reports = await IafAOSvc.getImpactAnalysisReports('d4721098-9c7f-4e7d-84f4-84bea8f21ca2', {}, ctx);

// Get reports on version 3 created after a date
const v3Reports = await IafAOSvc.getImpactAnalysisReports('d4721098-9c7f-4e7d-84f4-84bea8f21ca2',
{ query: { _versionFrom: 3, _createdAt: { $gt: '2026-09-22T14:00:00Z' } } }, ctx, { _pageSize: 10 });

// Get reports with breaking changes
const breaking = await IafAOSvc.getImpactAnalysisReports('d4721098-9c7f-4e7d-84f4-84bea8f21ca2',
{ query: { '_report._verdict._breaking': { $gt: 0 } } }, ctx);

getIndividual​

Gets an individual by its id.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
individualIdYesStringPass the individual's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<JSON> - A promise with the individual.

Examples
const individual = await IafAOSvc.getIndividual('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', 'pump-1', ctx);

getIndividualRelationships​

Gets the relationship edges of an individual.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
individualIdYesStringPass the individual's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcIndividualRelationship>> - A promise with the relationship edges.

Examples
const edges = await IafAOSvc.getIndividualRelationships('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', 'pump-1', ctx);

getIndividuals​

Gets the individuals of a class.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
criteriaNoAosvcLimitCriteriaPass a JSON object with a "limit". The service default is 1000.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<JSON>> - A promise with the individuals.

Examples
const individuals = await IafAOSvc.getIndividuals('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', { limit: 100 }, ctx);

getMcpConfig​

Gets the MCP tool declaration of a class.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcMcpConfig> - A promise with the MCP configuration.

Examples
const config = await IafAOSvc.getMcpConfig('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', ctx);

getOntologies​

Gets the base ontology and the application ontology of the namespace.

ParameterRequiredTypeDescription
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcOntology>> - A promise with the ontologies.

Examples
const ontologies = await IafAOSvc.getOntologies(ctx);

getOntology​

Gets an application ontology by its id.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcOntology> - A promise with the ontology.

Examples
const ontology = await IafAOSvc.getOntology('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

getOntologyLock​

Gets who currently holds an ontology's edit lock.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcOntologyLock> - A promise with the lock status.

Examples
const lock = await IafAOSvc.getOntologyLock('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

getOntologyMappings​

Gets the ItemSvc collection mappings of all the classes in an ontology.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcCollectionMapping>> - A promise with the collection mappings.

Examples
const mappings = await IafAOSvc.getOntologyMappings('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

getOntologyPermissions​

Gets the Passport permissions granted on an ontology.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<Permission>> - A promise with the permissions.

Examples
const permissions = await IafAOSvc.getOntologyPermissions('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

getOntologySchema​

Gets the complete canonical aosvc schema bundle of an ontology.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
criteriaNoAosvcSchemaCriteriaPass a JSON object with a "revision" to read a past revision.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<JSON> - A promise with the schema bundle.

Examples
const schema = await IafAOSvc.getOntologySchema('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { revision: 4 }, ctx);

getPermissions​

Gets the logical ontology or ontology class permissions visible to the caller, by IRN. aosvc IRNs look like and .

ParameterRequiredTypeDescription
criteriaNoPermissionCriteriaPass a JSON object with "_namespace" and "_resourceDesc._irn", and optionally "_user._id", "_user._type" and "patternmatch".
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Page<Permission>> - A promise with the permissions.

Examples
const permissions = await IafAOSvc.getPermissions({ _namespace: 'plant_ns', '_resourceDesc._irn': 'aosvc:ontology:a1b2c3d4-e5f6-7890-abcd-ef1234567890' }, ctx);

getPromotionHistory​

Gets the immutable canonical promotion history of an ontology.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcCanonicalPromotion>> - A promise with the promotion records.

Examples
const history = await IafAOSvc.getPromotionHistory('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

getPromotionRequests​

Gets the promotion requests of an ontology, newest first.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcPromotionRequest>> - A promise with the promotion requests.

Examples
const requests = await IafAOSvc.getPromotionRequests('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

getPropertyMappings​

Gets the field to property mappings of a class.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcPropertyMapping>> - A promise with the property mappings.

Examples
const mappings = await IafAOSvc.getPropertyMappings('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', ctx);

getReadings​

Gets the telemetry readings of one individual (telemetry item), newest first.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
individualIdYesStringPass the individual's id.
criteriaNoAosvcReadingsCriteriaPass a JSON object with "from", "to", "offset", "limit" and "ascending" parameters.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcReadingsPage> - A promise with a page of readings.

Examples
const page = await IafAOSvc.getReadings('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', 'sensor-1', { from: '2026-09-01T00:00:00Z', limit: 500 }, ctx);

getRelationships​

Gets the object property relationships of an ontology.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcEntityRelationship>> - A promise with the relationships.

Examples
const relationships = await IafAOSvc.getRelationships('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

getRevision​

Gets the manifest of one ontology revision.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
revisionYesNumberPass the aggregate revision number.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcRevision> - A promise with the revision manifest.

Examples
const revision = await IafAOSvc.getRevision('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 4, ctx);

getRevisions​

Gets the immutable aggregate revisions of an ontology, newest first.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcRevision>> - A promise with the revision manifests.

Examples
const revisions = await IafAOSvc.getRevisions('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

getRevisionSnapshot​

Gets the complete canonical aggregate snapshot of one revision.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
revisionYesNumberPass the aggregate revision number.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<JSON> - A promise with the snapshot.

Examples
const snapshot = await IafAOSvc.getRevisionSnapshot('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 4, ctx);

getRules​

Gets the rules defined for an ontology.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcRule>> - A promise with the rules.

Examples
const rules = await IafAOSvc.getRules('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

getRuleTypes​

Gets the supported rule types.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcRuleType>> - A promise with the rule types.

Examples
const ruleTypes = await IafAOSvc.getRuleTypes('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

getStateMachine​

Gets one complete state machine definition.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
machineIdYesStringPass the state machine's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcStateMachine> - A promise with the state machine.

Examples
const machine = await IafAOSvc.getStateMachine('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'machine-1', ctx);

getStateMachineEvents​

Gets every event across an ontology's state machines, grouped by machine, optionally for one machine only.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
criteriaNoAosvcStateMachinePartCriteriaPass a JSON object with a "machineId" filter.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcStateMachineEvents>> - A promise with one entry per state machine.

Examples
const all = await IafAOSvc.getStateMachineEvents('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {}, ctx);
const one = await IafAOSvc.getStateMachineEvents('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { machineId: 'machine-1' }, ctx);

getStateMachineHistory​

Gets the newest transition attempts of one state machine, across every individual it tracks, newest first.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
machineIdYesStringPass the state machine's id.
criteriaNoAosvcStateMachineHistoryCriteriaPass a JSON object with a "limit" (default 100).
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcTransitionHistory>> - A promise with the transition attempts.

Examples
const history = await IafAOSvc.getStateMachineHistory('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'machine-1', { limit: 20 }, ctx);

getStateMachines​

Gets the complete state machine definitions of an ontology, optionally only those that track a class.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
criteriaNoAosvcStateMachineCriteriaPass a JSON object with a "classId" filter.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcStateMachine>> - A promise with the state machines.

Examples
const machines = await IafAOSvc.getStateMachines('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { classId: 'pump-cls' }, ctx);

getStateMachineStates​

Gets every state across an ontology's state machines, grouped by machine, optionally for one machine only.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
criteriaNoAosvcStateMachinePartCriteriaPass a JSON object with a "machineId" filter.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcStateMachineStates>> - A promise with one entry per state machine.

Examples
const all = await IafAOSvc.getStateMachineStates('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {}, ctx);
const one = await IafAOSvc.getStateMachineStates('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { machineId: 'machine-1' }, ctx);

getStateMachineTransitions​

Gets every transition across an ontology's state machines, grouped by machine, optionally for one machine only.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
criteriaNoAosvcStateMachinePartCriteriaPass a JSON object with a "machineId" filter.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcStateMachineTransitions>> - A promise with one entry per state machine.

Examples
const all = await IafAOSvc.getStateMachineTransitions('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {}, ctx);
const one = await IafAOSvc.getStateMachineTransitions('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { machineId: 'machine-1' }, ctx);

getTransitionHistory​

Gets the attempted state transitions of an individual, committed or rejected, newest first.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
individualIdYesStringPass the individual's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcTransitionHistory>> - A promise with the transition history.

Examples
const history = await IafAOSvc.getTransitionHistory('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', 'pump-1', ctx);

getVersion​

Gets one ontology version, including how many rows it holds per collection.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
versionNumberYesNumberPass the ontology version's number.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcOntologyVersion> - A promise with the version.

Examples
const version = await IafAOSvc.getVersion('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 2, ctx);

getVersions​

Gets every version of an ontology, oldest first.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<AosvcOntologyVersion>> - A promise with the versions.

Examples
const versions = await IafAOSvc.getVersions('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

grantClassPermission​

Grants a user, user group or profile permissions on an entity class. The grant cascades to its subclasses.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
grantYesAosvcPermissionGrantPass the grantee and the actions to grant.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.grantClassPermission('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', {
_user: { _id: 'f1e2d3c4-b5a6-4789-8abc-def012345678', _type: 'usergroup' },
_actions: ['INDIVIDUALS_READ', 'INDIVIDUALS_EDIT']
}, ctx);

grantOntologyPermission​

Grants a user, user group or profile permissions on an ontology. Granting (or ) also gives the grantee the Item Service access a promotion needs; that is done before the call returns, so the answer is still 204 and the grantee can promote at once.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
grantYesAosvcPermissionGrantPass the grantee and the actions to grant.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.grantOntologyPermission('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {
_user: { _id: 'f1e2d3c4-b5a6-4789-8abc-def012345678', _type: 'usergroup' },
_actions: ['READ', 'EDIT']
}, ctx);

heartbeatOntologyLock​

Extends an ontology's edit lock lease without making a change.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcOntologyLock> - A promise with the lock status.

Examples
const lock = await IafAOSvc.heartbeatOntologyLock('a1b2c3d4-e5f6-7890-abcd-ef1234567890', ctx);

importData​

Bulk-imports individuals across multiple classes and sets relationship edges between them. A real import is queued and returns a task id; poll it with getAsyncTask. A dry run validates inline and writes nothing.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
individualsYesArray<AosvcImportIndividual>Pass a non-empty JSON array of individuals (maximum 10 MB). Each names its class in ; inline become edges.
criteriaNoAosvcImportCriteriaPass a JSON object with "dryRun", "mode", "facets", "rollback" and "modelRevision" parameters.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<JSON> - A promise with the queued task (, , , ), or with the validation result for a dry run.

Examples
// Validate first
const check = await IafAOSvc.importData('a1b2c3d4-e5f6-7890-abcd-ef1234567890', individuals, { dryRun: true }, ctx);

// Then import and poll the task
const task = await IafAOSvc.importData('a1b2c3d4-e5f6-7890-abcd-ef1234567890', individuals, { mode: 'UPSERT' }, ctx);
const status = await IafAOSvc.getAsyncTask(task._taskId, ctx);

inferSchema​

Infers an ItemSvc item type schema from raw JSON sample data through aisvc.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
requestYesAosvcInferSchemaRequestPass a request whose is the sample data as a JSON string.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcInferSchemaResponse> - A promise with the inferred schema.

Examples
const response = await IafAOSvc.inferSchema('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { dataJson: JSON.stringify([{ name: 'Pump A', flowRate: 12.5 }]), _typeName: 'pump' }, ctx);

prepareSource​

Infers an instance-map dataset from File Service attachments through aisvc.

ParameterRequiredTypeDescription
requestYesAosvcSourcePrepareRequestPass the file attachments to infer from.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcSourcePrepareResponse> - A promise with the dataset and the inference log.

Examples
const response = await IafAOSvc.prepareSource({ _attachments: [{ _fileId: 'file-1', _fileVersionId: 'ver-1' }] }, ctx);

prepareSourceStream​

Infers a dataset from File Service attachments and returns the aisvc progress. The service streams NDJSON; this method resolves with all the events once the stream ends.

ParameterRequiredTypeDescription
requestYesAosvcSourcePrepareRequestPass the file attachments to infer from.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<Array<JSON>> - A promise with the array of progress events, in order.

Examples
const events = await IafAOSvc.prepareSourceStream({ _attachments: [{ _fileId: 'file-1', _fileVersionId: 'ver-1' }] }, ctx);

previewOwl​

Parses and classifies bounded inline OWL documents without persisting them.

ParameterRequiredTypeDescription
requestYesAosvcOwlPreviewRequestPass a request with 1 and the OWL as inline text.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcOwlPreviewResponse> - A promise with the classification, axioms and diagnostics.

Examples
const preview = await IafAOSvc.previewOwl({
contractVersion: 1,
documents: [{ name: 'plant.ttl', content: turtleText, mediaType: 'text/turtle' }],
includeInferred: true
}, ctx);

promoteRevision​

Promotes a canonical revision through schema export and import. Runs as a dry run unless is false.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
requestYesAosvcCanonicalPromotionRequestPass a promotion request. is required; defaults to true.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcCanonicalPromotion> - A promise with the promotion record.

Examples
const promotion = await IafAOSvc.promoteRevision('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {
reason: 'Release 2.1', sourceRevision: 6, targetNamespace: 'plant_prod', targetEnvironment: 'prod', dryRun: false
}, ctx);

provisionMcpConfig​

Provisions the declared MCP tool in aisvc. The tool wraps the class's OMAPI 'list' script.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcMcpConfig> - A promise with the MCP configuration and its .

Examples
const config = await IafAOSvc.provisionMcpConfig('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', ctx);

publishStateMachineEvent​

Queues a state machine event for individuals grouped by class. This changes individuals, not the ontology definition.

ParameterRequiredTypeDescription
machineIdYesStringPass the state machine's id.
eventYesAosvcStateMachineEventPublishPass the event id and name and the target individuals grouped by class (1 to 500 individuals per class).
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcStateMachineEventQueued> - A promise with the queued event trigger id.

Examples
const queued = await IafAOSvc.publishStateMachineEvent('machine-1', {
_eventId: 'e-stop', _eventName: 'Stop',
_targets: [{ _classId: 'pump-cls', _individualIds: ['pump-1', 'pump-2'] }]
}, ctx);

publishVersion​

Freezes a draft so its schema can no longer change.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
versionNumberYesNumberPass the ontology version's number.
publishYesAosvcPublishOptionally pass an object with a for the published version.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcOntologyVersion> - A promise with the published version.

Examples
const version = await IafAOSvc.publishVersion('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 2, { _label: 'Release 2.1' }, ctx);

releaseOntologyLock​

Releases an ontology's edit lock.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
criteriaNoAosvcLockReleaseCriteriaPass { force: true } to release a lock held by another user.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcOntologyLock> - A promise with the lock status.

Examples
const lock = await IafAOSvc.releaseOntologyLock('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {}, ctx);

removePermission​

Deletes a logical aosvc permission by its id. Removing a class permission, or an ontology permission that carried or , takes back the downstream Item Service grants in the background; the service then answers 202 with no body and a header that points at the task.

ParameterRequiredTypeDescription
idYesStringPass the resource's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response, or, when a reconciliation task was queued (202), the task's absolute URL; pass its last path segment to getAsyncTask.

Examples
await IafAOSvc.removePermission('a1b2c3d4-0000-4000-8000-000000000001', ctx);

requestImpactAnalysisReport​

Requests an impact analysis report: what would change if a draft or published version of an ontology replaced the live one. The report is created and filled in the background, usually within seconds, moving to (with ) or (with ).An existing or report that still describes the same version pair is returned instead of a new one. A report is never reused, so requesting again is the retry.By default the call resolves as soon as the report is stored, and you can poll IafAOSvc.getImpactAnalysisReport yourself. Pass to have it resolve once the report is or instead.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
versionYesImpactAnalysisReportRequestPass the version to compare against the live one, by number or by id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoImpactAnalysisReportRequestOptionsPass to wait for the report to finish, and poll timing overrides.
Returns

Promise<ImpactAnalysisReport> - A promise with the report: as stored (usually ), or or when is . With , rejects with an Error if the report is still after attempts.

Examples
// Request a report on version 3 and poll for it yourself
const report = await IafAOSvc.requestImpactAnalysisReport('d4721098-9c7f-4e7d-84f4-84bea8f21ca2', { _versionFrom: 3 }, ctx);

// Request a report by version id and wait until it is READY or FAILED
const finished = await IafAOSvc.requestImpactAnalysisReport('d4721098-9c7f-4e7d-84f4-84bea8f21ca2',
{ _versionFromId: 'd4721098-9c7f-4e7d-84f4-84bea8f21ca2:v3' }, ctx, { poll: true, pollMilliSecs: 1000, maxPoll: 60 });
if (finished._status === 'READY') {
console.log(finished._report._verdict);
} else {
console.log(finished._failureReason);
}

reviewDataset​

Reviews an import dataset through aisvc and persists the result as a proposal.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
requestYesAosvcReviewDatasetRequestPass a request with the review , the and the , both as JSON strings.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcReviewDatasetResponse> - A promise with the review.

Examples
const response = await IafAOSvc.reviewDataset('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { prompt: 'Check the data fits the model.', datasetJson, modelJson }, ctx);

revokeClassPermission​

Revokes one Passport permission on an entity class.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
permissionIdYesStringPass the permission's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.revokeClassPermission('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', 'a1b2c3d4-0000-4000-8000-000000000001', ctx);

revokeOntologyPermission​

Revokes one Passport permission on an ontology. When it carried (or ), the Item Service access it brought is taken back first, before the call returns, so the answer is still 204.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
permissionIdYesStringPass the permission's id.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<String> - {ok:204} response.

Examples
await IafAOSvc.revokeOntologyPermission('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'a1b2c3d4-0000-4000-8000-000000000001', ctx);

rollbackToRevision​

Restores a prior revision snapshot as a new forward revision. Pass the header to guard against concurrent changes.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
revisionYesNumberPass the aggregate revision number.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcRevision> - A promise with the new revision manifest.

Examples
const revision = await IafAOSvc.rollbackToRevision('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 4, ctx, { headers: { 'If-Match': '"6"' } });

runReasoner​

Runs the stateless reasoner over the ontology, rules, constraints and instances you supply. Nothing is read from or written to the database.

ParameterRequiredTypeDescription
requestYesAosvcReasonerRequestPass the ontology definition, and optionally rules, constraints and instances.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcReasonerResult> - A promise with the inferences, violations, derived relationships and instance types.

Examples
const result = await IafAOSvc.runReasoner({
ontology: ontologyDefinition,
rules: rules,
instances: { 'pump-1': { _classId: 'pump-cls', _name: 'Pump A' } }
}, ctx);

searchIndividuals​

Searches the individuals of a class with structured filters and class-subtree paging.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
searchYesAosvcIndividualSearchRequestOptionally pass a search request with a filter, paging, sort and projection.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcIndividualSearchResponse> - A promise with a page of individuals.

Examples
const page = await IafAOSvc.searchIndividuals('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', {
_filter: { _name: 'Pump A' }, _includeSubclasses: true, _offset: 0, _pageSize: 50
}, ctx);

setCollectionMapping​

Binds a class to an ItemSvc collection. Creates the binding or replaces the existing one.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
mappingYesAosvcCollectionMappingCreatePass a mapping object naming the collection to create or the collection id to bind.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcCollectionMapping> - A promise with the collection mapping.

Examples
const mapping = await IafAOSvc.setCollectionMapping('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', { _collectionName: 'pumps', _userType: 'pump' }, ctx);

setIndividualRelationshipsBatch​

Batch-sets relationships for many individuals of a class. Each parent and relationship type is replaced, and the whole batch is all-or-nothing.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
batchYesAosvcRelationshipBatchPass an object with the entries to set.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<JSON> - A promise with the result of the batch.

Examples
const result = await IafAOSvc.setIndividualRelationshipsBatch('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', {
_relationships: [{ _userType: 'locatedIn', _relatedFromId: 'pump-1', _relatedToIds: ['room-1'] }]
}, ctx);

setMcpConfig​

Declares, or replaces, the MCP tool configuration of a class.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
configYesAosvcMcpConfigUpdatePass the tool name and optional query criteria.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcMcpConfig> - A promise with the MCP configuration, with PENDING.

Examples
const config = await IafAOSvc.setMcpConfig('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', { _toolName: 'list_pumps' }, ctx);

traverseRelationships​

Traverses validated ontology relationships from individuals, following the hops in the order supplied.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
traversalYesAosvcTraversalRequestPass the start individuals and the relationships to follow.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcTraversalResponse> - A promise with the path, breadcrumbs and a page of terminal individuals.

Examples
const result = await IafAOSvc.traverseRelationships('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', {
_startIndividualIds: ['pump-1'],
_hops: [{ _relationship: 'locatedIn' }]
}, ctx);

unbindStateMachineClasses​

Unbinds classes from a state machine's ; at least one class must remain. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
machineIdYesStringPass the state machine's id.
bindingYesAosvcStateMachineClassBindingPass an object with the to unbind.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcStateMachine> - A promise with the updated state machine.

Examples
const machine = await IafAOSvc.unbindStateMachineClasses('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'machine-1', { _classIds: ['valve-cls'] }, ctx, { headers: { 'X-Ontology-Draft': 2 } });

updateAction​

Updates an action. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
actionIdYesStringPass the action's id.
actionYesAosvcActionUpdatePass an action object with the properties you want to update.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcAction> - A promise with the updated action.

Examples
const action = await IafAOSvc.updateAction('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'action-1', { _description: 'Sends the fault notification.' }, ctx, { headers: { 'X-Ontology-Draft': 2 } });

updateClass​

Updates an entity class. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
classIdYesStringPass the entity class's id.
entityClassYesAosvcEntityClassUpdatePass an entity class object with the properties you want to update.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcEntityClass> - A promise with the updated entity class.

Examples
const entityClass = await IafAOSvc.updateClass('a1b2c3d4-e5f6-7890-abcd-ef1234567890', '5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f',
{ _pluralName: 'Centrifugal Pumps' }, ctx, { headers: { 'X-Ontology-Draft': 2 } });

updateConstraint​

Updates a property constraint. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
constraintIdYesStringPass the constraint's id.
constraintYesAosvcConstraintUpdatePass a constraint object with the properties you want to update.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcConstraint> - A promise with the updated constraint.

Examples
const constraint = await IafAOSvc.updateConstraint('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'pump-name-required', { _description: 'Every pump has a name.' }, ctx, { headers: { 'X-Ontology-Draft': 2 } });

updateIndividual​

Updates an individual. The individual is validated against the ontology first. A non-conforming body is rejected with 422.

ParameterRequiredTypeDescription
classIdYesStringPass the entity class's id.
individualIdYesStringPass the individual's id.
individualYesJSONPass the individual object with the properties to store.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<JSON> - A promise with the updated individual.

Examples
const individual = await IafAOSvc.updateIndividual('5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f', 'pump-1', { _name: 'Pump A (rebuilt)' }, ctx);

updateOntology​

Updates an application ontology.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ontologyYesAosvcOntologyUpdatePass an ontology object with the properties you want to update.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcOntology> - A promise with the updated ontology.

Examples
const ontology = await IafAOSvc.updateOntology('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { _description: 'Updated description.' }, ctx);

updateRelationship​

Updates an object property relationship. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
relationshipIdYesStringPass the relationship's id.
relationshipYesAosvcEntityRelationshipCreatePass the complete relationship object.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcEntityRelationship> - A promise with the updated relationship.

Examples
const relationship = await IafAOSvc.updateRelationship('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'rel-1', {
_sourceClassId: 'pump-cls', _targetClassId: 'room-cls', _type: 'locatedIn', _description: 'Where the pump is installed.'
}, ctx, { headers: { 'X-Ontology-Draft': 2 } });

updateRule​

Updates a rule. Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
ruleIdYesStringPass the rule's id.
ruleYesAosvcRuleUpdatePass a rule object with the properties you want to update.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcRule> - A promise with the updated rule.

Examples
const rule = await IafAOSvc.updateRule('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'rule-1', { _superClassId: 'asset-cls' }, ctx, { headers: { 'X-Ontology-Draft': 2 } });

updateStateMachine​

Replaces a complete state machine definition. Exactly one state must be marked (422 otherwise). Schema writes need the header.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
machineIdYesStringPass the state machine's id.
stateMachineYesAosvcStateMachinePass the complete replacement state machine.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcStateMachine> - A promise with the updated state machine.

Examples
const machine = await IafAOSvc.updateStateMachine('a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'machine-1', machineDefinition, ctx, { headers: { 'X-Ontology-Draft': 2 } });

validateAgainstBaseOntology​

Validates individuals against the base platform ontology constraints.

ParameterRequiredTypeDescription
requestYesAosvcValidationRequestPass an object whose is the individuals to validate, as a JSON string.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcValidationResult> - A promise with the validation result.

Examples
const result = await IafAOSvc.validateAgainstBaseOntology({ dataJson: JSON.stringify([{ _name: 'Pump A' }]) }, ctx);

validateAgainstOntology​

Validates individuals against an ontology's constraints, merged with those of the base ontology.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
requestYesAosvcValidationRequestPass an object whose is the individuals to validate, as a JSON string.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<AosvcValidationResult> - A promise with the validation result.

Examples
const result = await IafAOSvc.validateAgainstOntology('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {
dataJson: JSON.stringify([{ _classId: 'pump-cls', _name: 'Pump A' }])
}, ctx);
if (!result._conforms) console.log(result._violations);

validateSchema​

Validates a schema bundle and diffs it against the current aggregate without changing anything.

ParameterRequiredTypeDescription
ontologyIdYesStringPass the ontology's id.
bundleYesAosvcSchemaBundlePass an object whose is the schema bundle to validate.
ctxNoCtxContext, such as namespaces and authentication token information.
optionsNoAosvcRequestOptionsPass a JSON object with request headers in a property, such as .
Returns

Promise<JSON> - A promise with the validation and diff result.

Examples
const schema = await IafAOSvc.getOntologySchema('a1b2c3d4-e5f6-7890-abcd-ef1234567890', {}, ctx);
const result = await IafAOSvc.validateSchema('a1b2c3d4-e5f6-7890-abcd-ef1234567890', { snapshot: schema.snapshot }, ctx);