diff --git a/CHANGELOG.md b/CHANGELOG.md index af376a7..ec175a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) and - `:implicit_base` option on the `RDF.Turtle.Encoder` - `:base_description` option on the `RDF.Turtle.Encoder` +- `RDF.Resource.t` type - `RDF.Triple.coercible_t`, `RDF.Quad.coercible_t`, `RDF.Star.Triple.coercible_t` and `RDF.Star.Quad.coercible_t` types diff --git a/lib/rdf/resource.ex b/lib/rdf/resource.ex new file mode 100644 index 0000000..11e2716 --- /dev/null +++ b/lib/rdf/resource.ex @@ -0,0 +1,5 @@ +defmodule RDF.Resource do + alias RDF.{IRI, BlankNode} + + @type t :: IRI.t() | BlankNode.t() +end diff --git a/lib/rdf/statement.ex b/lib/rdf/statement.ex index 95d34b3..f9636cd 100644 --- a/lib/rdf/statement.ex +++ b/lib/rdf/statement.ex @@ -5,13 +5,13 @@ defmodule RDF.Statement do An RDF statement is either a `RDF.Triple` or a `RDF.Quad`. """ - alias RDF.{BlankNode, IRI, Literal, Quad, Term, Triple, PropertyMap} + alias RDF.{Resource, BlankNode, IRI, Literal, Quad, Term, Triple, PropertyMap} import RDF.Guards - @type subject :: IRI.t() | BlankNode.t() - @type predicate :: IRI.t() | BlankNode.t() - @type object :: IRI.t() | BlankNode.t() | Literal.t() - @type graph_name :: IRI.t() | BlankNode.t() | nil + @type subject :: Resource.t() + @type predicate :: Resource.t() + @type object :: Resource.t() | Literal.t() + @type graph_name :: Resource.t() | nil @type coercible_subject :: subject | atom | String.t() @type coercible_predicate :: predicate | atom | String.t() diff --git a/lib/rdf/term.ex b/lib/rdf/term.ex index 7a27e38..5a5dde2 100644 --- a/lib/rdf/term.ex +++ b/lib/rdf/term.ex @@ -11,7 +11,7 @@ defprotocol RDF.Term do see """ - @type t :: RDF.IRI.t() | RDF.BlankNode.t() | RDF.Literal.t() + @type t :: RDF.Resource.t() | RDF.Literal.t() @doc """ Checks if the given value is a RDF term.