BONSAMURAIS / schema

Relational database schemas for BONSAI
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Add correspondence table(s) #17

Open cmutel opened 4 years ago

cmutel commented 4 years ago

Bonsai policy is to store data on its "native" scale, which means we need correspondence from one set to another. Traditionally, we would have 1 to 1 and 1 to N, but maybe it also makes sense to have approximate 1 to 1 matches, and to distinguish 1 to 1 that is official versus matches made by Bonsai team members.

@mfastudillo You know this as well as anyone, want to suggest something? We would need a table name and the names and data types of the columns, plus values to be added whenever we want to limit choices to a select few (enumerated types).

mfastudillo commented 4 years ago

sorry, I am a bit lost and I may be completely missing the point.

So for example, if we put the wri global power plant database on our relational bonsai database we will have among others a table of activities. To pick an example, one of the activities will be "electricity generation" coming from a plant whose "primary_fuel" is Gas... then we'll need a correspondence table claryfing that what they call Gas in the Bonsai ontology is xxx (as far as I know we have not adopted an otology of power plants yet) ?

cmutel commented 4 years ago

No, you have the point exactly.

Our policy is to store raw data on its native scale (decided at 2019 hackathon). To be useful, that data musts be aligned with a common core nomenclature (i.e. naming system, not ontology; that is things like products versus agents versus activities). We don't have a fixed common core nomenclature but something like HS tariff product codes, ISIC industry code, ISO country/region codes seems reasonable.

The correspondence table would be something like:

Source name Dest name Relationship
Electricity (gas) Electricity, from gas exact
Electricity (gas) Electricity narrower

This issues is about how we structure this table - column names, number of columns, what terms to use, etc.