macula_mri_ets (macula v0.20.5)

View Source

MRI ETS Storage Adapter

In-memory storage adapter using ETS tables. Implements both macula_mri_store and macula_mri_graph behaviours.

Suitable for development, testing, and single-node deployments. For distributed deployments, use macula_mri_khepri.

Summary

Functions

all_related(Subject)

-spec all_related(binary()) -> [{atom() | {custom, binary()}, binary()}].

classes_of(Instance)

-spec classes_of(binary()) -> [binary()].

clear()

-spec clear() -> ok.

Clear all data.

create_relationship(Subject, Predicate, Object)

-spec create_relationship(binary(), atom() | {custom, binary()}, binary()) -> ok | {error, term()}.

create_relationship(Subject, Predicate, Object, Metadata)

-spec create_relationship(binary(), atom() | {custom, binary()}, binary(), map()) ->
                             ok | {error, term()}.

delete(MRI)

-spec delete(binary()) -> ok | {error, term()}.

delete_relationship(Subject, Predicate, Object)

-spec delete_relationship(binary(), atom() | {custom, binary()}, binary()) -> ok | {error, term()}.

exists(MRI)

-spec exists(binary()) -> boolean().

export()

-spec export() -> {ok, [{binary(), map()}]} | {error, term()}.

get_relationship(Subject, Predicate, Object)

-spec get_relationship(binary(), atom() | {custom, binary()}, binary()) ->
                          {ok, map()} | {error, not_found | term()}.

handle_call(Request, From, State)

handle_cast(Msg, State)

handle_info(Info, State)

import(Entries)

-spec import([{binary(), map()}]) -> ok | {error, term()}.

init(Opts)

instances_of(Class)

-spec instances_of(binary()) -> [binary()].

instances_of_transitive(Class)

-spec instances_of_transitive(binary()) -> [binary()].

list_by_realm(Realm)

-spec list_by_realm(binary()) -> [binary()].

list_by_type(Type, Realm)

-spec list_by_type(atom(), binary()) -> [binary()].

list_children(MRI)

-spec list_children(binary()) -> [binary()].

list_descendants(MRI)

-spec list_descendants(binary()) -> [binary()].

lookup(MRI)

-spec lookup(binary()) -> {ok, map()} | {error, not_found | term()}.

register(MRI, Metadata)

-spec register(binary(), map()) -> ok | {error, term()}.

start_link()

-spec start_link() -> {ok, pid()} | {error, term()}.

Start the ETS adapter.

start_link(Opts)

-spec start_link(list()) -> {ok, pid()} | {error, term()}.

stats()

-spec stats() -> map().

Get statistics.

stop()

-spec stop() -> ok.

Stop the ETS adapter.

subclasses(Class)

-spec subclasses(binary()) -> [binary()].

superclasses(Class)

-spec superclasses(binary()) -> [binary()].

terminate(Reason, State)

traverse_transitive(Start, Predicate, Direction)

-spec traverse_transitive(binary(), atom() | {custom, binary()}, forward | reverse) -> [binary()].

update(MRI, Metadata)

-spec update(binary(), map()) -> ok | {error, term()}.