def to(options = {})
      format = options[:format].to_s
      mime_type = options[:mime_type] && options[:mime_type].to_s
      type_uri = options[:type_uri] && options[:type_uri].to_s
      base_uri = options[:base_uri] && options[:base_uri].to_s

      rdf_serializer = Redland.librdf_new_serializer(Redlander.rdf_world, format, mime_type, type_uri)
      raise RedlandError, "Failed to create a new serializer" if rdf_serializer.null?

      begin
        if options[:file]
          Redland.librdf_serializer_serialize_model_to_file(rdf_serializer, options[:file], base_uri, @rdf_model).zero?
        else
          Redland.librdf_serializer_serialize_model_to_string(rdf_serializer, base_uri, @rdf_model)
        end
      ensure
        Redland.librdf_free_serializer(rdf_serializer)
      end
    end
def to(options = {})
      format = options[:format].to_s
      mime_type = options[:mime_type] && options[:mime_type].to_s
      type_uri = options[:type_uri] && options[:type_uri].to_s
      base_uri = options[:base_uri] && options[:base_uri].to_s

      rdf_serializer = Redland.librdf_new_serializer(Redlander.rdf_world, format, mime_type, type_uri)
      raise RedlandError, "Failed to create a new serializer" if rdf_serializer.null?

      begin
        if options[:file]
          Redland.librdf_serializer_serialize_model_to_file(rdf_serializer, options[:file], base_uri, @rdf_model).zero?
        else
          Redland.librdf_serializer_serialize_model_to_string(rdf_serializer, base_uri, @rdf_model)
        end
      ensure
        Redland.librdf_free_serializer(rdf_serializer)
      end
    end
Serialize model into a string

 @param [Hash] options
 @option options [String] :format name of the serializer to use,
 @option options [String] :mime_type MIME type of the syntax, if applicable,
 @option options [String, URI] :type_uri URI of syntax, if applicable,
 @option options [String, URI] :base_uri base URI,
   to be applied to the nodes with relative URIs.
 @raise [RedlandError] if it fails to create a serializer