User Tools

Site Tools


sql-derivative-sensitivity-analyser

This is an old revision of the document!


SQL combined sensitivity analyser

SQL combined sensitivity analyser has a a user-facing frontend application that allows to extend models by attaching SQL scripts to its elements. SQL queries are added to tasks and SQL database information added to data objects. SQL information is attached by adding specific labels into the XML code of the model. The editor uses SQL combined sensitivity analysis tool to perform an analyze on the extended model to combine and present the results. Editor and analysis tool have separate codebases, but they are both required to use the full functionality of the analyser. Communication between the two components is arranged by backend REST service.

Quick guide

SQL combined sensitivity analyzer is accessible through Actions menu (with burger-menu icon) under each model in own and shared models/folders lists of frontend - link “Open in SQL CS editor”.

Adding information to model elements for analysis

Clicking on tasks or data objects opens a menu on the right side of the page (in sidebar). You can add SQL scripts (in a form of stored procedures) to tasks.

Adding SQL scripts

Clicking on a task opens a window tab Query input on the right side of the page (in sidebar) for entering an SQL script. Currently, the script should be in form of a stored procedure.

CREATE OR REPLACE FUNCTION f() RETURNS TABLE (
  var_1 type_1,
  ...
  var_2 type_2
) as $$ 

SELECT
    query_expression
FROM
    table_1 AS alias_1,
    ...
    table_n AS alias_n
WHERE
    condition_1 AND
    ...
    condition_n
$$ language SQL;

The goal of CS analyzer is to ensure differential privacy by adding noise to the final output of an SQL workflow. Hence, the last task (the one followed by a end event) should return exactly one numerical value, i.e the query_expression of that task should be an aggregation. Currently supported aggregations are COUNT, SUM, MIN, MAX. Conversely, all the intermediate tasks should not contain aggregations, as they are not supported yet.

Adding table data

Clicking on a data object opens several window tabs on the right side of the page (in sidebar) for entering an SQL script. Database schema, contents, and norm information can be added to data objects.

Running analysis

Clicking on Analyze button opens a menu entitled Analysis settings on the right side of the page (in sidebar). There you can adjust “Privacy level ε” and “Smoothness level β” parameters. Click on Run analysis button to run analysis - results (entitled Analysis results) appear in the sidebar as well.

More detailed instructions with example queries will be added soon.

Source code

The source code of SQL derivative sensitivity editor is available at pleak-sql-derivative-sensitivity-editor and the source code of SQL derivative sensitivity analysis tool at pleak-sql-analysis repositories.

sql-derivative-sensitivity-analyser.1542705858.txt.gz · Last modified: 2019/10/01 13:53 (external edit)