Class ExecutionResult

java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_eval.ExecutionResult

public class ExecutionResult extends Object
This class represents the result of a matcher execution.
Author:
Sven Hertling, Jan Portisch
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • testCase

      private TestCase testCase
    • matcherName

      private String matcherName
    • originalSystemAlignment

      private URL originalSystemAlignment
    • runtime

      private long runtime
      The runtime in nanoseconds
    • systemAlignment

      private Alignment systemAlignment
    • referenceAlignment

      private Alignment referenceAlignment
    • matcher

      private Object matcher
    • refinements

      private Set<Refiner> refinements
    • parameters

      private Object parameters
    • matcherLog

      File matcherLog
      Reference to the log message file of the matcher.
    • matcherErrorLog

      File matcherErrorLog
      File reference to the error log of the matcher.
    • MATCHER

      public static final com.googlecode.cqengine.attribute.Attribute<ExecutionResult,String> MATCHER
      This method allows the MATCHER to be an index within a collection.
    • TRACK

      public static final com.googlecode.cqengine.attribute.Attribute<ExecutionResult,Track> TRACK
      This method allows the TRACK to be an index within a collection.
    • TEST_CASE

      public static final com.googlecode.cqengine.attribute.Attribute<ExecutionResult,TestCase> 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_SET
      This 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 matcher
      originalSystemAlignment - original URL return by a matcher (represents a mapping file)
      runtime - Runtime used by the matcher
      systemAlignment - Alignment to the alignment output produced by the matcher
      referenceAlignment - Alignment to the reference alignment
      matcher - Reference to the mather which was used
      refinements - Refinements which were executed on this executionResult
      parameters - 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 matcher
      systemAlignment - Alignment to the alignment output produced by the matcher
      referenceAlignment - Alignment to the reference alignment
    • ExecutionResult

      public ExecutionResult(TestCase testCase, String matcherName, Alignment systemAlignment)
      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 matcher
      systemAlignment - 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

      private static Alignment silentlyParseAlignment(URL url)
      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

      public TestCase getTestCase()
    • getMatcherName

      public String 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 by Executor.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

      public Object getMatcher()
    • getSystemAlignment

      public Alignment getSystemAlignment()
    • getReferenceAlignment

      public Alignment getReferenceAlignment()
    • getOriginalSystemAlignment

      public URL getOriginalSystemAlignment()
    • getMatcherLog

      public File getMatcherLog()
    • setMatcherLog

      public void setMatcherLog(File matcherLog)
    • getMatcherErrorLog

      public File getMatcherErrorLog()
    • setMatcherErrorLog

      public void setMatcherErrorLog(File matcherErrorLog)
    • setSystemAlignment

      public void setSystemAlignment(Alignment systemAlignment)
      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

      public void setReferenceAlignment(Alignment referenceAlignment)
      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

      public <T> T getSourceOntology(Class<T> clazz)
      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

      public <T> T getTargetOntology(Class<T> clazz)
      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

      public Alignment getInputAlignment()
      Returns the input alignment from the testcase for this execution result.
      Returns:
      the input alignment parsed as an alignment object.
    • getTrack

      public Track getTrack()
      Convenience getter which returns the track to which the test case of the ExecutionResult belongs to.
      Returns:
      Instance of the track.
    • getRefinements

      public Set<Refiner> getRefinements()
    • getParameters

      public Object getParameters()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getMatcherNameComparator

      public static Comparator<ExecutionResult> getMatcherNameComparator()
      Returns a comparator that can be used to sort multiple ExecutionResults by matcher name.
      Returns:
      Comparator that compares ExecutionResults by matcher name.