Add API documentation for serialization encoders and decoders

This commit is contained in:
Marcel Otto 2020-11-12 16:34:21 +01:00
parent bafaf6332e
commit e53b951519
9 changed files with 71 additions and 13 deletions

View file

@ -1,7 +1,6 @@
defmodule RDF.NQuads do
@moduledoc """
`RDF.NQuads` provides support for reading the N-Quads serialization
format.
`RDF.NQuads` provides support for the N-Quads serialization format.
N-Quads is a line-based plain-text format for encoding an RDF dataset, i.e. a
collection of RDF graphs.

View file

@ -1,5 +1,11 @@
defmodule RDF.NQuads.Decoder do
@moduledoc false
@moduledoc """
A decoder for N-Quads serializations to `RDF.Dataset`s.
As for all decoders of `RDF.Serialization.Format`s, you normally won't use these
functions directly, but via one of the `read_` functions on the `RDF.NQuads` format
module or the generic `RDF.Serialization` module.
"""
use RDF.Serialization.Decoder

View file

@ -1,5 +1,11 @@
defmodule RDF.NQuads.Encoder do
@moduledoc false
@moduledoc """
An encoder for N-Quads serializations of RDF.ex data structures.
As for all encoders of `RDF.Serialization.Format`s, you normally won't use these
functions directly, but via one of the `write_` functions on the `RDF.NQuads`
format module or the generic `RDF.Serialization` module.
"""
use RDF.Serialization.Encoder

View file

@ -1,7 +1,6 @@
defmodule RDF.NTriples do
@moduledoc """
`RDF.NTriples` provides support for reading and writing the N-Triples
serialization format.
`RDF.NTriples` provides support for the N-Triples serialization format.
N-Triples is a line-based plain-text format for encoding an RDF graph.
It is a very restricted, explicit and well-defined subset of both

View file

@ -1,5 +1,11 @@
defmodule RDF.NTriples.Decoder do
@moduledoc false
@moduledoc """
A decoder for N-Triples serializations to `RDF.Graph`s.
As for all decoders of `RDF.Serialization.Format`s, you normally won't use these
functions directly, but via one of the `read_` functions on the `RDF.NTriples` format
module or the generic `RDF.Serialization` module.
"""
use RDF.Serialization.Decoder

View file

@ -1,5 +1,11 @@
defmodule RDF.NTriples.Encoder do
@moduledoc false
@moduledoc """
An encoder for N-Triples serializations of RDF.ex data structures.
As for all encoders of `RDF.Serialization.Format`s, 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.
"""
use RDF.Serialization.Encoder

View file

@ -1,9 +1,11 @@
defmodule RDF.Turtle do
@moduledoc """
`RDF.Turtle` provides support for reading and writing the Turtle
serialization format.
`RDF.Turtle` provides support for the Turtle serialization format.
see <https://www.w3.org/TR/turtle/>
See `RDF.Turtle.Decoder` and `RDF.Turtle.Encoder` for the available options
on the read and write functions.
For more on Turtle see <https://www.w3.org/TR/turtle/>.
"""
use RDF.Serialization.Format

View file

@ -1,5 +1,18 @@
defmodule RDF.Turtle.Decoder do
@moduledoc false
@moduledoc """
A decoder for N-Triples serializations to `RDF.Graph`s.
As for all decoders of `RDF.Serialization.Format`s, you normally won't use these
functions directly, but via one of the `read_` functions on the `RDF.Turtle` format
module or the generic `RDF.Serialization` module.
## Options
- `:base`: allows to specify the base URI to be used against relative URIs
when no base URI is defined with a `@base` directive within the document
"""
use RDF.Serialization.Decoder

View file

@ -1,5 +1,26 @@
defmodule RDF.Turtle.Encoder do
@moduledoc false
@moduledoc """
An encoder for Turtle serializations of RDF.ex data structures.
As for all encoders of `RDF.Serialization.Format`s, you normally won't use these
functions directly, but via one of the `write_` functions on the `RDF.Turtle`
format module or the generic `RDF.Serialization` module.
## Options
- `:base`: : Allows to specify the base URI to be used for a `@base` directive.
If not specified the one from the given graph is used or if there is also none
specified for the graph the `RDF.default_base_iri/0`.
- `:prefixes`: Allows to specify the prefixes to be used as a `RDF.PrefixMap` or
anything from which a `RDF.PrefixMap` can be created with `RDF.PrefixMap.new/2`.
If not specified the ones from the given graph are used or if these are also not
present the `RDF.default_prefixes/0`.
- `:only`: Allows to specify which parts of a Turtle document should be generated.
Possible values: `:base`, `:prefixes`, `:directives` (means the same as `[:base, :prefixes]`),
`:triples` or a list with any combination of these values.
"""
use RDF.Serialization.Encoder