# RubyRDF / RDF Parser. Based on code contributed from
# RDF4R RDF Parser, Copyright © 2002 Brandt Kurowski (brandt@kurowski.net)
# packaged as part of RubyRDF, see http://www.w3.org/2001/12/rubyrdf/intro.html
# All Rights Reserved. This work is distributed under the W3C® Software 
# License [1] in the hope that it will be useful, but WITHOUT ANY 
# WARRANTY; without even the implied warranty of MERCHANTABILITY or 
# FITNESS FOR A PARTICULAR PURPOSE. 
# [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231


require 'RDF4R/Model/Standard'

module RDF4R

	module Consumer

		class Standard

			attr_reader :models, :model
		
			def initialize
				@models = []
			end

			def start_model
				@model = Model::Model.new
			end

			def resource(uri = nil)
				return @model.resource(uri)
			end

			def literal(text, lang = nil)
				return @model.literal(text, lang)
			end

			def statement(subject, predicate, object)
				return @model.statement(subject, predicate, object)
			end

			def notify_id(id)
				@model.xml_ids << id
			end

			def notify_base(uri)
				@model.xml_base_uri = uri
			end

			def end_model
				@models.push @model
				@model = nil
			end

		end

	end

end

