lib/rdf/rdfxml/writer.rb
# Perform any preprocessing of statements required
# @return [ignored]
Perform any preprocessing of statements required
Perform any preprocessing of statements required
def preprocess
      (@options[:prefixes] || {}).each_pair do |k, v|
        @uri_to_prefix[v.to_s] = k
      end
      @options[:prefixes] = {}  
      prefix(:rdf, RDF.to_uri)
      @uri_to_prefix[RDF.to_uri.to_s] = :rdf
      if base_uri || @options[:lang]
        prefix(:xml, RDF::XML)
        @uri_to_prefix[RDF::XML.to_s] = :xml
      end
      if @options[:default_namespace]
        @uri_to_prefix[@options[:default_namespace]] = nil
        prefix(nil, @options[:default_namespace])
      end
      @graph.each {|statement| preprocess_statement(statement)}
    end
def preprocess ( @options [ :prefixes ] || { } ) . each_pair do | k , v | @uri_to_prefix [ v . to_s ] = k end @options [ :prefixes ] = { } prefix ( :rdf , RDF . to_uri ) @uri_to_prefix [ RDF . to_uri . to_s ] = :rdf if base_uri || @options [ :lang ] prefix ( :xml , RDF :: XML ) @uri_to_prefix [ RDF :: XML . to_s ] = :xml end if @options [ :default_namespace ] @uri_to_prefix [ @options [ :default_namespace ] ] = nil prefix ( nil , @options [ :default_namespace ] ) end @graph . each { | statement | preprocess_statement ( statement ) } end
Perform any preprocessing of statements required
Perform any preprocessing of statements required
# Load defined prefixes # Will define actual used when matched # Process each statement to establish CURIEs and Terms
None
ignored