All Implemented Interfaces:
IMatcher<org.apache.jena.ontology.OntModel,Alignment,Properties>, eu.sealsproject.platform.res.domain.omt.IOntologyMatchingToolBridge, eu.sealsproject.platform.res.tool.api.IPlugin, eu.sealsproject.platform.res.tool.api.IToolBridge

public class ParisMatcher extends MatcherYAAAJena
This is a wrapper for PARIS matching system by Fabian Suchanek et al. The corresponding paper is called PARIS: Probabilistic Alignment of Relations, Instances, and Schema. It will download the matcher if not already done and execute it as an external process. The equivalence files of the last iteration are then read into a YAAA aligment. It is tested to run with java 1.7 and 1.8.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • PARIS_WEB_LOCATION

      private static final URL PARIS_WEB_LOCATION
    • pathToParisJar

      private File pathToParisJar
      Path to the Paris matcher jar file.
    • tmpFolder

      private File tmpFolder
      Folder in which the ontologies and output file of PARIS are stored. The created folders in it are removed after a run.
    • javaCommand

      private String javaCommand
      The java command which is usually just "java" but can also be a fully qualified path to a java runtime.
    • javaRuntimeArguments

      private List<String> javaRuntimeArguments
      A list of java runtime arguments like "-Xmx2g" or the like
  • Constructor Details

    • ParisMatcher

      public ParisMatcher(File pathToParisJar, File tmpFolder, String javaCommand, List<String> javaRuntimeArguments)
      Constructor with all attributes. Be careful with the second parameter because the provided folder is deleted after a run. Thus specify a non existent folder which is created and then removed.
      Parameters:
      pathToParisJar - Path to the Paris matcher jar file. If file is not existent then version 0.3 it will be downloaded.
      tmpFolder - Folder in which the ontologies and output file of PARIS are stored. The created folders in it are removed after a run.
      javaCommand - The java command which is usually just "java" but can also be a fully qualified path to a java runtime.
      javaRuntimeArguments - A list of java runtime arguments like "-Xmx2g" or the like
    • ParisMatcher

      public ParisMatcher(File pathToParisJar, String javaCommand, List<String> javaRuntimeArguments)
      Constructor which uses a temp directory as a storage for files produced by PARIS.
      Parameters:
      pathToParisJar - Path to the Paris matcher jar file. If file is not existent then version 0.3 it will be downloaded.
      javaCommand - The java command which is usually just "java" but can also be a fully qualified path to a java runtime.
      javaRuntimeArguments - A list of java runtime arguments like "-Xmx2g" or the like
    • ParisMatcher

      public ParisMatcher(File pathToParisJar)
      Constructor which uses the default java executable (available in PATH) and no java parameters are used. A temp directory as a storage for files produced by PARIS is used.
      Parameters:
      pathToParisJar - Path to the Paris matcher jar file. If file is not existent then version 0.3 it will be downloaded.
    • ParisMatcher

      public ParisMatcher(List<String> javaRuntimeArguments)
      Constructor which only needs the additional java runtime arguments. A temp directory as a storage for files produced by PARIS is used.
      Parameters:
      javaRuntimeArguments - A list of java runtime arguments like "-Xmx2g" or the like
    • ParisMatcher

      public ParisMatcher()
      Constructor which expects the Paris matcher to be in the working directory and called "paris.jar". It uses the default java executable (available in PATH) and maximum heap size of 10G. A temp directory as a storage for files produced by PARIS is used.
  • Method Details

    • match

      public Alignment match(URL source, URL target, Alignment inputAlignment, Properties properties) throws Exception
      Description copied from class: MatcherYAAA
      Aligns two ontologies specified via URL, with an input alignment as Alignment object, and returns the mapping of the resulting alignment. Note: This method might be called multiple times in a row when using the evaluation framework. Make sure to return a mapping which is specific to the given inputs.
      Overrides:
      match in class MatcherYAAAJena
      Parameters:
      source - this url represents the source ontology
      target - this url represents the target ontology
      inputAlignment - this mapping represents the input alignment
      properties - additional properties
      Returns:
      The resulting mapping of the matching process.
      Throws:
      Exception - An exception that was risen while matching.
    • match

      public Alignment match(org.apache.jena.ontology.OntModel source, org.apache.jena.ontology.OntModel target, Alignment inputAlignment, Properties properties) throws Exception
      Description copied from class: MatcherYAAAJena
      Aligns two ontologies specified via a Jena OntModel, with an input alignment as Alignment object, and returns the mapping of the resulting alignment. Note: This method might be called multiple times in a row when using the evaluation framework. Make sure to return a mapping which is specific to the given inputs.
      Specified by:
      match in interface IMatcher<org.apache.jena.ontology.OntModel,Alignment,Properties>
      Specified by:
      match in class MatcherYAAAJena
      Parameters:
      source - This OntModel represents the source ontology.
      target - This OntModel represents the target ontology.
      inputAlignment - This mapping represents the input alignment.
      properties - Additional properties.
      Returns:
      The resulting alignment of the matching process.
      Throws:
      Exception - Any exception which occurs during matching.
    • runProcess

      private void runProcess(File tmpFolderForResults) throws IOException, InterruptedException
      Throws:
      IOException
      InterruptedException
    • getAlignment

      private Alignment getAlignment(File outputFolder)
    • findEquivalence

      private Alignment findEquivalence(Alignment directionOne, Alignment directionTwo)
    • getAlignmentHighestIteration

      private Alignment getAlignmentHighestIteration(List<File> files)
    • urlToNTripleFile

      private void urlToNTripleFile(URL url, File file)
    • modelToNTripleFile

      private void modelToNTripleFile(org.apache.jena.rdf.model.Model m, File file)
    • createURL

      private static URL createURL(String url)