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

Generating prototypes from Atlas population #1469

Open stefjoosten opened 4 months ago

stefjoosten commented 4 months ago

Is your feature request related to a problem? Please describe. Simon's research is about using the Atlas as an editor, so users can edit scripts without knowing the Ampersand syntax. For this purpose, we need to generate functional specs and prototypes from a population in the MySQL database. This issue is meant to discuss that topic.

Describe the solution you'd like A lot of the software is already present. Here is a picture: afbeelding Describe alternatives you've considered

Additional context

hanjoosten commented 4 months ago

That shouldn't be too difficult, but it should be something like jSON2Pstruct :: RIO env() -> Guarded P_Context. The hard part probably is to find out what requirements there should be on the input JSON.

stefjoosten commented 4 months ago

To inject the database population into the compiler stream feels much like what we did to inject an xlsx-population into the compiler stream. So there is further inspiration on how to do this.

hanjoosten commented 4 months ago

According to @Michiel-s the json-export from the atlas contains the populations of the concepts/relations of FormalAmpersand. In that case we need to write a "reverse meatgrinder". I guess that this is much easier than a general parser of .json as I suggested above, for the structure of FormalAmpersand is already known.

For @Svroozendaal I suggest to have a look at both the .json file that is exported by the ampersand generator as input for the Atlas. It contains the population of concepts and relations. Also, have a look at the .json file that is result of exporting contents from an Atlas. Inspection should give a good idea of the structure of both files.

The reverse meatgrinder is something that should be built as part of the ampersand generator. That means Haskell. To get started with Haskell you can use this codespace template. You can start learning Haskell by creating a web spidering application. Use these sheets. I will be happy to help you along the way.

Michiel-s commented 4 months ago

Discussed today with @Svroozendaal and we figured out that exporting Atlas population from RAP application for a given script version can be best done by using a regular Ampersand interface with SRC I[ScriptVersion].

The resulting API provides the atlas population by means of a json structure. Usually used by the frontend, but now used as input for the reverse meatgrinder as @hanjoosten explained above.