AshNeo4j.EdgeDescriptor (AshNeo4j v0.5.1)

Copy Markdown View Source

Describes a single graph edge from a resource's perspective.

An EdgeDescriptor captures the graph-level facts about one entry in a resource's relate DSL block: the edge label, the direction it travels from the source node, and the label of the node at the other end. It does not reference a destination Ash resource module — that would require the destination to be compiled, and edges can point to nodes whose resource hasn't been written yet.

Fields

  • :relationship — the Ash relationship name declared on the source resource (e.g. :shelves). nil when the descriptor is built from raw edge data rather than a relate tuple.
  • :label — the Neo4j edge type label (e.g. :HAS_SHELF).
  • :direction:outgoing if the edge goes from the source node, :incoming if it arrives at the source node.
  • :destination_label — the Neo4j node label matched at the far end (e.g. :Shelf).

Build a list of these from a resource via AshNeo4j.Resource.Info.mapping/1, which returns a %AshNeo4j.ResourceMapping{} whose :edges field holds [EdgeDescriptor.t()].

Summary

Functions

Build an EdgeDescriptor from a relate tuple {name, label, direction, dest_label}

Types

t()

@type t() :: %AshNeo4j.EdgeDescriptor{
  destination_label: atom(),
  direction: :incoming | :outgoing,
  label: atom(),
  relationship: atom() | nil
}

Functions

from_relate(arg)

Build an EdgeDescriptor from a relate tuple {name, label, direction, dest_label}