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:



129
130
131
132
133
134
135
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 129

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.



122
123
124
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 122

def adapter
  @adapter
end

#graphObject (readonly)

Returns the value of attribute graph.



122
123
124
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 122

def graph
  @graph
end

#keyObject (readonly)

Returns the value of attribute key.



122
123
124
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 122

def key
  @key
end

#resourceObject (readonly)

Returns the value of attribute resource.



122
123
124
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 122

def resource
  @resource
end

#subjectObject (readonly)

Returns the value of attribute subject.



122
123
124
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 122

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



140
141
142
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 140

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