AmpersandTarski / Ampersand

Build database applications faster than anyone else, and keep your data pollution free as a bonus.
http://ampersandtarski.github.io/
GNU General Public License v3.0
40 stars 8 forks source link

Automatic creation of missing relations when using spreadsheets #1287

Open hanjoosten opened 2 years ago

hanjoosten commented 2 years ago

Ampersand can compile a .xlsx-file as though it were a context by itself. This is useful to include a batch of data (population) into an Ampersand-script. There are at least two use-cases for this:

  1. Analyse an existing spreadsheet for redesigning a spreadsheet-based administration into a database-based administration. The typical use will be based on the ampersand data-analysis command, to generate a metamodel.
  2. Get the initial population into a prototype, which is pre-loaded when the prototype is deployed. The typical use will be based on the ampersand prototype command, to generate a prototype

In case of the data-analysis, a user will expect the metamodel to be compilable. So the relation names and relation types in the spreadsheets are represented in the metamodel. However, in the second use case, it is undesirable to generate relations because it prevents useful error messages to be generated during the development of the prototype. It seems more practical to include only the population of the spreadsheet and give error messages when the relations in the spreadsheet are not declared in the code of the prototype.

So we want a switch that causes .xlsx-files to be treated either as a complete context (i.e. including the relations) or as population only. Its default should be "with relations" in case of the ampersand data-analysis command, and "without relations" in case of the ampersand proto command.