Class ExecutionResult
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_eval.ExecutionResult
This class represents the result of a matcher execution.
- Author:
- Sven Hertling, Jan Portisch
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private Object
static final com.googlecode.cqengine.attribute.Attribute<ExecutionResult,
String> This method allows the MATCHER to be an index within a collection.(package private) File
File reference to the error log of the matcher.(package private) File
Reference to the log message file of the matcher.private String
private URL
private Object
private Alignment
static final com.googlecode.cqengine.attribute.Attribute<ExecutionResult,
Set<Refiner>> This method allows REFINEMENT_SET to be an index within a collection.private long
The runtime in nanosecondsprivate Alignment
static final com.googlecode.cqengine.attribute.Attribute<ExecutionResult,
TestCase> This method allows the TEST_CASE to be an index within a collection.private TestCase
static final com.googlecode.cqengine.attribute.Attribute<ExecutionResult,
Track> This method allows the TRACK to be an index within a collection. -
Constructor Summary
ConstructorDescriptionExecutionResult
(TestCase testCase, String matcherName, Alignment systemAlignment) Constructor used by tests to check if metrics compute correctly.ExecutionResult
(TestCase testCase, String matcherName, Alignment systemAlignment, Alignment referenceAlignment) Constructor used by tests to check if metrics compute correctly.ExecutionResult
(TestCase testCase, String matcherName, URL originalSystemAlignment, long runtime, Alignment systemAlignment, Alignment referenceAlignment, Object matcher, Set<Refiner> refinements, Object parameters) Base constructor which needs all parametersExecutionResult
(TestCase testCase, String matcherName, URL originalSystemAlignment, long runtime, Object matcher, Object parameters) Constructor used by ExecutionRunner for initializing a execution result from a matcher runExecutionResult
(ExecutionResult base, Alignment systemAlignment, Alignment referenceAlignment, Refiner refinement) Copies all members except the mappings from the given execution result (like a copy constructor). -
Method Summary
Modifier and TypeMethodDescriptionaddRefinementToNewSet
(Set<Refiner> initialRefinement, Refiner newRefinement) Helper method to create a new refinement set and add a new refinement to it.void
addRuntime
(long additionalRuntime) Adds runtime to this execution result.boolean
Returns the input alignment from the testcase for this execution result.static Comparator<ExecutionResult>
Returns a comparator that can be used to sort multiple ExecutionResults by matcher name.long
Returns the runtime in nanoseconds<T> T
getSourceOntology
(Class<T> clazz) Get the source ontology using a buffer and the default OntModelSpec.<T> T
getTargetOntology
(Class<T> clazz) Get the target ontology using a buffer and the default OntModelSpec.getTrack()
Convenience getter which returns the track to which the test case of the ExecutionResult belongs to.int
hashCode()
void
setMatcherErrorLog
(File matcherErrorLog) void
setMatcherLog
(File matcherLog) void
setReferenceAlignment
(Alignment referenceAlignment) Deprecated.better create a new execution result.void
setSystemAlignment
(Alignment systemAlignment) Deprecated.better create a new execution result.private static Alignment
Helper method to parse an alignment from an URL and log a possible error.toString()
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
testCase
-
matcherName
-
originalSystemAlignment
-
runtime
private long runtimeThe runtime in nanoseconds -
systemAlignment
-
referenceAlignment
-
matcher
-
refinements
-
parameters
-
matcherLog
File matcherLogReference to the log message file of the matcher. -
matcherErrorLog
File matcherErrorLogFile reference to the error log of the matcher. -
MATCHER
This method allows the MATCHER to be an index within a collection. -
TRACK
This method allows the TRACK to be an index within a collection. -
TEST_CASE
This method allows the TEST_CASE to be an index within a collection. -
REFINEMENT_SET
public static final com.googlecode.cqengine.attribute.Attribute<ExecutionResult,Set<Refiner>> REFINEMENT_SETThis method allows REFINEMENT_SET to be an index within a collection.
-
-
Constructor Details
-
ExecutionResult
public ExecutionResult(TestCase testCase, String matcherName, URL originalSystemAlignment, long runtime, Alignment systemAlignment, Alignment referenceAlignment, Object matcher, Set<Refiner> refinements, Object parameters) Base constructor which needs all parameters- Parameters:
testCase
- Test case on which the matcher was run which produced this particular result.matcherName
- Name of the matcheroriginalSystemAlignment
- original URL return by a matcher (represents a mapping file)runtime
- Runtime used by the matchersystemAlignment
- Alignment to the alignment output produced by the matcherreferenceAlignment
- Alignment to the reference alignmentmatcher
- Reference to the mather which was usedrefinements
- Refinements which were executed on this executionResultparameters
- Parameters which maybe enhanced by the matchers
-
ExecutionResult
public ExecutionResult(TestCase testCase, String matcherName, Alignment systemAlignment, Alignment referenceAlignment) Constructor used by tests to check if metrics compute correctly.- Parameters:
testCase
- Test case on which the matcher was run which produced this particular result.matcherName
- Name of the matchersystemAlignment
- Alignment to the alignment output produced by the matcherreferenceAlignment
- Alignment to the reference alignment
-
ExecutionResult
Constructor used by tests to check if metrics compute correctly. The reference alignment of the test case will be used.- Parameters:
testCase
- Test case on which the matcher was run which produced this particular result.matcherName
- Name of the matchersystemAlignment
- Alignment to the alignment output produced by the matcher
-
ExecutionResult
public ExecutionResult(TestCase testCase, String matcherName, URL originalSystemAlignment, long runtime, Object matcher, Object parameters) Constructor used by ExecutionRunner for initializing a execution result from a matcher run- Parameters:
testCase
- Test case on which the matcher was run which produced this particular result.matcherName
- Name of the matcher.originalSystemAlignment
- URL where the system alignment is persisted in. Note that this URL is parsed immediately into a mapping.runtime
- Runtime by the matcher.matcher
- Matcher that was used for the testCase.parameters
- Parameters which maybe enhanced by the matchers
-
ExecutionResult
public ExecutionResult(ExecutionResult base, Alignment systemAlignment, Alignment referenceAlignment, Refiner refinement) Copies all members except the mappings from the given execution result (like a copy constructor). It should be used by all refinement operations to create a new executionResult with modified system and referenceAlignments. The refinement is not executed.- Parameters:
base
- The base execution result from which all members except the mappings are copied.systemAlignment
- The new system alignment which should be used.referenceAlignment
- The reference alignment.refinement
- The refinement that was used.
-
-
Method Details
-
addRefinementToNewSet
private static Set<Refiner> addRefinementToNewSet(Set<Refiner> initialRefinement, Refiner newRefinement) Helper method to create a new refinement set and add a new refinement to it. Used by one constructor of this class. This method returns a NEW refinement set.- Parameters:
initialRefinement
- The original refinement, all data will also be found in the newly created refinement set.newRefinement
- Data that will be added.- Returns:
- New Refinement Set.
-
silentlyParseAlignment
Helper method to parse an alignment from an URL and log a possible error. This method will not throw any exceptions. Used by one constructor of this class.- Parameters:
url
- url which represents the alignment- Returns:
- Parsed alignment.
-
getTestCase
-
getMatcherName
-
getRuntime
public long getRuntime()Returns the runtime in nanoseconds- Returns:
- the runtime in nanoseconds
-
addRuntime
public void addRuntime(long additionalRuntime) Adds runtime to this execution result. Mostly used byExecutor.runMatcherOnTop(ExecutionResultSet, String, Object, String)
to add the runtime of the additional matcher.- Parameters:
additionalRuntime
- the runtime to add to the current execution result.
-
getMatcher
-
getSystemAlignment
-
getReferenceAlignment
-
getOriginalSystemAlignment
-
getMatcherLog
-
setMatcherLog
-
getMatcherErrorLog
-
setMatcherErrorLog
-
setSystemAlignment
Deprecated.better create a new execution result. This method will be removed in future releases.Sets a new system alignment. Be aware of what you are doing. This shall only be used in very rare cases such as residual recall calculations.- Parameters:
systemAlignment
- System alignment to be set.
-
setReferenceAlignment
Deprecated.better create a new execution result. This method will be removed in future releases.Sets a new reference alignment. Be aware of what you are doing. This shall only be used in very rare cases such as residual recall calculations.- Parameters:
referenceAlignment
- Reference alignment to be set.
-
getSourceOntology
Get the source ontology using a buffer and the default OntModelSpec.- Type Parameters:
T
- Type of the ontology class e.g. OntModel- Parameters:
clazz
- The result type that is expected.- Returns:
- Source ontology in the specified format.
-
getTargetOntology
Get the target ontology using a buffer and the default OntModelSpec.- Type Parameters:
T
- Type of the ontology class e.g. OntModel- Parameters:
clazz
- The result type that is expected.- Returns:
- Target ontology in the specified format.
-
getInputAlignment
Returns the input alignment from the testcase for this execution result.- Returns:
- the input alignment parsed as an alignment object.
-
getTrack
Convenience getter which returns the track to which the test case of the ExecutionResult belongs to.- Returns:
- Instance of the track.
-
getRefinements
-
getParameters
-
hashCode
public int hashCode() -
equals
-
toString
-
getMatcherNameComparator
Returns a comparator that can be used to sort multiple ExecutionResults by matcher name.- Returns:
- Comparator that compares ExecutionResults by matcher name.
-