lib/rdf/model/statement.rb in rdf-1.1.0.p2 vs lib/rdf/model/statement.rb in rdf-1.1.0.p3
- old
+ new
@@ -180,15 +180,14 @@
def has_object?
!!object
end
##
- # Returns `true` if the subject or object of this statement is a blank
- # node.
+ # Returns `true` if any resource of this statement is a blank node.
#
# @return [Boolean]
def has_blank_nodes?
- (has_object? && object.node?) || (has_subject? && subject.node?)
+ to_quad.compact.any?(&:node?)
end
##
# @param [Statement] other
# @return [Boolean]