sgraph_query
Filter architecture models by path, attribute, or dependency using SGraph Query Language, returning matching elements and associations for impact analysis.
Instructions
Filter the model using SGraph Query Language — concise, architecture-native syntax.
Best for: filtering sub-models, checking module dependencies, attribute-based element selection. Returns a filtered model (elements + associations), not tabular data. For tabular queries and aggregation, use sgraph_cypher_query instead.
Syntax quick reference:
Element selection: "/project/src/web" Exact path (quoted, case-sensitive) phone Keyword (unquoted, case-insensitive partial match) "/path/*" Direct children "/path/**" All descendants
Attribute filters: @type=file Attribute equals (contains match) @type="file" Exact match (quoted value) @type!=dir Not equals @loc>500 Greater than (numeric) @loc<100 Less than @name=~".*.py$" Regex match @loc Has attribute (any value)
Dependency queries: "/src/web" --> "/src/db" Directed: does web depend on db? "/src/web" -- "/src/db" Undirected: dependency in either direction "/web" -import-> "/db" Filter by dependency type "*" --> "/src/db" Wildcard: anything that depends on db "/a" ---> "/b" Chain search: all transitive paths (DFS) "/a" --import-> "/b" Chain with type filter "/a" --- "/b" Shortest undirected path (BFS)
Logical operators: expr1 AND expr2 Sequential filter (intersection) expr1 OR expr2 Union NOT expr Complement (expr) Grouping
Examples: @type=file AND @loc>500 "/src" AND NOT "/src/External" "/src/web" --> "/src/db" (@type=file OR @type=dir) AND @loc>200
Returns JSON with elements (path, type, name) and associations (from, to, type).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes |