RDF.ex v0.4.0 RDF.Triple View Source

Helper functions for RDF triples.

A RDF Triple is represented as a plain Elixir tuple consisting of three valid RDF values for subject, predicate and object.

Link to this section Summary

Functions

Creates a RDF.Triple with proper RDF values

Creates a RDF.Triple with proper RDF values

Link to this section Functions

Creates a RDF.Triple with proper RDF values.

An error is raised when the given elements are not coercible to RDF values.

Note: The RDF.triple function is a shortcut to this function.

Examples

iex> RDF.Triple.new {"http://example.com/S", "http://example.com/p", 42}
{~I<http://example.com/S>, ~I<http://example.com/p>, RDF.literal(42)}
iex> RDF.Triple.new {EX.S, EX.p, 42}
{RDF.iri("http://example.com/S"), RDF.iri("http://example.com/p"), RDF.literal(42)}
Link to this function new(subject, predicate, object) View Source

Creates a RDF.Triple with proper RDF values.

An error is raised when the given elements are not coercible to RDF values.

Note: The RDF.triple function is a shortcut to this function.

Examples

iex> RDF.Triple.new("http://example.com/S", "http://example.com/p", 42)
{~I<http://example.com/S>, ~I<http://example.com/p>, RDF.literal(42)}
iex> RDF.Triple.new(EX.S, EX.p, 42)
{RDF.iri("http://example.com/S"), RDF.iri("http://example.com/p"), RDF.literal(42)}