Skip to content

Latest commit

 

History

History
675 lines (617 loc) · 22.5 KB

File metadata and controls

675 lines (617 loc) · 22.5 KB

Smart Data Models

Entity: CarbonFootprint

Open License

document generated automatically

Global description: Data model to represent the carbon footprint in CO2 equivalents.

version: 0.0.1

List of properties

[*] If there is not a type in an attribute is because it could have several types or different formats/patterns

Required properties

  • id
  • type

Data Model description of properties

Sorted alphabetically (click for details)

full yaml details
CarbonFootprint:    
  description: Data model to represent the carbon footprint in CO2 equivalents.    
  properties:    
    CO2eq:    
      description: Amount of emissions in tons of CO2 equivalent    
      minimum: 0    
      type: number    
      x-ngsi:    
        model: https://schema.org/Number    
        type: Property    
    address:    
      description: The mailing address    
      properties:    
        addressCountry:    
          description: The country. For example, Spain    
          type: string    
          x-ngsi:    
            model: https://schema.org/addressCountry    
            type: Property    
        addressLocality:    
          description: The locality in which the street address is, and which is in the region    
          type: string    
          x-ngsi:    
            model: https://schema.org/addressLocality    
            type: Property    
        addressRegion:    
          description: The region in which the locality is, and which is in the country    
          type: string    
          x-ngsi:    
            model: https://schema.org/addressRegion    
            type: Property    
        district:    
          description: A district is a type of administrative division that, in some countries, is managed by the local government    
          type: string    
          x-ngsi:    
            type: Property    
        postOfficeBoxNumber:    
          description: The post office box number for PO box addresses. For example, 03578    
          type: string    
          x-ngsi:    
            model: https://schema.org/postOfficeBoxNumber    
            type: Property    
        postalCode:    
          description: The postal code. For example, 24004    
          type: string    
          x-ngsi:    
            model: https://schema.org/https://schema.org/postalCode    
            type: Property    
        streetAddress:    
          description: The street address    
          type: string    
          x-ngsi:    
            model: https://schema.org/streetAddress    
            type: Property    
        streetNr:    
          description: Number identifying a specific property on a public street    
          type: string    
          x-ngsi:    
            type: Property    
      type: object    
      x-ngsi:    
        model: https://schema.org/address    
        type: Property    
    alternateName:    
      description: An alternative name for this item    
      type: string    
      x-ngsi:    
        type: Property    
    areaServed:    
      description: The geographic area where a service or offered item is provided    
      type: string    
      x-ngsi:    
        model: https://schema.org/Text    
        type: Property    
    dataProvider:    
      description: A sequence of characters identifying the provider of the harmonised data entity    
      type: string    
      x-ngsi:    
        type: Property    
    dateCreated:    
      description: Entity creation timestamp. This will usually be allocated by the storage platform    
      format: date-time    
      type: string    
      x-ngsi:    
        type: Property    
    dateModified:    
      description: Timestamp of the last modification of the entity. This will usually be allocated by the storage platform    
      format: date-time    
      type: string    
      x-ngsi:    
        type: Property    
    description:    
      description: A description of this item    
      type: string    
      x-ngsi:    
        type: Property    
    emissionDate:    
      description: Date and time of the measurement    
      format: date-time    
      type: string    
      x-ngsi:    
        model: https://schema.org/Text    
        type: Property    
    emissionSource:    
      description: Source of emissions (e.g., Transport, Energy, Industry)    
      type: string    
      x-ngsi:    
        type: Property    
    id:    
      anyOf:    
        - description: Identifier format of any NGSI entity    
          maxLength: 256    
          minLength: 1    
          pattern: ^[\w\-\.\{\}\$\+\*\[\]`|~^@!,:\\]+$    
          type: string    
          x-ngsi:    
            type: Property    
        - description: Identifier format of any NGSI entity    
          format: uri    
          type: string    
          x-ngsi:    
            type: Property    
      description: Unique identifier of the entity    
      x-ngsi:    
        type: Relationship    
    location:    
      description: Geojson reference to the item. It can be Point, LineString, Polygon, MultiPoint, MultiLineString or MultiPolygon    
      oneOf:    
        - description: Geojson reference to the item. Point    
          properties:    
            bbox:    
              description: BBox of the  Point    
              items:    
                type: number    
              minItems: 4    
              type: array    
              x-ngsi:    
                type: Property    
            coordinates:    
              description: Coordinates of the Point    
              items:    
                type: number    
              minItems: 2    
              type: array    
              x-ngsi:    
                type: Property    
            type:    
              enum:    
                - Point    
              type: string    
          required:    
            - type    
            - coordinates    
          title: GeoJSON Point    
          type: object    
          x-ngsi:    
            type: GeoProperty    
        - description: Geojson reference to the item. LineString    
          properties:    
            bbox:    
              description: BBox coordinates of the LineString    
              items:    
                type: number    
              minItems: 4    
              type: array    
              x-ngsi:    
                type: Property    
            coordinates:    
              description: Coordinates of the LineString    
              items:    
                items:    
                  type: number    
                minItems: 2    
                type: array    
              minItems: 2    
              type: array    
              x-ngsi:    
                type: Property    
            type:    
              enum:    
                - LineString    
              type: string    
          required:    
            - type    
            - coordinates    
          title: GeoJSON LineString    
          type: object    
          x-ngsi:    
            type: GeoProperty    
        - description: Geojson reference to the item. Polygon    
          properties:    
            bbox:    
              description: BBox coordinates of the Polygon    
              items:    
                type: number    
              minItems: 4    
              type: array    
              x-ngsi:    
                type: Property    
            coordinates:    
              description: Coordinates of the Polygon    
              items:    
                items:    
                  items:    
                    type: number    
                  minItems: 2    
                  type: array    
                minItems: 4    
                type: array    
              type: array    
              x-ngsi:    
                type: Property    
            type:    
              enum:    
                - Polygon    
              type: string    
          required:    
            - type    
            - coordinates    
          title: GeoJSON Polygon    
          type: object    
          x-ngsi:    
            type: GeoProperty    
        - description: Geojson reference to the item. MultiPoint    
          properties:    
            bbox:    
              description: BBox coordinates of the LineString    
              items:    
                type: number    
              minItems: 4    
              type: array    
              x-ngsi:    
                type: Property    
            coordinates:    
              description: Coordinates of the MulitPoint    
              items:    
                items:    
                  type: number    
                minItems: 2    
                type: array    
              type: array    
              x-ngsi:    
                type: Property    
            type:    
              enum:    
                - MultiPoint    
              type: string    
          required:    
            - type    
            - coordinates    
          title: GeoJSON MultiPoint    
          type: object    
          x-ngsi:    
            type: GeoProperty    
        - description: Geojson reference to the item. MultiLineString    
          properties:    
            bbox:    
              description: BBox coordinates of the LineString    
              items:    
                type: number    
              minItems: 4    
              type: array    
              x-ngsi:    
                type: Property    
            coordinates:    
              description: Coordinates of the MultiLineString    
              items:    
                items:    
                  items:    
                    type: number    
                  minItems: 2    
                  type: array    
                minItems: 2    
                type: array    
              type: array    
              x-ngsi:    
                type: Property    
            type:    
              enum:    
                - MultiLineString    
              type: string    
          required:    
            - type    
            - coordinates    
          title: GeoJSON MultiLineString    
          type: object    
          x-ngsi:    
            type: GeoProperty    
        - description: Geojson reference to the item. MultiLineString    
          properties:    
            bbox:    
              items:    
                type: number    
              minItems: 4    
              type: array    
            coordinates:    
              description: Coordinates of the MultiPolygon    
              items:    
                items:    
                  items:    
                    items:    
                      type: number    
                    minItems: 2    
                    type: array    
                  minItems: 4    
                  type: array    
                type: array    
              type: array    
              x-ngsi:    
                type: Property    
            type:    
              enum:    
                - MultiPolygon    
              type: string    
          required:    
            - type    
            - coordinates    
          title: GeoJSON MultiPolygon    
          type: object    
          x-ngsi:    
            type: GeoProperty    
      x-ngsi:    
        type: GeoProperty    
    name:    
      description: The name of this item    
      type: string    
      x-ngsi:    
        type: Property    
    owner:    
      description: A List containing a JSON encoded sequence of characters referencing the unique Ids of the owner(s)    
      items:    
        anyOf:    
          - description: Identifier format of any NGSI entity    
            maxLength: 256    
            minLength: 1    
            pattern: ^[\w\-\.\{\}\$\+\*\[\]`|~^@!,:\\]+$    
            type: string    
            x-ngsi:    
              type: Property    
          - description: Identifier format of any NGSI entity    
            format: uri    
            type: string    
            x-ngsi:    
              type: Property    
        description: Unique identifier of the entity    
        x-ngsi:    
          type: Relationship    
      type: array    
      x-ngsi:    
        type: Property    
    relatedSource:    
      description: Reference to the data source or related entity    
      format: uri    
      type: string    
      x-ngsi:    
        type: Relationship    
    seeAlso:    
      description: list of uri pointing to additional resources about the item    
      oneOf:    
        - items:    
            format: uri    
            type: string    
          minItems: 1    
          type: array    
        - format: uri    
          type: string    
      x-ngsi:    
        type: Property    
    source:    
      description: A sequence of characters giving the original source of the entity data as a URL. Recommended to be the fully qualified domain name of the source provider, or the URL to the source object    
      type: string    
      x-ngsi:    
        type: Property    
    tags:    
      description: Tags associated with the carbon footprint calculation.    
      items:    
        description: Tag name    
        type: string    
        x-ngsi:    
          type: Property    
      type: array    
      x-ngsi:    
        type: Property    
    type:    
      description: NGSI Entity type. It must be 'CarbonFootprint'    
      type: string    
      x-ngsi:    
        type: Property    
  required:    
    - id    
    - type    
  type: object    
  x-derived-from: ''    
  x-disclaimer: Redistribution and use in source and binary forms, with or without modification, are permitted  provided that the license conditions are met. Copyleft (c) 2025 Contributors to Smart Data Models Program    
  x-license-url: https://github.com/smart-data-models/dataModel.Environment/blob/master/CarbonFootprint/LICENSE.md    
  x-model-schema: https://smart-data-models.github.io/Environment/CarbonFootprint/schema.json    
  x-model-tags: Carbon, Emissions, CO2eq    
  x-version: 0.0.1    

