View Source RDF.BlankNode.Generator.Algorithm behaviour (RDF.ex v2.0.1)

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.

Types

Callbacks

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

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.

@callback generate_for(t(), value :: any()) :: {RDF.BlankNode.t(), t()}

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 value from the given state and return a tuple consisting of the generated blank node and the new state.