Class: Ecoportal::API::GraphQL::Diff::Pairing::Candidate
- Inherits:
-
Struct
- Object
- Struct
- Ecoportal::API::GraphQL::Diff::Pairing::Candidate
- Defined in:
- lib/ecoportal/api/graphql/diff/pairing/candidate.rb
Overview
A scored pairing proposal: source object (id-space A) <-> target object (id-space B), with the aggregate confidence and the per-signal breakdown that produced it.
source/target are the raw field docs (Hashes) being paired. score is 0.0..1.0.
signals maps signal-name => contribution (for transparency + the ledger + Product's
Field-ID data). matched_by names the dominant signal (e.g. :genome, :label, :ledger).
Instance Attribute Summary collapse
-
#matched_by ⇒ Object
Returns the value of attribute matched_by.
-
#score ⇒ Object
Returns the value of attribute score.
-
#signals ⇒ Object
Returns the value of attribute signals.
-
#source ⇒ Object
Returns the value of attribute source.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
Instance Attribute Details
#matched_by ⇒ Object
Returns the value of attribute matched_by
12 13 14 |
# File 'lib/ecoportal/api/graphql/diff/pairing/candidate.rb', line 12 def matched_by @matched_by end |
#score ⇒ Object
Returns the value of attribute score
12 13 14 |
# File 'lib/ecoportal/api/graphql/diff/pairing/candidate.rb', line 12 def score @score end |
#signals ⇒ Object
Returns the value of attribute signals
12 13 14 |
# File 'lib/ecoportal/api/graphql/diff/pairing/candidate.rb', line 12 def signals @signals end |
#source ⇒ Object
Returns the value of attribute source
12 13 14 |
# File 'lib/ecoportal/api/graphql/diff/pairing/candidate.rb', line 12 def source @source end |
#target ⇒ Object
Returns the value of attribute target
12 13 14 |
# File 'lib/ecoportal/api/graphql/diff/pairing/candidate.rb', line 12 def target @target end |
Instance Method Details
#source_id ⇒ Object
13 14 15 |
# File 'lib/ecoportal/api/graphql/diff/pairing/candidate.rb', line 13 def source_id source && source['id'] end |
#target_id ⇒ Object
17 18 19 |
# File 'lib/ecoportal/api/graphql/diff/pairing/candidate.rb', line 17 def target_id target && target['id'] end |
#to_h ⇒ Object
21 22 23 24 25 26 |
# File 'lib/ecoportal/api/graphql/diff/pairing/candidate.rb', line 21 def to_h { source_id: source_id, target_id: target_id, score: score, matched_by: matched_by, signals: signals }.compact end |