Networks
Thing networks define the relationships between Things. A Thing can be a parent, child, or sibling of another Thing. Thing networks define a Thing hierarchy. Using networks and through REST interfaces, you can ask a Thing who its parent is, or who its siblings are 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 a part of or an entire network, and then show the network in a mashup.
Network Server-Side Script Functions
GetChildren(name)— (Optional) Returns an array of strings with the names of the child nodes. name = node for which to get the children. If a name is not provided, the list starts 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 an infotable with all parent-child relationships in a single table. If maxDepth is not defined (optional), returns all parent-child relationships.
GetSubNetworkConnections(start,maxDepth)— Returns an infotable with all parent-child relationships in a single table for a subset of the overall network, starting at a specified node name.
start— The node for which to start the subtree. If not defined, starts at the root node.
maxDepth — If not defined, returns all parent-child relationships.
GetChildConnections(name) — Returns an infotable with only direct child nodes, where name is the node for which to get the children. Will start at root node if not provided.
GetParentName(name) — Returns a 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 a boolean value, where name is the name of node to search for.
IsInSubNetwork(start,name) — Returns a boolean value.
start— The node for which to start the subtree. Starts at the root node if it is not provided.
name — 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 names of the child nodes.
name — The node for which to get the children. If a name is not provided, the list starts 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 — 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.
Networks and Visibility
A user cannot see Things in a network that they do not have visibility permission to. If a user has visibility to a network that contains parent and children Things, and they have visibility to children only, they will not see the parent or children. If they have visibility to the parent Thing, then will see the parent and any children they have visibility to.
Was this helpful?