Networks
Thing networks define the relationships between Things. One Thing can be a parent, child or sibling of another Thing. Thing networks allow you to define a Thing hierarchy. You can then ask a Thing who its parent is, or who its siblings are, through REST interfaces, when you need to walk a Thing hierarchy. You can walk the network via script in a service or subscription, or through REST services. There is a REST service that allows you to retrieve part or all of a network and display the network in a tree control in a mashup.
Network Server-Side Script Functions
GetChildren(name)— returns an array of strings with the name(s) of the child nodes. name = node for which to get the children, and is optional. If a name is not provided, the list will start at the root node.
GetParent(name)— returns a string containing the parent node name, an empty string if first level node, or null if the root (empty) node. name = node for which to get the parent.
GetChildrenForShape(parentName,shapeName)— returns an array of Thing names.
GetChildrenForTemplate(parentName,templateName)— returns an array of Thing names.
Network Services (Script + Mashup + REST API)
GetNetworkConnections(maxDepth)— returns infotable with all parent/child relationships in a single table, wheremaxDepth is optional (will get all if not provided).
GetSubNetworkConnections(start,maxDepth)— returns infotable with all parent/child relationships in a single table, but for a subset of the overall network, starting at a specific node name. Where: start is the node for which to start the subtree (optional and will start at root node if not provided), and maxDepth is optional (will get all if not provided).
GetNetworkAsNestedInfoTables(maxDepth)— similar to GetNetworkConnections but uses nested info tables. maxDepth is optional (will get all if not provided)
GetSubNetworkAsNestedInfoTables(start,maxDepth)— similar to GetSubNetworkConnections but uses nested infotables. Where: start is the node for which to start the subtree (optional and will start at root node if not provided), maxDepth is optional (will get all if not provided).
GetChildConnections(name) — returns infotable with only direct child nodes, where name is the node for which to get the children (optional will start at root node if not provided).
GetParentName(name) — returns string containing parent node name, empty string if first level node, or null if the root (empty) node, where name is the node for which to get the parent.
IsInNetwork(name) — returns boolean, where name is the name of node to search for.
IsInSubNetwork(start,name) — returns boolean where start is the node for which to start the subtree (optional, will start at root node if not provided), and name is the name of node to search for.
GetChildConnectionsForShape(parentName,shapeName) — returns an infotable of children filtered by parent and Thing Shape.
GetChildConnectionsForTemplate(parentName,templateName) — returns an infotable of children filtered by parent and Thing Template.
GetChildren(name)— returns an array of strings with the name(s) of the child nodes. Where:
name is the node for which to get the children, and is optional. If no name is provided, the list will start at the root node.
GetParent(name) — returns a string containing the parent node name, an empty string if first level node, or null if the root (empty) node. Where:
name is the node for which to get the parent
GetChildrenForShape(parentName,shapeName) — returns an array of Thing names.
GetChildrenForTemplate(parentName,templateName) — returns an array of Thing names.