diff --git a/examples/book-checkout.yaml b/examples/book-checkout.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4a20ce4ee12a9b549695a9b9f2cd386fda03eaf6 --- /dev/null +++ b/examples/book-checkout.yaml @@ -0,0 +1,57 @@ + +'@context': + - https://git.io/vf-examples-jsonld-context + - library: https://library.example/ + bob: https://bob.example/ + + +'@id': rgh:valueflows/valueflows/master/examples/book-checkout.yaml +'@graph': + + # resource before + - '@id': library:21f361a6-2375-46bb-b192-c21b5ba833bf + '@type': EconomicResource + skos:note: Valueflows cookbook + currentQuantity: + qudt:unit: unit:Number + qudt:numericValue: 1 + + - '@id': library:f47064eb-7120-4b31-b882-770165901fe6 + '@type': Agreement + skos:note: renting Valueflows cookbook to Bob + + - '@id': library:54b814ee-62dc-40c1-bb96-f8582aa4f771 + '@type': EconomicEvent + clauseOf: library:f47064eb-7120-4b31-b882-770165901fe6 + action: decrement + involves: library:21f361a6-2375-46bb-b192-c21b5ba833bf + involvesQuantity: + qudt:unit: unit:Number + qudt:numericValue: 1 + time:inXSDDateTimeStamp: 2019-04-18T8:00:00-5:00 + transfer: + - rights: use + provider: https://library.example/ + receipient: https://bob.example/ + + - '@id': bob:98c2bfeb-9c70-4801-896c-4646b975a7d9 + '@type': Commitment + clauseOf: library:f47064eb-7120-4b31-b882-770165901fe6 + action: increment + involves: library:21f361a6-2375-46bb-b192-c21b5ba833bf + involvesQuantity: + qudt:unit: unit:Number + qudt:numericValue: 1 + before: 2019-05-17T18:00:00-5:00 + transfer: + - rights: use + provider: https://bob.example/ + receipient: https://library.example/ + + # resource after + - '@id': library:21f361a6-2375-46bb-b192-c21b5ba833bf + '@type': EconomicResource + skos:note: Valueflows cookbook + currentQuantity: + qudt:unit: unit:Number + qudt:numericValue: 0 diff --git a/examples/currency-transfer.yaml b/examples/currency-transfer.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d19b24a8c439df8c364ca260566c4d0d751948ac --- /dev/null +++ b/examples/currency-transfer.yaml @@ -0,0 +1,177 @@ + +'@context': + - https://git.io/vf-examples-jsonld-context + - bob: https://bob.example/ + alice: https://alice.example/ + abank: https://abank.example/ + bbank: https://bbank.example/ + notary: https://notary.example/ + +'@id': rgh:valueflows/valueflows/master/examples/currency-transfer.yaml +'@graph': + + # accounts before + + - '@id': abank:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead + '@type': EconomicResource + skos:note: shared account Alice has some credits on + classifiedAs: wd:Q179941 + currentQuantity: + qudt:unit: unit:Number + qudt:numericValue: 200 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 150 + - owner: https://zoe.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 50 + + - '@id': bbank:3be5259d-10f0-431c-9fec-9c0c15a461d3 + '@type': EconomicResource + skos:note: shared account Bob has some credits on + classifiedAs: wd:Q179941 + currentQuantity: + qudt:unit: unit:Number + qudt:numericValue: 500 + share: + - owner: https://bob.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 200 + - owner: https://sam.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 300 + + - '@id': abank:e0caf1e3-4a9b-4927-a19c-3f681d234529 + '@type': Process + skos:note: debit Alice's credits on account + + - '@id': abank:0468e9b9-4d54-4eee-9d3f-bc76db11710a + '@type': EconomicEvent + action: split + inputOf: abank:e0caf1e3-4a9b-4927-a19c-3f681d234529 + resourceInventoriedAs: abank:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead + provider: https://alice.example/ + recipient: https://alice.example/ + actsOnQuantity: + qudt:unit: unit:Number + qudt:numericValue: 100 + + - '@id': abank:58c36336-09fa-4be2-b1ac-d26ea91bd982 + '@type': EconomicEvent + action: merge + outputOf: abank:e0caf1e3-4a9b-4927-a19c-3f681d234529 + resourceInventoriedAs: urn:uuid:9f5181db-7bd2-4ddf-92ff-10f0e8fad844 + provider: https://alice.example/ + recipient: https://alice.example/ + actsOnQuantity: + qudt:unit: unit:Number + qudt:numericValue: 100 + + - '@id': abank:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead + '@type': EconomicResource + skos:note: Alice's account + classifiedAs: wd:Q179941 + currentQuantity: + qudt:unit: unit:Number + qudt:numericValue: 100 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 150 + - owner: https://zoe.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 50 + + - '@id': urn:uuid:9f5181db-7bd2-4ddf-92ff-10f0e8fad844 + '@type': EconomicResource + skos:note: credits in transit + classifiedAs: wd:Q179941 + currentQuantity: + qudt:unit: unit:Number + qudt:numericValue: 100 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 100 + + # actual ownership transfer happens only in this flow + - '@id': notary:da8f3360-3a6d-4ea8-b57f-4d4236fe2c3e + '@type': EconomicEvent + action: own + provider: https://alice.example/ + recipient: https://bob.example/ + resourceInventoriedAs: urn:uuid:9f5181db-7bd2-4ddf-92ff-10f0e8fad844 + actsOnQuantity: + qudt:unit: unit:Number + qudt:numericValue: 100 + + - '@id': urn:uuid:9f5181db-7bd2-4ddf-92ff-10f0e8fad844 + '@type': EconomicResource + skos:note: credits in transit + classifiedAs: wd:Q179941 + currentQuantity: + qudt:unit: unit:Number + qudt:numericValue: 100 + share: + - owner: https://bob.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 100 + + - '@id': bbank:57f01dbe-fd78-40d0-9278-60005debfba6 + '@type': Process + skos:note: credit Bob's account + + - '@id': bbank:33f11508-92b3-4095-9e03-6678cddf7adf + '@type': EconomicEvent + action: split + inputOf: bbank:57f01dbe-fd78-40d0-9278-60005debfba6 + resourceInventoriedAs: urn:uuid:9f5181db-7bd2-4ddf-92ff-10f0e8fad844 + provider: https://bob.example/ + recipient: https://bob.example/ + actsOnQuantity: + qudt:unit: unit:Number + qudt:numericValue: 100 + + - '@id': bbank:33f11508-92b3-4095-9e03-6678cddf7adf + '@type': EconomicEvent + action: merge + outputOf: bbank:57f01dbe-fd78-40d0-9278-60005debfba6 + resourceInventoriedAs: bbank:3be5259d-10f0-431c-9fec-9c0c15a461d3 + provider: https://bob.example/ + recipient: https://bob.example/ + actsOnQuantity: + qudt:unit: unit:Number + qudt:numericValue: 100 + + - '@id': bbank:3be5259d-10f0-431c-9fec-9c0c15a461d3 + '@type': EconomicResource + skos:note: Bob's account + classifiedAs: wd:Q179941 + currentQuantity: + qudt:unit: unit:Number + qudt:numericValue: 600 + share: + - owner: https://bob.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 300 + - owner: https://sam.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 300 + + - '@id': urn:uuid:9f5181db-7bd2-4ddf-92ff-10f0e8fad844 + '@type': EconomicResource + skos:note: credits in transit + classifiedAs: wd:Q179941 + currentQuantity: + qudt:numericValue: 0 diff --git a/examples/transfer-inventory.yaml b/examples/transfer-inventory.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f1f0e7499f9222fe71276a501397b718299dde8f --- /dev/null +++ b/examples/transfer-inventory.yaml @@ -0,0 +1,564 @@ +'@context': + - https://git.io/vf-examples-jsonld-context + - alice: https://bob.example/ + bob: https://alice.example/ + carol: https://carol.example/ + dan: https://dan.example/ + +'@graph': + + - '@id': alice:8b6c819c-8b0f-426c-8f34-4ebe65275150 + '@graph': + # initial resource snapshot + - '@id': urn:uuid:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:7d209b4e-8431-4227-9ca0-1bb1b1dab44c + currentPossesion: https://alice.example/ + currentLocation: urn:uuid:26798e9d-9afc-406d-9e29-45beafb6ff96 + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 230 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 230 + + - '@id': alice:d4acd4ce-1b3d-4282-a1c8-ab1f2630ecfb + '@graph': + # alice sells some of her apples at the farmer's market + # first she splits amount of apples + + - '@id': urn:uuid:d27e7a9f-9850-4d11-9a46-1eefb8e6a629 + '@type': Process + + - '@id': urn:uuid:0468e9b9-4d54-4eee-9d3f-bc76db11710a + '@type': EconomicEvent + action: split + provider: https://alice.example/ + inputOf: urn:uuid:d27e7a9f-9850-4d11-9a46-1eefb8e6a629 + resourceInventoriedAs: urn:uuid:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 50 + + - '@id': urn:uuid:267a2f60-92e0-49c8-928b-601e89d5ddf9 + '@type': EconomicEvent + action: merge + receiver: https://alice.example/ + outputOf: urn:uuid:d27e7a9f-9850-4d11-9a46-1eefb8e6a629 + resourceInventoriedAs: urn:uuid:e55414b6-0b4d-42a5-b86c-d85d95979732 + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 50 + + # snapshots after split + - '@id': alice:e207fc96-da76-441f-b3d3-e2c19f397e61 + '@graph': + - '@id': urn:uuid:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:d27e7a9f-9850-4d11-9a46-1eefb8e6a629 + currentPossesion: https://alice.example/ + currentLocation: urn:uuid:26798e9d-9afc-406d-9e29-45beafb6ff96 + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 180 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 180 + + - '@id': alice:025c0e7c-c762-42a0-867e-ffdc48fe7f35 + '@graph': + - '@id': urn:uuid:e55414b6-0b4d-42a5-b86c-d85d95979732 + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:267a2f60-92e0-49c8-928b-601e89d5ddf9 + currentPossesion: https://alice.example/ + currentLocation: urn:uuid:26798e9d-9afc-406d-9e29-45beafb6ff96 + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 50 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 50 + + # then she transfer rights to them, both alice and dan have copy of that event + - '@id': alice:b7063124-5f81-4cd1-87e4-81c7dd055000 + '@graph': + - '@id': urn:uuid:267a2f60-92e0-49c8-928b-601e89d5ddf9 + '@type': EconomicEvent + action: + - own + - possess + provider: https://alice.example/ + receiver: https://dan.example/ + resourceInventoriedAs: urn:uuid:e55414b6-0b4d-42a5-b86c-d85d95979732 + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 50 + + - '@id': dan:926a3d76-3eac-4531-866d-473ba0dc4bfa + '@graph': + - '@id': urn:uuid:267a2f60-92e0-49c8-928b-601e89d5ddf9 + '@type': EconomicEvent + action: + - own + - possess + - load + provider: https://alice.example/ + receiver: https://dan.example/ + resourceInventoriedAs: urn:uuid:e55414b6-0b4d-42a5-b86c-d85d95979732 + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 50 + + - '@id': alice:025c0e7c-c762-42a0-867e-ffdc48fe7f35 + '@graph': + - '@id': urn:uuid:e55414b6-0b4d-42a5-b86c-d85d95979732 + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:267a2f60-92e0-49c8-928b-601e89d5ddf9 + currentPossesion: https://dan.example/ + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 50 + share: + - owner: https://dan.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 50 + + - '@id': dan:b8d98e3c-ef3e-48f4-87be-4f4325cd3c5a + '@graph': + - '@id': urn:uuid:e55414b6-0b4d-42a5-b86c-d85d95979732 + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:267a2f60-92e0-49c8-928b-601e89d5ddf9 + currentPossesion: https://dan.example/ + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 50 + share: + - owner: https://dan.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 50 + + - '@id': alice:9666d95c-3dec-4950-8853-15d26cb220fb + '@graph': + # alice loans a basket of apples to her friend to use in a display for a few days + + - '@id': urn:uuid:ee2331d6-f7de-4440-8006-5d01fee4c8d3 + '@type': Process + + - '@id': urn:uuid:33f11508-92b3-4095-9e03-6678cddf7adf + '@type': EconomicEvent + action: split + provider: https://alice.example/ + inputOf: urn:uuid:ee2331d6-f7de-4440-8006-5d01fee4c8d3 + resourceInventoriedAs: urn:uuid:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 10 + + - '@id': urn:uuid:d5062396-c17f-4880-9cb4-d25e74fe1f63 + '@type': EconomicEvent + action: merge + receiver: https://alice.example/ + outputOf: urn:uuid:ee2331d6-f7de-4440-8006-5d01fee4c8d3 + resourceInventoriedAs: urn:uuid:01595d68-e3d6-40ab-a77d-3a48b64fc5ba + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 10 + + # snapshots after split + - '@id': alice:e6c424a5-73e6-4747-b14a-3e7a7b57aa78 + '@graph': + - '@id': urn:uuid:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:33f11508-92b3-4095-9e03-6678cddf7adf + currentPossesion: https://alice.example/ + currentLocation: urn:uuid:26798e9d-9afc-406d-9e29-45beafb6ff96 + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 170 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 170 + + - '@id': alice:81d6a665-3469-4409-a132-849cb857d16f + '@graph': + - '@id': urn:uuid:01595d68-e3d6-40ab-a77d-3a48b64fc5ba + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:d5062396-c17f-4880-9cb4-d25e74fe1f63 + currentPossesion: https://alice.example/ + currentLocation: urn:uuid:26798e9d-9afc-406d-9e29-45beafb6ff96 + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 10 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 10 + + - '@id': alice:4d75e133-ec88-4a76-9820-ced1163c6060 + '@graph': + - '@id': urn:uuid:e899998e-36ca-4cd6-9c54-655346ac6102 + '@type': EconomicEvent + action: possess + provider: https://alice.example/ + receiver: https://carol.example/ + resourceInventoriedAs: urn:uuid:01595d68-e3d6-40ab-a77d-3a48b64fc5ba + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 10 + + - '@id': carol:08d9e80a-c094-443a-b8db-235e310b1c27 + '@graph': + - '@id': urn:uuid:e899998e-36ca-4cd6-9c54-655346ac6102 + '@type': EconomicEvent + action: possess + provider: https://alice.example/ + receiver: https://carol.example/ + resourceInventoriedAs: urn:uuid:01595d68-e3d6-40ab-a77d-3a48b64fc5ba + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 10 + + - '@id': alice:82415034-dba7-4ca4-82b6-ffdf12618726 + '@graph': + - '@id': urn:uuid:01595d68-e3d6-40ab-a77d-3a48b64fc5ba + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:d5062396-c17f-4880-9cb4-d25e74fe1f63 + currentPossesion: https://carol.example/ + currentLocation: urn:uuid:26798e9d-9afc-406d-9e29-45beafb6ff96 + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 10 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 10 + + - '@id': carol:f4d6660c-32ab-494f-ad05-a455d8991881 + '@graph': + - '@id': urn:uuid:01595d68-e3d6-40ab-a77d-3a48b64fc5ba + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:d5062396-c17f-4880-9cb4-d25e74fe1f63 + currentPossesion: https://carol.example/ + currentLocation: urn:uuid:26798e9d-9afc-406d-9e29-45beafb6ff96 + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 10 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 10 + + - '@id': carol:c44e49b8-dd79-4a55-86e3-670982ad01ca + '@graph': + - '@id': urn:uuid:d5062396-c17f-4880-9cb4-d25e74fe1f63 + '@type': Commitment + action: possess + provider: https://carol.example/ + receiver: https://alice.example/ + resourceInventoriedAs: urn:uuid:01595d68-e3d6-40ab-a77d-3a48b64fc5ba + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 10 + + - '@id': alice:8d4824ba-ba90-418c-9715-27f5077ade0c + '@graph': + - '@id': urn:uuid:d5062396-c17f-4880-9cb4-d25e74fe1f63 + '@type': Commitment + action: possess + provider: https://carol.example/ + receiver: https://alice.example/ + resourceInventoriedAs: urn:uuid:01595d68-e3d6-40ab-a77d-3a48b64fc5ba + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 10 + + # alice sells some apples FOB destination, and has them shipped (they are enroute) + + - '@id': alice:8d4824ba-ba90-418c-9715-27f5077ade0c + '@graph': + - '@id': urn:uuid:155f6552-f865-4b91-b65a-10d55b3918a6 + '@type': Process + + - '@id': urn:uuid:469a7adb-c7c0-44d2-99a2-df4e4eff97a3 + '@type': EconomicEvent + action: split + provider: https://alice.example/ + inputOf: urn:uuid:155f6552-f865-4b91-b65a-10d55b3918a6 + resourceInventoriedAs: urn:uuid:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 100 + + - '@id': urn:uuid:12c25554-1d9f-47e7-9f23-038b8c3b1246 + '@type': EconomicEvent + action: merge + receiver: https://alice.example/ + outputOf: urn:uuid:155f6552-f865-4b91-b65a-10d55b3918a6 + resourceInventoriedAs: urn:uuid:7a3b3eda-bef6-4b15-bcec-8f0b172e4051 + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 100 + + # snapshots after split + - '@id': alice:9aab3e62-ab42-4e32-8b6b-da7ad44b1526 + '@graph': + - '@id': urn:uuid:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:469a7adb-c7c0-44d2-99a2-df4e4eff97a3 + currentPossesion: https://alice.example/ + currentLocation: urn:uuid:26798e9d-9afc-406d-9e29-45beafb6ff96 + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 70 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 70 + + - '@id': alice:1da5bb68-000a-454d-8090-21605a9550d1 + '@graph': + - '@id': urn:uuid:7a3b3eda-bef6-4b15-bcec-8f0b172e4051 + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:12c25554-1d9f-47e7-9f23-038b8c3b1246 + currentPossesion: https://alice.example/ + currentLocation: urn:uuid:26798e9d-9afc-406d-9e29-45beafb6ff96 + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 100 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 100 + + - '@id': alice:995d4227-8a99-4e39-9630-2caa41851e8f + '@graph': + - '@id': urn:uuid:c44e95ed-6caf-47e6-b42d-dbfe3ac68aab + '@type': EconomicEvent + action: + - possess + - load + atLocation: urn:uuid:26798e9d-9afc-406d-9e29-45beafb6ff96 + provider: https://alice.example/ + receiver: https://carol.example/ + resourceInventoriedAs: urn:uuid:7a3b3eda-bef6-4b15-bcec-8f0b172e4051 + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 100 + + - '@id': carol:ab7885d7-c23e-41d3-b193-6c01f41ae058 + '@graph': + - '@id': urn:uuid:c44e95ed-6caf-47e6-b42d-dbfe3ac68aab + '@type': EconomicEvent + action: + - possess + - load + atLocation: urn:uuid:26798e9d-9afc-406d-9e29-45beafb6ff96 + provider: https://alice.example/ + receiver: https://carol.example/ + resourceInventoriedAs: urn:uuid:7a3b3eda-bef6-4b15-bcec-8f0b172e4051 + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 100 + + - '@id': bob:ab7885d7-c23e-41d3-b193-6c01f41ae058 + '@graph': + - '@id': urn:uuid:c44e95ed-6caf-47e6-b42d-dbfe3ac68aab + '@type': EconomicEvent + action: + - possess + - load + atLocation: urn:uuid:26798e9d-9afc-406d-9e29-45beafb6ff96 + provider: https://alice.example/ + receiver: https://carol.example/ + resourceInventoriedAs: urn:uuid:7a3b3eda-bef6-4b15-bcec-8f0b172e4051 + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 100 + + - '@id': alice:45305f9a-4690-45ce-89df-b2b0a85cfcd7 + '@graph': + - '@id': urn:uuid:7a3b3eda-bef6-4b15-bcec-8f0b172e4051 + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:c44e95ed-6caf-47e6-b42d-dbfe3ac68aab + currentPossesion: https://carol.example/ + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 100 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 100 + + - '@id': carol:e500cede-a709-46bd-b654-a3500d253591 + '@graph': + - '@id': urn:uuid:7a3b3eda-bef6-4b15-bcec-8f0b172e4051 + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:c44e95ed-6caf-47e6-b42d-dbfe3ac68aab + currentPossesion: https://carol.example/ + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 100 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 100 + + - '@id': bob:38e45212-a09a-4eb3-89a5-f292fd85342a + '@graph': + - '@id': urn:uuid:7a3b3eda-bef6-4b15-bcec-8f0b172e4051 + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:c44e95ed-6caf-47e6-b42d-dbfe3ac68aab + currentPossesion: https://carol.example/ + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 100 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 100 + + - '@id': alice:e6233180-ec72-404a-a5dd-47f7e09a9870 + '@graph': + - '@id': urn:uuid:70e22de0-307f-4594-a7e3-d040a08a66d9 + '@type': Commitment + action: + - possess + - unload + atLocation: urn:uuid:c1e8e9b6-506c-4e36-aedc-b95d787029a7 + provider: https://carol.example/ + receiver: https://bob.example/ + resourceInventoriedAs: urn:uuid:7a3b3eda-bef6-4b15-bcec-8f0b172e4051 + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 100 + + - '@id': carol:c9985c74-118f-4046-aa40-686709739898 + '@graph': + - '@id': urn:uuid:70e22de0-307f-4594-a7e3-d040a08a66d9 + '@type': Commitment + action: + - possess + - unload + atLocation: urn:uuid:c1e8e9b6-506c-4e36-aedc-b95d787029a7 + provider: https://carol.example/ + receiver: https://bob.example/ + resourceInventoriedAs: urn:uuid:7a3b3eda-bef6-4b15-bcec-8f0b172e4051 + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 100 + + - '@id': bob:b5f193d2-8835-4ae3-82b3-5e2ad8623e60 + '@graph': + - '@id': urn:uuid:70e22de0-307f-4594-a7e3-d040a08a66d9 + '@type': Commitment + action: + - possess + - unload + atLocation: urn:uuid:c1e8e9b6-506c-4e36-aedc-b95d787029a7 + provider: https://carol.example/ + receiver: https://bob.example/ + resourceInventoriedAs: urn:uuid:7a3b3eda-bef6-4b15-bcec-8f0b172e4051 + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 100 + + # alice sells some apples for which she has been pre-paid but not shipped yet + + - '@id': alice:65d1350a-4646-4f08-b496-4ea27e0e81a8 + '@graph': + - '@id': urn:uuid:7fb920ae-bf36-4773-b6a1-c6417c64f9b5 + '@type': EconomicEvent + action: own + provider: https://alice.example/ + receiver: https://bob.example/ + resourceInventoriedAs: urn:uuid:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 40 + + - '@id': bob:f86b92a8-d5e1-41f1-8d1f-bfe350c73473 + '@graph': + - '@id': urn:uuid:7fb920ae-bf36-4773-b6a1-c6417c64f9b5 + '@type': EconomicEvent + action: own + provider: https://alice.example/ + receiver: https://bob.example/ + resourceInventoriedAs: urn:uuid:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead + actsOnQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 40 + + # bob owns 40kg of remaining 70 + - '@id': alice:9aab3e62-ab42-4e32-8b6b-da7ad44b1526 + '@graph': + - '@id': urn:uuid:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:7fb920ae-bf36-4773-b6a1-c6417c64f9b5 + currentPossesion: https://alice.example/ + currentLocation: urn:uuid:26798e9d-9afc-406d-9e29-45beafb6ff96 + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 70 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 30 + - owner: https://bob.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 40 + + - '@id': bob:799c11b2-68be-454f-9f60-a334aadd5eb4 + '@graph': + - '@id': urn:uuid:b75d8f6a-e2df-4e52-b36d-1a22a66f4ead + '@type': EconomicResource + classifiedAs: wd:Q89 # apples + lastEvent: urn:uuid:7fb920ae-bf36-4773-b6a1-c6417c64f9b5 + currentPossesion: https://alice.example/ + currentLocation: urn:uuid:26798e9d-9afc-406d-9e29-45beafb6ff96 + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 70 + share: + - owner: https://alice.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 30 + - owner: https://bob.example/ + quantity: + qudt:unit: unit:Number + qudt:numericValue: 40 diff --git a/examples/transfer-simple.yaml b/examples/transfer-simple.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ca8ac47064b5a1bb9f9cbd93f3204236a890f3ba --- /dev/null +++ b/examples/transfer-simple.yaml @@ -0,0 +1,68 @@ +# Simple transfer + +'@context': + - https://git.io/vf-examples-jsonld-context + - bob: https://bob.example/ + alice: https://alice.example/ + +'@graph': + + # initial resources + + - '@id': alice:c7897c39-7f05-4a5d-a487-80e130a24345 + '@type': EconomicResource + classifiedAs: http://www.wikidata.org/entity/Q89 # apples + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 670 + + - '@id': bob:0f563083-7f05-4a5d-a487-80e130a24345 + '@type': EconomicResource + classifiedAs: http://www.wikidata.org/entity/Q89 # apples + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 0 + + + # Alice gives Bob 200 kg apples. + + - '@id': alice:e7482f32-25b5-4f79-934b-5d0db3a5b77d + '@type': Process + + - '@id': alice:6fb358a3-2859-4d6a-a4fa-431603ee70f5 + '@type': EconomicEvent + inputOf: alice:e7482f32-25b5-4f79-934b-5d0db3a5b77d + action: decrement + involves: alice:c7897c39-7f05-4a5d-a487-80e130a24345 + involvesQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 200 + + - '@id': bob:73410782-74da-4165-ad2b-b92fdf55f795 + '@type': EconomicEvent + outputOf: alice:e7482f32-25b5-4f79-934b-5d0db3a5b77d + action: increment + involves: bob:0f563083-7f05-4a5d-a487-80e130a24345 + involvedQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 200 + transfer: + - rights: control + provider: https://alice.example/ + receipient: https://bob.example/ + + # - resources after transfers + + - '@id': alice:c7897c39-7f05-4a5d-a487-80e130a24345 + '@type': EconomicResource + classifiedAs: http://www.wikidata.org/entity/Q89 # apples + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 470 + + - '@id': bob:0f563083-7f05-4a5d-a487-80e130a24345 + '@type': EconomicResource + classifiedAs: http://www.wikidata.org/entity/Q89 # apples + currentQuantity: + qudt:unit: unit:Kilogram + qudt:numericValue: 200