FAQ
What is node and how to define a node?
- Nodes are architypes forming part of a graph, holding properties. You can define nodes with attributes and values:
How to connect two nodes?
- Nodes can be connected with generic edges (default) or custom edges (defined with specific properties).
What is custom edge?
- Custom edges allow defining specific properties and behaviors for relationships between nodes
How to connect nodes with custom edge?
- Nodes can be connected with a custom edge as follows:
How to delete connection or edge between two nodes?
- To delete a connection between nodes:
What is walker and how to define a walker?
- A walker is an architype that performs actions within the graph. It can traverse nodes through edges, performing operations at each step.
How to visit all the Successor nodes of a node/ list of nodes?
- A walker can visit all successor nodes (directly connected nodes):
How to get all the Successor nodes of a node/ list of nodes?
- To retrieve all the successor nodes:
How to get all edges that is connected with a node?
- You can retrieve all the edges connected to a node by using edge filtering expressions.
How to get all edges that is connected between two nodes?
- To get all edges between two nodes:
How do I connect a list of nodes to a single node, either in series or parallel?
- You can connect a list of nodes to a single node in both series (one after the other) or in parallel (all at once):
How do I create a mesh connection between two lists of nodes?
- A mesh connection between two lists of nodes can be established, connecting each node in the first list to each node in the second list:
How to spawn a walker from root?
- You can spawn a walker from a specific node or root:
How to setup special ability for a entry through a given node or root?
- You can set up special abilities for root or specific node entries in walkers:
How to set up special Data Spatial abilities for a root
or specific node entry in a walker?
- Walkers can have special DS abilities triggered through the
root
or a specific node. You can define such abilities based on where the walker starts its traversal:# Ability entry through the root walker walker_name { can walker_ability with `root entry; } # Ability entry through a specific node walker walker_name { can walker_ability with specific_node entry; } # Ability entry through either root or a specific node walker walker_name { can walker_ability with `root | specific_node entry; }
- This allows you to specify different behavior depending on whether the walker enters the DS ability from the root or a particular node, or both.
What happens when using can ability_name with entry
in a walker?
- The ability_name ability is called once at the start of the walker’s lifecycle. It is triggered when the walker is first spawned and acts as the initial entry point.
- Key Point: This is executed only once at the beginning of the walker’s execution. jac
How to setup special ability of a node for a certain walker?
- You can setup special ability of a node for a certain walker using:
How can I access the current node instance in DS abilities of a walker?
- Current walker instance can be accessed using the
here
keyword within Data Spatial abilities of the node.
How to access the current walker inside DS abilities of a node?
- You can access the current walker instance inside Data Spatial abilities of a node using the
self
keyword.
How to access the current walker inside DS abilities of the current walker?
- You can access the current walker instance inside Data Spatial abilities of the current walker using the
self
keyword.
How to inherit walker?
- Walkers can inherit from other walkers and override their abilities:
How to override walker ability?
- To override a walker’s ability:
How to filter nodes based on conditions?
- You can filter nodes by their type or properties when traversing the graph using filters like
(?Type)
or attribute conditions.
How do I traverse nodes in JacLang?
- You can traverse nodes using the visit operation, which allows you to move from one node to another along edges.
Can I visualize my graph in JacLang?
- Yes, you can visualize your graph using built-in function
dotgen
.
How to customize the visualization of the graph?
- You can use various parameters such as staring node, depth, edge limit, node limit, and more to customize the output of
dotgen
. For example:
What is BFS traversal in dotgen
?
- By default,
dotgen
uses breadth-first search (BFS) to explore nodes. This can be controlled with thebfs
flag.
Can I export the graph visualization to a file?
- Yes, you can specify a
dot_file
to save the output in a.dot
file, which can be rendered using external graph visualization tools like Graphviz.
Can I exclude specific edge types from the visualization?
- Yes, using the
edge_type
parameter, you can exclude specific edge types from the visualization:
What parameters can I use with dotgen
?
-
Starting Node: The node from where graph traversal or visualization begins. Default: Root.
-
Depth: Limits how deep the traversal should go in the graph. Default: Infinity.
-
Edge Limit: Sets a cap on the number of edges to include in the visualization. Default: 512.
-
Node Limit: Specifies the maximum number of nodes to include. Default: 512.
-
BFS: Enables Breadth-First Search (BFS) for node traversal. Default: True.
-
Edge Type: Option to exclude specific edge types from the visualization. Default: An empty list (i.e., no exclusion).
-
dot_file: Optional parameter to specify a file name for saving the DOT graph output. If provided, the visualization will be saved in this file.
How can I generate and visualize a graph from a .jac
file using the CLI?
-
You can use the
jac dot
command to generate a graph visualization from a.jac
file. This command allows you to specify various options like depth, breadth traversal method, connection types, and node/edge limits. The generated graph is saved as a DOT file, which you can use with visualization tools like Graphviz. -
You can specify an initial node and limit the traversal depth:
-
You can use the following file to customize the visualization:
What parameters can I use with the jac dot command?
- filename: The .jac file containing the graph definition.
- initial: The initial node for traversal (default is root).
- depth: The maximum depth for traversal (-1 for unlimited).
- traverse: Flag to traverse the graph (False by default).
- connection: List of edge types to include.
- bfs: Use Breadth-First Search for traversal (False by default).
- edge_limit: Maximum number of edges (512 by default).
- node_limit: Maximum number of nodes (512 by default).
- saveto: Specify a file path to save the generated DOT file.