View Source RDF.NTriples.Encoder (RDF.ex v1.2.0)

An encoder for N-Triples serializations of RDF.ex data structures.

As for all encoders of RDF.Serialization.Formats, you normally won't use these functions directly, but via one of the write_ functions on the RDF.NTriples format module or the generic RDF.Serialization module.

Summary

Functions

Encodes the given RDF data in N-Triples format.

Encodes the given RDF data into a stream of N-Triples.

Functions

Link to this function

encode(data, opts \\ [])

View Source
@spec encode(
  RDF.Data.t(),
  keyword()
) :: {:ok, String.t()} | {:error, any()}

Encodes the given RDF data in N-Triples format.

Options

  • :sort: Boolean flag which specifies if the encoded triples should be sorted into Unicode code point order (Default: false)
@spec iolist_statement(RDF.Triple.t()) :: iolist()
@spec iolist_term(RDF.Term.t()) :: String.t()
@spec statement(RDF.Triple.t()) :: String.t()
Link to this function

stream(data, opts \\ [])

View Source
@spec stream(
  RDF.Data.t(),
  keyword()
) :: Enumerable.t()

Encodes the given RDF data into a stream of N-Triples.

Options

  • :mode: Allows to specify if the encoded statements should be emitted as strings or IO lists using the value :string or :iodata respectively (Default: :string)
@spec term(RDF.Term.t()) :: String.t()