Class MatcherSeals
java.lang.Object
eu.sealsproject.platform.res.tool.impl.AbstractPlugin
de.uni_mannheim.informatik.dws.melt.matching_base.MatcherURL
de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile
de.uni_mannheim.informatik.dws.melt.matching_base.external.seals.MatcherSeals
- All Implemented Interfaces:
eu.sealsproject.platform.res.domain.omt.IOntologyMatchingToolBridge
,eu.sealsproject.platform.res.tool.api.IPlugin
,eu.sealsproject.platform.res.tool.api.IToolBridge
This matcher wraps the SEALS client such that a SEALS zip file or folder can be executed.
If multiple matcher should be instantiated, have a look at MatcherSealsBuilder buildFromFolder.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
If true, the input alignment is not passed to SEALS even if one is provided.private boolean
If true, the original matcher folder is untouched and the folder is copied.private String
The command to start java in the terminal.The parameters that appear between java [parameters] -jar.private static final org.slf4j.Logger
private File
The folder which represents one matcher.private static final Pattern
Regex pattern to get the matcher name from the SEALSdescriptor.xml
file.private static final String
private static final String
private File
Path to the JAR of the SEALS client.private long
Time out for the external seals process.private TimeUnit
Time unit for the process time out.private File
Path to a temporary folder.Fields inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile
FILE_PREFIX, FILE_SUFFIX
-
Constructor Summary
ConstructorDescriptionMatcherSeals
(File matcherFileOrFolder) The SEALS client will be search in the systems tmp directory with the name seals-omt-client-v7.0.5.jar.MatcherSeals
(File matcherFileOrFolder, File sealsClientJar) Constructor with reasonable defaults like 12 hours timeout, no runtime parameter, java as the java command and no new matcher instance every time.MatcherSeals
(File matcherFileOrFolder, File sealsClientJar, long timeout, TimeUnit timeoutTimeUnit, List<String> javaRuntimeParameters, boolean freshMatcherInstance, boolean doNotUseInputAlignment, String javaCommand) MatcherSeals
(File matcherFileOrFolder, File sealsClientJar, File tmpFolder, long timeout, TimeUnit timeoutTimeUnit, List<String> javaRuntimeParameters, boolean freshMatcherInstance, boolean doNotUseInputAlignment, String javaCommand) Constructor with all parameters.MatcherSeals
(String matcherFileOrFolderPath) The SEALS client will be search in the systems tmp directory with the name seals-omt-client-v7.0.5.jar. -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
copyDirectory
(File targetDirectory, File sourceDirectory) private static void
downloadSealsIfNecessary
(File sealsClientJar) private static String
static File
getFirstSubDirectoryRunnableInSeals
(File rootDir) This method visits all folders below the starting directory and returns the first directory which is runnable in seals.static String
Returns the matcher name in the seals descriptor.getName()
static String
static String
static boolean
isDirectoryRunnableInSeals
(File directory) Determines whether the specified directory is runnable in seals.private boolean
isJava8()
void
private static File
prepareMatcherFolder
(File tmpDirectory, File matcherFileOrFolder) void
setJavaCommand
(String javaCommand) void
setSealsClientJar
(File sealsClientJar) toString()
private static void
unzipToDirectory
(File targetDirectory, File sourceFile, boolean deleteOnExit) Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherFile
match
Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherURL
align, align, canExecute, getType
Methods inherited from class eu.sealsproject.platform.res.tool.impl.AbstractPlugin
getId, getVersion, setId, setVersion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface eu.sealsproject.platform.res.tool.api.IPlugin
getId, getVersion
-
Field Details
-
SEALS_DOWNLOAD_URL_VERSION
- See Also:
-
SEALS_DOWNLOAD_URL
- See Also:
-
LOGGER
private static final org.slf4j.Logger LOGGER -
matcherFolder
The folder which represents one matcher. -
sealsClientJar
Path to the JAR of the SEALS client. -
tmpFolder
Path to a temporary folder. Default is set to the systems tmp. In this folder creates folders will be created and can be removed after execution. -
timeout
private long timeoutTime out for the external seals process. The timeout is applied for each testcase and not track. -
timeoutTimeUnit
Time unit for the process time out. -
javaRuntimeParameters
The parameters that appear between java [parameters] -jar. Example: ("-Xmx25g", "-Xms15g"). -
freshMatcherInstance
private boolean freshMatcherInstanceIf true, the original matcher folder is untouched and the folder is copied. Some matchers require this, because the do not close some resources. -
doNotUseInputAlignment
private boolean doNotUseInputAlignmentIf true, the input alignment is not passed to SEALS even if one is provided. -
javaCommand
The command to start java in the terminal. Typically, this is "java" Seals needs java version 1.8 -
matcherNamePattern
Regex pattern to get the matcher name from the SEALSdescriptor.xml
file.
-
-
Constructor Details
-
MatcherSeals
public MatcherSeals(File matcherFileOrFolder, File sealsClientJar, File tmpFolder, long timeout, TimeUnit timeoutTimeUnit, List<String> javaRuntimeParameters, boolean freshMatcherInstance, boolean doNotUseInputAlignment, String javaCommand) Constructor with all parameters. IMPORTANT: the sealsHome folder will be deleted (do not use any folder which contains content). USE IT WITH CARE. The Seals client will be downloaded on demand, if necessary.- Parameters:
matcherFileOrFolder
- The file (zip file) or folder which represents one matcher.sealsClientJar
- The path to the local SEALS client JAR file.tmpFolder
- folder to store the matcher temporary.timeout
- Timeout for one testcase as long.timeoutTimeUnit
- The unit of the timeout.javaRuntimeParameters
- Runtime parameters such as ("-Xmx25g", "-Xms15g").freshMatcherInstance
- If true, the original matcher folder is untouched and the folder is copieddoNotUseInputAlignment
- If true, the input alignment is not passed to SEALS even if one is provided.javaCommand
- the java 1.8 command on the system. usually it is just java
-
MatcherSeals
-
MatcherSeals
Constructor with reasonable defaults like 12 hours timeout, no runtime parameter, java as the java command and no new matcher instance every time.- Parameters:
matcherFileOrFolder
- The file (zip file) or folder which represents one matcher.sealsClientJar
- the seals client jar
-
MatcherSeals
The SEALS client will be search in the systems tmp directory with the name seals-omt-client-v7.0.5.jar.- Parameters:
matcherFileOrFolder
- The file (zip file) or folder which represents one matcher.
-
MatcherSeals
The SEALS client will be search in the systems tmp directory with the name seals-omt-client-v7.0.5.jar.- Parameters:
matcherFileOrFolderPath
- The file (zip file) or folder which represents one matcher.
-
-
Method Details
-
getSealsDownloadUrlVersion
-
getSealsFileName
-
downloadSealsIfNecessary
-
prepareMatcherFolder
-
isJava8
private boolean isJava8() -
match
public void match(URL source, URL target, URL inputAlignment, File alignmentResult) throws Exception - Specified by:
match
in classMatcherFile
- Throws:
Exception
-
getFirstSubDirectoryRunnableInSeals
This method visits all folders below the starting directory and returns the first directory which is runnable in seals. The traversing strategy is breadth first search.- Parameters:
rootDir
- Path to the starting directory.- Returns:
- The first directory which is runnable in seals or null if such a folder does not exist
-
copyDirectory
-
unzipToDirectory
-
isDirectoryRunnableInSeals
Determines whether the specified directory is runnable in seals.- Parameters:
directory
- Path to the directory.- Returns:
- True if runnable, else false.
-
getName
-
getMatcherFolder
-
toString
-
getMatcherNameFromSealsDescriptor
Returns the matcher name in the seals descriptor.- Parameters:
file
- File instance which points to a descriptor file or a matcher directory.- Returns:
- name of the matcher or MatcherSeals-randomNumber if not available.
-
getDefaultMatcherName
-
getSealsClientJar
-
setSealsClientJar
-
getJavaCommand
-
setJavaCommand
-
getTimeoutAsText
-