java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.util.AlignmentsCube

public class AlignmentsCube extends Object
Analytical Store for alignments.
Author:
Jan Portisch
  • Field Details

    • alignmentDataCube

      Internal, wrapped data structure.
    • LOGGER

      private static org.slf4j.Logger LOGGER
      Default logger.
    • resourceExplainers

      private List<IExplainerResource> resourceExplainers
      A list of resource explainers that shall be used to further describe resources in the detailed mapping report.
    • correspondenceExtensions

      private List<String> correspondenceExtensions
      Correspondence extension.
    • isPrintCorrespondenceExtensions

      private boolean isPrintCorrespondenceExtensions
      If true no correspondence extensions will be printed.
  • Constructor Details

    • AlignmentsCube

      public AlignmentsCube()
      Constructor
  • Method Details

    • putAnalyticalMappingInformation

      public AnalyticalAlignmentInformation putAnalyticalMappingInformation(TestCase testCase, String matcherName, AnalyticalAlignmentInformation analyticalAlignmentInformation)
      Add analytical alignment information.
      Parameters:
      testCase - Test case instance.
      matcherName - Matcher name.
      analyticalAlignmentInformation - The analytical alignment information data set to be added.
      Returns:
      The previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key.)
    • getAnalyticalMappingInformation

      public AnalyticalAlignmentInformation getAnalyticalMappingInformation(TestCase testCase, String matcher)
      Get analytical mapping information for testcase and matcher name. This method will never return null. If the AnalyticalAlignmentInformation cannot be found, it will be initialized.
      Parameters:
      testCase - Test Case
      matcher - Matcher name.
      Returns:
      Analytical Alignment Information if exists
    • size

      public int size()
      Number of available analytical mappign information.
      Returns:
      Number as int.
    • write

      public void write(File baseDirectory)
      Write the Alignment Cube as CSV.
      Parameters:
      baseDirectory - The base directory to which the alignment cube shall be written.
    • cutAfterThirtyTwoThousandCharacters

      public static String cutAfterThirtyTwoThousandCharacters(String stringToCut)
      This method cuts Strings after 32000 characters.
      Parameters:
      stringToCut - The string to be cut.
      Returns:
      Cut string. If a cut operation was performed, this will be printed as warning in the log.
    • toShortString

      public String toShortString()
      Same logic/code as in write(File) but worse memory behavior (that's why the code cannot be better modularized). Similar to toString() with the difference that URIs are shortened.
      Returns:
      Large String.
    • mostFrequent

      private <O> O mostFrequent(HashMap<O,Integer> distribution)
      Determines the most frequent object of a distribution.
      Type Parameters:
      O - Return type.
      Parameters:
      distribution - The distribution of which the most frequent object shall be determined.
      Returns:
      Most frequent object.
    • toString

      public String toString()
      Same logic/code as in write(File) but worse memory behavior (that's why the code cannot be better modularized).
      Overrides:
      toString in class Object
      Returns:
      Large String.
    • getRecordsToPrintForToStringMethods

      private List<List<String>> getRecordsToPrintForToStringMethods()
    • getRecordsToPrintForToStringMethods

      private List<List<String>> getRecordsToPrintForToStringMethods(HashMap<AlignmentsCube.TestCaseMatcher,PrefixLookup> left, HashMap<AlignmentsCube.TestCaseMatcher,PrefixLookup> right, boolean printShort)
      This method returns the alignment cube in a way that it can be easily printed as String. This internal method is to be used by toString() and toShortString(). This method only contains the data (without the CSV header).
      Parameters:
      left - Left side.
      right - Right side.
      printShort - Indicator whether prefixes shall be used in URIs.
      Returns:
      List of the records to be printed.
    • getHeader

      public List<String> getHeader()
      Get the header of the cube, i.e. all describing attributes.
      Returns:
      Cube header as String List.
    • getFeatureNames

      private ArrayList<String> getFeatureNames()
      Get feature names used.
      Returns:
      a list of all feature names.
    • getResourceExplainers

      public List<IExplainerResource> getResourceExplainers()
    • setResourceExplainers

      public void setResourceExplainers(List<IExplainerResource> resourceExplainers)
    • getCorrespondenceExtensions

      public List<String> getCorrespondenceExtensions()
    • setCorrespondenceExtensions

      public void setCorrespondenceExtensions(List<String> correspondenceExtensions)
    • isPrintCorrespondenceExtensions

      public boolean isPrintCorrespondenceExtensions()
    • setPrintCorrespondenceExtensions

      public void setPrintCorrespondenceExtensions(boolean printCorrespondenceExtensions)