From 5d7324e05ef67e250fca0b0ccd187b6402320960 Mon Sep 17 00:00:00 2001 From: Brent Zundel Date: Fri, 13 Sep 2024 15:06:18 -0600 Subject: [PATCH] Add Agriculture Activiy Credential Signed-off-by: Brent Zundel --- ...edentials-with-issuer-dependent-terms.json | 4 + .../AgricultureActivityCredential.yml | 280 ++++++++++++++++++ 2 files changed, 284 insertions(+) create mode 100644 docs/openapi/components/schemas/credentials/AgricultureActivityCredential.yml diff --git a/docs/credentials-with-issuer-dependent-terms.json b/docs/credentials-with-issuer-dependent-terms.json index 6f27b4815..e8086c55e 100644 --- a/docs/credentials-with-issuer-dependent-terms.json +++ b/docs/credentials-with-issuer-dependent-terms.json @@ -299,6 +299,10 @@ "type": "AgricultureCanineCard", "count": 20 }, + { + "type": "AgricultureActivityCredential", + "count": 0 + }, { "type": "ActivityPubActorCard", "count": 0 diff --git a/docs/openapi/components/schemas/credentials/AgricultureActivityCredential.yml b/docs/openapi/components/schemas/credentials/AgricultureActivityCredential.yml new file mode 100644 index 000000000..e82e710b3 --- /dev/null +++ b/docs/openapi/components/schemas/credentials/AgricultureActivityCredential.yml @@ -0,0 +1,280 @@ +$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": "Elaina.Wiza@example.org", + "phoneNumber": "+1-980-555-6819" + }, + "actor": [ + { + "type": [ + "Person" + ], + "firstName": "Karson", + "lastName": "Mante", + "email": "Alexandrea_Wisozk44@example.org", + "phoneNumber": "+1-688-555-6847", + "worksFor": { + "type": [ + "Organization" + ], + "name": "Jimbo's Awesome Farm", + "description": "Organic fruits & vegetables", + "email": "Chloe.Ondricka42@jimbofarm.example.org", + "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": "Jeremie_Bauch@example.org", + "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": "Sven22@example.org", + "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" + } + } + ] + } + ] + } + }