RDF.ex v0.7.1 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.

Creates a RDF.List for a given RDF list node of a given RDF.Graph.

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

Link to this type

t()

View Source
t() :: %RDF.List{graph: RDF.Graph.t(), head: RDF.IRI.t()}

Link to this section Functions

Checks if a list is the empty list.

Link to this function

from(list, opts \\ [])

View Source
from(Enumerable.t(), keyword()) :: t()

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.

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:first and rdf:rest statement each
  • does not contain cycles, i.e. rdf:rest statements don't refer to preceding list nodes

Checks if the given RDF.Description describes a RDF list node.

Link to this function

node?(list_node, graph)

View Source
node?(any(), RDF.Graph.t()) :: boolean()

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.

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.

Nested lists are converted recursively.