Documentation
¶
Overview ¶
Package graph provides APOC graph manipulation functions.
This package implements all apoc.graph.* functions for creating and manipulating virtual graphs and graph structures.
Index ¶
- func Stats(graph *Graph) map[string]interface{}
- func ToMap(graph *Graph) map[string]interface{}
- func Validate(graph *Graph) map[string]interface{}
- type Graph
- func Clone(graph *Graph) *Graph
- func From(nodes []*Node, rels []*Relationship, name string) *Graph
- func FromCypher(query string, params map[string]interface{}) *Graph
- func FromData(data map[string]interface{}, name string) *Graph
- func FromDocument(doc map[string]interface{}, config map[string]interface{}) *Graph
- func FromMap(data map[string]interface{}) *Graph
- func FromPath(nodes []*Node, rels []*Relationship, name string) *Graph
- func FromPaths(paths []map[string]interface{}, name string) *Graph
- func Merge(graphs ...*Graph) *Graph
- func Subgraph(graph *Graph, nodeIDs []int64) *Graph
- type Node
- type Relationship
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Stats ¶
Stats returns statistics about a graph.
Example:
apoc.graph.stats(graph) => {nodes: 10, relationships: 15}
Types ¶
type Graph ¶
type Graph struct {
Nodes []*Node
Relationships []*Relationship
}
Graph represents a virtual graph.
func From ¶
func From(nodes []*Node, rels []*Relationship, name string) *Graph
From creates a virtual graph from nodes and relationships.
Example:
apoc.graph.from(nodes, rels, 'MyGraph') => virtual graph
func FromCypher ¶
FromCypher creates a virtual graph from Cypher query results.
Example:
apoc.graph.fromCypher('MATCH (n) RETURN n', {}) => virtual graph
func FromData ¶
FromData creates a virtual graph from data.
Example:
apoc.graph.fromData(data, 'MyGraph') => virtual graph
func FromDocument ¶
FromDocument creates a virtual graph from a document structure.
Example:
apoc.graph.fromDocument(doc, {}) => virtual graph
func FromMap ¶
FromMap creates a graph from a map representation.
Example:
apoc.graph.fromMap(map) => graph
func FromPath ¶
func FromPath(nodes []*Node, rels []*Relationship, name string) *Graph
FromPath creates a virtual graph from a path.
Example:
apoc.graph.fromPath(path, 'MyGraph') => virtual graph
func FromPaths ¶
FromPaths creates a virtual graph from multiple paths.
Example:
apoc.graph.fromPaths(paths, 'MyGraph') => virtual graph
type Relationship ¶
type Relationship struct {
ID int64
Type string
StartNode int64
EndNode int64
Properties map[string]interface{}
}
Relationship represents a graph relationship.
func Relationships ¶
func Relationships(graph *Graph) []*Relationship
Relationships returns all relationships in a graph.
Example:
apoc.graph.relationships(graph) => [rel1, rel2, ...]