Class: Krikri::Mapper::Agent
- Inherits:
-
Object
- Object
- Krikri::Mapper::Agent
- Includes:
- SoftwareAgent
- Defined in:
- lib/krikri/mapper.rb
Overview
A SoftwareAgent to run mapping processes.
@see: Krikri::SoftwareAgent, Krikri::Activity
Constant Summary
Constants included from SoftwareAgent
Instance Attribute Summary collapse
-
#generator_uri ⇒ Object
readonly
Returns the value of attribute generator_uri.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Agent
constructor
A new instance of Agent.
- #records ⇒ Object
- #run(activity_uri = nil) ⇒ Object
Methods included from SoftwareAgent
Constructor Details
#initialize(opts = {}) ⇒ Agent
Returns a new instance of Agent.
76 77 78 79 |
# File 'lib/krikri/mapper.rb', line 76 def initialize(opts = {}) @name = opts.fetch(:name).to_sym @generator_uri = RDF::URI(opts.fetch(:generator_uri)) end |
Instance Attribute Details
#generator_uri ⇒ Object (readonly)
Returns the value of attribute generator_uri.
74 75 76 |
# File 'lib/krikri/mapper.rb', line 74 def generator_uri @generator_uri end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
74 75 76 |
# File 'lib/krikri/mapper.rb', line 74 def name @name end |
Instance Method Details
#records ⇒ Object
90 91 92 93 94 95 |
# File 'lib/krikri/mapper.rb', line 90 def records Krikri::ProvenanceQueryClient.find_by_activity(generator_uri) .execute.lazy.flat_map do |solution| OriginalRecord.load(solution.record.to_s) end end |