Transfer and Exchange Examples

  1. Exchange Agreements
  2. Crypto-currency transfer
  3. Crypto-currency move
  4. Checkout library book
  5. Claim

Exchange agreement

An exchange agreement with commitments.

agreement diagram

# Example: Simple exchange agreement

'@context':
  - https://git.io/vf-examples-jsonld-context
  - alice: https://alice.example/
    bob: https://bob.example/

'@id': rgh:valueflows/valueflows/master/examples/exch-agreement.yaml
'@graph':

  # Exchange agreement with commitments

  - '@id': alice:57f1c1d0-432e-4bfa-9d32-002b8955a708
    '@type': Agreement
    skos:note: Alice commits to giving Bob 50 kg of apples in exchange for 10 liters of apple cider.

  - '@id': alice:2342d456-5d6f-46d5-a7ed-3ac7bfd5a86c
    '@type': Commitment
    clauseOf: alice:57f1c1d0-432e-4bfa-9d32-002b8955a708
    action: transfer-complete
    provider: https://alice.example/
    receiver: https://bob.example/
    resourceClassifiedAs: https://www.wikidata.org/wiki/Q89 # apples
    resourceQuantity:
      qudt:unit: unit: Kilogram
      qudt:numericValue: 50

  - '@id': bob:fd399b37-0740-4a68-a184-1e655021ca21
    '@type': Commitment
    clauseOf: alice:57f1c1d0-432e-4bfa-9d32-002b8955a708
    action: transfer-complete
    provider: https://bob.example/
    receiver: https://alice.example/
    resourceClassifiedAs: https://www.wikidata.org/wiki/Q5977438 # soft apple cider
    resourceQuantity:
      qudt:unit: unit: Liter
      qudt:numericValue: 10

Retail exchange

An exchange without prior commitments. Note we are still using the Agreement to tie together the reciprocal events, even there were no commitments ahead of time.

retail diagram

# Example: Simple retail exchange without commitments

'@context':
  - https://git.io/vf-examples-jsonld-context
  - carol: https://carol.example/
    store: https://store.example/

'@id': rgh:valueflows/valueflows/master/examples/exch-retail.yaml
'@graph':

  - '@id': store:ac9ec98d-db80-44dc-97be-7aa149b2fe5d
    '@type': Agreement
    skos:note: Carol purchased a new bucket at the hardware store and paid 5 dollars for it.

  - '@id': store:a8356625-bf64-4c16-9099-28aa1b718c4b
    '@type': EconomicEvent
    realizationOf: store:ac9ec98d-db80-44dc-97be-7aa149b2fe5d
    action: transfer-complete
    provider: https://store.example/
    receiver: https://carol.example/
    resourceClassifiedAs: https://www.wikidata.org/wiki/Q47107 # bucket
    resourceQuantity:
      qudt:unit: unit: Number
      qudt:numericValue: 1

  - '@id': store:2342d456-5d6f-46d5-a7ed-3ac7bfd5a86c
    '@type': EconomicEvent
    realizationOf: store:ac9ec98d-db80-44dc-97be-7aa149b2fe5d
    action: transfer-complete
    provider: https://carol.example/
    receiver: https://store.example/
    resourceClassifiedAs: https://www.wikidata.org/wiki/Q4917 # US dollar
    resourceInventoriedAs: carol:e56fd654-7b94-4d96-8e60-de39e08329a7 # Carol's bank account
    resourceQuantity:
      qudt:unit: unit: Number
      qudt:numericValue: 5

Crypto-currency transfer

A simple transfer of a currency from one agent to another.

crypto transfer diagram

# Transfer of crypto-currency, ignoring the fee, but to record time involved in the transfer validation process

'@context':
  - https://git.io/vf-examples-jsonld-context
  - bob: https://bob.example/
    alice: https://alice.example/
    fair: https://faircoin.example/

