View Source Grax (Grax v0.4.1)
The Grax API.
For now there is no API documentation. Read about the API in the guide here.
Link to this section Summary
Functions
Returns the id of a Grax struct.
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
.
Link to this section Functions
@spec add_additional_statements(Grax.Schema.t(), RDF.Description.input()) :: Grax.Schema.t()
@spec additional_statements(Grax.Schema.t()) :: RDF.Description.t()
@spec clear_additional_statements(Grax.Schema.t(), opts :: keyword()) :: Grax.Schema.t()
@spec delete_additional_predicates( Grax.Schema.t(), RDF.Statement.coercible_predicate() | [RDF.Statement.coercible_predicate()] ) :: Grax.Schema.t()
@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
Example
iex> user = Example.User.build!(EX.User, name: "John Doe")
...> Grax.id(user)
~I<http://example.com/User>
@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
.
@spec reset_id(Grax.Schema.t(), RDF.Resource.coercible()) :: Grax.Schema.t()
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
@spec to_rdf(Grax.Schema.t(), opts :: keyword()) :: {:ok, RDF.Graph.t()} | {:error, any()}
@spec to_rdf!(Grax.Schema.t(), opts :: keyword()) :: RDF.Graph.t()
@spec valid?(Grax.Schema.t(), opts :: keyword()) :: boolean()
@spec validate(Grax.Schema.t(), opts :: keyword()) :: {:ok, Grax.Schema.t()} | {:error, Grax.ValidationError.t()}
@spec validate!(Grax.Schema.t(), opts :: keyword()) :: Grax.Schema.t()