View Source RDF.BlankNode.Generator (RDF.ex v1.1.0)

A GenServer which generates RDF.BlankNodes using a RDF.BlankNode.Generator.Algorithm.

This module implements the RDF.Resource.Generator behaviour. The only RDF.Resource.Generator configuration it requires is the process identifier. The actual configuration of the behaviour of this generator is done on the GenServer itself via start_link/1 and start/1.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Generates a new blank node according to the RDF.BlankNode.Generator.Algorithm set up.

Generates a blank node for a given value according to the RDF.BlankNode.Generator.Algorithm set up.

Starts a blank node generator process without links (outside of a supervision tree).

Starts a blank node generator linked to the current process.

Synchronously stops the blank node generator with the given reason.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Generates a new blank node according to the RDF.BlankNode.Generator.Algorithm set up.

Link to this function

generate_for(pid, value)

View Source

Generates a blank node for a given value according to the RDF.BlankNode.Generator.Algorithm set up.

Starts a blank node generator process without links (outside of a supervision tree).

The options are handled the same as start_link/1.

Starts a blank node generator linked to the current process.

The RDF.BlankNode.Generator.Algorithm implementation is the only required keyword option, which must be given with the :algorithm key or, if no other options are required, can be given directly (instead of a keyword list). The remaining options are used as the configuration for init/1 of the respective RDF.BlankNode.Generator.Algorithm implementation.

If you want to pass GenServer.start_link/3 options, you'll can provide two separate keyword lists as a tuple with the first being the RDF.BlankNode.Generator configuration and the second the GenServer.start_link/3 options.

Link to this function

stop(pid, reason \\ :normal, timeout \\ :infinity)

View Source

Synchronously stops the blank node generator with the given reason.

It returns :ok if the agent terminates with the given reason. If the agent terminates with another reason, the call will exit.

This function keeps OTP semantics regarding error reporting. If the reason is any other than :normal, :shutdown or {:shutdown, _}, an error report will be logged.