operator == method

  1. @override
bool operator ==(
  1. Object other
)
override

Compares this literal term with another object for equality.

Two literal terms are equal if they have the same lexical value, the same datatype, and the same language tag (if present).

This follows the RDF 1.1 specification's definition of literal equality, which is based on the lexical value rather than any derived value. For example, "01"^^xsd:integer and "1"^^xsd:integer are not equal even though they represent the same number.

Implementation

@override
bool operator ==(Object other) {
  return other is LiteralTerm &&
      value == other.value &&
      datatype == other.datatype &&
      language == other.language;
}