Skip to content

Commit 8e01a37

Browse files
committed
Improve Literal#comperable_datatypes2.
1 parent 4903e9b commit 8e01a37

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

lib/rdf/model/literal.rb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,10 @@ def comperable_datatype?(other)
431431
end
432432

433433
##
434-
# Returns `true` if the literal has a datatype and the comparison should
435-
# return false instead of raise a type error.
434+
# Returns `true` if the literals are comperable.
436435
#
437436
# Used for <=> operator.
438437
#
439-
# This behavior is intuited from SPARQL data-r2/expr-equal/eq-2-2
440438
# @return [Boolean]
441439
def comperable_datatype2?(other)
442440
case self
@@ -445,13 +443,9 @@ def comperable_datatype2?(other)
445443
when RDF::Literal::Numeric, RDF::Literal::Boolean
446444
true
447445
else
448-
self.plain? || other.plain? ||
449-
self.language? || other.language? ||
450-
self.datatype == other.datatype
446+
false
451447
end
452448
else
453-
self.plain? || other.plain? ||
454-
self.language? || other.language? ||
455449
self.datatype == other.datatype
456450
end
457451
end

0 commit comments

Comments
 (0)