Skip to content

Latest commit

 

History

History
72 lines (57 loc) · 3.44 KB

Get Metrics.md

File metadata and controls

72 lines (57 loc) · 3.44 KB

Get Metrics

A Metric is a tool for measuring. On WikiRate, metrics are used to measure company performance, and they are a way of asking the same question of many companies. It consists of a question, an About section (which describes why this metric is important and how it is used), and a Methodology section (which describes how to research the answer).

Some metric answers are researched, and their values and source citations are entered directly. Other answers are dynamically calculated from other answers. Learn More

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

The get_metrics method take as an input a Hash where the user can define the parameters of their request. More specifically, we could divide our params in two different types of parameters, the endpoint parameters and the filter parameters. The endpoint parameters help us to iterate through our query's results and the filter parameters allow us to restrict our results based on specific given input.

endpoint params:
  • limit: default value 20, the maximum number of entries to return. If the value exceeds the maximum, then the maximum value will be used.
  • offset: default value 0, the (zero-based) offset of the first item in the collection to return

filter params:

  • name:: returns all metrics that contain in their name the given string.

  • bookmark: returns the metrics you have bookmarked, allowed parameter values:

    • 'bookmark'
    • 'nobookmark'
  • wikirate_topic: returns all metrics that fall under the defined wikirate topic. All wikirate topics can be found here.

  • designer: returns all metrics the given designer created.

  • published: returns all metrics based on status published or not published. Note that only stewards are allowed to filter based on status. Allowed parameter values:

    • 'true': for published metrics (default)
    • 'false': for not published metrics
    • 'all': for published and unpublished
  • metric_type: returns all metrics of the given metric type. If you want to learn more about the different wikirate metric types follow this link. Allowed parameter values:

    • 'researched'
    • 'relationship'
    • 'inverse relationship'
    • 'formula'
    • 'wikirating'
    • 'score'
    • 'descendant'
  • value_type: returns all metric that their answers are of the specified value type. Allowed parameter values:

    • 'number'
    • 'money'
    • 'category'
    • 'multi-category'
    • 'free text'
  • research_policy: returns all metrics that follow the given research policy. Allowed parameter values:

    • 'community assessed'
    • 'designer assessed'
  • dataset: returns all metrics contained on the given dataset. All available wikirate datasets can be found here.

In the example below, we are asking to get 50 community assessed metrics which are designed by Walk Free

metrics = client.get_metrics({ 'limit' => 50,
                               'research_policy' => 'community assessed',
                               'designer' => 'Walk Free' })