Skip to content

Declare Miner

Dependency

To use these algorithms in your Java Maven project it is necessary to include, in the pom.xml file, the dependency:

<dependency>
    <groupId>com.github.beamline</groupId>
    <artifactId>discovery-declare</artifactId>
    <version>master-SNAPSHOT</version>
</dependency>
See the introduction page for further instructions.

Usage

It is possible to call the two miners beamline.miners.declare.DeclareMinerLossyCounting and beamline.miners.declare.DeclareMinerBudgetLossyCounting using the following:

1
2
3
4
DeclareMinerLossyCounting miner = new DeclareMinerLossyCounting(
    0.001, // the maximal approximation error
    10 // the number of declare constraints to show
);
1
2
3
4
DeclareMinerBudgetLossyCounting miner = new DeclareMinerBudgetLossyCounting(
    1000, // the available budget
    10 // the number of declare constraints to show
);

After the miner is configured, both can be used to produce a CNet which can be either exported into a .cnet file or visualized (currently the visualization does not support the bindings):

StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env
    .addSource(source)
    .keyBy(BEvent::getProcessName)
    .flatMap(miner.setModelRefreshRate(100))
    .addSink(new SinkFunction<DeclareModelView>(){
        public void invoke(DeclareModelView value, Context context) throws Exception {
            value.generateDot().exportToSvg(new File("output.svg"));
        };
    });
env.execute();

Scientific literature

The techniques implemented in this package are described in: