NebulaGraphEx.Types.Edge (nebula_graph_ex v0.1.10)

Copy Markdown View Source

Represents a directed edge (relationship) in NebulaGraph.

Fields

  • :src — source vertex ID (decoded Elixir term).
  • :dst — destination vertex ID (decoded Elixir term).
  • :name — edge type name binary, e.g. "follow".
  • :type — raw integer edge type (positive = outgoing, negative = incoming).
  • :ranking — edge ranking integer (used to distinguish parallel edges).
  • :props — map of binary() => term() property values.

Example

%NebulaGraphEx.Types.Edge{
  src: "player100",
  dst: "player101",
  name: "follow",
  type: 1,
  ranking: 0,
  props: %{"degree" => 95}
}

Summary

Functions

Returns true if the edge points inward (negative type).

Returns true if the edge points outward (positive type).

Returns a property value by name, or nil.

Types

t()

@type t() :: %NebulaGraphEx.Types.Edge{
  dst: term(),
  name: String.t() | nil,
  props: %{required(String.t()) => term()},
  ranking: integer(),
  src: term(),
  type: integer()
}

Functions

incoming?(edge)

@spec incoming?(t()) :: boolean()

Returns true if the edge points inward (negative type).

outgoing?(edge)

@spec outgoing?(t()) :: boolean()

Returns true if the edge points outward (positive type).

prop(edge, key)

@spec prop(t(), String.t()) :: term()

Returns a property value by name, or nil.