Example payloads

CarbonFootprint NGSI-v2 key-values Example

Here is an example of a CarbonFootprint in JSON-LD format as key-values. This is compatible with NGSI-v2 when using options=keyValues and returns the context data of an individual entity.

show/hide example
{  
  "id": "urn:ngsi-ld:CarbonFootprint:001",  
  "type": "CarbonFootprint",  
  "emissionSource": "Transport",  
  "CO2eq": 25.5,  
  "emissionDate": "2025-05-12T10:00:00Z",  
  "location": {  
    "type": "Point",  
    "coordinates": [ -3.70379, 40.41678 ]  
  },  
  "relatedSource": "urn:ngsi-ld:Source:001",  
  "description": "Annual emissions from a vehicle fleet.",  
  "tags": ["transport", "CO2", "annual"]  
}  

CarbonFootprint NGSI-v2 normalized Example

Here is an example of a CarbonFootprint in JSON-LD format as normalized. This is compatible with NGSI-v2 when not using options and returns the context data of an individual entity.

show/hide example
{  
  "id": "CarbonFootprint:TransportFleet",  
  "type": "CarbonFootprint",  
  "emissionSource": {  
    "type": "Text",  
    "value": "Transport"  
  },  
  "CO2eq": {  
    "type": "Number",  
    "value": 25.5  
  },  
  "emissionDate": {  
    "type": "DateTime",  
    "value": "2025-05-12T10:00:00Z"  
  },  
  "location": {  
    "type": "geo:json",  
    "value": {  
      "type": "Point",  
      "coordinates": [-3.70379, 40.41678]  
    }  
  },  
  "relatedSource": {  
    "type": "URI",  
    "value": "urn:ngsi-ld:Source:001"  
  },  
  "description": {  
    "type": "Text",  
    "value": "Annual emissions from a vehicle fleet."  
  },  
  "tags": {  
    "type": "array",  
    "value": [  
      "transport",  
      "CO2",  
      "annual"  
    ]  
  }  
}  

