Core¶
For more details regarding inputs and output in form of complex dictionaries see the original source docs at:
%host%/docs/source/Core.html
for example:
https://editor.webgme.org/docs/source/Core.html
-
class
webgme_bindings.core.
Core
(webgme)[source]¶ Bases:
object
Class for querying and manipulating the tree graph in a gme project. Practically, each method takes at least one node-dict as input. Use core.load_root(root_hash) to get an initial root-node of a the tree.
-
property
CONSTANTS
¶ A dictionary with the constants associated with the Core.
-
add_library
(node, name, library_root_hash, library_info=None)[source]¶ It adds a project as library to your project by copying it over. The library will be a node with the given name directly under your project’s ROOT. It becomes a read-only portion of your project. You will only be able to manipulate it with library functions, but cannot edit the individual nodes inside. However you will be able to instantiate or copy the nodes into other places of your project. Every node that was part of the META in the originating project becomes part of your project’s meta.
- Parameters
node (dict) – any regular node in your project.
name (str) – the name of the library you wish to use as a namespace in your project.
library_root_hash (str) – the hash of your library’s root (must exist in the project’s collection at the time of call).
library_info (dict) – information about your project.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the result of the execution.
CoreIllegalOperationError – the result of the execution.
CoreInternalError – the result of the execution.
-
add_member
(node, name, member)[source]¶ Adds a member to the given set.
- Parameters
node (dict) – the owner of the set.
name (str) – the name of the set.
member (dict) – the new member of the set.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
add_mixin
(node, path)[source]¶ Adds a mixin to the mixin set of the node.
- Parameters
node (dict) – the node in question.
path (str) – the path of the mixin node.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
apply_resolution
(conflict)[source]¶ When our attempt to merge two patches ended in some conflict, then we can modify that result highlighting that in case of every conflict, which side we prefer (mine vs. theirs). If we give that object as an input to this function, it will finish the merge resolving the conflict according our settings and present a final patch.
- Parameters
conflict (dict) – the object that represents our settings for every conflict and the so-far-merged patch.
- Returns
The function results in a tree structured patch object that contains the changesthat cover both parties modifications (and the conflicts are resolved according the input settings).
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
apply_tree_diff
(node, patch)[source]¶ Apply changes to the current project.
- Parameters
node (dict) – the root of the containment hierarchy where we wish to apply the changes
patch (dict) – the tree structured collection of changes represented with a special JSON object
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the result of the execution.
CoreInternalError – the result of the execution.
-
can_set_as_mixin
(node, path)[source]¶ Checks if the given path can be added as a mixin to the given node.
- Parameters
node (dict) – the node in question.
path (str) – the path of the mixin node.
- Returns
Returns an object with isOk set to true if the given path can be added as a mixin to the given node. If it cannot, the reason will be reported under reason.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
clear_meta_rules
(node)[source]¶ Removes all META rules defined at the node. Note that it does not clear any rules from other meta-nodes where the node if referenced.
- Parameters
node (dict) – the node in question.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
clear_mixins
(node)[source]¶ Removes all mixins for a given node.
- Parameters
node (dict) – the node in question.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
copy_node
(node, parent)[source]¶ Copies the given node into parent.
- Parameters
node (dict) – the node to be copied.
parent (dict) – the parent node of the copy.
- Returns
The function returns the copied node.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
copy_nodes
(nodes, parent)[source]¶ Copies the given nodes into parent.
- Parameters
nodes (list of dict) – the nodes to be copied.
parent (dict) – the parent node of the copy.
- Returns
The function returns an array of the copied nodes. The order follows the order of originals.
- Return type
list of dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
create_child
(node, base)[source]¶ Creates a child, with base as provided, inside the provided node.
- Parameters
node (dict) – the parent of the node to be created.
base (dict) – the base of the node to be created.
- Returns
The function returns the created child node.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
create_node
(parameters=None)[source]¶ Creates a node according to the given parameters.
- Parameters
parameters (dict) – the details of the creation.
- Returns
The function returns the created node.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
create_set
(node, name)[source]¶ Creates a set for the node.
- Parameters
node (dict) – the owner of the set.
name (str) – the name of the set.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_aspect_meta
(node, name)[source]¶ Removes the given aspect rule of the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the aspect.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_aspect_meta_target
(node, name, path)[source]¶ Removes a valid type from the given aspect of the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the aspect.
path (str) – the absolute path of the valid type of the aspect.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_attribute
(node, name)[source]¶ Removes the given attributes from the given node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the attribute.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_attribute_meta
(node, name)[source]¶ Removes an attribute definition from the META rules of the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the attribute.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_child_meta
(node, path)[source]¶ Removes the given child rule from the node.
- Parameters
node (dict) – the node in question.
path (str) – the absolute path of the child which rule is to be removed from the node.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_constraint
(node, name)[source]¶ Removes a constraint from the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the constraint.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_member
(node, name, path)[source]¶ Removes a member from the set. The functions doesn’t remove the node itself.
- Parameters
node (dict) – the owner of the set.
name (str) – the name of the set.
path (str) – the absolute path of the member to be removed.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_member_attribute
(node, set_name, member_path, attr_name)[source]¶ Removes an attribute which represented a property of the given set membership.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
member_path (str) – the absolute path of the member node.
attr_name (str) – the name of the attribute.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_member_registry
(node, set_name, path, reg_name)[source]¶ Removes a registry entry which represented a property of the given set membership.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
path (str) – the absolute path of the member node.
reg_name (str) – the name of the registry entry.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_mixin
(node, path)[source]¶ Removes a mixin from the mixin set of the node.
- Parameters
node (dict) – the node in question.
path (str) – the path of the mixin node.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_pointer
(node, name)[source]¶ Removes the pointer from the node. (Aliased deletePointer.)
- Parameters
node (dict) – the node in question.
name (str) – the name of the pointer in question.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_pointer_meta
(node, name)[source]¶ Removes the complete META rule regarding the given pointer/set of the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the pointer/set.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_pointer_meta_target
(node, name, path)[source]¶ Removes a possible target type from the pointer/set of the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the pointer/set
path (str) – the absolute path of the possible target type.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If node is read-only, or definition does not exist.
CoreInternalError – If some internal error took place inside the core layers.
-
del_registry
(node, name)[source]¶ Removes the given registry entry from the given node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the registry entry.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_set
(node, name)[source]¶ Removes a set from the node. (Aliased deleteSet.)
- Parameters
node (dict) – the owner of the set.
name (str) – the name of the set.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_set_attribute
(node, set_name, attr_name)[source]¶ Removes the attribute entry for the set at the node.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
attr_name (str) – the name of the attribute entry.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
del_set_registry
(node, set_name, reg_name)[source]¶ Removes the registry entry for the set at the node.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
reg_name (str) – the name of the registry entry.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
delete_node
(node)[source]¶ Removes a node from the containment hierarchy.
- Parameters
node (dict) – the node to be removed.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
delete_pointer
(node, name)[source]¶ Removes the pointer from the node. (Aliased delPointer.)
- Parameters
node (dict) – the node in question.
name (str) – the name of the pointer in question.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
delete_set
(node, name)[source]¶ Removes a set from the node. (Aliased delSet.)
- Parameters
node (dict) – the owner of the set.
name (str) – the name of the set.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
generate_tree_diff
(source_root, target_root)[source]¶ Generates a differential tree among the two states of the project that contains the necessary changes that can modify the source to be identical to the target. The result is in form of a json object.
- Parameters
source_root (dict) – the root node of the source state.
target_root (dict) – the root node of the target state.
- Returns
the difference between the two containment hierarchies in a special JSON object
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the status of the exectuion.
CoreInternalError – the status of the exectuion.
-
get_all_meta_nodes
(node)[source]¶ Returns all META nodes.
- Parameters
node (dict) – any node of the containment hierarchy.
- Returns
The function returns a dictionary. The keys of the dictionary are the absolute paths of the META nodes of the project. Every value of the dictionary is a {@link module:Core~Node}.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_aspect_definition_info
(node, name, member)[source]¶ Returns the meta nodes that introduce the given aspect relationship.
- Parameters
node (dict) – the node in question.
name (str) – the name of the set in question.
member (dict) – the child.
- Returns
The owner and the target of the aspect meta-rule that makes member a valid member of the named aspect of node.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_aspect_definition_owner
(node, name)[source]¶ Returns the meta node that introduces the given aspect.
- Parameters
node (dict) – the node in question.
name (str) – the name of the set in question.
- Returns
The meta-node that defines the aspect and makes a valid aspect for the given node.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_aspect_meta
(node, name)[source]¶ Returns the list of valid children types of the given aspect.
- Parameters
node (dict) – the node in question.
name (str) – the name of the aspect.
- Returns
The function returns a list of absolute paths of nodes that are valid children of the node and fits to the META rules defined for the aspect. Any children, visible under the given aspect of the node must be an instance of at least one node represented by the absolute paths.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_attribute
(node, name)[source]¶ Retrieves the value of the given attribute of the given node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the attribute.
- Returns
The function returns the value of the attribute of the node. If the value is undefined that means the node do not have such attribute defined.
- Return type
str or int or float or bool or dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_attribute_definition_owner
(node, name)[source]¶ Returns the meta node that introduces the given attribute.
- Parameters
node (dict) – the node in question.
name (str) – the name of the attribute in question.
- Returns
The meta-node that defines the attribute and makes it valid attribute for the given node.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_attribute_meta
(node, name)[source]¶ Returns the definition object of an attribute from the META rules of the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the attribute.
- Returns
The function returns the definition object, where type is always defined.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_attribute_names
(node)[source]¶ Returns the names of the defined attributes of the node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns an array of the names of the attributes of the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_base
(node)[source]¶ Returns the base node.
- Parameters
node (dict) – the node in question.
- Returns
Returns the base of the given node or null if there is no such node.
- Return type
dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_base_root
(node)[source]¶ Returns the root of the inheritance chain of the given node.
- Parameters
node (dict) – the node in question.
- Returns
Returns the root of the inheritance chain (usually the FCO).
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_base_type
(node)[source]¶ Returns the meta-node of the node in question, that is the first base node that is part of the meta. (Aliased getMetaType).
- Parameters
node (dict) – the node in question
- Returns
Returns the first node (including itself) among the inheritance chain that is a META node. It returns null if it does not find such node (ideally the only node with this result is the ROOT).
- Return type
dict or None
- Raises
CoreIllegalArgumentError – If node is not a Node
CoreInternalError – If some internal error took place inside the core layers.
-
get_base_types
(node)[source]¶ Searches for the closest META node of the node in question and the direct mixins of that node.
- Parameters
node (dict) – the node in question
- Returns
Returns the closest Meta node that is a base of the given node plus it returns all the mixin nodes associated with the base.
- Return type
list of dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_child_definition_info
(node, child)[source]¶ Returns the meta nodes that introduce the given containment relationship.
- Parameters
node (dict) – the node in question.
child (dict) – the child.
- Returns
The owner and the target of the containment meta-rule that makes child a valid child of node.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_children_hashes
(node)[source]¶ Collects the data hash values of the children of the node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns a dictionary of {@link module:Core~ObjectHash} that stored in pair with the relative id of the corresponding child of the node.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_children_meta
(node)[source]¶ Return a JSON representation of the META rules regarding the valid children of the given node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns a detailed JSON structure that represents the META rules regarding the possible children of the node.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_children_paths
(node)[source]¶ Collects the paths of all the children of the given node.
- Parameters
node (dict) – the container node in question.
- Returns
The function returns an array of the absolute paths of the children.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_children_relids
(node)[source]¶ Collects the relative ids of all the children of the given node.
- Parameters
node (dict) – the container node in question.
- Returns
The function returns an array of the relative ids.
- Return type
list of str
-
get_closure_information
(nodes)[source]¶ Collects the necessary information to export the set of input nodes and use it in other - compatible - projects.
- Parameters
nodes (list of dict) – the set of nodes that we want to export
- Returns
If the closure is available for export, the returned special JSON object will contain information about the necessary data that needs to be exported as well as relations that will need to be recreated in the destination project to preserve the structure of nodes.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_collection_names
(node)[source]¶ Retrieves a list of the defined pointer names that has the node as target.
- Parameters
node (dict) – the node in question.
- Returns
The function returns an array of the names of the pointers pointing to the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_collection_paths
(node, name)[source]¶ Retrieves a list of absolute paths of nodes that has a given pointer which points to the given node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the pointer.
- Returns
The function returns an array of absolute paths of nodes that has the pointer pointing to the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_common_base
(nodes)[source]¶ Returns the common base node of all supplied nodes.
- Parameters
nodes (list of dict) – a variable number of nodes to compare
- Returns
The common base or null if e.g. the root node was passed.
- Return type
dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_common_parent
(nodes)[source]¶ Returns the common parent node of all supplied nodes.
- Parameters
nodes (list of dict) – a variable number of nodes to compare
- Returns
The common base or null if no nodes were passed.
- Return type
dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_constraint
(node, name)[source]¶ Gets a constraint object of the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the constraint.
- Returns
Returns the defined constraint or null if it was not defined for the node.
- Return type
dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_constraint_names
(node)[source]¶ Retrieves the list of constraint names defined for the node.
- Parameters
node (dict) – the node in question.
- Returns
Returns the array of names of constraints available for the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_fco
(node)[source]¶ Return the root of the inheritance chain of your Meta nodes.
- Parameters
node (dict) – any node in your project.
- Returns
Returns the acting FCO of your project.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_fully_qualified_name
(node)[source]¶ Returns the fully qualified name of the node, which is the list of its namespaces separated by dot and followed by the name of the node.
- Parameters
node (dict) – the node in question.
- Returns
Returns the fully qualified name of the node, i.e. its namespaces and name join together by dots.
- Return type
str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_guid
(node)[source]¶ Get the GUID of a node.
- Parameters
node (dict) – the node in question.
- Returns
Returns the globally unique identifier.
- Return type
str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_hash
(node)[source]¶ Returns the calculated hash and database id of the data for the node.
- Parameters
node (dict) – the node in question.
- Returns
Returns the hash value of the data for the given node. An empty string is returned when the node was mutated and not persisted.
- Return type
str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_instance_paths
(node)[source]¶ Collects the paths of all the instances of the given node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns an array of the absolute paths of the instances.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_json_meta
(node)[source]¶ Gives a JSON representation of the META rules of the node.
- Parameters
node (dict) – the node in question.
- Returns
Returns an object that represents all the META rules of the node.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_library_guid
(node, name=None)[source]¶ Returns the origin GUID of any library node. (If name is not provided the returned GUID will be the same across all projects where the library node is contained - regardless of library hierarchy.)
- Parameters
node (dict) – the node in question.
name (None or str) – name of the library where we want to compute the GUID from. If not given, then the GUID is computed from the direct library root of the node.
- Returns
Returns the origin GUID of the node.
- Return type
str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_library_info
(node, name)[source]¶ Returns the info associated with the library.
- Parameters
node (dict) – any node in the project.
name (str) – the name of the library.
- Returns
Returns the information object, stored alongside the library (that basically carries metaData about the library).
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_library_meta_nodes
(node, name, only_own=None)[source]¶ Returns all the Meta nodes within the given library. By default it will include nodes defined in any library within the given library.
- Parameters
node (dict) – any node of your project.
name (str) – name of your library.
only_own (bool) – if true only returns with Meta nodes defined in the library itself.
- Returns
Returns an array of core nodes that are part of your meta from the given library.
- Return type
list of dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_library_names
(node)[source]¶ Gives back the list of libraries in your project.
- Parameters
node (dict) – any node in your project.
- Returns
Returns the fully qualified names of all the libraries in your project (even embedded ones).
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_library_root
(node, name)[source]¶ Returns the root node of the given library.
- Parameters
node (dict) – any node in the project.
name (str) – the name of the library.
- Returns
Returns the library root node or null, if the library is unknown.
- Return type
dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_member_attribute
(node, set_name, path, attr_name)[source]¶ Get the value of the attribute in relation with the set membership.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
path (str) – the absolute path of the member node.
attr_name (str) – the name of the attribute.
- Returns
Return the value of the attribute. If it is undefined, then there is no such attributed connected to the given set membership.
- Return type
str or int or float or bool or dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_member_attribute_names
(node, name, path)[source]¶ Return the names of the attributes defined for the set membership to the member node.
- Parameters
node (dict) – the owner of the set.
name (str) – the name of the set.
path (str) – the absolute path of the member.
- Returns
Returns the array of names of attributes that represents some property of the membership.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_member_own_attribute
(node, set_name, path, attr_name)[source]¶ Get the value of the attribute for the set membership specifically defined to the member node.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
path (str) – the absolute path of the member node.
attr_name (str) – the name of the attribute.
- Returns
Return the value of the attribute. If it is undefined, then there is no such attributed connected to the given set membership.
- Return type
str or int or float or bool or dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_member_own_attribute_names
(node, name, path)[source]¶ Return the names of the attributes defined for the set membership specifically defined to the member node.
- Parameters
node (dict) – the owner of the set.
name (str) – the name of the set.
path (str) – the absolute path of the member.
- Returns
Returns the array of names of attributes that represents some property of the membership.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_member_own_registry
(node, set_name, path, reg_name)[source]¶ Get the value of the registry entry for the set membership specifically defined to the member node.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
path (str) – the absolute path of the member node.
reg_name (str) – the name of the registry entry.
- Returns
Return the value of the registry. If it is undefined, then there is no such registry connected to the given set membership.
- Return type
str or int or float or bool or dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_member_own_registry_names
(node, name, path)[source]¶ Return the names of the registry entries defined for the set membership specifically defined to the member node.
- Parameters
node (dict) – the owner of the set.
name (str) – the name of the set.
path (str) – the absolute path of the member.
- Returns
Returns the array of names of registry entries that represents some property of the membership.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_member_paths
(node, name)[source]¶ Returns the list of absolute paths of the members of the given set of the given node.
- Parameters
node (dict) – the set owner.
name (str) – the name of the set.
- Returns
Returns an array of absolute path strings of the member nodes of the set.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_member_registry
(node, set_name, path, reg_name)[source]¶ Get the value of the registry entry in relation with the set membership.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
path (str) – the absolute path of the member node.
reg_name (str) – the name of the registry entry.
- Returns
Return the value of the registry. If it is undefined, then there is no such registry connected to the given set membership.
- Return type
str or int or float or bool or dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_member_registry_names
(node, name, path)[source]¶ Return the names of the registry entries defined for the set membership to the member node.
- Parameters
node (dict) – the owner of the set.
name (str) – the name of the set.
path (str) – the absolute path of the member.
- Returns
Returns the array of names of registry entries that represents some property of the membership.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_meta_type
(node)[source]¶ Returns the meta-node of the node in question, that is the first base node that is part of the meta. (Aliased getBaseType).
- Parameters
node (dict) – the node in question
- Returns
Returns the first node (including itself) among the inheritance chain that is a META node. It returns null if it does not find such node (ideally the only node with this result is the ROOT).
- Return type
dict or None
- Raises
CoreIllegalArgumentError – If node is not a Node
CoreInternalError – If some internal error took place inside the core layers.
-
get_mixin_errors
(node)[source]¶ Checks if the mixins allocated with the node can be used. Every mixin node should be on the Meta. Every rule (attribute/pointer/set/aspect/containment/constraint) should be defined only in one mixin.
- Parameters
node (dict) – the node to test.
- Returns
Returns the array of violations. If the array is empty, there is no violation.
- Return type
list of dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_mixin_nodes
(node)[source]¶ Gathers the mixin nodes defined directly at the node.
- Parameters
node (dict) – the node in question.
- Returns
The dictionary of the mixin nodes keyed by their paths.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_mixin_paths
(node)[source]¶ Gathers the paths of the mixin nodes defined directly at the node.
- Parameters
node (dict) – the node in question.
- Returns
The paths of the mixins in an array ordered by their order of use (which is important in case of some collision among definitions would arise).
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_namespace
(node)[source]¶ Returns the resolved namespace for the node. If node is not in a library it returns the empty string. If the node is in a library of a library - the full name space is the library names joined together by dots.
- Parameters
node (dict) – the node in question.
- Returns
Returns the name space of the node.
- Return type
str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_attribute
(node, name)[source]¶ Returns the value of the attribute defined for the given node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the attribute.
- Returns
Returns the value of the attribute defined specifically for the node. If undefined then it means that there is no such attribute defined directly for the node, meaning that it either inherits some value or there is no such attribute at all.
- Return type
str or int or float or bool or dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_attribute_names
(node)[source]¶ Returns the names of the attributes of the node that have been first defined for the node and not for its bases.
- Parameters
node (dict) – the node in question.
- Returns
The function returns an array of the names of the own attributes of the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_children_paths
(parent)[source]¶ Collects the paths of all the children of the given node that has some data as well and not just inherited.
- Parameters
parent (dict) – the container node in question.
- Returns
The function returns an array of the absolute paths of the children.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_children_relids
(node)[source]¶ Collects the relative ids of all the children of the given node that has some data and not just inherited. N.B. Do not mutate the returned array!
- Parameters
node (dict) – the container node in question.
- Returns
The function returns an array of the relative ids.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_constraint_names
(node)[source]¶ Retrieves the list of constraint names defined specifically for the node.
- Parameters
node (dict) – the node in question.
- Returns
Returns the array of names of constraints for the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_json_meta
(node)[source]¶ Returns the META rules specifically defined for the given node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns an object that represent the META rules that were defined specifically for the node.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_member_paths
(node, name)[source]¶ Returns the list of absolute paths of the members of the given set of the given node that not simply inherited.
- Parameters
node (dict) – the set owner.
name (str) – the name of the set.
- Returns
Returns an array of absolute path strings of the member nodes of the set that has information on the node’s inheritance level.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_pointer_names
(node)[source]¶ Returns the list of the names of the pointers that were defined specifically for the node.
- Parameters
node (dict) – the node in question.
- Returns
Returns an array of names of pointers defined specifically for the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_pointer_path
(node, name)[source]¶ Returns the absolute path of the target of the pointer specifically defined for the node.
- Parameters
node (dict) – the node in question
name (str) – the name of the pointer
- Returns
Returns the absolute path. If the path is null, then it means that ‘no-target’ was defined specifically for this node for the pointer. If undefined it means that the node either inherits the target of the pointer or there is no pointer defined at all.
- Return type
str or None or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_registry
(node, name)[source]¶ Returns the value of the registry entry defined for the given node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the registry entry.
- Returns
Returns the value of the registry entry defined specifically for the node. If undefined then it means that there is no such registry entry defined directly for the node, meaning that it either inherits some value or there is no such registry entry at all.
- Return type
str or int or float or bool or dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_registry_names
(node)[source]¶ Returns the names of the registry enrties of the node that have been first defined for the node and not for its bases.
- Parameters
node (dict) – the node in question.
- Returns
The function returns an array of the names of the own registry entries of the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_set_attribute
(node, set_name, attr_name)[source]¶ Get the value of the attribute entry specifically set for the set at the node.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
attr_name (str) – the name of the attribute entry.
- Returns
Return the value of the attribute. If it is undefined, then there is no such attribute at the set.
- Return type
str or int or float or bool or dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_set_attribute_names
(node, name)[source]¶ Return the names of the attribute entries specifically set for the set at the node.
- Parameters
node (dict) – the owner of the set.
name (str) – the name of the set.
- Returns
Returns the array of names of attribute entries defined in the set at the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_set_names
(node)[source]¶ Returns the names of the sets created specifically at the node. N.B. When adding a member to a set of a node, the set is automatically created at the node.
- Parameters
node (dict) – the node in question.
- Returns
Returns an array of set names that were specifically created at the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_set_registry
(node, set_name, reg_name)[source]¶ Get the value of the registry entry specifically set for the set at the node.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
reg_name (str) – the name of the registry entry.
- Returns
Return the value of the registry. If it is undefined, then there is no such registry at the set.
- Return type
str or int or float or bool or dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_set_registry_names
(node, name)[source]¶ Return the names of the registry entries specifically set for the set at the node.
- Parameters
node (dict) – the owner of the set.
name (str) – the name of the set.
- Returns
Returns the array of names of registry entries defined in the set at the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_valid_aspect_names
(node)[source]¶ Returns the list of the META defined aspect names of the node that were specifically defined for the node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns the aspect names that are specifically defined for the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_valid_aspect_target_paths
(node, name)[source]¶ Returns the paths of the meta nodes that are valid target members of the given aspect specifically defined for the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the aspec in question.
- Returns
The paths of the meta nodes whose instances could be members of the aspect.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_valid_attribute_names
(node)[source]¶ Returns the list of the META defined attribute names of the node that were specifically defined for the node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns the attribute names that are defined specifically for the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_valid_pointer_names
(node)[source]¶ Returns the list of the META defined pointer names of the node that were specifically defined for the node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns all the pointer names that are defined among the META rules of the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_valid_set_names
(node)[source]¶ Returns the list of the META defined set names of the node that were specifically defined for the node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns all the set names that are defined among the META rules of the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_own_valid_target_paths
(node, name)[source]¶ Returns the paths of Meta nodes that are possible targets of the given pointer/set introduced by the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of pointer/set.
- Returns
The function returns the paths of valid nodes.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_parent
(node)[source]¶ Returns the parent of the node.
- Parameters
node (dict) – the node in question
- Returns
Returns the parent of the node or NULL if it has no parent.
- Return type
dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_path
(node)[source]¶ Returns the complete path of the node in the containment hierarchy.
- Parameters
node (dict) – the node in question.
- Returns
Returns a path string where each portion is a relative id and they are separated by ‘/’. The path can be empty as well if the node in question is the root itself, otherwise it should be a chain of relative ids from the root of the containment hierarchy.
- Return type
str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_pointer_definition_info
(node, name, target)[source]¶ Returns the meta nodes that introduce the given pointer relationship.
- Parameters
node (dict) – the node in question.
name (str) – the name of the pointer in question.
target (dict) – the target node.
- Returns
The owner and the target of the pointer meta-rule that makes target a valid target of the named pointer of node.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_pointer_meta
(node, name)[source]¶ Return a JSON representation of the META rules regarding the given pointer/set of the given node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the pointer/set.
- Returns
The function returns a detailed JSON structure that represents the META rules regarding the given pointer/set of the node.
- Return type
dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_pointer_names
(node)[source]¶ Retrieves a list of the defined pointer names of the node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns an array of the names of the pointers of the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_pointer_path
(node, name)[source]¶ Retrieves the path of the target of the given pointer of the given node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the pointer in question.
- Returns
The function returns the absolute path of the target node if there is a valid target. It returns null if though the pointer is defined it does not have any valid target. Finally, it return undefined if there is no pointer defined for the node under the given name.
- Return type
str or None or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_registry
(node, name)[source]¶ Retrieves the value of the given registry entry of the given node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the registry entry.
- Returns
The function returns the value of the registry entry of the node. The value can be an object or any primitive type. If the value is undefined that means the node do not have such attribute defined.
- Return type
str or int or float or bool or dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_registry_names
(node)[source]¶ Returns the names of the defined registry entries of the node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns an array of the names of the registry entries of the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_relid
(node)[source]¶ Returns the parent-relative identifier of the node.
- Parameters
node (dict) – the node in question.
- Returns
Returns the last segment of the node path.
- Return type
str or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_root
(node)[source]¶ Returns the root node of the containment tree that node is part of.
- Parameters
node (dict) – the node in question.
- Returns
Returns the root of the containment hierarchy (it can be the node itself).
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_set_attribute
(node, set_name, attr_name)[source]¶ Get the value of the attribute entry in the set.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
attr_name (str) – the name of the attribute entry.
- Returns
Return the value of the attribute. If it is undefined, then there is no such attribute at the set.
- Return type
str or int or float or bool or dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_set_attribute_names
(node, name)[source]¶ Return the names of the attribute entries for the set.
- Parameters
node (dict) – the owner of the set.
name (str) – the name of the set.
- Returns
Returns the array of names of attribute entries in the set.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_set_definition_info
(node, name, member)[source]¶ Returns the meta nodes that introduce the given set relationship.
- Parameters
node (dict) – the node in question.
name (str) – the name of the set in question.
member (dict) – the member.
- Returns
The owner and the target of the set meta-rule that makes member a valid member of the named set of node.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_set_names
(node)[source]¶ Returns the names of the sets of the node.
- Parameters
node (dict) – the node in question.
- Returns
Returns an array of set names that the node has.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_set_registry
(node, set_name, reg_name)[source]¶ Get the value of the registry entry in the set.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
reg_name (str) – the name of the registry entry.
- Returns
Return the value of the registry. If it is undefined, then there is no such registry at the set.
- Return type
str or int or float or bool or dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_set_registry_names
(node, name)[source]¶ Return the names of the registry entries for the set.
- Parameters
node (dict) – the owner of the set.
name (str) – the name of the set.
- Returns
Returns the array of names of registry entries in the set.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_type_root
(node)[source]¶ Returns the root of the inheritance chain (cannot be the node itself).
- Parameters
node (dict) – the node in question.
- Returns
Returns the root of the inheritance chain of the node. If returns null, that means the node in question is the root of the chain.
- Return type
dict or None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_valid_aspect_names
(node)[source]¶ Returns the list of the META defined aspect names of the node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns all the aspect names that are defined among the META rules of the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_valid_aspect_target_paths
(node, name)[source]¶ Returns the paths of the meta nodes that are valid target members of the given aspect.
- Parameters
node (dict) – the node in question.
name (str) – the name of the aspec in question.
- Returns
The paths of the meta nodes whose instances could be members of the aspect.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
get_valid_attribute_names
(node)[source]¶ Returns the list of the META defined attribute names of the node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns all the attribute names that are defined among the META rules of the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_valid_children_meta_nodes
(parameters)[source]¶ Retrieves the valid META nodes that can be base of a child of the node.
- Parameters
parameters (dict) – the input parameters of the query.
- Returns
The function returns a list of valid nodes that can be instantiated as a child of the node.
- Return type
list of dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_valid_children_paths
(node)[source]¶ Returns the list of absolute path of the valid children types of the node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns an array of absolute paths of the nodes that was defined as valid children for the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_valid_pointer_names
(node)[source]¶ Returns the list of the META defined pointer names of the node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns all the pointer names that are defined among the META rules of the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_valid_set_elements_meta_nodes
(parameters)[source]¶ Retrieves the valid META nodes that can be base of a member of the set of the node.
- Parameters
parameters (dict) – the input parameters of the query.
- Returns
The function returns a list of valid nodes that can be instantiated as a member of the set of the node.
- Return type
list of dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_valid_set_names
(node)[source]¶ Returns the list of the META defined set names of the node.
- Parameters
node (dict) – the node in question.
- Returns
The function returns all the set names that are defined among the META rules of the node.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
get_valid_target_paths
(node, name)[source]¶ Returns the paths of Meta nodes that are possible targets of the given pointer/set.
- Parameters
node (dict) – the node in question.
name (str) – the name of pointer/set.
- Returns
The function returns the paths of valid nodes.
- Return type
list of str
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
import_closure
(node, closure_information)[source]¶ Imports the set of nodes in the closureInformation - that has the format created by [getClosureInformation]{@link Core#getClosureInformation} - as direct children of the parent node. All data necessary for importing the closure has to be imported beforehand!
- Parameters
node (dict) – the parent node where the closure will be imported.
closure_information (dict) – the information about the closure.
- Returns
If the closure cannot be imported the resulting error highlights the causes, otherwise a specific object will be returned that holds information about the closure.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_abstract
(node)[source]¶ Checks if the node is abstract.
- Parameters
node (dict) – the node in question.
- Returns
The function returns true if the registry entry ‘isAbstract’ of the node if true hence the node is abstract.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_connection
(node)[source]¶ Check is the node is a connection-like node.
- Parameters
node (dict) – the node in question.
- Returns
Returns true if both the ‘src’ and ‘dst’ pointer are defined as valid for the node.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_empty
(node)[source]¶ Checks if the node in question has some actual data.
- Parameters
node (dict) – the node in question.
- Returns
Returns true if the node is ‘empty’ meaning that it is not reserved by real data. Returns false if the node is exists and have some meaningful value.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_fully_overridden_member
(node, name, path)[source]¶ Checks if the member is completely overridden in the set of the node.
- Parameters
node (dict) – the node to test.
name (str) – the name of the set of the node.
path (str) – the path of the member in question.
- Returns
Returns true if the member exists in the base of the set, but was added to the given set as well, which means a complete override. If the set does not exist or the member do not have a ‘base’ member or just some property was overridden, the function returns false.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
is_instance_of
(node, base_node_or_path)[source]¶ Checks if the node is an instance of base.
- Parameters
node (dict) – the node in question.
base_node_or_path (dict or str) – a potential base node (or its path) of the node
- Returns
Returns true if the base is on the inheritance chain of node. A node is considered to be an instance of itself here.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_library_element
(node)[source]¶ Returns true if the node in question is a library element..
- Parameters
node (dict) – the node in question.
- Returns
Returns true if your node is a library element, false otherwise.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_library_root
(node)[source]¶ Returns true if the node in question is a library root..
- Parameters
node (dict) – the node in question.
- Returns
Returns true if your node is a library root (even if it is embedded in other library), false otherwise.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_member_of
(node)[source]¶ Returns all membership information of the given node.
- Parameters
node (dict) – the node in question
- Returns
Returns a dictionary where every the key of every entry is an absolute path of a set owner node. The value of each entry is an array with the set names in which the node can be found as a member.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_meta_node
(node)[source]¶ Checks if the node is a META node.
- Parameters
node (dict) – the node to test.
- Returns
Returns true if the node is a member of the METAAspectSet of the ROOT node hence can be seen as a META node.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_type_of
(node, type_node_or_path)[source]¶ Checks if the given node in any way inherits from the typeNode. In addition to checking if the node “isInstanceOf” of typeNode, this methods also takes mixins into account.
- Parameters
node (dict) – the node in question.
type_node_or_path (dict or str) – the type node we want to check or its path.
- Returns
The function returns true if the typeNodeOrPath represents a base node, or a mixin of any of the base nodes, of the node. Every node is considered to be a type of itself.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_valid_aspect_member_of
(node, parent, name)[source]¶ Returns if a node could be contained in the given container’s aspect.
- Parameters
node (dict) – the node in question.
parent (dict) – the container node in question.
name (str) – the name of aspect.
- Returns
The function returns true if the given container could contain the node in the asked aspect.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_valid_attribute_value_of
(node, name, value)[source]¶ Checks if the given value is of the necessary type, according to the META rules.
- Parameters
node (dict) – the node in question.
name (str) – the name of the attribute.
value (str or int or float or bool or dict) – the value to test.
- Returns
Returns true if the value matches the META definitions.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_valid_child_of
(node, parent)[source]¶ Checks if according to the META rules the given node can be a child of the parent.
- Parameters
node (dict) – the node in question
parent (dict) – the parent we like to test.
- Returns
The function returns true if according to the META rules the node can be a child of the parent. The check does not cover multiplicity (so if the parent can only have twi children and it already has them, this function will still returns true).
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_valid_new_base
(node, base)[source]¶ Checks if base can be the new base of node.
- Parameters
node (dict) – the node in question.
base (dict or None or None) – the new base.
- Returns
True if the supplied base is a valid base for the node.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_valid_new_child
(parent_node, base_node)[source]¶ Checks if an instance of the given base can be created under the parent. It does not check for meta consistency. It only validates if the proposed creation would cause any loops in the combined containment inheritance trees.
- Parameters
parent_node (dict or None) – the parent in question.
base_node (dict or None) – the intended type of the node.
- Returns
True if a child of the type can be created.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_valid_new_parent
(node, parent)[source]¶ Checks if parent can be the new parent of node.
- Parameters
node (dict) – the node in question.
parent (dict) – the new parent.
- Returns
True if the supplied parent is a valid parent for the node.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
is_valid_target_of
(node, source, name)[source]¶ Checks if the node can be a target of a pointer of the source node in accordance with the META rules.
- Parameters
node (dict) – the node in question.
source (dict) – the source to test.
name (str) – the name of the pointer.
- Returns
The function returns true if according to the META rules, the given node is a valid target of the given pointer of the source.
- Return type
bool
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
load_by_path
(node, relative_path)[source]¶ From the given starting node, it loads the path given as a series of relative ids (separated by ‘/’) and returns the node it finds at the ends of the path. If there is no node, the function will return null.
- Parameters
node (dict) – the starting node of our search.
relative_path (str) – the relative path - built by relative ids - of the node in question.
- Returns
the resulting node
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the result of the execution
CoreInternalError – the result of the execution
-
load_child
(parent, relative_id)[source]¶ Loads the child of the given parent pointed by the relative id. Behind the scenes, it means that it actually loads the data pointed by a hash stored inside the parent under the given id and wraps it in a node object which will be connected to the parent as a child in the containment hierarchy. If there is no such relative id reserved, the call will return with null.
- Parameters
parent (dict) – the container node in question.
relative_id (str) – the relative id of the child in question.
- Returns
the resulting child
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the result of the execution
CoreInternalError – the result of the execution
-
load_children
(node)[source]¶ Loads all the children of the given parent. As it first checks the already reserved relative ids of the parent, it only loads the already existing children (so no on-demand empty node creation).
- Parameters
node (dict) – the container node in question.
- Returns
the resulting children
- Return type
list of dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the result of the execution
CoreInternalError – the result of the execution
-
load_collection
(node, pointer_name)[source]¶ Loads all the source nodes that has such a pointer and its target is the given node.
- Parameters
node (dict) – the target node in question.
pointer_name (str) – the name of the pointer of the sources.
- Returns
the resulting sources
- Return type
list of dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the result of the execution
CoreInternalError – the result of the execution
-
load_instances
(node)[source]¶ Loads all the instances of the given node.
- Parameters
node (dict) – the node in question.
- Returns
the found instances of the node.
- Return type
list of dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the status of the execution.
CoreInternalError – the status of the execution.
-
load_members
(node, set_name)[source]¶ Loads all the members of the given set of the node.
- Parameters
node (dict) – the node in question.
set_name (str) – the name of the set in question.
- Returns
the found members of the set of the node.
- Return type
list of dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the status of the execution.
CoreInternalError – the status of the execution.
-
load_own_children
(node)[source]¶ Loads all the children of the given parent that has some data and not just inherited. As it first checks the already reserved relative ids of the parent, it only loads the already existing children (so no on-demand empty node creation).
- Parameters
node (dict) – the container node in question.
- Returns
the resulting children
- Return type
list of dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the result of the execution
CoreInternalError – the result of the execution
-
load_own_members
(node, set_name)[source]¶ Loads all the own members of the given set of the node.
- Parameters
node (dict) – the node in question.
set_name (str) – the name of the set in question.
- Returns
the found own members of the set of the node.
- Return type
list of dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the status of the execution.
CoreInternalError – the status of the execution.
-
load_own_sub_tree
(node)[source]¶ Loads a complete sub-tree of the containment hierarchy starting from the given node, but load only those children that has some additional data and not purely inherited.
- Parameters
node (dict) – the container node in question.
- Returns
the resulting sources
- Return type
list of dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the result of the execution
CoreInternalError – the result of the execution
-
load_pointer
(node, pointer_name)[source]¶ Loads the target of the given pointer of the given node. In the callback the node can have three values: if the node is valid, then it is the defined target of a valid pointer, if the returned value is null, then it means that the pointer is defined, but has no real target, finally if the returned value is undefined than there is no such pointer defined for the given node.
- Parameters
node (dict) – the source node in question.
pointer_name (str) – the name of the pointer.
- Returns
the resulting target
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the result of the execution
CoreInternalError – the result of the execution
-
load_root
(hash)[source]¶ Loads the data object with the given hash and makes it a root of a containment hierarchy.
- Parameters
hash (str) – the hash of the data object we like to load as root.
- Returns
the resulting root node
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the result of the execution
CoreInternalError – the result of the execution
-
load_sub_tree
(node)[source]¶ Loads a complete sub-tree of the containment hierarchy starting from the given node.
- Parameters
node (dict) – the node that is the root of the sub-tree in question.
- Returns
the resulting sources
- Return type
list of dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the result of the execution
CoreInternalError – the result of the execution
-
move_aspect_meta_target
(node, target, old_name, new_name)[source]¶ Moves the given target definition over to a new aspect. As actual values in case of relation definitions vary quite a bit from the meta-targets, this function does not deals with the actual pointer/set target/members.
- Parameters
node (dict) – the node in question.
target (dict) – the target that should be moved among definitions.
old_name (str) – the current name of the aspect that has the target.
new_name (str) – the new aspect name where the target should be moved over.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
move_member
(node, member_path, old_set_name, new_set_name)[source]¶ Moves an own member of the set over to another set of the node.
- Parameters
node (dict) – the node in question.
member_path (str) – the path of the memberNode that should be moved.
old_set_name (str) – the name of the set where the member is currently reside.
new_set_name (str) – the name of the target set where the member should be moved to.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
move_node
(node, parent)[source]¶ Moves the given node under the given parent.
- Parameters
node (dict) – the node to be moved.
parent (dict) – the parent node of the copy.
- Returns
The function returns the node after the move.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
move_pointer_meta_target
(node, target, old_name, new_name)[source]¶ Moves the given target definition over to a new pointer or set. Note this does not alter the actual pointer target or set members.
- Parameters
node (dict) – the node in question.
target (dict) – the target that should be moved among definitions.
old_name (str) – the current name of the pointer/set definition in question.
new_name (str) – the new name of the relation towards the target.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
persist
(node)[source]¶ Persists the changes made in memory and computed the data blobs that needs to be saved into the database to make the change and allow other users to see the new state of the project.
- Parameters
node (dict) – some node element of the modified containment hierarchy (usually the root).
- Returns
The function returns an object which collects all the changes on data level and necessary to update the database on server side. Keys of the returned object are ‘rootHash’ and ‘objects’. The values of these should be passed to project.makeCommit.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
remove_library
(node, name)[source]¶ Removes a library from your project. It will also remove any remaining instances of the specific library.
- Parameters
node (dict) – any node in your project.
name (str) – the name of your library.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
rename_attribute
(node, old_name, new_name)[source]¶ Renames the given attribute of the node if its value is not inherited.
- Parameters
node (dict) – the node in question.
old_name (str) – the current name of the attribute in question.
new_name (str) – the new name of the attribute.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
rename_attribute_meta
(node, old_name, new_name)[source]¶ Renames the given attribute definition of the node. It also renames the default value of the definition! As a result of this operation, all instances of node will have the new attribute, but if they have overriden the old attribute it will remain under that name (and become meta invalid).
- Parameters
node (dict) – the node in question.
old_name (str) – the current name of the attribute definition in question.
new_name (str) – the new name of the attribute.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
rename_library
(node, old_name, new_name)[source]¶ Rename a library in your project.
- Parameters
node (dict) – any node in your project.
old_name (str) – the current name of the library.
new_name (str) – the new name of the project.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
rename_pointer
(node, old_name, new_name)[source]¶ Renames the given pointer of the node if its target is not inherited.
- Parameters
node (dict) – the node in question.
old_name (str) – the current name of the pointer in question.
new_name (str) – the new name of the pointer.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
rename_registry
(node, old_name, new_name)[source]¶ Renames the given registry of the node if its value is not inherited.
- Parameters
node (dict) – the node in question.
old_name (str) – the current name of the registry in question.
new_name (str) – the new name of the registry.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
rename_set
(node, old_name, new_name)[source]¶ Renames the given set of the node if its is not inherited.
- Parameters
node (dict) – the node in question.
old_name (str) – the current name of the set in question.
new_name (str) – the new name of the set.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_aspect_meta_target
(node, name, target)[source]¶ Sets a valid type for the given aspect of the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the aspect.
target (dict) – the valid type for the aspect.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_attribute
(node, name, value)[source]¶ Sets the value of the given attribute of the given node. It defines the attribute on demand, means that it will set the given attribute even if was ot defined for the node beforehand.
- Parameters
node (dict) – the node in question.
name (str) – the name of the attribute.
value (str or int or float or bool or dict) – the new of the attribute, undefined is not allowed.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_attribute_meta
(node, name, rule)[source]¶ Sets the META rules of the attribute of the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the attribute.
rule (dict) – the rules that defines the attribute
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_base
(node, base)[source]¶ Sets the base node of the given node. The function doesn’t touches the properties or the children of the node so it can cause META rule violations that needs to be corrected manually.
- Parameters
node (dict) – the node in question.
base (dict or None) – the new base.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_child_meta
(node, child, min=None, max=None)[source]¶ Sets the given child as a valid children type for the node.
- Parameters
node (dict) – the node in question.
child (dict) – the valid child node.
min (int) – the allowed minimum number of children from this given node type (if not given or -1 is set, then there will be no minimum rule according this child type)
max (int) – the allowed maximum number of children from this given node type (if not given or -1 is set, then there will be no minimum rule according this child type)
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_children_meta_limits
(node, min=None, max=None)[source]¶ Sets the global containment limits for the node.
- Parameters
node (dict) – the node in question.
min (int) – the allowed minimum number of children (if not given or -1 is set, then there will be no minimum rule according children)
max (int) – the allowed maximum number of children (if not given or -1 is set, then there will be no maximum rule according children)
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_constraint
(node, name, constraint)[source]¶ Sets a constraint object of the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the constraint.
constraint (dict) – the constraint to be set.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_guid
(node, guid)[source]¶ Set the GUID of a node. As the Core itself do not checks whether the GUID already exists. The use of this function is only advised during the creation of the node.
- Parameters
node (dict) – the node in question.
guid (str) – the new globally unique identifier.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the result of the execution.
CoreIllegalOperationError – the result of the execution.
CoreInternalError – the result of the execution.
-
set_member_attribute
(node, set_name, path, attr_name, value)[source]¶ Sets the attribute value which represents a property of the membership.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
path (str) – the absolute path of the member node.
attr_name (str) – the name of the attribute.
value (str or int or float or bool or dict) – the new value of the attribute.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_member_registry
(node, set_name, path, reg_name, value)[source]¶ Sets the registry entry value which represents a property of the membership.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
path (str) – the absolute path of the member node.
reg_name (str) – the name of the registry entry.
value (str or int or float or bool or dict) – the new value of the registry.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_pointer
(node, name, target)[source]¶ Sets the target of the pointer of the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the pointer in question.
target (dict or None) – the new target of the pointer.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_pointer_meta_limits
(node, name, min=None, max=None)[source]¶ Sets the global target limits for pointer/set of the node. On META level the only distinction between pointer and sets is the global multiplicity which has to maximize the number of possible targets to 1 in case of ‘pure’ pointer definitions.
- Parameters
node (dict) – the node in question.
name (str) – the name of the pointer/set.
min (int) – the allowed minimum number of children (if not given or -1 is set, then there will be no minimum rule according targets)
max (int) – the allowed maximum number of children (if not given or -1 is set, then there will be no maximum rule according targets)
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_pointer_meta_target
(node, name, target, min=None, max=None)[source]¶ Sets the given target as a valid target type for the pointer/set of the node.
- Parameters
node (dict) – the node in question.
name (str) – the name of the pointer/set.
target (dict) – the valid target/member node.
min (int) – the allowed minimum number of target/member from this given node type (if not given or -1 is set, then there will be no minimum rule according this target type)
max (int) – the allowed maximum number of target/member from this given node type (if not given or -1 is set, then there will be no minimum rule according this target type)
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_registry
(node, name, value)[source]¶ Sets the value of the given registry entry of the given node. It defines the registry entry on demand, means that it will set the given registry entry even if was ot defined for the node beforehand.
- Parameters
node (dict) – the node in question.
name (str) – the name of the registry entry.
value (str or int or float or bool or dict) – the new of the registry entry. Can be any primitive type or object. Undefined is not allowed.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_set_attribute
(node, set_name, attr_name, value)[source]¶ Sets the attribute entry value for the set at the node.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
attr_name (str) – the name of the attribute entry.
value (str or int or float or bool or dict) – the new value of the attribute.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
set_set_registry
(node, set_name, reg_name, value)[source]¶ Sets the registry entry value for the set at the node.
- Parameters
node (dict) – the owner of the set.
set_name (str) – the name of the set.
reg_name (str) – the name of the registry entry.
value (str or int or float or bool or dict) – the new value of the registry.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreIllegalOperationError – If the context of the operation is not allowed.
CoreInternalError – If some internal error took place inside the core layers.
-
try_to_concat_changes
(mine, theirs)[source]¶ Tries to merge two patch object. The patches ideally represents changes made by two parties. They represents changes from the same source ending in different states. Our aim is to generate a single patch that could cover the changes of both party.
- Parameters
mine (dict) – the tree structured JSON patch that represents my changes.
theirs (dict) – the tree structured JSON patch that represents the changes of the other party.
- Returns
The function returns with an object that contains the conflicts (if any) and the merged patch.
- Return type
dict
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
CoreInternalError – If some internal error took place inside the core layers.
-
update_library
(node, name, library_root_hash, library_info=None)[source]¶ It updates a library in your project based on the input information. It will ‘reaplace’ the old version, keeping as much information as possible regarding the instances.
- Parameters
node (dict) – any regular node in your project.
name (str) – the name of the library you want to update.
library_root_hash (str) – the hash of your library’s new root (must exist in the project’s collection at the time of call).
library_info (dict) – information about your project.
- Returns
Nothing is returned by the function.
- Return type
None
- Raises
CoreIllegalArgumentError – If some of the parameters don’t match the input criteria.
JSError – the status of the execution.
CoreIllegalOperationError – the status of the execution.
CoreInternalError – the status of the execution.
-
property