RDF.BlankNode.Generator (RDF.ex v2.1.0)

View Source

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/2 or start/2.

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 a supervision tree).

Starts a blank node generator linked to the current process.

Synchronously stops the blank node generator with the given reason.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

generate(pid)

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

generate_for(pid, value)

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

start(algorithm, opts \\ [])

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

The options are handled the same as start_link/1.

start_link(algorithm, opts \\ [])

Starts a blank node generator linked to the current process.

The RDF.BlankNode.Generator.Algorithm can be given either as a respective struct or just the module, in which case a struct is created implicitly with the default values of its fields.

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

Synchronously stops the blank node generator with the given reason.

It returns :ok if the GenServer terminates with the given reason. If the GenServer 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.