RDF.ex v0.6.0 RDF.List View Source
A structure for RDF lists.
see
Link to this section Summary
Functions
Checks if a list is the empty list.
Creates a RDF.List from a native Elixir list or any other Enumerable with coercible RDF values.
Checks if the given RDF.Description describes a RDF list node.
Checks if a given resource is a RDF list node in a given RDF.Graph.
The RDF nodes constituting a RDF.List as an Elixir list.
Checks if the given list consists of list nodes which are all blank nodes.
The values of a RDF.List as an Elixir list.
Link to this section Types
t()
View Source
t() :: module()
t() :: module()
Link to this section Functions
empty?(arg1) View Source
Checks if a list is the empty list.
from(list, opts \\ []) View Source
Creates a RDF.List from a native Elixir list or any other Enumerable with coercible RDF values.
By default the statements constituting the Enumerable are added to an empty graph. An
already existing graph to which the statements are added can be specified with
the graph option.
The name of the head node can be specified with the head option
(default: RDF.bnode(), i.e. an arbitrary unique name).
Note: When the given Enumerable is empty, the name option will be ignored -
the head node of the empty list is always RDF.nil.
new(head, graph) View Source
Creates a RDF.List for a given RDF list node of a given RDF.Graph.
If the given node does not refer to a well-formed list in the graph, nil is
returned. A well-formed list
- consists of list nodes which have exactly one
rdf:firstandrdf:reststatement each - does not contain cycles, i.e.
rdf:reststatements don't refer to preceding list nodes
node?(description) View Source
Checks if the given RDF.Description describes a RDF list node.
node?(list_node, graph) View Source
Checks if a given resource is a RDF list node in a given RDF.Graph.
Although, technically a resource is a list, if it uses at least one rdf:first
or rdf:rest, we pragmatically require the usage of both.
Note: This function doesn't indicate if the list is valid.
See new/2 and valid?/2 for validations.
nodes(list) View Source
The RDF nodes constituting a RDF.List as an Elixir list.
valid?(list) View Source
Checks if the given list consists of list nodes which are all blank nodes.
values(list) View Source
The values of a RDF.List as an Elixir list.
Nested lists are converted recursively.