# `RDF.BlankNode.Generator.Algorithm`
[🔗](https://github.com/rdf-elixir/rdf-ex/blob/v3.0.1/lib/rdf/blank_node_generator/algorithm.ex#L1)

A behaviour for implementations of blank node identifier generation algorithms.

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

# `t`

```elixir
@type t() :: struct()
```

# `type`

```elixir
@type type() :: module()
```

# `generate`

```elixir
@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.

# `generate_for`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
