View Source RDF.BlankNode.Generator.Algorithm behaviour (RDF.ex v1.2.0)

A behaviour for implementations of blank node identifier generation algorithms.

The RDF.BlankNode.Generator executes such an algorithm and holds its state.

Summary

Callbacks

Generates a blank node.

Generates a blank node for a given string.

Returns the initial state of the algorithm.

Callbacks

@callback generate(state :: map()) :: {RDF.BlankNode.t(), map()}

Generates a blank node.

An implementation should compute a blank node from the given state and return a tuple consisting of the generated blank node and the new state.

Link to this callback

generate_for(value, state)

View Source
@callback generate_for(value :: any(), state :: map()) :: {RDF.BlankNode.t(), map()}

Generates a blank node for a given string.

Every call with the same string must return the same blank node.

An implementation should compute a blank node for the given string from the given state and return a tuple consisting of the generated blank node and the new state.

@callback init(opts :: map()) :: map()

Returns the initial state of the algorithm.