Skip to content

Data Structure

AlexVialaBellander edited this page Nov 20, 2020 · 8 revisions

The data structure

The idea is to have the system behave like a tree where we have nodes and paths

Objects

Product

_id: ObjectID
type: product
type_description: STRING
impact: { 
    co2: FLOAT
    measurement_error: FLOAT
    energy_sources: [STRING]
    }
prod_name: STRING
prod_id: STRING
weight: FLOAT
benchmarks: {
        Date: {
            ObjectID product: ObjectID transport
        }
    }
}

Keys and Values

_id - Globally unique ID for MongoDB
type - product or transport
type_description - description of what type of product. Is this a refinement of oil? Is it an assembly of a bed?
impact.co2 - kg of co2 emission when this specific part of the chain was processed
impact.measurement_error - percentage of how accurate the co2 data is
impact.energy_sources - an array of all the used energy sources used during this step
prod_name - Humanly readable name of the product
prod_id - unique id for this product from a specific company
weight - weight in kg for this product
benchmarks - all dependencies of this product, and how they were transported to this part of the chain.

Transport

{
_id: ObjectID
type: transport
type_description: STRING (plane, boat, voi, etc.)
impact: {
   co2: FLOAT (self co2)
   measurement_error: FLOAT (%)
   distance_travelled: FLOAT (in km)
   energy_sources: [STRING] (biofuel, electricity...)
   }
max_weight: NUMBER (kg)
}

Keys and Values

_id - Globally unique ID for MongoDB
type - product or transport
type_description - description of what type of product. Is this a refinement of oil? Is it an assembly of a bed?
impact.co2 - kg of co2 emission when this specific part of the chain was processed
impact.measurement_error - percentage of how accurate the co2 data is