Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 2.33 KB

Add Relationship Metric Answer.md

File metadata and controls

43 lines (32 loc) · 2.33 KB

Add Relationship Metric Answer

Wikirate platform can host answers that respond to relationship questions between companies. For instance, which companies supplied company A in 2022? Relationship answers respond to such questions (metrics with metric type Relationship Metric).

This example assumes you have configured your Wikirate REST client. Instructions on how to configure a client can be found in examples/Configurations.md

WikiRate's REST API allows you to import not only research metric answers but also relationship answers. wikirate4ruby provides the method add_relationship_metric_answer to facilitate this functionality and allow users to import relationships. The method takes as an input a number of parameters where all the information about the new relationship is defined. The parameters can be split into required and optional.

required params:

  • metric_designer: the designer of the metric we want to add the answer to
  • metric_name: the metric name/title of the metric we want to add the answer to
  • subject_company: the company name/id of the subject company
  • object_company: the company name/id of the object company
  • year: the year the relationship is referred to
  • value: the value/answer to the question
  • source: wikirate's source name of the source we found the mentioned relationship

optional params:

  • discussion: any comments we might have on the answer

The example below demonstrates the import of a relationship to the Commons metric Supplied By

relationship = client.add_relationship_metric_answer({ 'metric_designer' => 'Commons',
                                                       'metric_name' => 'Supplied By',
                                                       'subject_company' => 'Aldi Sud',
                                                       'object_company' => 'Zhejiang Bangjie Digital Knitting Share Co. Ltd.',
                                                       'year' => 2019,
                                                       'value' => 'Tier 1 Supplier',
                                                       'source' => 'Source-000092586' })