View Source RDF.Data protocol (RDF.ex v1.2.0)

An abstraction over the different data structures for collections of RDF statements.

Summary

Types

t()

All the types that implement this protocol.

Functions

Deletes statements from an RDF data structure.

Checks if an RDF data structure contains statements about the given resource.

Returns a RDF.Description of the given subject.

Returns all RDF.Descriptions within an RDF data structure.

Returns if the given RDF data structure is empty.

Checks if two RDF data structures are equal.

Checks if the given statement exists within an RDF data structure.

Returns a map representation of an RDF data structure where each element from its statements is mapped with the given function.

Adds statements to an RDF data structure.

Returns the set of all resources used in the objects within the statements of an RDF data structure.

Deletes one statement from an RDF data structure and returns a tuple with deleted statement and the changed data structure.

Returns the set of all properties used within the statements of an RDF data structure.

Returns the set of all resources used within the statements of an RDF data structure

Returns the count of all statements of an RDF data structure.

Returns the list of all statements of an RDF data structure.

Returns the count of all resources which are subject of the statements of an RDF data structure.

Returns the set of all resources which are subject of the statements of an RDF data structure.

Returns a nested map of the native Elixir values of an RDF data structure.

Types

@type t() :: term()

All the types that implement this protocol.

Functions

Link to this function

delete(data, input, opts \\ [])

View Source

Deletes statements from an RDF data structure.

As opposed to the delete functions on RDF data structures directly, this function only deletes exactly matching structures.

Link to this function

describes?(data, subject)

View Source

Checks if an RDF data structure contains statements about the given resource.

Link to this function

description(data, subject)

View Source

Returns a RDF.Description of the given subject.

Note: On a RDF.Dataset this will return an aggregated RDF.Description with the statements about this subject from all graphs.

Returns all RDF.Descriptions within an RDF data structure.

Note: On a RDF.Dataset this will return aggregated RDF.Descriptions about the same subject from all graphs.

Returns if the given RDF data structure is empty.

Checks if two RDF data structures are equal.

Two RDF data structures are considered to be equal if they contain the same triples.

Link to this function

include?(data, input, opts \\ [])

View Source

Checks if the given statement exists within an RDF data structure.

Returns a map representation of an RDF data structure where each element from its statements is mapped with the given function.

Link to this function

merge(data, input, opts \\ [])

View Source

Adds statements to an RDF data structure.

As opposed to the specific add functions on the RDF data structures, which always return the same structure type than the first argument, merge might result in another RDF data structure, e.g. merging two RDF.Description with different subjects results in a RDF.Graph or adding a quad to a RDF.Graph with a different name than the graph context of the quad results in a RDF.Dataset. But it is always guaranteed that the resulting structure has a RDF.Data implementation.

Returns the set of all resources used in the objects within the statements of an RDF data structure.

Deletes one statement from an RDF data structure and returns a tuple with deleted statement and the changed data structure.

Returns the set of all properties used within the statements of an RDF data structure.

Returns the set of all resources used within the statements of an RDF data structure

Returns the count of all statements of an RDF data structure.

Returns the list of all statements of an RDF data structure.

Returns the count of all resources which are subject of the statements of an RDF data structure.

Returns the set of all resources which are subject of the statements of an RDF data structure.

Link to this function

values(data, opts \\ [])

View Source

Returns a nested map of the native Elixir values of an RDF data structure.

When a :context option is given with a RDF.PropertyMap, predicates will be mapped to the terms defined in the RDF.PropertyMap, if present.