Creates a new assertion and calculates its digest.
This constructor takes a predicate and object, both of which are
converted to envelopes using the ToEnvelope trait. It then
calculates the assertion's digest by combining the digests of the
predicate and object.
The digest is calculated according to the Gordian Envelope specification, which ensures that semantically equivalent assertions always produce the same digest.
The predicate of the assertion, which states what is being asserted
The object of the assertion, which provides the assertion's value
A new assertion with the specified predicate, object, and calculated digest.
Returns the predicate of the assertion.
The predicate states what is being asserted about the subject. It is typically a string or known value, but can be any envelope.
A clone of the assertion's predicate envelope.
Returns the object of the assertion.
The object provides the value or content of the assertion. It can be any type that can be represented as an envelope.
A clone of the assertion's object envelope.
Returns the digest of this assertion.
The assertion's digest
Checks if two assertions are equal based on digest equality.
Two assertions are considered equal if they have the same digest, regardless of how they were constructed.
The other assertion to compare with
true if the assertions are equal, false otherwise
Converts this assertion to CBOR.
The CBOR representation of an assertion is a map with a single key-value pair, where the key is the predicate's CBOR and the value is the object's CBOR.
A CBOR representation of this assertion
StaticfromAttempts to create an assertion from a CBOR value.
The CBOR must be a map with exactly one entry, where the key represents the predicate and the value represents the object.
The CBOR value to convert
A new Assertion instance
StaticfromAttempts to create an assertion from a CBOR map.
The map must have exactly one entry, where the key represents the predicate and the value represents the object. This is used in the deserialization process.
The CBOR map to convert
A new Assertion instance
Creates a string representation of this assertion for debugging.
A string representation
A predicate-object relationship representing an assertion about a subject.
In Gordian Envelope, assertions are the basic building blocks for attaching information to a subject. An assertion consists of a predicate (which states what is being asserted) and an object (which provides the assertion's value).
Assertions can be attached to envelope subjects to form semantic statements like: "subject hasAttribute value" or "document signedBy signature".
Assertions are equivalent to RDF (Resource Description Framework) triples, where:
Generally you do not create an instance of this type directly, but instead use
Envelope.assertion(), or the various functions onEnvelopethat create assertions.