RDF.Literal.Datatype.do_compare

You're seeing just the callback do_compare, go back to RDF.Literal.Datatype module for more information.

Specs

do_compare(literal() | any(), literal() | any()) ::
  comparison_result() | :indeterminate | nil

Callback for datatype specific compare/2 comparisons between two RDF.Literals.

This callback is called by auto-generated compare/2 function on the implementations, which already deals with the basic cases. So, implementations can assume the passed arguments are valid RDF.Literal.Datatype structs and have the same datatypes or are derived from each other.

Should return :gt if value of the first literal is greater than the value of the second in terms of their datatype and :lt for vice versa. If the two literals can be considered equal :eq should be returned. For datatypes with only partial ordering :indeterminate should be returned when the order of the given literals is not defined.

nil should be returned when the given arguments are not comparable datatypes or if one them is invalid.

The default implementation of the _using__ macro of RDF.Literal.Datatypes just compares the values of the given literals.