# `AshNeo4j.Resource.Info`
[🔗](https://github.com/diffo-dev/ash_neo4j/blob/v0.6.0/lib/resource/info.ex#L5)

Resource information for AshNeo4j.DataLayer

# `all_labels`

```elixir
@spec all_labels(Ash.Resource.t()) :: [atom()] | nil
```

Returns the full list of labels written to the node on CREATE. Always starts with the domain
label, followed by the module label, then any additional base type label from a resource
fragment, then the domain fragment label if the domain uses `AshNeo4j.DataLayer.Domain`.
For example, `DiffoExample.Access.Shelf` (using `BaseInstance` and a `Telco` domain fragment)
returns `[:Access, :Shelf, :Instance, :Telco]`.

# `attribute_type`

```elixir
@spec attribute_type(Ash.Resource.t(), atom()) :: Ash.Type.t() | nil
@spec attribute_type(Ash.Resource.t(), atom()) :: Ash.Type.t() | nil
```

Returns the Ash.Type of the attribute from the name

# `convert_to_properties`

```elixir
@spec convert_to_properties(Ash.Resource.t(), map()) :: map()
```

Converts attributes to node properties

# `convert_to_property_name`

```elixir
@spec convert_to_property_name(
  Ash.Resource.t(),
  struct()
) :: String.t() | nil
@spec convert_to_property_name(Ash.Resource.t(), atom()) :: String.t() | nil
```

Converts an attribute name to a node property name string, translating if necessary

# `destination_exclusive?`

```elixir
@spec destination_exclusive?(Ash.Resource.t(), atom()) :: boolean()
```

Returns whether the relationship is exclusive on the destination resource, given a source resource and source relationship name

# `domain_fragment_label`

```elixir
@spec domain_fragment_label(Ash.Resource.t()) :: atom() | nil
```

The label contributed by a domain fragment using `AshNeo4j.DataLayer.Domain`.
Written on CREATE as an additional label for graph traversal. `nil` when the domain
declares no fragment label.

# `domain_label`

```elixir
@spec domain_label(Ash.Resource.t()) :: atom() | nil
```

The domain label is the PascalCase short name of the domain's Elixir Module name. It is used only on create.

# `label`

```elixir
@spec label(Ash.Resource.t()) :: atom() | nil
```

The match label used for read, update, and destroy operations. This is the value of `label` in
the `neo4j do` block — which may come from a fragment (e.g. `:Instance` from `BaseInstance`).
Defaults to the PascalCase short name of the resource module.

# `label_pair`

```elixir
@spec label_pair(Ash.Resource.t()) :: [atom()]
```

The two-label pair `[domain_label, module_label]` used in MATCH for all read, update,
delete, and aggregate operations. Always uniquely identifies this specific resource type.

# `mapping`

```elixir
@spec mapping(Ash.Resource.t()) :: AshNeo4j.ResourceMapping.t()
```

Returns the complete graph mapping for a resource as a `%AshNeo4j.ResourceMapping{}` struct.
This is the single source of truth for how an Ash resource maps to the Neo4j graph.

# `module_label`

```elixir
@spec module_label(Ash.Resource.t()) :: atom() | nil
```

The label derived from the resource module's own short name (e.g. `:Shelf` for
`MyApp.Access.Shelf`). Always set regardless of any fragment label override.
Use this when you need to identify the specific resource type rather than its base type.

# `node_relationship`

```elixir
@spec node_relationship(Ash.Resource.t(), atom() | String.t()) :: tuple() | nil
```

Returns a node_relationship that matches the relationship name

# `node_relationship`

```elixir
@spec node_relationship(Ash.Resource.t(), atom(), atom(), atom()) :: tuple() | nil
@spec node_relationship(Ash.Resource.t(), atom(), atom(), [atom()]) :: tuple() | nil
```

Returns a node_relationship that matches the edge label, edge direction and destination label

# `preserve_node_relationships`

```elixir
@spec preserve_node_relationships(Ash.Resource.t()) :: [tuple()]
```

Returns the list of node relationships which block resource deletion, given the source resource
The node relationships are tuples of {edge_label, edge_direction, destination_label}
These include explicit guard relationships.

# `relate`

```elixir
@spec relate(Ash.Resource.t()) :: [tuple()] | nil
```

Returns the effective relate of the resource, merging DSL and defaults

# `relationship`

```elixir
@spec relationship(Ash.Resource.t(), atom() | String.t()) :: tuple() | nil
```

Returns the relationship from the source attribute, if any

# `relationship`

```elixir
@spec relationship(Ash.Resource.t(), atom(), atom(), atom()) :: struct() | nil
@spec relationship(Ash.Resource.t(), atom(), atom(), [atom()]) :: struct() | nil
```

Returns a matching Ash.Resource.Info relationship given edge label, edge direction and destination node label

# `relationship_attributes`

```elixir
@spec relationship_attributes(Ash.Resource.t()) :: keyword() | nil
```

Returns the relationship attributes for the resource.

# `reverse_node_relationship`

```elixir
@spec reverse_node_relationship(Ash.Resource.t(), atom()) :: tuple() | nil
```

Returns the reverse node relationship given resource and relationship name

# `reverse_relationship`

```elixir
@spec reverse_relationship(Ash.Resource.t(), atom()) :: tuple() | nil
```

Returns the reverse relationship given resource and relationship name

# `source_exclusive?`

```elixir
@spec source_exclusive?(Ash.Resource.t(), atom()) :: boolean()
```

Returns whether the relationship is exclusive on the source resource

# `translations`

```elixir
@spec translations(Ash.Resource.t()) :: keyword() | nil
```

Returns the list of attribute translations for the resource.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
