NebulaGraphEx.Types.Path (nebula_graph_ex v0.1.10)

Copy Markdown View Source

Represents a path through the graph — a sequence of alternating vertices and edges, starting from a source vertex.

Fields

  • :src — source %NebulaGraphEx.Types.Vertex{}.
  • :steps — list of step maps, each with:
    • :dst%NebulaGraphEx.Types.Vertex{}
    • :name — edge type name binary
    • :type — integer edge type
    • :ranking — integer edge ranking
    • :props — map of edge property values

Example

%NebulaGraphEx.Types.Path{
  src: %Vertex{vid: "player100", tags: [...]},
  steps: [
    %{dst: %Vertex{vid: "player101", ...}, name: "follow", ranking: 0, props: %{}}
  ]
}

Summary

Functions

Returns the number of hops (edges) in the path.

Returns an ordered list of all vertices in the path, starting with :src.

Types

step()

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

t()

@type t() :: %NebulaGraphEx.Types.Path{
  src: NebulaGraphEx.Types.Vertex.t(),
  steps: [step()]
}

Functions

length(path)

@spec length(t()) :: non_neg_integer()

Returns the number of hops (edges) in the path.

vertices(path)

@spec vertices(t()) :: [NebulaGraphEx.Types.Vertex.t()]

Returns an ordered list of all vertices in the path, starting with :src.