Class AlignmentsCube
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.util.AlignmentsCube
Analytical Store for alignments.
- Author:
- Jan Portisch
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate class
Internal data structure.private class
TestCaseMatcher Structure -
Field Summary
Modifier and TypeFieldDescriptionInternal, wrapped data structure.Correspondence extension.private boolean
If true no correspondence extensions will be printed.private static org.slf4j.Logger
Default logger.private List<IExplainerResource>
A list of resource explainers that shall be used to further describe resources in the detailed mapping report. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
cutAfterThirtyTwoThousandCharacters
(String stringToCut) This method cuts Strings after 32000 characters.getAnalyticalMappingInformation
(TestCase testCase, String matcher) Get analytical mapping information for testcase and matcher name.Get feature names used.Get the header of the cube, i.e.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.boolean
private <O> O
mostFrequent
(HashMap<O, Integer> distribution) Determines the most frequent object of a distribution.putAnalyticalMappingInformation
(TestCase testCase, String matcherName, AnalyticalAlignmentInformation analyticalAlignmentInformation) Add analytical alignment information.void
setCorrespondenceExtensions
(List<String> correspondenceExtensions) void
setPrintCorrespondenceExtensions
(boolean printCorrespondenceExtensions) void
setResourceExplainers
(List<IExplainerResource> resourceExplainers) int
size()
Number of available analytical mappign information.Same logic/code as inwrite(File)
but worse memory behavior (that's why the code cannot be better modularized).toString()
Same logic/code as inwrite(File)
but worse memory behavior (that's why the code cannot be better modularized).void
Write the Alignment Cube as CSV.
-
Field Details
-
alignmentDataCube
Internal, wrapped data structure. -
LOGGER
private static org.slf4j.Logger LOGGERDefault logger. -
resourceExplainers
A list of resource explainers that shall be used to further describe resources in the detailed mapping report. -
correspondenceExtensions
Correspondence extension. -
isPrintCorrespondenceExtensions
private boolean isPrintCorrespondenceExtensionsIf 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 Casematcher
- Matcher name.- Returns:
- Analytical Alignment Information if exists
-
size
public int size()Number of available analytical mappign information.- Returns:
- Number as int.
-
write
Write the Alignment Cube as CSV.- Parameters:
baseDirectory
- The base directory to which the alignment cube shall be written.
-
cutAfterThirtyTwoThousandCharacters
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
Same logic/code as inwrite(File)
but worse memory behavior (that's why the code cannot be better modularized). Similar totoString()
with the difference that URIs are shortened.- Returns:
- Large String.
-
mostFrequent
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
Same logic/code as inwrite(File)
but worse memory behavior (that's why the code cannot be better modularized). -
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 bytoString()
andtoShortString()
. 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
Get the header of the cube, i.e. all describing attributes.- Returns:
- Cube header as String List.
-
getFeatureNames
Get feature names used.- Returns:
- a list of all feature names.
-
getResourceExplainers
-
setResourceExplainers
-
getCorrespondenceExtensions
-
setCorrespondenceExtensions
-
isPrintCorrespondenceExtensions
public boolean isPrintCorrespondenceExtensions() -
setPrintCorrespondenceExtensions
public void setPrintCorrespondenceExtensions(boolean printCorrespondenceExtensions)
-