Documentation
¶
Overview ¶
Package path provides APOC path finding functions.
This package implements all apoc.path.* functions for finding and analyzing paths in graph queries.
Index ¶
- Variables
- func Elements(path *Path) []interface{}
- func SubgraphAll(start *Node, config Config) (nodes []*Node, rels []*Relationship)
- type Config
- type Node
- type Path
- func AllShortestPaths(start, end *Node, relFilter string, maxHops int) []*Path
- func Combine(paths ...*Path) *Path
- func ExpandConfig(start *Node, config Config) []*Path
- func ShortestPath(start, end *Node, relFilter string, maxHops int) *Path
- func Slice(path *Path, start, end int) *Path
- func SpanningTree(start *Node, config Config) []*Path
- type Relationship
Constants ¶
This section is empty.
Variables ¶
var Storage storage.Storage = storage.NewInMemoryStorage()
Storage is the interface for database operations.
Functions ¶
func Elements ¶
func Elements(path *Path) []interface{}
Elements returns all elements (nodes and relationships) in a path.
Example:
apoc.path.elements(path) => [node1, rel1, node2, rel2, ...]
func SubgraphAll ¶
func SubgraphAll(start *Node, config Config) (nodes []*Node, rels []*Relationship)
SubgraphAll finds all nodes and relationships in a subgraph.
Example:
apoc.path.subgraphAll(startNode, {maxLevel: 3})
Types ¶
type Config ¶
type Config struct {
MinLevel int
MaxLevel int
RelationshipFilter string
LabelFilter string
Limit int
Unique string
BFS bool
}
Config holds path finding configuration.
type Node ¶
Node represents a graph node.
func SubgraphNodes ¶
SubgraphNodes finds all nodes in a subgraph from a start node.
Example:
apoc.path.subgraphNodes(startNode, {maxLevel: 3})
type Path ¶
Path represents a path through the graph.
func AllShortestPaths ¶
AllShortestPaths finds all shortest paths between two nodes.
Example:
apoc.path.allShortestPaths(start, end, 'KNOWS>', 10)
func ExpandConfig ¶
ExpandConfig expands from a start node with configuration.
Example:
apoc.path.expandConfig(startNode, {relationshipFilter: 'KNOWS>'})
func ShortestPath ¶
ShortestPath finds the shortest path between two nodes.
Example:
apoc.path.shortestPath(start, end, 'KNOWS>', 10)
func Slice ¶
Slice returns a slice of a path.
Example:
apoc.path.slice(path, 1, 3) => path from index 1 to 3
func SpanningTree ¶
SpanningTree finds a spanning tree from a start node.
Example:
apoc.path.spanningTree(startNode, {maxLevel: 5})
type Relationship ¶
type Relationship = storage.Relationship
Relationship represents a graph relationship.