lib/rdf/model/statement.rb in rdf-1.0.4 vs lib/rdf/model/statement.rb in rdf-1.0.5
- old
+ new
@@ -104,9 +104,21 @@
def statement?
true
end
##
+ # Returns `true` if any element of the statement is not a
+ # URI, Node or Literal.
+ #
+ # @return [Boolean]
+ def variable?
+ !(has_subject? && subject.resource? &&
+ has_predicate? && predicate.resource? &&
+ has_object? && (object.resource? || object.literal?) &&
+ (has_context? ? context.resource? : true ))
+ end
+
+ ##
# @return [Boolean]
def invalid?
!valid?
end