datafly
Class Datafly

java.lang.Object
  extended by anonymizer.Anonymizer
      extended by datafly.Datafly

public class Datafly
extends Anonymizer

Implementation of the Datafly algorithm for satisfying k-anonymity described in the following paper:

 @article{datafly,
 author = {L. Sweeney and Latanya Sweeney},
 title = {Achieving K-Anonymity Privacy Protection Using Generalization and Suppression},
 journal = {International Journal on Uncertainty, Fuzziness and Knowledge-based Systems},
 year = {2002},
 volume = {10},
 pages = {2002}
 }
 
By default, suppression threshold is set to k of k-anonymity.

We also allow a relaxation of full-domain generalization. In this alternative, equivalences that reached a size of k or larger before the entire table is k-anonymous will not be further generalized. Please use the flag fullDomainGeneralization to de/active this version.


Field Summary
private  int anonTableIndex
          Current iteration number for the anonRecords table.
private  int eqTableIndex
          Current iteration number for the equivalence table.
 boolean fullDomainGeneralization
          Flag indicating whether domain generalization will be applied strictly or not.
 
Fields inherited from class anonymizer.Anonymizer
anonTable, conf, eqTable, sqlwrapper, suppressionThreshold
 
Constructor Summary
Datafly(Configuration conf)
          Class constructor
 
Method Summary
 void anonymize()
          Anonymizes the input.
 void changeKAnonymityRequirement(int newKvalue)
          Overwrites the privacy parameter k
protected  AnonRecordTable createAnonRecordsTable(java.lang.String tableName)
          Create anonRecords table
protected  EquivalenceTable createEquivalenceTable(java.lang.String tableName)
          Create equivalence table
protected  void insertTupleToAnonTable(java.lang.String[] vals, long eid)
          Insert a tuple to the anonRecords table
protected  long insertTupleToEquivalenceTable(java.lang.String[] vals)
          Insert a tuple to the equivalence table
 
Methods inherited from class anonymizer.Anonymizer
anonymizeDataset, anonymizeDataset, isReadyForSuppression, main, outputResults_Anatomy, outputResults_GenVals, outputResults_GenValsDist, outputResults, readData, suppressEquivalences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fullDomainGeneralization

public boolean fullDomainGeneralization
Flag indicating whether domain generalization will be applied strictly or not. The default value is TRUE, in which case, an equivalence that reaches size >=k before the entire table becomes k-anonymous is not generalized anymore. This violates the domain generalization concept, but certainly not k-anonymity.


eqTableIndex

private int eqTableIndex
Current iteration number for the equivalence table. Starts with 1, used for keeping track of table names in the database.


anonTableIndex

private int anonTableIndex
Current iteration number for the anonRecords table. Starts with 1, used for keeping track of table names in the database.

Constructor Detail

Datafly

public Datafly(Configuration conf)
        throws java.lang.Exception
Class constructor

Parameters:
conf - Configuration instance
Throws:
java.lang.Exception
Method Detail

changeKAnonymityRequirement

public void changeKAnonymityRequirement(int newKvalue)
Overwrites the privacy parameter k

Parameters:
newKvalue - New value of k

createEquivalenceTable

protected EquivalenceTable createEquivalenceTable(java.lang.String tableName)
Create equivalence table

Specified by:
createEquivalenceTable in class Anonymizer
Parameters:
tableName - Name of the table
Returns:
A new equivalence table

createAnonRecordsTable

protected AnonRecordTable createAnonRecordsTable(java.lang.String tableName)
Create anonRecords table

Specified by:
createAnonRecordsTable in class Anonymizer
Parameters:
tableName - Name of the table
Returns:
A new anonymization records table

insertTupleToEquivalenceTable

protected long insertTupleToEquivalenceTable(java.lang.String[] vals)
                                      throws java.lang.Exception
Insert a tuple to the equivalence table

Specified by:
insertTupleToEquivalenceTable in class Anonymizer
Parameters:
vals - All values of the tuple to be inserted (as read from the source, i.e., before any generalization)
Returns:
Equivalence id of the equivalence to which the tuple belongs
Throws:
java.lang.Exception

insertTupleToAnonTable

protected void insertTupleToAnonTable(java.lang.String[] vals,
                                      long eid)
                               throws java.lang.Exception
Insert a tuple to the anonRecords table

Specified by:
insertTupleToAnonTable in class Anonymizer
Parameters:
vals - All values of the tuple to be inserted (as read from the source, i.e., before any generalization)
eid - Equivalence id of the equivalence to which the tuple belongs
Throws:
java.lang.Exception

anonymize

public void anonymize()
               throws java.lang.Exception
Anonymizes the input. This function can be reused (with new k maybe), as long as eqTable and anonTable objects are fresh and the configuration has not changed.

Specified by:
anonymize in class Anonymizer
Throws:
java.lang.Exception