Resource information for AshNeo4j.DataLayer
Summary
Functions
Returns the Ash.Type of the attribute from the name
Converts attributes to node properties
Converts an attribute name to a node property name string, translating if necessary
Returns whether the relationship is exclusive on the destination resource, given a source resource and source relationship name
The domain label is the PascalCase short name of the domain's Elixir Module name. It is used only on create.
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.
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 labels from fragments.
For example, DiffoExample.Access.Shelf (using BaseInstance) returns [:Access, :Shelf, :Instance].
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.
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.
Returns a node_relationship that matches the relationship name
Returns a node_relationship that matches the edge label, edge direction and destination label
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.
Returns the effective relate of the resource, merging DSL and defaults
Returns the relationship from the source attribute, if any
Returns a matching Ash.Resource.Info relationship given edge label, edge direction and destination node label
Returns the relationship attributes for the resource.
Returns the reverse node relationship given resource and relationship name
Returns the reverse relationship given resource and relationship name
Returns whether the relationship is exclusive on the source resource
Returns the list of attribute translations for the resource.
Functions
@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
@spec convert_to_properties(Ash.Resource.t(), map()) :: map()
Converts attributes to node properties
@spec convert_to_property_name(Ash.Resource.t(), Ash.Query.Ref.t()) :: 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
@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
@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.
@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.
@spec 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 labels from fragments.
For example, DiffoExample.Access.Shelf (using BaseInstance) returns [:Access, :Shelf, :Instance].
@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.
@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.
@spec node_relationship(Ash.Resource.t(), atom() | String.t()) :: tuple() | nil
Returns a node_relationship that matches the relationship name
@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
@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.
@spec relate(Ash.Resource.t()) :: [tuple()] | nil
Returns the effective relate of the resource, merging DSL and defaults
@spec relationship(Ash.Resource.t(), atom() | String.t()) :: tuple() | nil
Returns the relationship from the source attribute, if any
@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
@spec relationship_attributes(Ash.Resource.t()) :: keyword() | nil
Returns the relationship attributes for the resource.
@spec reverse_node_relationship(Ash.Resource.t(), atom()) :: tuple() | nil
Returns the reverse node relationship given resource and relationship name
@spec reverse_relationship(Ash.Resource.t(), atom()) :: tuple() | nil
Returns the reverse relationship given resource and relationship name
@spec source_exclusive?(Ash.Resource.t(), atom()) :: boolean()
Returns whether the relationship is exclusive on the source resource
@spec translations(Ash.Resource.t()) :: keyword() | nil
Returns the list of attribute translations for the resource.