CarbonFootprint NGSI-LD key-values Example

Here is an example of a CarbonFootprint in JSON-LD format as key-values. This is compatible with NGSI-LD when using options=keyValues and returns the context data of an individual entity.

show/hide example
{  
  "id": "urn:ngsi-ld:CarbonFootprint:001",  
  "type": "CarbonFootprint",  
  "emissionSource": "Transport",  
  "CO2eq": 25.5,  
  "emissionDate": "2025-05-12T10:00:00Z",  
  "location": {  
    "type": "Point",  
    "coordinates": [  
      -3.70379,  
      40.41678  
    ]  
  },  
  "relatedSource": "urn:ngsi-ld:Source:001",  
  "description": "Annual emissions from a vehicle fleet.",  
  "tags": [  
    "transport",  
    "CO2",  
    "annual"  
  ],  
    "@context": [  
    "https://smart-data-models.github.io/dataModel.Environment/context.jsonld"  
  ]  
}  

CarbonFootprint NGSI-LD normalized Example

Here is an example of a CarbonFootprint in JSON-LD format as normalized. This is compatible with NGSI-LD when not using options and returns the context data of an individual entity.

show/hide example
{  
  "id": "urn:ngsi-ld:CarbonFootprint:001",  
  "type": "CarbonFootprint",  
  "emissionSource": {  
    "type": "Property",  
    "value": "Transport"  
  },  
  "CO2eq": {  
    "type": "Property",  
    "value": 25.5  
  },  
  "emissionDate": {  
    "type": "Property",  
    "value": {  
      "@type": "date-time",  
      "@value":"2025-05-12T10:00:00Z"  
    }  
  },  
  "location": {  
    "type": "GeoProperty",  
    "value": {  
      "type": "Point",  
      "coordinates": [-3.70379, 40.41678]  
    }  
  },  
  "relatedSource": {  
    "type": "Relationship",  
    "object": "urn:ngsi-ld:Source:001"  
  },  
  "description": {  
    "type": "Property",  
    "value": "Annual emissions from a vehicle fleet."  
  },  
  "tags": {  
    "type": "Property",  
    "value": [  
      "transport",  
      "CO2",  
      "annual"  
    ]  
  },  
  "@context": [  
    "https://smart-data-models.github.io/dataModel.Environment/context.jsonld"  
  ]  
}  

See FAQ 10 to get an answer on how to deal with magnitude units


Smart Data Models +++ Contribution Manual +++ About