Grax (Grax v0.6.0)

View Source

The Grax API.

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

Summary

Functions

add_additional_statements(mapping, predications)

@spec add_additional_statements(Grax.Schema.t(), RDF.Description.input()) ::
  Grax.Schema.t()

additional_statements(mapping)

@spec additional_statements(Grax.Schema.t()) :: RDF.Description.t()

build(mod, id)

build(mod, id_schema, initial)

build!(mod, id)

build!(mod, id, initial)

build_id(id_schema, attributes)

clear_additional_statements(mapping, opts \\ [])

@spec clear_additional_statements(Grax.Schema.t(), opts :: keyword()) ::
  Grax.Schema.t()

delete_additional_predicates(mapping, properties)

delete_additional_statements(mapping, predications)

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

id(map)

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>

id_schema(schema, initial)

load(graph, id)

load(graph, id, opts)

load(graph, id, mod, opts)

load!(graph, id)

load!(graph, id, opts)

load!(graph, id, mod, opts)

normalize_preload_opt(depth, _)

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

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

preloaded?(mapping)

preloaded?(mapping, property)

put(mapping, values)

put(mapping, property, predications)

put!(mapping, values)

put!(mapping, property, predications)

put_additional_statements(mapping, description)

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

reset_id(struct)

@spec reset_id(Grax.Schema.t()) :: Grax.Schema.t()

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

reset_id(schema, id)

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

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

schema(iri)

@spec schema(RDF.IRI.coercible()) :: module() | [module()] | nil

setup_depth_preload_opts(opts)

to_rdf(mapping, opts \\ [])

@spec to_rdf(Grax.Schema.t(), opts :: keyword()) ::
  {:ok, RDF.Graph.t()} | {:error, any()}

to_rdf!(mapping, opts \\ [])

@spec to_rdf!(Grax.Schema.t(), opts :: keyword()) :: RDF.Graph.t()

valid?(mapping, opts \\ [])

@spec valid?(Grax.Schema.t(), opts :: keyword()) :: boolean()

validate(mapping, opts \\ [])

@spec validate(Grax.Schema.t(), opts :: keyword()) ::
  {:ok, Grax.Schema.t()} | {:error, Grax.ValidationError.t()}

validate!(mapping, opts \\ [])

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