CGEF import and merge
Why CGEF
CGEF (Codeweb Graph Exchange Format) is the JSON format for graph data produced outside of codeweb — for example, call relationships of a private ERP system whose source cannot be scanned. Import it as a standalone store, merge it with local analysis, and trace chains across the boundary.
Document structure
A CGEF document is a JSON file with these top-level fields:
| Field | Required | Meaning |
|---|---|---|
format_version | yes | Format version; currently 1 |
metadata | yes | source identifier and ISO 8601 generated_at |
node_schemas | no | Declarations for custom node types |
edge_schemas | no | Declarations for custom edge types |
nodes | yes | Node array (may be empty) |
edges | yes | Edge array (may be empty) |
Standard node types cover all built-in codeweb objects (procedure, function, table, view, mapped_statement, java_method, java_class, java_sql, package, trigger, type, sequence, index, materialized_view, …). The full per-type key fields are specified in the CGEF user guide and the JSON Schema.
Custom types
Node or edge types that have no built-in equivalent are declared in node_schemas / edge_schemas (display name, key fields, property definitions). Their edges import as CustomEdge and their nodes with tag custom, so they behave like first-class nodes in trace, impact, and export.
Import
| Flag | Meaning |
|---|---|
--file | CGEF JSON input |
--output | Output store: .bincode or .json |
--prefix | Path prefix prepended to all relative file paths |
--name | Project name for the imported store |
--force | Import even when validation or parse errors are found |
Merge
Merging deduplicates nodes and edges across stores, so the same table analyzed locally and imported via CGEF collapses into one node. The merged store behaves like any local store for trace, serve, and export.
View the full guide
The Chinese guide docs/cgef-user-guide.md walks through a complete worked example, including the OP Excel lineage converter (lib/op-lineage.py).