RDF.ex v0.7.1 RDF.Serialization.Writer View Source
General functions for writing the statements of a RDF.Graph or RDF.Dataset to a serialization file or 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.Encoder module.
Link to this section Summary
Functions
Encodes and writes a graph or dataset to a file.
Encodes and writes a graph or dataset to a file.
Encodes and writes a graph or dataset to a string.
Encodes and writes a graph or dataset to a string.
Link to this section Functions
write_file(encoder, data, path, opts \\ [])
View Sourcewrite_file(module(), RDF.Graph.t() | RDF.Dataset.t(), Path.t(), keyword()) :: :ok | {:error, any()}
Encodes and writes a graph or dataset to a file.
General available serialization-independent options:
:force- If not set totrue, an error is raised when the given file already exists (default:false):file_mode- A list with the ElixirFile.openmodes to be used for writing (default:[:write, :exclusive])
It returns :ok if successful or {:error, reason} if an error occurs.
write_file!(encoder, data, path, opts \\ [])
View Sourcewrite_file!(module(), RDF.Graph.t() | RDF.Dataset.t(), Path.t(), keyword()) :: :ok
Encodes and writes a graph or dataset to a file.
See write_file for a list of available options.
As opposed to write_file, it raises an exception if an error occurs.
write_string(encoder, data, opts \\ [])
View Sourcewrite_string(module(), RDF.Graph.t() | RDF.Dataset.t(), keyword()) :: {:ok, String.t()} | {:error, any()}
Encodes and writes a graph or dataset to a string.
It returns an {:ok, string} tuple, with string being the serialized graph or
dataset, or {:error, reason} if an error occurs.
write_string!(encoder, data, opts \\ [])
View Sourcewrite_string!(module(), RDF.Graph.t() | RDF.Dataset.t(), keyword()) :: String.t()
Encodes and writes a graph or dataset to a string.
As opposed to write_string, it raises an exception if an error occurs.