java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_data.Track
All Implemented Interfaces:
Comparable<Track>
Direct Known Subclasses:
LocalTrack, SealsTrack

public abstract class Track extends Object implements Comparable<Track>
This class represents a track from OAEI like anatomy, conference or multifarm etc. For a list of possible tracks, have a look at the TrackRepository. Example:
 
 TrackRepository.Anatomy.Default.getTestCases()
 
 
A track consists of multiple TestCase.
Author:
Sven Hertling, Jan Portisch
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
      Default Logger
    • cacheFolder

      protected static File cacheFolder
      The folder where the individual tracks that were downloaded will be cached so that they can be reused across multiple evaluation session.
    • skipTestsWithoutRefAlign

      protected boolean skipTestsWithoutRefAlign
    • remoteLocation

      protected String remoteLocation
    • name

      protected String name
    • version

      protected String version
    • testCases

      protected List<TestCase> testCases
    • useDuplicateFreeStorageLayout

      protected boolean useDuplicateFreeStorageLayout
      If true, store and load testcases in a folder structure where ontologies are only stored once and not copied for every testcase. layout: - ontologies - ont1.rdf - ont2.rdf - references - ont1-ont2.rdf
    • goldStandardCompleteness

      protected GoldStandardCompleteness goldStandardCompleteness
      Completeness of the gold standard for all test cases.
  • Constructor Details

    • Track

      protected Track(String remoteLocation, String name, String version, boolean useDuplicateFreeStorageLayout, GoldStandardCompleteness goldStandardCompleteness, boolean skipTestsWithoutRefAlign)
    • Track

      protected Track(String remoteLocation, String name, String version, boolean useDuplicateFreeStorageLayout, GoldStandardCompleteness goldStandardCompleteness)
    • Track

      protected Track(String remoteLocation, String name, String version, boolean useDuplicateFreeStorageLayout)
    • Track

      protected Track(String remoteLocation, String name, String version)
      Constructor
      Parameters:
      remoteLocation - The remote location.
      name - The test case name.
      version - The test case version.
  • Method Details

    • setCacheFolder

      public static void setCacheFolder(File directory)
      Folder where the tracks and the corresponding test cases shall be cached.
      Parameters:
      directory - Target directory.
    • setSkipTestCasesWithoutRefAlign

      public void setSkipTestCasesWithoutRefAlign(boolean skip)
    • getRemoteLocation

      public String getRemoteLocation()
    • getName

      public String getName()
    • getVersion

      public String getVersion()
    • getTestCases

      public List<TestCase> getTestCases()
      Return all test cases of the track.
      Returns:
      A list of TestCase instances belonging to this track.
    • getTestCases

      public List<TestCase> getTestCases(String... names)
      Obtain multiple test cases using specified test case names. If name does not exist, a log is written and the testcase is skipped.
      Parameters:
      names - Names of the test cases.
      Returns:
      List of testcases.
    • getTestCases

      public List<TestCase> getTestCases(List<String> testCaseNames)
      Obtain multiple test cases using specified test case names. If name does not exist, a log is written and the testcase is skipped.
      Parameters:
      testCaseNames - Names of the test cases.
      Returns:
      List of testcases.
    • getMapNameToTestCase

      private Map<String,TestCase> getMapNameToTestCase()
    • getTestCase

      public TestCase getTestCase(String name)
      Obtain a test case using a specified name. If name does not exist, null is returned.
      Parameters:
      name - Name of the test case.
      Returns:
      Test case or null if not existent.
    • getTestCase

      public TestCase getTestCase(int index)
      Obtain a test case using the index.
      Parameters:
      index - The position of the test case that is to be obtained.
      Returns:
      Test case.
      Throws:
      IndexOutOfBoundsException - if the index is out of range
    • getFirstTestCase

      public TestCase getFirstTestCase()
      Obtain an example test case (the first one). throws NoSuchElementException if there are no test cases.
      Returns:
      Test case.
    • getNameAndVersionString

      public String getNameAndVersionString()
      Returns a string containing name and version of track in url encoded fashion.
      Returns:
      String as name and version of track (url encoded)
    • getDistinctOntologies

      public List<URL> getDistinctOntologies()
      This function returns the distinct ontologies for the whole track.This means if you have testcases like A-B, B-C and A-C, then it would return the ontologies A,B,and C.
      IMPORTANT: this only works if the testcase name consists of the source and target names separated by "-". This is the case for conference and KG track and maybe some others.
      Returns:
      list of URLs which points to the ontologies.
    • getDistinctOntologies

      public static List<URL> getDistinctOntologies(List<TestCase> testCases)
    • getDistinctOntologiesMap

      public Map<String,URL> getDistinctOntologiesMap()
    • getDistinctOntologiesMap

      public static Map<String,URL> getDistinctOntologiesMap(List<TestCase> testCases)
    • readFromCache

      protected List<TestCase> readFromCache()
    • downloadToCache

      protected abstract void downloadToCache() throws Exception
      Throws:
      Exception
    • saveToFile

      protected void saveToFile(InputStream inputStream, File file)
      Writes an input stream to a file. Developer remark: Does not close the input stream.
      Parameters:
      inputStream - Input stream to write.
      file - File to write input stream into.
    • encode

      protected String encode(String s)
    • saveInTestCaseLayout

      protected void saveInTestCaseLayout(InputStream in, String testCaseName, TestCaseType type)
    • saveInDuplicateFreeLayout

      protected void saveInDuplicateFreeLayout(InputStream in, String testCaseName, TestCaseType type)
    • saveInDefaultLayout

      protected void saveInDefaultLayout(InputStream in, String testCaseName, TestCaseType type)
    • saveInDefaultLayout

      protected void saveInDefaultLayout(URL url, String testCaseName, TestCaseType type)
    • saveInDefaultLayout

      protected void saveInDefaultLayout(File f, String testCaseName, TestCaseType type)
    • readFromTestCaseLayout

      protected List<TestCase> readFromTestCaseLayout()
      Reads and parses test cases. Test Case Layout: Test is a directory with source.rdf, target.rdf, reference.rdf.
      Returns:
      Parsed TestCase list.
    • readFromDuplicateFreeLayout

      protected List<TestCase> readFromDuplicateFreeLayout()
      Reads and parses test cases. Duplicate Free Layout: - Folder references holding reference files with style source_name-target_name.rdf. - Folder ontologies holding the ontologies whose names were specified in the reference file names. Ontologies end with ".rdf".
      Returns:
      Parsed TestCase list.
    • readFromDefaultLayout

      private List<TestCase> readFromDefaultLayout()
    • removeExtension

      private String removeExtension(String filename)
    • getNiceRemoteLocation

      protected static String getNiceRemoteLocation(String url)
    • getCacheFolder

      public static File getCacheFolder()
    • toString

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

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

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

      public int compareTo(Track otherTrack)
      Specified by:
      compareTo in interface Comparable<Track>