RDF.NTriples.Encoder (RDF.ex v2.1.0)

View Source

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

encode(data, opts \\ [])

@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)

iolist_statement(arg)

@spec iolist_statement(RDF.Triple.t()) :: iolist()

iolist_term(iri)

@spec iolist_term(RDF.Term.t()) :: String.t()

statement(arg)

@spec statement(RDF.Triple.t()) :: String.t()

stream(data, opts \\ [])

@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)

term(iri)

@spec term(RDF.Term.t()) :: String.t()