📄️ Spawn
The spawn keyword has various applications in graphs, nodes, and walkers, each with its own unique context. To gain a better understanding of its usage in each of these contexts, please refer to the following sections.
📄️ Info and Context
In Jac, you can use the info and context commands to view the content of a node or edge. Although the following example demonstrates the use of these commands on nodes, the same principles can be applied to edges as well. Take a look at the example below to see how to use the info and context commands.
📄️ Take
Jaseci introduces the handy command called "take" to instruct walker to navigate through nodes. You may notice by default, a walker traverse with take command using the breadth first search approach (refer to the example here). But the take command is flexible hence you can indicate whether the take command should use a depth first or a breadth first traversal to navigate. Look at the following example;
📄️ Skip
The idea behind the abstraction of skip in the context of a walkers code block is that it tells a walker to halt and abandon any unfinished work on the current node in favor of moving to the next node (or complete computation if no nodes are queued up).
📄️ Disengage
The command disengage tells the walker to stop all execution and "disengage" from the graph (i.e., stop visiting nodes anymore from here) and can only be used inside the code body of a walker.
📄️ Ignore
The quite handy command ignore from Jaseci allows you to skip(ignore) visiting nodes or edges when traversing.
📄️ Destroy
To remove nodes or edges from the graph, Jaseci also offers the very useful command "destroy." Run the example that follows using the 'dot' command in the Jac shell. i.e. jac dot main.jac.
📄️ Report
The report command in jac resembles a conventional programming logging function in certain ways. The state of each node the walker visits while traversing continue to be recorded in this way.
📄️ Yield
We have so far examined walkers that carry variables and state as they move around a graph. Each time a walk is completed, a walker's state is cleared by default , but node/edge state is preserved. Nevertheless, there are circumstances in which you would want a walker to maintain its state across runs, or even to pause in the middle of a walk and wait to be explicitly called again, updating a subset of its dynamic state. This is where the yield keyword comes in.