Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries...

Post on 30-Dec-2015

224 views 1 download

Tags:

Transcript of Fluvial Architecture Knowledge Transfer System (FAKTS): database interrogation through SQL queries...

Fluvial Architecture Knowledge Transfer System (FAKTS):

database interrogation through SQL queries

Luca Colombera, Nigel P. Mountney

Fluvial & Eolian Research Group – University of Leeds

Querying FAKTS

Two alternative ways to interrogate FAKTS:

- WEB-BASED FRONT-END hosted on FRG website.

Easy to use, but of limited capability. Queries can be run on the website without requiring download of software or data.

- SQL QUERIES on MySQL.

More difficult to use, but it enables full database interrogation.Queries are run locally, requiring download of software (MySQL and HeidiSQL) and database.

MySQL queries

Fully searchable but requires SQLknowledge:

-output referring to any type of genetic unit can be generated;

- any type of output can be queried (including proportions, grain size, etc.);

- all available filters can be applied;

- it is possible to tailor the query so that output does not require further data analysis.

MySQL queries

Interrogation of FAKTS through MySQL queries requires having MySQL (back-end) and HeidiSQL (front-end) installed locally.

The software, database and documentation can be downloaded from the FRG website (Doc ID: 598)

MySQL HeidiSQLFAKTS +documents

MySQL queries

Once all software is installed (see FAKTS manual for instructions), users can login to the local MySQL server using HeidiSQL.

MySQL queries

The screen will appear as above: now FAKTS can be loaded.

MySQL queries

The FAKTS dump file needs to be chosen, opened and run.

MySQL queries

The FAKTS dump file needs to be chosen, opened and run.

MySQL queries

Now, if you refresh (F5)…

MySQL queries

…the FAKTS database will appear on the database panel.

MySQL queries

If you click on the database, you will select it.

MySQL queries

You can now query FAKTS by writing or loading a query in a tab.

MySQL queries

You can write a query in the query editor panel.

MySQL queries

Information on SQL syntax and functions can be found in Chapters 12 and 13 of MySQL manual: http://dev.mysql.com/doc/refman/5.6/en/index.html.

MySQL queries

For example, we can write a query for the thickness of channel complexes from sparsely vegetated basins.

MySQL queries

Then we can click on ‘Execute SQL’, or press F9.

MySQL queries

Results will appear in the panel at the bottom.

MySQL queries

Let’s open a new query tab and load a template query.

MySQL queries

Click on ‘Load SQL file’ or press ctrl + O.

MySQL queries

The ‘template query’ folder contains over 50 SQL scripts.

MySQL queries

To guide the choice of a script suitable for your specific scopes, the ‘template query’ document should be referred to.

MySQL queries

To guide the choice of a script suitable for your specific scopes, the ‘template query’ document should be referred to.

MySQL queries

Let’s say we are interested in the types and thicknesses of facies units overlying a 4th-order channel base: we open tq_32.

MySQL queries

In particular, we are interested in information on facies units overlying the base of crevasse channels.

MySQL queries

After identifying the clause that specifies the architectural element type, we edit the script changing ‘CH’ into ‘CR’.

MySQL queries

After editing the script, we can run the query.

MySQL queries

The results are returned in the bottom panel.

MySQL queries

The query we have just run entailed the generation of a temporary table: if we want to edit and run the same script we need to…

MySQL queries

…either edit the script re-naming the temporary table (in addition to the changes required for obtaining the desired output),…

MySQL queries

…or open a new session, in which the same query can be run, without requiring re-naming the temporary table.

MySQL queries

…or open a new session, in which the same query can be run, without requiring re-naming the temporary table.

MySQL queries

The new output – referring to facies units overlying the base of LA barform elements – is now displayed.

MySQL queries

The queries can be designed in a way that all required functions are included: the results do not require any further processing.

MySQL queries

If we want to export the results: we can right click on them…

MySQL queries

…and select ‘Export grid rows’.

MySQL queries

The results can now be exported conveniently as CSV file.

MySQL queries

After exporting either all the results or the selected rows...

MySQL queries

…the FAKTS output can be further analysed or graphed after opening the CSV file using Excel.

Conclusions

FAKTS interrogation

MySQL queries FRG website- user-friendly menu-driven front-end;

- depositional and architectural elements currently included;

- dimension and transition data currently made available;

- limited number of filters;

- output is given in the form of raw data, which may require further analysis.

Further developments will follow.

- HeidiSQL front-end requires basic SQL knowledge;

- output referring to any type of genetic unit can be generated;

- any type of output can be queried (including proportions, grain size, etc.);

- all available filters can be applied;

- it is possible to tailor the query so that output does not require further data analysis.