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.external.cli.MatcherCLI
All Implemented Interfaces:
IMatcher<URL,URL,URL>, eu.sealsproject.platform.res.domain.omt.IOntologyMatchingToolBridge, eu.sealsproject.platform.res.tool.api.IPlugin, eu.sealsproject.platform.res.tool.api.IToolBridge
Direct Known Subclasses:
MatcherCLIFromFile

public abstract class MatcherCLI extends MatcherURL implements IMatcher<URL,URL,URL>
Matcher for running external matchers (require the subclass to create a command to execute).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract String
    The command which should be executed as one string (containing potentially multiple arguments).The line is splitted by whitespace but quotations are respected.
    private Map<String,Object>
    getSubsitiutionMap(URL source, URL target, URL inputAlignment, URL parameters)
     
    protected boolean
    if set to true, all logging should go to stderr and the result of the process (url or alignment api format) should go to stdout.
    match(URL source, URL target, URL inputAlignment)
    Match two ontologies / knowledge graphs together and returns an alignment.
    match(URL source, URL target, URL inputAlignment, URL parameters)
    Aligns two ontologies/knowledge graphs given as the first and second parameter.

    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, toString, wait, wait, wait

    Methods inherited from interface eu.sealsproject.platform.res.tool.api.IPlugin

    getId, getVersion
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
  • Constructor Details

    • MatcherCLI

      public MatcherCLI()
  • Method Details

    • isUsingStdOut

      protected boolean isUsingStdOut()
      if set to true, all logging should go to stderr and the result of the process (url or alignment api format) should go to stdout. if set to false, all logging should go to stdout and the result of the process (url or alignment api format) should go to stderr.
      Returns:
      true, all logging should go to stderr and the result of the process (url or alignment api format) should go to stdout, false otherwise
    • match

      public URL match(URL source, URL target, URL inputAlignment) throws Exception
      Description copied from class: MatcherURL
      Match two ontologies / knowledge graphs together and returns an alignment.
      Specified by:
      match in class MatcherURL
      Parameters:
      source - The source ontology / knowledge graph
      target - The target ontology / knowledge graph
      inputAlignment - The input alignment as URL (alignment API format)
      Returns:
      An alignment as URL (most often as file URL) the format is again the alignment API format.
      Throws:
      Exception - in case something went wrong.
    • getCommand

      protected abstract String getCommand() throws Exception
      The command which should be executed as one string (containing potentially multiple arguments).The line is splitted by whitespace but quotations are respected. An argument line can contain scopes (scopes are only printed if all variables in a scope can be replaced). The following varaibles are replaced:
      • ${source} with source URI
      • ${target} with target URI
      • ${inputAlignment} with inputAlignment URI
      • ${parameters} with parameters URI
      • system properties like ${line.separator} or ${file.separator} ${java.io.tmpdir}
      • environment variables like ${PATH}
      • JVM arguments like ${Xmx} which is replaced by e.g. -Xmx10G
      For more see ExternalProcess.addSubstitutionForSystemProperties(), ExternalProcess.addSubstitutionForEnvironmentVariables() and ExternalProcess.addSubstitutionForJVMArguments(). The String can also contain scopes which are created with $[...]. The scope is only printed if all variables in the scope can be replaced. This is good for named arguments like: $[-i ${inputAlignment}] then only -i is printed if the input alignment is set.
      Returns:
      the string which represents the command to execute.
      Throws:
      Exception - in case something goes from when generating the command
    • getSubsitiutionMap

      private Map<String,Object> getSubsitiutionMap(URL source, URL target, URL inputAlignment, URL parameters)
    • match

      public URL match(URL source, URL target, URL inputAlignment, URL parameters) throws Exception
      Description copied from interface: IMatcher
      Aligns two ontologies/knowledge graphs given as the first and second parameter. An additional input alignment can be given as well as parameters which further define how and what to match. In case inputAlignment or parameters is not used, making them to the Object class, will required no additional transformations of these objects (no overhead).
      Specified by:
      match in interface IMatcher<URL,URL,URL>
      Parameters:
      source - this object represents the source ontology/knowledge graph
      target - this object represents the target ontology/knowledge graph
      inputAlignment - this object represents the input alignment.
      parameters - object representing additional parameters. Only add to this object and do not create a new Object like parameters= new ...() because otherwise the parameters are lost (java ist call by value). Sensible classes are Properties (preferred), Map<String, Object> or any similar data structure. Some already specified keys (strings) can be found at ParameterConfigKeys.
      Returns:
      the resulting alignment of the matching process.
      Throws:
      Exception - any exception which occurs during matching