DFC Data Sharing Module Frontend - First release
What is the problem we are solving
Any project using data needs to have consent from the owner of the data before using it. Short food chains platforms wishing to interoperate need an easy way to share their data on a DFC format, with consent from their users.
Goal
The DFC Data Sharing interface is the place where producers and other authorized users would initiate the sharing of specific datasets with another OIDC user (that may represent a group, or platform, such as a TAP (Technical Assistance Providers) organization, certification body, government agency, or digital farm tool). In this interaction, it is important to clearly and completely illustrate the terms of sharing with the party in question so that the producer can make an informed decision.
We want to provide to short food chain platforms a module to handle this interaction easily. The module should be able to be embedded in current platforms UI.
Scope of first release
Based on OpenTEAM AgDW UX/UI output here + feedback from previous Open Food Network & CoopCircuits' projects.
- Users from platforms can choose to share their data with another party (we only push from platforms to 3rd party service, not the other way around).
- Only 1 service will be handled to start with
- Only one language will be supported per use
The potential connection should specify:
- The terms of sharing with that party, including whether sharing can later be revoked, and shared data deleted
- Individuals and/or organizations that will have access to the data
- What recipients will do with the data
- Data management practices / certifications
- How the producer will benefit
Stretch functionality (TBC if we can add it in first release)
Ability to grant access to groups (e.g. all Persons within an Enterprise) in a single request. This is needed for platforms specialized in procurement
Technical requirements
- Separate keycloack server OR SiB backend for the directory has an OIDC auth (TBC)
- Internationalization (although we only display one language, the module should be available in different languages)
- Mobile first
Dataset
Predominantly plan to manage this with OIDC AUth headers (Scopes & Roles), the WebID will link to a dfc-b:Agent that will provide details of the Person or Enterprise linked to the email of the OIDC account (and can therefore provide additional details for the Enterprise).
- Scope(s) & Role(s) requested (parsed from auth header & TBC - looked up against OIDC service).
- Application needs to display meaningful descriptions that relate to the scope/role requested: e.g. Scope Product, Role: Editor should be translated to "This user wishes to access and update your Product data"
Main use case we want to use the data for: As a producer I can share my profile on a directory
- Enterprise Name (through webid)
- Enterprise Location / address
- Enterprise certifications
- Shipping : delivery options (this is not included in DFC yet)
- Social media
- Website
- Images / logo
- Contact infos
To be confirmed:
- Payment option / method
Enterprise DFC endpoint
The OFN Enterprise endpoint follows (& extends slighly) the DFC format.
API documentation can be found here, or see below for an example of the Enterprise format:
{
"@context": "https://www.datafoodconsortium.org",
"@graph": [
{
"@id": "http://test.host/api/dfc/enterprises/10000",
"@type": "dfc-b:Enterprise",
"dfc-b:hasAddress": "http://test.host/api/dfc/addresses/40000",
"dfc-b:hasPhoneNumber": "0404 444 000 200",
"dfc-b:email": "hello@example.org",
"dfc-b:websitePage": "https://openfoodnetwork.org",
"dfc-b:hasSocialMedia": "http://test.host/api/dfc/enterprises/10000/social_medias/facebook",
"dfc-b:logo": "http://test.host/rails/active_storage/url/logo.png",
"dfc-b:name": "Fred's Farm",
"dfc-b:hasDescription": "This is an awesome enterprise",
"dfc-b:VATnumber": "123 456",
"dfc-b:manages": "http://test.host/api/dfc/enterprises/10000/catalog_items/10001",
"dfc-b:supplies": "http://test.host/api/dfc/enterprises/10000/supplied_products/10001",
"dfc-b:hasMainContact": "http://test.host/api/dfc/enterprises/10000#mainContact",
"ofn:long_description": "<p>Hello, world!</p><p>This is a paragraph.</p>",
"ofn:contact_name": "Fred Farmer",
"ofn:logo_url": "http://test.host/rails/active_storage/url/logo.png",
"ofn:promo_image_url": "http://test.host/rails/active_storage/url/promo.png",
"dfc-b:affiliates": "http://test.host/api/dfc/enterprise_groups/60000"
},
{
"@id": "http://test.host/api/dfc/enterprises/10000#mainContact",
"@type": "dfc-b:Person",
"dfc-b:firstName": "Fred",
"dfc-b:familyName": "Farmer"
},
{
"@id": "http://test.host/api/dfc/addresses/40000",
"@type": "dfc-b:Address",
"dfc-b:hasStreet": "42 Doveton Street",
"dfc-b:hasPostalCode": "20170",
"dfc-b:hasCity": "Herndon",
"dfc-b:hasCountry": "Australia",
"dfc-b:region": "Victoria"
},
{
"@id": "http://test.host/api/dfc/enterprises/10000/supplied_products/10001",
"@type": "dfc-b:SuppliedProduct",
"dfc-b:name": "Apple - 1g",
"dfc-b:description": "Round",
"dfc-b:hasQuantity": {
"@type": "dfc-b:QuantitativeValue",
"dfc-b:hasUnit": "dfc-m:Gram",
"dfc-b:value": 1
},
"dfc-b:image": "http://test.host/rails/active_storage/url/logo-white.png",
"dfc-b:isVariantOf": "http://test.host/api/dfc/product_groups/90000",
"ofn:spree_product_id": 90000,
"ofn:spree_product_uri": "http://test.host/api/dfc/enterprises/10000?spree_product_id=90000",
"ofn:image": "http://test.host/rails/active_storage/url/logo-white.png"
},
{
"@id": "http://test.host/api/dfc/enterprises/10000/catalog_items/10001",
"@type": "dfc-b:CatalogItem",
"dfc-b:references": "http://test.host/api/dfc/enterprises/10000/supplied_products/10001",
"dfc-b:sku": "APP",
"dfc-b:stockLimitation": 5,
"dfc-b:offeredThrough": "http://test.host/api/dfc/enterprises/10000/offers/10001"
},
{
"@id": "http://test.host/api/dfc/enterprises/10000/social_medias/facebook",
"@type": "dfc-b:SocialMedia",
"dfc-b:name": "facebook",
"dfc-b:URL": "https://facebook.com/user"
}
]
}
Note: previous portal have failed because users are not updated data at several places. We want this portal to only fetch data, not create specific data. This means the DFC standard will need to be updated to provide the required data model when missing.
Success factors = expected outcome
- Use the module on at least one production instance
- Get 5 producers feedback
- Agree on a roadmap to use the module on all platforms involved with CADP project

