Class: ActiveFedora::RDFXMLWriter

Inherits:
RDF::RDFXML::Writer
  • Object
show all
Defined in:
lib/active_fedora/rdf_xml_writer.rb

Overview

This class ensures that the RELS-EXT datastream is always serialized with an rdf:Description container for the properties the default behavior for RDF:RDFXML::Writer is to change that element if an rdf:type assertion is present; this is incompatible with Fedora

Instance Method Summary (collapse)

Instance Method Details

- (Object) subject(subject, parent_node)

Raises:

  • (RDF::WriterError)


11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/active_fedora/rdf_xml_writer.rb', line 11

def subject(subject, parent_node)
  
  raise RDF::WriterError, "Illegal use of subject #{subject.inspect}, not supported in RDF/XML" unless subject.resource?
  
  node = if !is_done?(subject)
    subject_not_done(subject, parent_node)
  elsif @force_RDF_about.include?(subject)
    force_about(subject, parent_node)
  end
  @force_RDF_about.delete(subject)

  parent_node.add_child(node) if node
end