lib/rdf/model/statement.rb in rdf-3.2.3 vs lib/rdf/model/statement.rb in rdf-3.2.4
- old
+ new
@@ -69,10 +69,11 @@
# @option options [RDF::Resource] :object (nil)
# if not a {Resource}, it is coerced to {Literal} or {Node} depending on if it is a symbol or something other than a {Term}.
# @option options [RDF::Term] :graph_name (nil)
# Note, in RDF 1.1, a graph name MUST be an {Resource}.
# @option options [Boolean] :inferred used as a marker to record that this statement was inferred based on semantic relationships (T-Box).
+ # @option options [Boolean] :quoted used as a marker to record that this statement quoted and appears as the subject or object of another RDF::Statement.
# @return [RDF::Statement]
#
# @overload initialize(subject, predicate, object, **options)
# @param [RDF::Term] subject
# A symbol is converted to an interned {Node}.
@@ -81,10 +82,11 @@
# if not a {Resource}, it is coerced to {Literal} or {Node} depending on if it is a symbol or something other than a {Term}.
# @param [Hash{Symbol => Object}] options
# @option options [RDF::Term] :graph_name (nil)
# Note, in RDF 1.1, a graph name MUST be an {Resource}.
# @option options [Boolean] :inferred used as a marker to record that this statement was inferred based on semantic relationships (T-Box).
+ # @option options [Boolean] :quoted used as a marker to record that this statement quoted and appears as the subject or object of another RDF::Statement.
# @return [RDF::Statement]
def initialize(subject = nil, predicate = nil, object = nil, options = {})
if subject.is_a?(Hash)
@options = Hash[subject] # faster subject.dup
@subject = @options.delete(:subject)
@@ -207,10 +209,10 @@
end
##
# @return [Boolean]
def quoted?
- false
+ !!@options[:quoted]
end
##
# @return [Boolean]
def inferred?