-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #972 from brentzundel/creds-from-schemas
Add Agriculture Credentials for Tech Demo
- Loading branch information
Showing
4 changed files
with
1,081 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
282 changes: 282 additions & 0 deletions
282
docs/openapi/components/schemas/credentials/AgricultureActivityCredential.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,282 @@ | ||
$linkedData: | ||
term: AgricultureActivityCredential | ||
'@id': https://w3id.org/traceability#AgricultureActivityCredential | ||
title: Agriculture Activity Credential | ||
tags: | ||
- Agriculture | ||
description: >- | ||
A credential asserting activities that take place on the farm that need to be | ||
recorded, such as planting, harvesting, applying fertilizer, etc. | ||
type: object | ||
properties: | ||
'@context': | ||
type: array | ||
readOnly: true | ||
const: | ||
- https://www.w3.org/2018/credentials/v1 | ||
- https://w3id.org/traceability/v1 | ||
default: | ||
- https://www.w3.org/2018/credentials/v1 | ||
- https://w3id.org/traceability/v1 | ||
items: | ||
type: string | ||
enum: | ||
- https://www.w3.org/2018/credentials/v1 | ||
- https://w3id.org/traceability/v1 | ||
type: | ||
type: array | ||
readOnly: true | ||
const: | ||
- VerifiableCredential | ||
- AgricultureActivityCredential | ||
default: | ||
- VerifiableCredential | ||
- AgricultureActivityCredential | ||
items: | ||
type: string | ||
enum: | ||
- VerifiableCredential | ||
- AgricultureActivityCredential | ||
id: | ||
type: string | ||
name: | ||
type: string | ||
description: | ||
type: string | ||
issuanceDate: | ||
type: string | ||
format: date-time | ||
expirationDate: | ||
type: string | ||
format: date-time | ||
issuer: | ||
$ref: ../snippets/IssuerOrganization.yml | ||
credentialSchema: | ||
type: object | ||
properties: | ||
id: | ||
title: Id | ||
description: The url of the schema file to validate the shape of the json object | ||
type: string | ||
format: uri | ||
example: https://w3id.org/traceability/openapi/components/schemas/credentials/AgricultureActivityCredential.yml | ||
default: https://w3id.org/traceability/openapi/components/schemas/credentials/AgricultureActivityCredential.yml | ||
readOnly: true | ||
type: | ||
title: Type | ||
description: The type of validation to be run against the defined schema | ||
const: OpenApiSpecificationValidator2022 | ||
credentialSubject: | ||
title: Agriculture Activities array | ||
type: object | ||
properties: | ||
agActivities: | ||
type: array | ||
items: | ||
$ref: ../common/AgricultureActivity.yml | ||
additionalProperties: false | ||
required: | ||
- '@context' | ||
- type | ||
- id | ||
- issuanceDate | ||
- expirationDate | ||
- issuer | ||
- credentialSubject | ||
example: |- | ||
{ | ||
"type": [ | ||
"VerifiableCredential", | ||
"AgricultureActivityCredential" | ||
], | ||
"@context": [ | ||
"https://www.w3.org/2018/credentials/v1", | ||
"https://w3id.org/traceability/v1" | ||
], | ||
"id": "urn:uuid:2385e117-8011-4n15-bcae-64e4e26856c8", | ||
"name": "Agriculture Activies Credential", | ||
"description": "These agriculture activities are hereby recorded", | ||
"issuer": { | ||
"type": [ | ||
"Organization" | ||
], | ||
"id": "did:web:organization.example.com", | ||
"name": "Binky's Farm" | ||
}, | ||
"issuanceDate": "2022-01-13T09:16:46Z", | ||
"expirationDate": "2122-01-13T09:16:46Z", | ||
"credentialSubject": { | ||
"agActivities": [ | ||
{ | ||
"type": [ | ||
"AgricultureActivity" | ||
], | ||
"farm": { | ||
"type": [ | ||
"Person" | ||
], | ||
"email": "[email protected]", | ||
"phoneNumber": "+1-980-555-6819" | ||
}, | ||
"actor": [ | ||
{ | ||
"type": [ | ||
"Person" | ||
], | ||
"firstName": "Karson", | ||
"lastName": "Mante", | ||
"email": "[email protected]", | ||
"phoneNumber": "+1-688-555-6847", | ||
"worksFor": { | ||
"type": [ | ||
"Organization" | ||
], | ||
"name": "Jimbo's Awesome Farm", | ||
"description": "Organic fruits & vegetables", | ||
"email": "[email protected]", | ||
"phoneNumber": "+1-155-555-9176", | ||
"faxNumber": "+1-701-555-0319" | ||
}, | ||
"jobTitle": "Chief Markets Agent" | ||
} | ||
], | ||
"field": { | ||
"type": [ | ||
"Place" | ||
], | ||
"globalLocationNumber": "9339929638102", | ||
"geo": { | ||
"type": [ | ||
"GeoCoordinates" | ||
], | ||
"latitude": "40.9090", | ||
"longitude": "151.8748" | ||
}, | ||
"unLocode": "DKCPH" | ||
}, | ||
"activityDate": "2020-02-15", | ||
"activityType": "spray", | ||
"agricultureProduct": [ | ||
{ | ||
"type": [ | ||
"AgricultureProduct" | ||
], | ||
"plu": "94225", | ||
"unitQuantity": { | ||
"type": [ | ||
"QuantitativeValue" | ||
], | ||
"unitCode": "boxes", | ||
"value": "893" | ||
}, | ||
"product": { | ||
"type": [ | ||
"Product" | ||
], | ||
"manufacturer": { | ||
"type": [ | ||
"Organization" | ||
], | ||
"email": "[email protected]", | ||
"phoneNumber": "+1-540-555-5299" | ||
}, | ||
"name": "Avocados", | ||
"description": "Avocados, 4 pack boxes", | ||
"weight": { | ||
"type": [ | ||
"QuantitativeValue" | ||
], | ||
"unitCode": "lbs", | ||
"value": "1784" | ||
}, | ||
"sku": "563279941950" | ||
}, | ||
"scientificName": "Persea americana", | ||
"labelImageUrl": "https://img.example.org/033383401508/640/480/", | ||
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" | ||
}, | ||
{ | ||
"type": [ | ||
"AgricultureProduct" | ||
], | ||
"plu": "94225", | ||
"product": { | ||
"type": [ | ||
"Product" | ||
], | ||
"manufacturer": { | ||
"type": [ | ||
"Organization" | ||
], | ||
"email": "[email protected]", | ||
"phoneNumber": "+1-516-555-4400" | ||
}, | ||
"name": "Tomatoes", | ||
"description": "Tomatoes, Cartons", | ||
"weight": { | ||
"type": [ | ||
"QuantitativeValue" | ||
], | ||
"unitCode": "lbs", | ||
"value": "640" | ||
}, | ||
"sku": "164664203943" | ||
}, | ||
"unitQuantity": { | ||
"type": [ | ||
"QuantitativeValue" | ||
], | ||
"unitCode": "cartons", | ||
"value": "348" | ||
}, | ||
"scientificName": "Solanum lycopersicum", | ||
"labelImageUrl": "https://img.example.org/033383401508/640/480/", | ||
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" | ||
} | ||
], | ||
"observation": [ | ||
{ | ||
"type": [ | ||
"Observation" | ||
], | ||
"date": "2019-12-11T03:50:55Z", | ||
"property": { | ||
"type": [ | ||
"MechanicalProperty" | ||
], | ||
"identifier": "ISO 3738", | ||
"name": "Rockwell Hardness Test (Scale A)", | ||
"description": "The Rockwell hardness test is an empirical indentation hardness test that can provide useful information about metallic materials." | ||
}, | ||
"measurement": { | ||
"type": [ | ||
"MeasuredValue" | ||
], | ||
"value": "00.00", | ||
"unitCode": "UNKNOWN" | ||
} | ||
}, | ||
{ | ||
"type": [ | ||
"Observation" | ||
], | ||
"date": "2019-12-11T03:50:55Z", | ||
"property": { | ||
"type": [ | ||
"ChemicalProperty" | ||
], | ||
"name": "Technetium" | ||
}, | ||
"measurement": { | ||
"type": [ | ||
"MeasuredValue" | ||
], | ||
"value": "100.00", | ||
"unitCode": "P1" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.