Add coercible_t type on Triple and Quad modules

This commit is contained in:
Marcel Otto 2022-02-11 12:03:25 +01:00
parent f00e29a432
commit 9bb07c8259
7 changed files with 34 additions and 6 deletions

View file

@ -11,6 +11,8 @@ This project adheres to [Semantic Versioning](http://semver.org/) and
- `:implicit_base` option on the `RDF.Turtle.Encoder` - `:implicit_base` option on the `RDF.Turtle.Encoder`
- `:base_description` option on the `RDF.Turtle.Encoder` - `:base_description` option on the `RDF.Turtle.Encoder`
- `RDF.Triple.coercible_t`, `RDF.Quad.coercible_t`, `RDF.Star.Triple.coercible_t`
and `RDF.Star.Quad.coercible_t` types
[Compare v0.10.0...HEAD](https://github.com/rdf-elixir/rdf-ex/compare/v0.10.0...HEAD) [Compare v0.10.0...HEAD](https://github.com/rdf-elixir/rdf-ex/compare/v0.10.0...HEAD)

View file

@ -15,6 +15,14 @@ defmodule RDF.Quad do
Statement.graph_name() Statement.graph_name()
} }
@type coercible_t ::
{
Statement.coercible_subject(),
Statement.coercible_predicate(),
Statement.coercible_object(),
Statement.coercible_graph_name()
}
@type t_values :: {String.t(), String.t(), any, String.t()} @type t_values :: {String.t(), String.t(), any, String.t()}
@doc """ @doc """

View file

@ -17,6 +17,14 @@ defmodule RDF.Star.Quad do
Statement.graph_name() Statement.graph_name()
} }
@type coercible_t ::
{
Statement.coercible_subject(),
Statement.coercible_predicate(),
Statement.coercible_object(),
Statement.coercible_graph_name()
}
@type t_values :: {String.t(), String.t(), any, String.t()} @type t_values :: {String.t(), String.t(), any, String.t()}
@doc """ @doc """

View file

@ -19,9 +19,7 @@ defmodule RDF.Star.Statement do
@type coercible_graph_name :: RDF.Statement.coercible_graph_name() @type coercible_graph_name :: RDF.Statement.coercible_graph_name()
@type t :: Triple.t() | Quad.t() @type t :: Triple.t() | Quad.t()
@type coercible_t :: @type coercible_t :: Triple.coercible_t() | Quad.coercible_t()
{coercible_subject(), coercible_predicate(), coercible_object(), coercible_graph_name()}
| {coercible_subject(), coercible_predicate(), coercible_object()}
@type term_mapping :: RDF.Statement.term_mapping() @type term_mapping :: RDF.Statement.term_mapping()

View file

@ -12,6 +12,13 @@ defmodule RDF.Star.Triple do
@type t :: {Statement.subject(), Statement.predicate(), Statement.object()} @type t :: {Statement.subject(), Statement.predicate(), Statement.object()}
@type coercible_t ::
{
Statement.coercible_subject(),
Statement.coercible_predicate(),
Statement.coercible_object()
}
@doc """ @doc """
Creates a `RDF.Star.Triple` with proper RDF-star values. Creates a `RDF.Star.Triple` with proper RDF-star values.

View file

@ -23,9 +23,7 @@ defmodule RDF.Statement do
@type term_mapping :: (qualified_term -> any | nil) @type term_mapping :: (qualified_term -> any | nil)
@type t :: Triple.t() | Quad.t() @type t :: Triple.t() | Quad.t()
@type coercible_t :: @type coercible_t :: Triple.coercible_t() | Quad.coercible_t()
{coercible_subject(), coercible_predicate(), coercible_object(), coercible_graph_name()}
| {coercible_subject(), coercible_predicate(), coercible_object()}
@doc """ @doc """
Creates a `RDF.Triple` or `RDF.Quad` with proper RDF values. Creates a `RDF.Triple` or `RDF.Quad` with proper RDF values.

View file

@ -10,6 +10,13 @@ defmodule RDF.Triple do
@type t :: {Statement.subject(), Statement.predicate(), Statement.object()} @type t :: {Statement.subject(), Statement.predicate(), Statement.object()}
@type coercible_t ::
{
Statement.coercible_subject(),
Statement.coercible_predicate(),
Statement.coercible_object()
}
@type t_values :: {String.t(), String.t(), any} @type t_values :: {String.t(), String.t(), any}
@doc """ @doc """