Class: Hyrax::GraphExporter
- Inherits:
-
Object
- Object
- Hyrax::GraphExporter
show all
- Defined in:
- app/services/hyrax/graph_exporter.rb
Overview
Retrieves the graph for an object with the internal triples removed and the uris translated to external uris.
Defined Under Namespace
Classes: ListSourceExporter
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(solr_document, hostname:) ⇒ GraphExporter
Returns a new instance of GraphExporter.
13
14
15
16
17
18
|
# File 'app/services/hyrax/graph_exporter.rb', line 13
def initialize(solr_document, hostname:)
@solr_document = solr_document
@hostname = hostname
@additional_resources = []
@visited_subresources = Set.new
end
|
Instance Attribute Details
#additional_resources ⇒ Array<RDF::Graph>, ActionDispatch::Request
28
|
# File 'app/services/hyrax/graph_exporter.rb', line 28
attr_reader :solr_document, :additional_resources, :hostname
|
#hostname ⇒ Object
28
|
# File 'app/services/hyrax/graph_exporter.rb', line 28
attr_reader :solr_document, :additional_resources, :hostname
|
#solr_document ⇒ #id
28
29
30
|
# File 'app/services/hyrax/graph_exporter.rb', line 28
def solr_document
@solr_document
end
|
Instance Method Details
#fetch ⇒ RDF::Graph
32
33
34
35
36
37
38
39
|
# File 'app/services/hyrax/graph_exporter.rb', line 32
def fetch
clean_graph_repository.find(solr_document.id).tap do |g|
additional_resources.each { |subgraph| g << subgraph }
end
rescue Ldp::NotFound
raise Hyrax::ObjectNotFoundError
end
|