SPARQL.ex v0.1.0 SPARQL.Query.Result.Format.Encoder behaviour View Source

A behaviour for encoders of SPARQL.Query.ResultSets in a specific SPARQL.Query.Result.Formats.

Link to this section Summary

Link to this section Callbacks

Encodes a SPARQL.Query.ResultSet.

It returns an {:ok, string} tuple, with string being the serialized SPARQL.Query.ResultSet, or {:error, reason} if an error occurs.

Encodes a SPARQL.Query.ResultSet.

As opposed to encode, it raises an exception if an error occurs.

Note: The __using__ macro automatically provides an overridable default implementation based on the non-bang encode function.