apocexport

package
v1.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package export provides APOC export functions.

This package implements all apoc.export.* functions for exporting graph data to various formats (JSON, CSV, Cypher, GraphML). Author: L6 / #1665 lane (Codex gpt-6.1-sol). Existing export producers delegate numeric text to its shared owner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Csv

func Csv(ctx context.Context, nodes []*Node, filePath string) error

Csv exports data to CSV format.

Example:

apoc.export.csv(nodes, '/path/to/export.csv') => exported

func Cypher

func Cypher(nodes []*Node, rels []*Relationship) string

Cypher exports data as Cypher statements.

Example:

apoc.export.cypher(nodes, rels) => Cypher statements

func CypherAll

func CypherAll(ctx context.Context, nodes []*Node, rels []*Relationship, filePath string) error

CypherAll exports all graph data as Cypher statements on the caller's context.

Example:

apoc.export.cypher.all('/path/to/export.cypher') => exported

func GraphML

func GraphML(nodes []*Node, rels []*Relationship) (string, error)

GraphML exports data to GraphML format.

Example:

apoc.export.graphml(nodes, rels) => GraphML string

GraphML rejects malformed UTF-8 and characters forbidden by XML 1.0. On error it returns no partial document.

func GraphMLAll

func GraphMLAll(ctx context.Context, nodes []*Node, rels []*Relationship, filePath string) error

GraphMLAll exports all graph data to GraphML on the caller's context.

Example:

apoc.export.graphml.all('/path/to/export.graphml') => exported

func Json

func Json(nodes []*Node, rels []*Relationship) (string, error)

Json exports data to JSON format.

Example:

apoc.export.json(nodes, relationships) => JSON string

func JsonAll

func JsonAll(ctx context.Context, nodes []*Node, rels []*Relationship, filePath string) error

JsonAll exports all graph data to JSON on the caller's context.

Example:

apoc.export.json.all('/path/to/export.json') => exported

func ToFile

func ToFile(ctx context.Context, data string, filePath string) error

ToFile writes export data to a file, creating its parent directories.

The caller's context is the whole admission: pkg/apocio admits the named destination through the caller's APOC I/O capability and performs the write, so a context without an export capability writes nothing. An empty destination preserves the established no-file behavior. Directory and file errors are returned to the caller.

Example:

err := apocexport.ToFile(ctx, document, "/path/to/export.graphml")

func ToString

func ToString(nodes []*Node, rels []*Relationship, format string) (string, error)

ToString returns export data as a string.

Example:

apoc.export.toString(nodes, rels, 'json') => string

Types

type Node

type Node struct {
	ID         int64
	Labels     []string
	Properties map[string]interface{}
}

Node represents a graph node.

type Relationship

type Relationship struct {
	ID         int64
	Type       string
	StartNode  int64
	EndNode    int64
	Properties map[string]interface{}
}

Relationship represents a graph relationship.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL