transform

transform.extract

extract(config: ExtractConfig, options?: ExtractOptions): Promise<TransformResult>

Extract a subset of properties from matching nodes into newly created linked nodes.

For each visible source node, the specified properties are moved to a new node of targetCategory. An edge is added from the source to the extracted node. When keys are provided, nodes sharing the same key values share a single extracted node (deduplication). The operation is recorded in history as "ExtractNodes" and is fully undoable.

configExtractConfigtargetCategory: category of the new nodes; props: properties to extract.
optionsExtractOptionsOptional: sourceCategory filters source nodes; keys deduplicate extracted nodes; relationship names the connecting edge (default "HAS"); inheritLinks copies existing edges of the source onto the extracted node; skipEmpty (default true) skips source nodes where all extracted props are empty.

Returns: Promise<TransformResult>

Example

// Extract zip code into a shared Location node per unique zip
await api.transform.extract(
  { targetCategory: "Location", props: ["zip"] },
  { keys: ["zip"], relationship: "LIVES_IN" },
);