Skip to content

Revise Command

graju256 edited this page Sep 15, 2026 · 3 revisions

Revise Command

Overview

The revise command updates a bundle to conform to schema changes, normalize entity structures, and apply transformations. It's essential for migrating bundles between Gateway versions and ensuring bundle compatibility.

Note

Currently, bundle portability is supported from the older gateway releases to the latest. This may not be true when the deprecated features are no longer supported. During this phase, revise command ensures the portability by transforming the bundles as per the target gateway.

Syntax

graphman revise --input <input-file>
  [--output <output-file>]
  [--options.<name> <value>,...]

Parameters

Required Parameters

Parameter Description
--input Input bundle file to revise

Optional Parameters

Parameter Description Default
--output Output file for revised bundle Standard output (console)
--options.<name> Customize revise operation See defaults below

Options

Option Default Description
normalize false Normalize/sanitize bundle for import
excludeGoids false Remove GOIDs from entities (requires normalize)

Behavior

Schema Revision

The revise command automatically:

  • Updates entity structures to match current schema
  • Adds new required fields with default values
  • Removes deprecated fields
  • Transforms field values to new formats
  • Adjusts entity relationships

Normalization

When normalize: true:

  • Sanitizes bundle for import operations
  • Removes duplicate entities
  • Validates entity structures
  • Applies import-ready transformations
  • Optionally removes GOIDs

Examples

Basic Revision

Revise bundle to current schema:

graphman revise --input old-bundle.json --output revised-bundle.json

Revise with Normalization

Normalize bundle for import:

graphman revise --input bundle.json --output normalized.json --options.normalize true

Revise and Remove GOIDs

Prepare portable bundle without GOIDs:

graphman revise --input bundle.json --output portable.json \
  --options.normalize true \
  --options.excludeGoids true

Revise to Console

View revised bundle without saving:

graphman revise --input bundle.json --options.normalize true

Use Cases

1. Gateway Version Migration

Migrate bundle from older Gateway version:

# Export from old gateway (v10.x)
graphman export --gateway old-gw --output old-version.json

# Revise for new gateway (v11.x)
graphman revise --input old-version.json --output migrated.json

# Import to new gateway
graphman import --input migrated.json --gateway new-gw

2. Schema Compatibility

Update bundle to match current schema:

graphman revise --input legacy-bundle.json --output current-schema.json

3. Import Preparation

Prepare exported bundle for import:

# Export from source
graphman export --gateway source --output export.json

# Revise for import
graphman revise --input export.json --output import-ready.json \
  --options.normalize true \
  --options.excludeGoids true

# Import to target
graphman import --input import-ready.json --gateway target

Custom Schema Version

Revise to specific schema version:

graphman revise --input bundle.json --output revised.json \
  --options.schema v11.1.1 \
  --options.normalize true

Batch Revision

Revise multiple bundles:

#!/bin/bash
for file in bundles/*.json; do
  output="revised/$(basename $file)"
  graphman revise --input "$file" --output "$output" \
    --options.normalize true \
    --options.excludeGoids true
done

Clone this wiki locally