Class Track
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_data.Track
- All Implemented Interfaces:
Comparable<Track>
- Direct Known Subclasses:
LocalTrack
,SealsTrack
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 Summary
Modifier and TypeFieldDescriptionprotected static File
The folder where the individual tracks that were downloaded will be cached so that they can be reused across multiple evaluation session.protected GoldStandardCompleteness
Completeness of the gold standard for all test cases.private static final org.slf4j.Logger
Default Loggerprotected String
protected String
protected boolean
protected boolean
If true, store and load testcases in a folder structure where ontologies are only stored once and not copied for every testcase.protected String
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructorprotected
protected
Track
(String remoteLocation, String name, String version, boolean useDuplicateFreeStorageLayout, GoldStandardCompleteness goldStandardCompleteness) protected
Track
(String remoteLocation, String name, String version, boolean useDuplicateFreeStorageLayout, GoldStandardCompleteness goldStandardCompleteness, boolean skipTestsWithoutRefAlign) -
Method Summary
Modifier and TypeMethodDescriptionint
protected abstract void
protected String
boolean
static File
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 "-".getDistinctOntologies
(List<TestCase> testCases) getDistinctOntologiesMap
(List<TestCase> testCases) Obtain an example test case (the first one).getName()
Returns a string containing name and version of track in url encoded fashion.protected static String
getTestCase
(int index) Obtain a test case using the index.getTestCase
(String name) Obtain a test case using a specified name.Return all test cases of the track.getTestCases
(String... names) Obtain multiple test cases using specified test case names.getTestCases
(List<String> testCaseNames) Obtain multiple test cases using specified test case names.int
hashCode()
Reads and parses test cases.Reads and parses test cases.private String
removeExtension
(String filename) protected void
saveInDefaultLayout
(File f, String testCaseName, TestCaseType type) protected void
saveInDefaultLayout
(InputStream in, String testCaseName, TestCaseType type) protected void
saveInDefaultLayout
(URL url, String testCaseName, TestCaseType type) protected void
saveInDuplicateFreeLayout
(InputStream in, String testCaseName, TestCaseType type) protected void
saveInTestCaseLayout
(InputStream in, String testCaseName, TestCaseType type) protected void
saveToFile
(InputStream inputStream, File file) Writes an input stream to a file.static void
setCacheFolder
(File directory) Folder where the tracks and the corresponding test cases shall be cached.void
setSkipTestCasesWithoutRefAlign
(boolean skip) toString()
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGERDefault Logger -
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
-
name
-
version
-
testCases
-
useDuplicateFreeStorageLayout
protected boolean useDuplicateFreeStorageLayoutIf 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
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
-
Track
Constructor- Parameters:
remoteLocation
- The remote location.name
- The test case name.version
- The test case version.
-
-
Method Details
-
setCacheFolder
Folder where the tracks and the corresponding test cases shall be cached.- Parameters:
directory
- Target directory.
-
setSkipTestCasesWithoutRefAlign
public void setSkipTestCasesWithoutRefAlign(boolean skip) -
getRemoteLocation
-
getName
-
getVersion
-
getTestCases
Return all test cases of the track.- Returns:
- A list of
TestCase
instances belonging to this track.
-
getTestCases
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
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
-
getTestCase
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
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
Obtain an example test case (the first one). throws NoSuchElementException if there are no test cases.- Returns:
- Test case.
-
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
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
-
getDistinctOntologiesMap
-
getDistinctOntologiesMap
-
readFromCache
-
downloadToCache
- Throws:
Exception
-
saveToFile
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
-
saveInTestCaseLayout
-
saveInDuplicateFreeLayout
-
saveInDefaultLayout
-
saveInDefaultLayout
-
saveInDefaultLayout
-
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
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
-
removeExtension
-
getNiceRemoteLocation
-
getCacheFolder
-
toString
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Track>
-