Method: Note::SKOS::ChangeNote#build_rdf

Defined in:
app/models/note/skos/change_note.rb

#build_rdf(document, subject) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
# File 'app/models/note/skos/change_note.rb', line 36

def build_rdf(document, subject)
  subject.send(self.rdf_namespace).build_predicate(self.rdf_predicate) do |blank_node|
    blank_node.Rdfs::comment(self.value, lang: self.language || nil) if self.value
    self.annotations.each do |annotation|
      if (IqRdf::Namespace.find_namespace_class(annotation.namespace))
        blank_node.send(annotation.namespace.camelcase).send(annotation.predicate, annotation.value)
      else
        raise "Note::SKOS::ChangeNote#build_rdf: couldn't find Namespace '#{annotation.namespace}'."
      end
    end
  end
end