ShEx.ex v0.1.0 ShEx.ShapeMap View Source
A finite set of ShEx.ShapeMap.Associations used to specify the nodes on which validations should be performed and for the result of validations.
A ShapeMap can be either created with ShEx.ShapeMap.new/1 or loaded from a
string representation in the standard ShapeMap format with ShEx.ShapeMap.decode/2
or a JSON-based format ShEx.ShapeMap.from_json/2.
The set of associations can be accessed with the associations/1 function as
a list. ShEx.ShapeMap also implements the Enumerable protocol over this
set of associations, so you can use it with all of Elixir's Enum functions.
After the validation the associations get partitioned into two fields on the
ShEx.ShapeMap struct: conformant and nonconformant.
Link to this section Summary
Functions
Adds a single or list of ShapeMap associations to shape_map.
Returns all associations in shape_map as a list.
Returns if all association in shape_map were conformant after a validation.
Loads a ShapeMap from the standard representation format.
Return true if shape_map is a fixed ShapeMap, i.e. doesn't contain triple patterns (query ShapeMap) or results (result ShapeMap).
Loads a ShapeMap from a JSON representation.
Creates an empty ShapeMap.
Creates an ShapeMap with the associations given as an enumerable.
Return true if shape_map is a query ShapeMap, i.e. does not contain results (result ShapeMap).
Return true if shape_map is a result ShapeMap.
Converts a query ShapeMap into a fixed ShapeMap by resolving all triple patterns against the given graph.
Link to this section Types
type()
View Source
type() :: :fixed | :query | :result
type() :: :fixed | :query | :result
Link to this section Functions
add(shape_map, associations) View Source
Adds a single or list of ShapeMap associations to shape_map.
associations(shape_map) View Source
Returns all associations in shape_map as a list.
conformant?(shape_map) View Source
Returns if all association in shape_map were conformant after a validation.
Note: A non-result ShapeMap is always conformant.
decode(content, opts \\ []) View Source
Loads a ShapeMap from the standard representation format.
fixed?(shape_map) View Source
Return true if shape_map is a fixed ShapeMap, i.e. doesn't contain triple patterns (query ShapeMap) or results (result ShapeMap).
from_json(content, options \\ []) View Source
Loads a ShapeMap from a JSON representation.
This format is not clearly specified. It's currently used only to make test suite pass, where this format is used.
Creates an empty ShapeMap.
new(associations) View Source
Creates an ShapeMap with the associations given as an enumerable.
query?(shape_map) View Source
Return true if shape_map is a query ShapeMap, i.e. does not contain results (result ShapeMap).
Note: Every fixed ShapeMap is also a query ShapeMap.
result?(shape_map) View Source
Return true if shape_map is a result ShapeMap.
to_fixed(shape_map, graph) View Source
Converts a query ShapeMap into a fixed ShapeMap by resolving all triple patterns against the given graph.