Class CacheTrimmer


  • public class CacheTrimmer
    extends Object
    Author:
    Klaus Lyko
    • Constructor Detail

      • CacheTrimmer

        public CacheTrimmer()
    • Method Detail

      • trimExamples

        public static AMapping trimExamples​(AMapping m,
                                            int max)
        Method to scale down a reference mapping given by an Oracle. Only the first max Entries are used.
        Parameters:
        m - Oracle holding all data.
        max - number of examples
        Returns:
        Mapping scaled down to max entries.
      • trimExamplesRandomly

        public static AMapping trimExamplesRandomly​(AMapping m,
                                                    int max)
        Standard implementation to get random training examples. Basic approach is to get a random set of source uris of the reference mapping and for each one target uri it is mapped to!
        Parameters:
        m - Mapping
        max - number of examples
        Returns:
        AMapping
      • getRandomTrainingData

        public static AMapping getRandomTrainingData​(AMapping m,
                                                     int max)
        Another implementation to get a random training data of size max out of the reference mapping m. The approach here is to randomly select source URIs of m and for each add ALL target URIs it is mapped to.
        Parameters:
        m - Mapping
        max - number of examples
        Returns:
        AMapping
      • processData

        public static ACache[] processData​(ACache sC,
                                           ACache tC,
                                           AMapping m)
        Method to scale down the Caches used to perform entity matching upon. Scaling down is done according to the given reference mapping. Returns Caches only holding instances of the reference Mapping.
        Parameters:
        sC - Cache for source data.
        tC - Cache for target data.
        m - Reference Mapping (e.g. part of the optimal mapping)
        Returns:
        Array holding both resulting Caches, where the Cache for the source is at index 0. Cache for the target knowledge base at index 1.
      • getReferenceMapping

        public AMapping getReferenceMapping()
        Returns:
        reference mapping