Class: Hyrax::GraphExporter
- Inherits:
-
Object
- Object
- Hyrax::GraphExporter
- 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.
Instance Attribute Summary collapse
-
#additional_resources ⇒ Object
readonly
Returns the value of attribute additional_resources.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#solr_document ⇒ Object
readonly
Returns the value of attribute solr_document.
Instance Method Summary collapse
- #fetch ⇒ RDF::Graph
-
#initialize(solr_document, request) ⇒ GraphExporter
constructor
A new instance of GraphExporter.
Constructor Details
#initialize(solr_document, request) ⇒ GraphExporter
Returns a new instance of GraphExporter.
7 8 9 10 11 |
# File 'app/services/hyrax/graph_exporter.rb', line 7 def initialize(solr_document, request) @solr_document = solr_document @request = request @additional_resources = [] end |
Instance Attribute Details
#additional_resources ⇒ Object (readonly)
Returns the value of attribute additional_resources.
13 14 15 |
# File 'app/services/hyrax/graph_exporter.rb', line 13 def additional_resources @additional_resources end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
13 14 15 |
# File 'app/services/hyrax/graph_exporter.rb', line 13 def request @request end |
#solr_document ⇒ Object (readonly)
Returns the value of attribute solr_document.
13 14 15 |
# File 'app/services/hyrax/graph_exporter.rb', line 13 def solr_document @solr_document end |
Instance Method Details
#fetch ⇒ RDF::Graph
16 17 18 19 20 21 22 23 24 25 |
# File 'app/services/hyrax/graph_exporter.rb', line 16 def fetch clean_graph_repository.find(solr_document.id).tap do |g| additional_resources.uniq.each do |stmt| g << stmt end end rescue Ldp::NotFound # this error is handled with a 404 page. raise ActiveFedora::ObjectNotFoundError end |