'@id': rgh:valueflows/valueflows/master/examples/transfer-crypto.yaml
'@graph':

  # accounts before

  - '@id': fair:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead
    '@type': EconomicResource
    skos:note: Alice's wallet address
    classifiedAs: wd:Q21002847 # FairCoin
    accountingQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 540

  - '@id': fair:3be5259d-10f0-431c-9fec-9c0c15a461d3
    '@type': EconomicResource
    skos:note: Bob's wallet address 
    classifiedAs: wd:Q21002847 # FairCoin
    accountingQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 480

  # transfer from Alice to Bob

  - '@id': urn:uuid:e5afaa28-1080-4912-835b-46883efb83e6
    '@type': EconomicEvent
    action: transfer-complete
    resourceClassifiedAs: wd:Q21002847 # FairCoin
    resourceInventoriedAs: fair:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead # Alice's wallet address
    toResourceInventoriedAs: fair:3be5259d-10f0-431c-9fec-9c0c15a461d3 # Bob's wallet address
    provider: https://alice.example
    receiver: https://bob.example
    resourceQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 100
    time:inXSDDateTimeStamp: 2019-04-18T8:30:08-5:00

  # accounts after

  - '@id': fair:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead
    '@type': EconomicResource
    skos:note: Alice's wallet address 
    classifiedAs: wd:Q21002847 # FairCoin
    accountingQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 440

  - '@id': fair:3be5259d-10f0-431c-9fec-9c0c15a461d3
    '@type': EconomicResource
    skos:note: Bob's wallet address 
    classifiedAs: wd:Q21002847 # FairCoin
    accountingQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 580

Moving crypto-currency

A simple move of a currency from one account to another by one agent.

crypto move diagram

# Move of crypto-currency for one agent, ignoring the fee

'@context':
  - https://git.io/vf-examples-jsonld-context
  - bob: https://bob.example/
    fair: https://faircoin.example/

'@id': rgh:valueflows/valueflows/master/examples/move-crypto.yaml
'@graph':

  # accounts before

  - '@id': fair:6fb358a3-2859-4d6a-a4fa-431603ee70f5
    '@type': EconomicResource
    skos:note: Bob's first wallet address
    classifiedAs: wd:Q21002847 # FairCoin
    accountingQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 540

  - '@id': fair:3be5259d-10f0-431c-9fec-9c0c15a461d3
    '@type': EconomicResource
    skos:note: Bob's second wallet address 
    classifiedAs: wd:Q21002847 # FairCoin
    accountingQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 480

  # move between Bob's accounts

  - '@id': urn:uuid:e5afaa28-1080-4912-835b-46883efb83e6
    '@type': EconomicEvent
    action: move
    resourceClassifiedAs: wd:Q21002847 # FairCoin
    resourceInventoriedAs: fair:6fb358a3-2859-4d6a-a4fa-431603ee70f5 # Bob's first wallet address
    toResourceInventoriedAs: fair:3be5259d-10f0-431c-9fec-9c0c15a461d3 # Bob's second wallet address
    provider: https://bob.example
    receiver: https://bob.example
    resourceQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 100
    time:inXSDDateTimeStamp: 2019-04-18T8:30:08-5:00

  # accounts after

  - '@id': fair:b6fb358a3-2859-4d6a-a4fa-431603ee70f5
    '@type': EconomicResource
    skos:note: Bob's first wallet address 
    classifiedAs: wd:Q21002847 # FairCoin
    accountingQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 440

  - '@id': fair:3be5259d-10f0-431c-9fec-9c0c15a461d3
    '@type': EconomicResource
    skos:note: Bob's second wallet address 
    classifiedAs: wd:Q21002847 # FairCoin
    accountingQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 580

Checkout book

Checking out and checking back in a library book (a loan).

checkout diagram

'@context':
  - https://git.io/vf-examples-jsonld-context
  - library: https://library.example/
    bob: https://bob.example/

