Class StatementEquivalence
- Namespace
- Xapi.Validation
- Assembly
- Xapi.Core.dll
Decides whether two Statements are the same Statement under the standard's immutability rules, for example when an LRS receives a Statement id it already stores (409 Conflict) or a client checks what it sent.
public static class StatementEquivalence
- Inheritance
-
StatementEquivalence
- Inherited Members
Remarks
IEEE 9274.1.1, 4.2 "Statement Immutability" (and 5.2 in the Content book): the Actor (except member order),
the Verb (except display), the object and the duration are immutable; case, id, the order of Group
members, authority, stored, timestamp, version, attachments and referenced Activity definitions are not
considered. xAPI 1.0.3 Data 2.3.1 says the same and adds that differences outside those exceptions must not
be ignored, so result and context are compared too.
What this means here:
- Ignored:
id,stored,authority,version, the Statementtimestamp,attachments(also inside SubStatements), Verbdisplay, and every Activitydefinition(object, SubStatement and context Activities). - Strings, IRIs, names, identifiers, language tags and extension keys and string values compare ignoring case ("Case (upper vs. lower)" is listed as not considered).
- Group
memberlists compare as unordered collections; all other lists keep their order. result.durationcompares to 0.01 second (4.2.7 "Duration"); see XapiDuration.- A SubStatement's
timestampis part of the object, so it is compared, as a UTC instant at millisecond precision (4.2.7 allows an LRS to keep only 3 fraction digits). - Extension values compare deeply (object property order ignored, numbers by value).
Methods
AreEquivalent(Statement, Statement)
Returns whether two Statements are equivalent under the immutability rules described above.
public static bool AreEquivalent(Statement a, Statement b)