Skip to content
Snippets Groups Projects
Commit 5a37fca2 authored by Cornelia Michlits's avatar Cornelia Michlits
Browse files

update README

parent a60ed634
No related branches found
No related tags found
1 merge request!103241 modify bstat
This commit is part of merge request !103. Comments created here will be created in the context of that merge request.
# Analyse Service
Service to analyse datatypes, update statistical properties of databases in the metadatabase, add metadata, e.g., data provenance, db description ... to the metadatabase
Service to analyse datatypes, update statistical properties of databases in the metadatabase
Remark: if you use swagger-ui, you can switch between /api-analyze.json and /api-mdb.json
......@@ -69,92 +69,23 @@ where the numbers represent a ranking of all the primary keys (consisting of one
## API-mdb
### `POST /update_mdb_db`
Updates attributes 'description', 'resourcetype' and 'publisher' of a certain database in the metadatabase.
Example http request:
POST /update_mdb_db HTTP/1.1
Content-Type: application/json
Host: 127.0.0.1:5000
Content-Length: 178
{
"dbid": 1,
"description": "Here goes a detailed description of the data set.",
"publisher": "Geological Institute, University of Tokyo",
"resourcetype": "Census Data"
}
The response is a status message, e.g. "\"UPDATE 1\"".
### `POST /update_mdb_db_ispublic`
Updates the attribute is_public in table mdb_databases in the metadatabase.
Example http request:
POST /update_mdb_db_ispublic HTTP/1.1
Content-Type: application/json
Host: 127.0.0.1:5000
Content-Length: 39
{
"dbid": 1,
"is_public": "false"
}
The respose is a status message.
### `POST /update_mdb_data_provenance`
Updates the data provenance of a provided dataset and stores information in the metadatabase.
### `POST /update_mdb_tbl`
Automatically updates the number of columns and rows of each table in a certain database in the repository and saves the information in the metadatabase (entity mdb_tables, attributes numcols and numrows).
Example http request:
POST /update_mdb_tbl HTTP/1.1
Content-Type: application/json
Host: 127.0.0.1:5000
Content-Length: 15
{
"dbid": 1
}
### `POST /update_mdb_col`
Updates entity mdb_columns attributes (datatype, ordinal_position, is_nullable) and automatically updates mdb_columns_nom (attribute max_length), mdb_columns_num (min, max, mean, sd, histogram) and mdb_columns_cat (num_cat, cat_array). The attribute 'histogram' describes a equi-width histogram with a fix number of 10 buckets. The last value in this numeric array is the width of one bucket. The attribute cat_array contains an array with the names of the categories.
Updates statisical values of all columns for a given table. In particular, the entities mdb_columns_nom (attribute max_length), mdb_columns_num (min, max, mean, sd, histogram) and mdb_columns_cat (num_cat, cat_array) are updated. The attribute 'histogram' describes a equi-width histogram with a fix number of 10 buckets. The last value in this numeric array is the width of one bucket. The attribute cat_array contains an array with the names of the categories.
Example http request:
POST /update_mdb_col HTTP/1.1
POST /api/mdb/update_mdb_col HTTP/1.1
Content-Type: application/json
Host: 127.0.0.1:5000
Content-Length: 39
Host: localhost:5000
Content-Length: 29
{
"cid": 1,
"dbid": 1,
"tid": 1
"dbid": "1",
"tid": "1"
}
### `POST /update_mdb_col_num_siunit`
Updates attribute siunit (physical quatities for length, mass, ... ) in metadatabase.
Example http request:
POST /update_mdb_columns_num_siunit HTTP/1.1
Content-Type: application/json
Host: 127.0.0.1:5000
Content-Length: 56
{
"cid": 1,
"dbid": 1,
"siunit": "m",
"tid": 1
}
The response is a status message:
* 200: OK
* 500: error
## How to use
### Dependencies
......
......
......@@ -126,6 +126,7 @@ def determinepk():
@app.route('/api/mdb/update_mdb_col', methods=["POST"], endpoint='mdb_basicstatistic')
@swag_from('as-yml/bstatistic.yml')
def mdb_basicstatistic():
logging.debug('endpoint update_mdb_col, body=%s', request)
input_json = request.get_json()
try:
dbid = int(input_json['dbid'])
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment