InstanceGraphAPI

add(dataURI, parentID, usage, label, contentType, initialProperties)
Loads the resource behind the given dataURI and returns the ID of the new contents root node. . .The default is closed. open - Adds the data in an expanded state. Granularity is set to the leaf-level of the data.
closed - Adds the data as a single node. Granularity is set to the root-level. Can be expanded afterwards by traversing the tree.
Arguments
  • dataURI (string()) – Specifies the URI of the data resource

  • parentID (number()) – By specifying a parentID the resource can be added to an arbitrary node instead of the tree root Optional

  • usage (string()) – The usage parameter allows to define how the resource should be inserted in the instance graph as described in the next table Optional

  • label (string()) – label can be used to set a string that is shown in the UI as a name of the node Optional

  • contentType (string()) – With contentType the type of the input data can be specified with a MimeType or any other descriptor Optional

  • initialProperties (any()) – A map of properties to initialize the new node Optional

Returns

number – The ID of the new contents root node

add(params)
Variant of the add function, accepting a params object instead of explicit parameters. The params object is a map from parameter names to parameter values.
Arguments
  • params (any()) –

Returns

number

addCustomNode(customNodeType, data, dataType)
Creates a custom node with custom data which is stored in an attachment
Arguments
  • customNodeType (string()) – Specifies the custom node type

  • data (any()) – Specifies the data of the custom node

  • dataType (AttachmentType()) – Specifies the type of the data Optional

Returns

number

collectRuntimeNodesOfType(nodeType, subType)
collectRuntimeNodesOfType
Arguments
  • nodeType – (NodeType ) The node type to collect

  • subType (string()) – Optional

Returns

Array<number> – Array of node ids of the specified type

getProperties(nodeID, properties)
Returns the values of the properties on the node with the matching id.
Arguments
  • nodeID (number()) – The ID of the node whose properties should be read

  • properties (Array) – The names of the properties whose value should be read

Returns

Promise<Array<PropertyType>> – The retrieved values of the node’s properties

getProperty(nodeID, property)
Returns the value of the property on the node with the matching id.
Arguments
  • nodeID (number()) – The ID of the node whose property should be read

  • property (T()) – The name of the property whose value should be read

Returns

Promise<PropertyType<T>> – The retrieved value of the node property

getStatistics(nodeType, nodeID)
Traverses the subtree of a given nodeID and collects all statistics (currently only available for AUX-Nodes).
Arguments
  • nodeType

    (NodeType ) Optional

  • nodeID (number()) – Optional

Returns

Promise<any> – An Object of Type/Count pairs

invertEnabledStates()
Returns

void

isNodeDeletable(nodeID)

readonly

Returns if a node is deletable
Arguments
  • nodeID (number()) –

Returns

boolean – of the node is deletable

isNodeType(nodeID, nodeType)

readonly

Checks the node's type for the given node id.
Arguments
  • nodeID (number()) –

  • nodeType

    (NodeType )

Returns

boolean – boolean

registerCustomProperty(name, defaultValue, recursive)
Registering a new custom property
Arguments
  • name (string()) – The name of the new property

  • defaultValue (any()) – Specifies the default value

  • recursive (boolean()) – Defines whether the property is recursive Optional

Returns

void

remove(nodeID, silent)
Removes the node for the given nodeID from the tree.If no nodeID is supplied all nodes are deleted.
Arguments
  • nodeID (number|Array) – The ID of the node that should be removed Optional

  • silent (boolean()) – Optional

Returns

Promise<void>

resetProperties(nodeID, properties)
Resets the value of the specified properties on the given node.
Arguments
  • nodeID (number()) – The ID of the node whose property should be reset

  • properties (Array) –

Returns

Promise<void>

resetProperty(nodeID, property)
Resets the value of the property on the node with the matching id.
Arguments
  • nodeID (number()) – The ID of the node whose property should be reset

  • property (string()) – Property which should be reset

Returns

Promise<void>

setParent(nodeID, newParentID)
Arguments
  • nodeID (number()) –

  • newParentID (number()) –

Returns

void

setProperty(nodeID, property, value, silent)
Sets the property named property to value on the node with id nodeID. The recursive flag, if specified as true, allows the user to set a property for a whole subtree with one API call. If the recursive flag is not specified, a property-specific default value is used (see property table). For custom properties, the default value is false.
Arguments
  • nodeID (number|Array) – The ID of the node whose property has to be set

  • property (T()) – The name of the property that has to be set

  • value (any()) – The new value of the specified property

  • silent (boolean()) – The silent flag indicates that no NODE_CHANGED event is fired Optional

Returns

Promise<SetPropertyResults>

setProperty(collectionID, property, value, silent)
Sets the property named property to value on all nodes in the collection with id collectionID. The recursive flag, if specified as true, allows the user to set a property for a whole subtree with one API call. If the recursive flag is not specified, a property-specific default value is used (see property table). For custom properties, the default value is false.
Arguments
  • collectionID (number()) – The ID of collection of nodes whose property has to be set

  • property (T()) – The name of the property that has to be set

  • value (any()) – The new value of the specified property

  • silent (boolean()) – The silent flag indicates that no NODE_CHANGED event is fired Optional

Returns

Promise<SetPropertyResults>

setProperty(idList, property, value, silent)
Sets the property named property to value on all nodes and collections specified in the idLIst . The recursive flag, if specified as true, allows the user to set a property for a whole subtree with one API call. If the recursive flag is not specified, a property-specific default value is used (see property table). For custom properties, the default value is false.
Arguments
  • idList (Array) – An ID List of nodes whose property has to be set

  • property (T()) – The name of the property that has to be set

  • value (any()) – The new value of the specified property

  • silent (boolean()) – The silent flag indicates that no NODE_CHANGED event is fired Optional

Returns

Promise<SetPropertyResults>