Optional
data_factory: DataFactory<Quad, Quad>An implementation of the generic RDF DataFactory interface, see the specification. If undefined, the DataFactory of the n3 package is used.
Optional
getConfigData: GetConfigDataA function returning the configuration data, see ConfigData. By default, this returns the constant values set in the code; the caller may provide a more complex function to handle environment variables and/or configuration files.
Current logger type.
List of available logger types.
Set the Hash algorithm (default is "sha256"). If the algorithm isn't available the value is ignored (and an exception is thrown).
The name is considered to be case insensitive. Also, both the format including a '-' dash character or not are accepted (i.e., "sha256" and "sha-256" are both fine).
List of available hash algorithm names.
Set the maximal complexity number. This number, multiplied with the number of blank nodes in the dataset, sets a maximum number of calls the algorithm can do for the so called "hash n degree quads" function. Setting this number to a reasonably low number (say, 30), ensures that some "poison graphs" would not result in an unreasonably long canonicalization process. See the security consideration section in the specification.
The default value set by this implementation is 50; any number greater then this number is ignored (and an exception is thrown).
The system-wide maximum value for the complexity level. The current maximum complexity level cannot exceed this value.
Canonicalize a Dataset into an N-Quads document.
Implementation of the main algorithm, see the separate overview in the spec.
(The real work is done in the separate function).
whether the input should be copied to a local store (e.g., if the input is a generator, or the uniqueness of quads are not guaranteed). If this
parameter is not used (i.e., value is undefined
) the copy is always done unless the input is an rdf.DatasetCore
instance.
Note that the N-Quads parser throws an exception in case of syntax error.
Canonicalize a Dataset producing the full set of information.
Implementation of the main algorithmic steps, see separate overview in the spec.
(The real work is done in the separate function).
The result is an Object containing the serialized version and the Quads version of the canonicalization result, as well as a bnode mapping from the original to the canonical equivalents.
whether the input should be copied to a local store (e.g., if the input is a generator, or the uniqueness of quads are not guaranteed). If this
parameter is not used (i.e., value is undefined
) the copy is always done unless the input is an rdf.DatasetCore
instance.
Note that the N-Quads parser throws an exception in case of syntax error.
Hash a dataset:
This method is typically used on the result of the canonicalization to compute the canonical hash of a dataset.
Just a shell around the algorithm, consisting of a state, and the calls to the real implementation.
The variable parts of the state, as defined in the spec, are re-initialized at the canonicalize call. Ie, the same class instance can therefore be reused to canonicalize for different graphs.