jac-node-edge-patterns

Defines nodes, edges, and filtered graph traversal patterns for Jac Object-Spatial Programming.

Updated Jul 26, 2026
One-click install
npx skills add https://github.com/nihalnihalani/jachacks-sf-2026 --skill jac-node-edge-patterns-nihalnihalani
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: jac-node-edge-patterns
Source: https://github.com/nihalnihalani/jachacks-sf-2026/tree/main/plugins/jac-codex/skills/jac-node-edge-patterns
Command: npx skills add https://github.com/nihalnihalani/jachacks-sf-2026 --skill jac-node-edge-patterns-nihalnihalani

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing graph-persistent code in Jac requires knowing the exact syntax for typed nodes, typed edges, connection operators, and nested traversal filters, and small mistakes like untyped edge predicates or colon-assign edge fields silently produce wrong results. This Skill provides verified patterns and pitfalls so graph modeling and query code works correctly the first time. ## Core Features & Use Cases - Node and Edge Definition: Declare graph-persistent node and edge archetypes with has fields and typed endpoints (edge Follows: Person --> Person). - Traversal and Filtering: Read the graph with direction variants, typed edge filters, nested [?:Type, field == value] predicates, multi-hop chains, and assign comprehensions for bulk updates. - Pitfall Avoidance: Documents verified failure modes such as silently dropped edge-field assignments, duck-typed untyped predicates raising runtime errors, and typed-edge deletion requiring [edge ...] iteration. - Use Case: When modeling a social graph in Jac, use this Skill to define a typed Follows edge with a since field, then query adult followers with [me ->:Follows:since > 2020:-> [?:Person, age >= 18]] without hitting type-inference or parse errors. ## Quick Start Use the jac-node-edge-patterns skill to define typed nodes and edges and write a filtered multi-hop graph traversal for my Jac data model.

Frequently Asked Questions about jac-node-edge-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define typed nodes and edges in Jac?▼

Declare graph-persistent entities with `node Person { has name: str; }` and typed connections with `edge Follows: Person --> Person { has since: int; }`. Create them with `alice +>:Follows(since=2020):+> bob`, passing fields through the constructor parens.

How do I filter graph traversal by node type and field in Jac?▼

Nest the filter inside the reference: `[alice -->[?:Person, age > 30]]` filters by node type and field predicate. Edge-attribute predicates require naming the edge type, as in `[a ->:Follows:since > 2020:->]`.

Why does my Jac edge field assignment not persist?▼

The colon-assign form `+>:E:field=val:+>` parses but silently drops the assignment, leaving the edge default-constructed. Always pass fields through the constructor parens: `+>:E(field=val):+>`.

How do I delete a typed edge in Jac?▼

The `del -->` operator is untyped-only, and `del [a ->:E:-> b]` fails at run time. Query the edge objects with `[edge a ->:E:-> b]` and iterate-del each one; deleting a node cascades to all its edges.

Why does my Jac traversal return Unknown-typed nodes?▼

An untyped edge gives no endpoint type information, so attribute access only warns and typed function calls fail. Declare endpoints on the edge (`edge E: Src --> Tgt {}`) or nest `[?:NodeType]` at the read site to narrow the type.

Why is my Jac node unreachable after creation?▼

A freshly constructed node with no incoming edge cannot be found by `[root -->]` reads or walkers. Always attach it with `root ++> node;` so it has a path from root.