Sha256: 60ab5d8aa12ecf300c680acfed7f01154824103c017fc91b1cf3cfae01e4cf0b

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

# -*- encoding : utf-8 -*-
module ActiveFedora
  module RelsInt
    class RDFXMLWriter < ActiveFedora::RDFXMLWriter
      # Write a predicate with one or more values.
      #
      # Values may be a combination of Literal and Resource (Node or URI).
      # @param [RDF::Resource] predicate
      #   Predicate to serialize
      # @param [Array<RDF::Resource>] objects
      #   Objects to serialize
      # @return [String]
      def predicate(predicate, objects)
        add_debug {"predicate: #{predicate.inspect}, objects: #{objects}"}

        return if objects.to_a.empty?

        add_debug {"predicate: #{get_curie(predicate)}"}
        render_property(predicate, objects) do |o, inlist=nil|
          # Yields each object, for potential recursive definition.
          # If nil is returned, a leaf is produced
          #depth {subject(o, :rel => get_curie(predicate), :inlist => inlist, :element => (:li if objects.length > 1 || inlist))} if !is_done?(o) && @subjects.include?(o)
          # we don't ever want to recurse, so nil it all
          nil
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_fedora_relsint-0.4.1 lib/active_fedora_relsint/rdf_xml_writer.rb
active_fedora_relsint-0.4.0 lib/active_fedora_relsint/rdf_xml_writer.rb