Skip to content

Commit

Permalink
Merge pull request #945 from w3c-ccg/environmentFootprint
Browse files Browse the repository at this point in the history
environment footprint
  • Loading branch information
mkhraisha authored Apr 18, 2024
2 parents a212b90 + d44d2e9 commit 92b8cbf
Show file tree
Hide file tree
Showing 2 changed files with 157 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
$linkedData:
term: environmentalImpactCredential
'@id': https://w3id.org/traceability#environmentalImpactCredential
title: environmentalImpactCredential
tags:
- Oil and Gas
description: A credential that represents the environmental impact of a product or event.
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
- environmentalImpactCredential
default:
- VerifiableCredential
- environmentalImpactCredential
items:
type: string
enum:
- VerifiableCredential
- environmentalImpactCredential
id:
type: string
format: uri
issuanceDate:
type: string
format: date-time
expirationDate:
type: string
format: date-time
issuer:
$ref: ../common/Organization.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/environmentalImpactCredential.yml
default: https://w3id.org/traceability/openapi/components/schemas/credentials/environmentalImpactCredential.yml
readOnly: true
type:
title: Type
description: The type of validation to be run against the defined schema
const: OpenApiSpecificationValidator2022
credentialSubject:
title: Environment Footprint
description: Environmental impact of a product or event.
type: object
properties:
impactTimeStart:
type: string
format: date-time
title: Impact Start time
description: the time when the activity impacting the environment started
impactTimeEnd:
type: string
format: date-time
title: Impact End Time
description: the time when the activity impacting the environment ended
pollutants:
title: Pollutants
description: a list of pollutants that we are tracking the environmental impact of, this is a small non-exhaustive list that we intend to expand.
type: object
properties:
type:
type: array
readOnly: true
const:
- Pollutants
default:
- Pollutants
items:
type: string
enum:
- Pollutants
CO2:
title: CO2
description: amount of carbon dioxide released into the atmosphere, measured in kilograms
CH4:
title: CH4
description: amount of methane released into the atmosphere, measured in kilograms
NO2:
title: NO2
description: amount of nitrogen dioxide released into the atmosphere, measured in kilograms
CO2equivalent:
title: CO2 Equivalent
description: a calculated total of the CO2 equivalent of all the pollutants, measured in KG
type: string
proof:
$ref: ../snippets/proof.yml
additionalProperties: false
required:
- '@context'
- type
- issuanceDate
- issuer
- credentialSubject
example: |-
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/traceability/v1"
],
"id": "http://example.com/dd0c6f9a-5df6-40a3-bb34-863cd1fda606",
"type": [
"VerifiableCredential",
"environmentalImpactCredential"
],
"issuer": {
"type": [
"Organization"
],
"id": "did:key:z6MktHQo3fRRohk44dsbE76CuiTpBmyMWq2VVjvV6aBSeE3U"
},
"issuanceDate": "2022-11-01T10:58:45-04:00",
"credentialSubject": {
"impactTimeStart": "2024-03-10T10:58:45-04:00",
"impactTimeEnd": "2024-03-19T10:58:45-04:00",
"pollutants": {
"CO2": "870",
"CH4": "320",
"NO2": "0"
},
"CO2e": "1190"
}
}
12 changes: 12 additions & 0 deletions docs/openapi/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2360,6 +2360,18 @@ paths:
$ref: './components/schemas/credentials/EntryNumberCredential.yml'


/schemas/credentials/EnvironmentFootprintCredential.yml:
get:
tags:
- credentials
responses:
'200':
content:
application/yml:
schema:
$ref: './components/schemas/credentials/EnvironmentFootprintCredential.yml'


/schemas/credentials/EventCredential.yml:
get:
tags:
Expand Down

0 comments on commit 92b8cbf

Please sign in to comment.