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 ¶
- func Csv(ctx context.Context, nodes []*Node, filePath string) error
- func Cypher(nodes []*Node, rels []*Relationship) string
- func CypherAll(ctx context.Context, nodes []*Node, rels []*Relationship, filePath string) error
- func GraphML(nodes []*Node, rels []*Relationship) (string, error)
- func GraphMLAll(ctx context.Context, nodes []*Node, rels []*Relationship, filePath string) error
- func Json(nodes []*Node, rels []*Relationship) (string, error)
- func JsonAll(ctx context.Context, nodes []*Node, rels []*Relationship, filePath string) error
- func ToFile(ctx context.Context, data string, filePath string) error
- func ToString(nodes []*Node, rels []*Relationship, format string) (string, error)
- type Node
- type Relationship
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Csv ¶
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 ¶
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 ¶
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 ¶
JsonAll exports all graph data to JSON on the caller's context.
Example:
apoc.export.json.all('/path/to/export.json') => exported
func ToFile ¶
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")