Class: Valkyrie::Persistence::Fedora::Persister::ModelConverter::GraphProperty

Inherits:
Object
  • Object
show all
Defined in:
lib/valkyrie/persistence/fedora/persister/model_converter.rb

Overview

Class modeling RDF properties which are single, existing graphs (i. e. this inserts a single existing "child" graph into a "parent" graph)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subject, key, graph, adapter, resource) ⇒ GraphProperty

Returns a new instance of GraphProperty.

Parameters:



135
136
137
138
139
140
141
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 135

def initialize(subject, key, graph, adapter, resource)
  @subject = subject
  @key = key
  @graph = graph
  @adapter = adapter
  @resource = resource
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



128
129
130
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 128

def adapter
  @adapter
end

#graphObject (readonly)

Returns the value of attribute graph.



128
129
130
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 128

def graph
  @graph
end

#keyObject (readonly)

Returns the value of attribute key.



128
129
130
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 128

def key
  @key
end

#resourceObject (readonly)

Returns the value of attribute resource.



128
129
130
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 128

def resource
  @resource
end

#subjectObject (readonly)

Returns the value of attribute subject.



128
129
130
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 128

def subject
  @subject
end

Instance Method Details

#to_graph(passed_graph = RDF::Graph.new) ⇒ RDF::Graph

Appends the existing graph to a new or existing "parent" graph

Parameters:

  • passed_graph (RDF::Graph) (defaults to: RDF::Graph.new)

Returns:

  • (RDF::Graph)

    the updated "parent" graph



146
147
148
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 146

def to_graph(passed_graph = RDF::Graph.new)
  passed_graph << graph
end