anatomy
Class Anatomy

java.lang.Object
  extended by anonymizer.Anonymizer
      extended by anatomy.Anatomy

public class Anatomy
extends Anonymizer

Implementation of the Anatomy anonymization algorithm. For details on Anatomy, please refer to the following paper:

 @inproceedings{anatomy,
 author = {Xiao, Xiaokui and Tao, Yufei},
 title = {Anatomy: simple and effective privacy preservation},
 booktitle = {VLDB '06: Proceedings of the 32nd international conference on Very large data bases},
 year = {2006},
 pages = {139--150},
 location = {Seoul, Korea},
 publisher = {VLDB Endowment}
 }
 
The algorithm is described in Section 5.2 of the paper. The specific l-diversity definition supported by the algorithm is quite different than those described in the l-diversity paper. The output produces equivalence classes of size at least l, each of which contains at least l distinct sensitive values.

Only integer valued l values are acceptable. Constructor performs the necessary check, and convert l to an integer value if needed.

Property I of Section 5.2 in the paper mentions an eligibility condition. If this condition does not hold with the input dataset, the algorithm simply throws an exception and exits.


Field Summary
 
Fields inherited from class anonymizer.Anonymizer
anonTable, conf, eqTable, sqlwrapper, suppressionThreshold
 
Constructor Summary
Anatomy(Configuration conf)
          Class constructor
 
Method Summary
 void anonymize()
          Anonymizing the input.
 void changeLDiversityRequirement(double newLvalue)
          Overwrites the privacy parameter l
protected  AnonRecordTable createAnonRecordsTable(java.lang.String tableName)
          Create anonRecords table
protected  EquivalenceTable createEquivalenceTable(java.lang.String tableName)
          Create equivalence table
private  void decrementFirstLCounts(AttValueCount[] counts, double l)
          Decrements the counts of the first l most frequent sensitive attribute values
private  boolean existsLNonEmptyBuckets(AttValueCount[] counts, double l)
          Check if there are at least l non-empty buckets of sensitive attribute values (iteration condition)
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
 

Constructor Detail

Anatomy

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

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

changeLDiversityRequirement

public void changeLDiversityRequirement(double newLvalue)
Overwrites the privacy parameter l

Parameters:
newLvalue - New value of l

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
Anonymizing the input. This function can be reused (with new l 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

decrementFirstLCounts

private void decrementFirstLCounts(AttValueCount[] counts,
                                   double l)
Decrements the counts of the first l most frequent sensitive attribute values

Parameters:
counts - Counts of each sensitive attribute value
l - Privacy parameter l

existsLNonEmptyBuckets

private boolean existsLNonEmptyBuckets(AttValueCount[] counts,
                                       double l)
Check if there are at least l non-empty buckets of sensitive attribute values (iteration condition)

Parameters:
counts - Counts of each sensitive attribute value
l - Privacy parameter l
Returns:
true if the condition holds, false otherwise