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 isclosed
.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 resourceparentID (
number()
) – By specifying a parentID the resource can be added to an arbitrary node instead of the tree root Optionalusage (
string()
) – The usage parameter allows to define how the resource should be inserted in the instance graph as described in the next table Optionallabel (
string()
) – label can be used to set a string that is shown in the UI as a name of the node OptionalcontentType (
string()
) – With contentType the type of the input data can be specified with a MimeType or any other descriptor OptionalinitialProperties (
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 typedata (
any()
) – Specifies the data of the custom nodedataType (
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 readproperties (
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 readproperty (
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 propertydefaultValue (
any()
) – Specifies the default valuerecursive (
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 Optionalsilent (
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 resetproperties (
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 resetproperty (
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 setproperty (
T()
) – The name of the property that has to be setvalue (
any()
) – The new value of the specified propertysilent (
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 setproperty (
T()
) – The name of the property that has to be setvalue (
any()
) – The new value of the specified propertysilent (
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 setproperty (
T()
) – The name of the property that has to be setvalue (
any()
) – The new value of the specified propertysilent (
boolean()
) – The silent flag indicates that no NODE_CHANGED event is fired Optional- Returns
Promise<SetPropertyResults>