# Efes¶

Efes is the name of the prototype for EFfort EStimation of data integration.
The provided jar is the self-contained command line interface of this prototype.

## Running Efes¶

In order to run Efes, you need Java 7. It is assumed that the java command is available
in your command line and that your currently pointing to the directory containing this
readme.

To get information about the usage of the tool, you can issue the following command:

    > java -jar efes-cli-{version}.jar

As an example, assume you have a ++Spicy file my-integration.xml, then you can run Efes
on this file by issuing the following command:

    > java -jar efes-cli-{version}.jar
        --spicy-file my-integration.xml
        --pipeline config/pipeline.xml
        --unit min
        -D log4j.configurationFile=config/log4j2.xml

## Configuring the pipeline¶

Efes organizes its different components in a pipeline, which can be configured using
an XML file, e.g. the provided pipeline.xml.

### Setting the data fit and effort models¶

The basic structure of the pipeline configuration file is the following:

    <configuration>
        <dataFitModels>
            <dataFitModel ... />
            <dataFitModel ... />
        </dataFitModels>
        <effortModel ... />
    </configuration>

The default effort model, which is the task list model, additionally allows for a set of submodels:

    <configuration>
        ...
        <effortModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="taskListModelConfiguration">
            <subModels>
                <subModel ... />
                <subModel ... />
            </subModels>
        </effortModel>
    </configuration>

These data fit models and effort (sub)models can be exchanged and/or removed.
E.g., one might want to execute only a subset of effort models.
Furthermore, some of the models have additional parameters that are also configured in this XML file.
Some of these parameters are explained in the following.

### Setting the quality/effort profile¶

In order to configure the quality/effort profile of the task model component, please
find the following element:

    <configuration>
        <effortModel>
            <profile>...</profile>
        </effortModel>
    </configuration>

You can set this profile to either of `LOW_EFFORT` and `HIGH_QUALITY`.

### Estimation functions¶

In the XML file, you can register a set of functions that convert tasks from the
task list model into concrete effort estimates. The functions are found in the
following place:

    <configuration>
        <effortModel>
            <estimationFunctions>
                <estimationFunction>
                    <expression>...</expression>
                    <name>...</name>
                    <unit>...</unit>
                </estimationFunction>
                ...
            </estimationFunctions>
         </effortModel>
    </configuration>

Each estimation function consists of three parts:

1. the `name` of a task that the function delivers estimates for
2. the `unit` that is estimated by this function
3. a JUEL `expression` that converts the parameters of the tasks into the estimation value
   - if you need further information about the parameters of each task type, please contact me

## Notes on the database¶

Efes supports only PostgreSQL databases (tested on 9.2), as the meta-information on database schemas must be obtained differently
across different database types. The necessary parameters to connect to the database are read from
the ++Spicy configuration file. Thus, only those configuration files are usable, that describe a mapping between two PostgreSQL databases.

## Version information¶

### 0.1¶

- supports a single source and target
- supports a single source relationship for each target relationship
- value fit model, structure fit model, task list model

### 0.2¶

- supports multiple sources
- existing target data is also regarded
- supports multiple source relationships for each target relationship
- structure fit model detects removes metadata and shortcuts composite metadata relationships
- structure fit model calculates amount of integrated data
- improved matching of table nodes
- mapping complexity model