Move RDF.Reader and RDF.Writer into RDF.Serialization module

This commit is contained in:
Marcel Otto 2018-03-08 17:33:20 +01:00
parent eb6ede55b9
commit 54d9eff014
4 changed files with 17 additions and 16 deletions

View file

@ -9,9 +9,10 @@ This project adheres to [Semantic Versioning](http://semver.org/) and
### Changed
- rename `RDF.Serialization` behaviour to `RDF.Serialization.Format`; the new
- renamed `RDF.Serialization` behaviour to `RDF.Serialization.Format`; the new
`RDF.Serialization` module contains just simple RDF serialization related functions
- rename `RDF.Serialization.Format.content_type/0` to `RDF.Serialization.Format.media_type/0`
- renamed `RDF.Serialization.Format.content_type/0` to `RDF.Serialization.Format.media_type/0`
- moved `RDF.Reader` and `RDF.Writer` into `RDF.Serialization` module
### Added

View file

@ -79,22 +79,22 @@ defmodule RDF.Serialization.Format do
defoverridable [decoder: 0, encoder: 0, options: 0]
def read_string(content, opts \\ []),
do: RDF.Reader.read_string(decoder(), content, opts)
do: RDF.Serialization.Reader.read_string(decoder(), content, opts)
def read_string!(content, opts \\ []),
do: RDF.Reader.read_string!(decoder(), content, opts)
do: RDF.Serialization.Reader.read_string!(decoder(), content, opts)
def read_file(file, opts \\ []),
do: RDF.Reader.read_file(decoder(), file, opts)
do: RDF.Serialization.Reader.read_file(decoder(), file, opts)
def read_file!(file, opts \\ []),
do: RDF.Reader.read_file!(decoder(), file, opts)
do: RDF.Serialization.Reader.read_file!(decoder(), file, opts)
def write_string(data, opts \\ []),
do: RDF.Writer.write_string(encoder(), data, opts)
do: RDF.Serialization.Writer.write_string(encoder(), data, opts)
def write_string!(data, opts \\ []),
do: RDF.Writer.write_string!(encoder(), data, opts)
do: RDF.Serialization.Writer.write_string!(encoder(), data, opts)
def write_file(data, path, opts \\ []),
do: RDF.Writer.write_file(encoder(), data, path, opts)
do: RDF.Serialization.Writer.write_file(encoder(), data, path, opts)
def write_file!(data, path, opts \\ []),
do: RDF.Writer.write_file!(encoder(), data, path, opts)
do: RDF.Serialization.Writer.write_file!(encoder(), data, path, opts)
@before_compile unquote(__MODULE__)
end

View file

@ -1,9 +1,9 @@
defmodule RDF.Reader do
defmodule RDF.Serialization.Reader do
@moduledoc """
General serialization-independent functions for reading a `RDF.Graph` or `RDF.Dataset` from a file or encoded-string.
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`, which implicitly
generated functions with same name on a `RDF.Serialization.Format`, which implicitly
use the proper `RDF.Serialization.Decoder` module.
"""

View file

@ -1,9 +1,9 @@
defmodule RDF.Writer do
defmodule RDF.Serialization.Writer do
@moduledoc """
General serialization-independent functions for writing the statements of a `RDF.Graph` or `RDF.Dataset` to a file or string.
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`, which implicitly
generated functions with same name on a `RDF.Serialization.Format`, which implicitly
use the proper `RDF.Serialization.Encoder` module.
"""