'@id': rgh:valueflows/valueflows/master/examples/checkout-book.yaml
'@graph':

  # resource before

  - '@id': library:2402b57c-1c45-423a-acb2-f50961c97d65
    '@type': EconomicResource
    skos:note: Valueflows cookbook ISBN:1234 copy 2
    accountingQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 1
    onhandQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 1

  # check out

  - '@id': library:f47064eb-7120-4b31-b882-770165901fe6
    '@type': Agreement
    skos:note: loaning Valueflows cookbook to Bob

  - '@id': urn:uuid:54b814ee-62dc-40c1-bb96-f8582aa4f771
    '@type': EconomicEvent
    realizationOf: library:f47064eb-7120-4b31-b882-770165901fe6
    action: transfer-custody
    resourceInventoriedAs: library:2402b57c-1c45-423a-acb2-f50961c97d65
    time:inXSDDateTimeStamp: 2019-04-18T8:00:00-5:00
    provider: https://library.example/
    receiver: https://bob.example/
    resourceQuantity: 
      qudt:unit: unit:Number
      qudt:numericValue: 1

  - '@id': urn:uuid:98c2bfeb-9c70-4801-896c-4646b975a7d9
    '@type': Commitment
    clauseOf: library:f47064eb-7120-4b31-b882-770165901fe6
    action: transfer-custody
    resourceInventoriedAs: library:2402b57c-1c45-423a-acb2-f50961c97d65
    provider: https://bob.example/
    receiver: https://library.example/
    resourceQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 1
    time:before: 2019-05-17T18:00:00-5:00

  # resource after check out

  - '@id': library:2402b57c-1c45-423a-acb2-f50961c97d65
    '@type': EconomicResource
    skos:note: Valueflows cookbook ISBN:1234 copy 2
    accountingQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 1
    onhandQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 0

  # return

  - '@id': urn:uuid:d4d2fd71-34f2-41c3-b1c5-19ad5ed2da59
    '@type': EconomicEvent
    realizationOf: library:f47064eb-7120-4b31-b882-770165901fe6
    action: transfer-custody
    resourceInventoriedAs: library:2402b57c-1c45-423a-acb2-f50961c97d65
    provider: https://bob.example/
    receiver: https://library.example/
    resourceQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 1
    time:inXSDDateTimeStamp: 2019-05-14T10:20:00-5:00

  - '@id': urn:uuid:6f438393-7f87-4914-806c-e23a4fd15e89
    '@type': Fulfillment
    fulfills: urn:uuid:98c2bfeb-9c70-4801-896c-4646b975a7d9 # the commitment
    fulfilledBy: urn:uuid:d4d2fd71-34f2-41c3-b1c5-19ad5ed2da59 # the economic event
    resourceQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 1

  # resource after return

  - '@id': library:2402b57c-1c45-423a-acb2-f50961c97d65
    '@type': EconomicResource
    skos:note: Valueflows cookbook ISBN:1234 copy 2
    accountingQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 1
    onhandQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 1

Claim

Logged work triggers a claim for future income distribution for that work.

claim diagram

# Example: Claim (simple)

'@context':
  - https://git.io/vf-examples-jsonld-context
  - bob: https://bob.example/
    mfg: https://manufacturer.example/

'@id': rgh:valueflows/valueflows/master/examples/claim.yaml
'@graph':

  # Bob does some work to create a product that the mfg team wishes to sell on the marketplace

  - '@id': mfg:02b39a30-3e04-4305-9656-7f261aa63c83
    '@type': EconomicEvent
    action: work
    provider: https://bob.example/
    receiver: https://manufacturing.example/
    resourceClassifiedAs: https://www.wikidata.org/wiki/Q192047 # machining
    effortQuantity:
      qudt:unit: unit:Hour
      qudt:numericValue: 7
    hasBeginning: 2018-10-14T8:00:00-0:00
    hasEnd: 2018-10-14T15:00:00-0:00

  # this triggers a claim for payment in the future based on an income distribution agreement among the mfg group

  - '@id': mfg:d4d2fd71-34f2-41c3-b1c5-19ad5ed2da58
    '@type': Claim
    action: transfer-complete
    provider: https://manufacturing.example/
    receiver: https://bob.example/
    resourceClassifiedAs: https://www.wikidata.org/wiki/Q1104069 # Canadian dollar
    resourceQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 140
    dcterms:created: 2018-10-14T15:30:00-0:00
    triggeredBy: mfg:02b39a30-3e04-4305-9656-7f261aa63c83
    agreedIn: mfg:e1721a61-cd47-4556-84b9-8b1b81da15be # a distribution agreement (not detailed in example)

  # half of the manufactured product is sold along with some other products, and income is distributed

  - '@id': mfg:c7897c39-7f05-4a5d-a487-80e130a2414a
    '@type': EconomicEvent
    action: transfer-complete
    provider: https://manufacturing.example/
    receiver: https://bob.example/
    resourceClassifiedAs: https://www.wikidata.org/wiki/Q1104069 # Canadian dollar
    resourceQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 260 # here Bob received income for more than one work event (others not included in the example)
    time:inXSDDateTimeStamp: 2018-10-25T09:30:00-0:00

  - '@id': mfg:b52a5815-fae9-43bf-be95-833b95dc0ada
    '@type': Settlement
    settles: mfg:d4d2fd71-34f2-41c3-b1c5-19ad5ed2da58 # the claim
    settlededBy: mfg:c7897c39-7f05-4a5d-a487-80e130a2414a # the economic event
    resourceQuantity:
      qudt:unit: unit:Number
      qudt:numericValue: 70 # half of the original claim for the work

results matching ""

    No results matching ""