Skip to content

exchange rates

elf Pavlik requested to merge github/fork/elf-pavlik/x-rates into master

This PR proposes vf:ExchangeRate which allows referencing two flows together with values to calculate exchange rate. Both units come from flows. For example:

`@context': ...
`@graph`:

  - `@id`: ex:an-agreement
    `@type`: Agreement

  - `@id`: ex:work-event
    `@type`: EconomicEvent
    under: ex:an-agreement
    action: work
    quantity:
      'qudt:numericValue': 3
      `qudt:unit`: unit:Hour

  - `@id`: ex:use-event
    `@type`: EconomicEvent
    under: ex:an-agreement
    action: use
    affects: ex:some-tool
    quantity:
      'qudt:numericValue': 2
      `qudt:unit`: unit:Hour

  - `@id`: ex:issue-event
    `@type`: EconomicEvent
    under: ex:an-agreement
    action: issue
    affectedClassifiedAs: http://www.wikidata.org/entity/Q618355 # apple juice
    quantity:
      'qudt:numericValue': 20
      `qudt:unit`: unit:Liter 

  - `@id`: ex:an-exchange-rate
    `@type`: ExchangeRate
    under: ex:an-agreement
    numerator: 5
    denominator: 1
    numeratorFlow: ex:issue-event
    denominatorFlow: ex:work-event

  - `@id`: ex:another-exchange-rate
    `@type`: ExchangeRate
    under: ex:an-agreement
    numerator: 2.5
    denominator: 1
    numeratorFlow: ex:issue-event
    denominatorFlow: ex:use-event

One can use them with vf:Commitment in the same way. I'll try to add an example of a Proposal which uses exchange rate together with two intents.

Merge request reports