View Source Grax (Grax v0.5.0)

The Grax API.

For now there is no API documentation. Read about the API in the guide here.

Summary

Functions

Link to this function

add_additional_statements(mapping, predications)

View Source
@spec add_additional_statements(Grax.Schema.t(), RDF.Description.input()) ::
  Grax.Schema.t()
Link to this function

additional_statements(mapping)

View Source
@spec additional_statements(Grax.Schema.t()) :: RDF.Description.t()
Link to this function

build(mod, id_schema, initial)

View Source
Link to this function

build!(mod, id, initial)

View Source
Link to this function

build_id(id_schema, attributes)

View Source
Link to this function

clear_additional_statements(mapping, opts \\ [])

View Source
@spec clear_additional_statements(Grax.Schema.t(), opts :: keyword()) ::
  Grax.Schema.t()
Link to this function

delete_additional_predicates(mapping, properties)

View Source
Link to this function

delete_additional_statements(mapping, predications)

View Source
@spec delete_additional_statements(Grax.Schema.t(), RDF.Description.input()) ::
  Grax.Schema.t()

Returns the id of a Grax struct.

This should be the preferred over accessing the :__id__ field directly.

Example

iex> user = Example.User.build!(EX.User, name: "John Doe")
...> Grax.id(user)
~I<http://example.com/User>
Link to this function

id_schema(schema, initial)

View Source
Link to this function

load(graph, id, mod, opts)

View Source
Link to this function

load!(graph, id, mod, opts)

View Source
Link to this function

normalize_preload_opt(depth, _)

View Source
Link to this function

preload(mapping, graph, opts \\ [])

View Source
Link to this function

preload!(mapping, graph, opts \\ [])

View Source
Link to this function

preloaded?(mapping, property)

View Source
Link to this function

put(mapping, property, predications)

View Source
Link to this function

put!(mapping, property, predications)

View Source
Link to this function

put_additional_statements(mapping, description)

View Source
@spec put_additional_statements(Grax.Schema.t(), RDF.Description.input()) ::
  Grax.Schema.t()
@spec reset_id(Grax.Schema.t()) :: Grax.Schema.t()

Resets the id of the given Grax schema struct by reapplying its Grax.Id.Schema.

Resets the id of the given Grax schema struct to the given id.

This should always be preferred over setting the __id__ field directly.

@spec schema(RDF.IRI.coercible()) :: module() | [module()] | nil
Link to this function

setup_depth_preload_opts(opts)

View Source
Link to this function

to_rdf(mapping, opts \\ [])

View Source
@spec to_rdf(Grax.Schema.t(), opts :: keyword()) ::
  {:ok, RDF.Graph.t()} | {:error, any()}
Link to this function

to_rdf!(mapping, opts \\ [])

View Source
@spec to_rdf!(Grax.Schema.t(), opts :: keyword()) :: RDF.Graph.t()
Link to this function

valid?(mapping, opts \\ [])

View Source
@spec valid?(Grax.Schema.t(), opts :: keyword()) :: boolean()
Link to this function

validate(mapping, opts \\ [])

View Source
@spec validate(Grax.Schema.t(), opts :: keyword()) ::
  {:ok, Grax.Schema.t()} | {:error, Grax.ValidationError.t()}
Link to this function

validate!(mapping, opts \\ [])

View Source
@spec validate!(Grax.Schema.t(), opts :: keyword()) :: Grax.Schema.t()