RDF.Serialization.Reader (RDF.ex v0.9.0) View Source

General functions for reading a RDF.Graph or RDF.Dataset from a serialization file or encoded-string.

You probably won't use these functions directly, but instead use the automatically generated functions with same name on a RDF.Serialization.Format, which implicitly use the proper RDF.Serialization.Decoder module.

Link to this section Summary

Functions

Reads and decodes a serialized graph or dataset from a file.

Reads and decodes a serialized graph or dataset from a file.

Reads and decodes a serialized graph or dataset from a string.

Reads and decodes a serialized graph or dataset from a string.

Link to this section Functions

Link to this function

read_file(decoder, file, opts \\ [])

View Source

Specs

read_file(module(), Path.t(), keyword()) ::
  {:ok, RDF.Graph.t() | RDF.Dataset.t()} | {:error, any()}

Reads and decodes a serialized graph or dataset from a file.

It returns an {:ok, data} tuple, with data being the deserialized graph or dataset, or {:error, reason} if an error occurs.

Link to this function

read_file!(decoder, file, opts \\ [])

View Source

Specs

read_file!(module(), Path.t(), keyword()) :: RDF.Graph.t() | RDF.Dataset.t()

Reads and decodes a serialized graph or dataset from a file.

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

Link to this function

read_string(decoder, content, opts \\ [])

View Source

Specs

read_string(module(), String.t(), keyword()) ::
  {:ok, RDF.Graph.t() | RDF.Dataset.t()} | {:error, any()}

Reads and decodes a serialized graph or dataset from a string.

It returns an {:ok, data} tuple, with data being the deserialized graph or dataset, or {:error, reason} if an error occurs.

Link to this function

read_string!(decoder, content, opts \\ [])

View Source

Specs

read_string!(module(), String.t(), keyword()) :: RDF.Graph.t() | RDF.Dataset.t()

Reads and decodes a serialized graph or dataset from a string.

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