Skip to content
UPG is in early alpha. The specification is still evolving and may change between versions.

from @unified-product-graph/cli · Read

upg query

Traverse the graph following typed edges, with field projection and truncation. The BFS primitive behind tree views.

Usage

upg query --from <type>|--from-id <id> [options]

Options

--file <path>
Path to .upg file
--from <type>
Start from all nodes of this type
--from-id <id>
Start from a specific node
--traverse <edges>
Comma list of edge types to follow per level (prefix ! to exclude)
--depth <n>
Max depth (default 3, max 10)
--include <fields>
Node fields to project
--edge-include <fields>
Edge fields to project: id,type,source,target. Pass "" to omit edges
--limit <n>
Max nodes to collect (default 200)
--json
Machine-readable JSON output

Examples

Personas and the jobs they pursue

upg query --from persona --traverse persona_pursues_job --depth 1

Two-hop neighbourhood of a node, as JSON

upg query --from-id n_abc --depth 2 --json

Related

upg treeupg listupg spec