dwslab / melt

MELT - Matching EvaLuation Toolkit
MIT License
47 stars 12 forks source link

How to deeply parse ontologies in simpleWebMatcher by OWLAPI #102

Closed liweizhuo001 closed 3 years ago

liweizhuo001 commented 3 years ago

For MatcherYAAAOwlApi extends MatcherYAAA implements IMatcher<OWLOntology, Alignment, Properties>

I want to obtain the disjoint classes of given class, but my orignal code can not work.

OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology onto = manager.loadOntologyFromOntologyDocument(file); 
OWLClass c : onto.getClassesInSignature();
{
     Set<OWLClassExpression> disjoints=c.getDisjointClasses(onto);  
}

//The warning: The method getDisjointClasses(OWLOntology) is undefined for the type OWLClass

If I want to obtain the domain or range of given objectpropertyies or dataproperties. This orignal code can not support.

OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology onto = manager.loadOntologyFromOntologyDocument(file); 

OWLObjectProperty op : onto.getObjectPropertiesInSignature()
{
    Set<OWLClassExpression> Domain= op.getDomains(onto);
    Set<OWLClassExpression> Range= op.getRanges(onto);
}

The method getDomains(OWLOntology) is undefined for the type OWLObjectProperty The method getRanges(OWLOntology) is undefined for the type OWLObjectProperty

The problem is similar to the dataproperties.

Does the pom.xml contain the complete OWLAPI in this simpleWebMatcher project? or the above methods have been changed in new OWLAPI?

Please tell me the reason, because these source codes asserted in OWLAPI_tools.java can be successfully run in my Matcher.

liweizhuo001 commented 3 years ago
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology onto = manager.loadOntologyFromOntologyDocument(file); 
OWLClass c : onto.getClassesInSignature();
{
    Set<OWLAnnotationProperty> annos = c.getAnnotationPropertiesInSignature();
}

c. getAnnotationPropertiesInSignature() can not be used, which can obtain the labels or comments of the given class.

janothan commented 3 years ago

Hi @liweizhuo001,

it is hard to reproduce your problem. Which version of the OWL API do you require? MELT uses a rather recent version.

In case the problem is rooted merely in the OWL API version, you can just add your required version to the pom.xml such as:

<dependency>
            <groupId>net.sourceforge.owlapi</groupId>
            <artifactId>owlapi-distribution</artifactId>
            <version>5.1.9</version>
</dependency>

Do you mind sharing your project with us so that we can have a quick look in case the proposed solution does not work for you?

Best regards, Jan

liweizhuo001 commented 3 years ago

Thank you. I have try to add this dependency in pom.xml, but it does not work.

Besides, we add some exteral lib such as org.semanticweb.elk.jar and HermiT_1.3.6.jar. Both of them are not helpful. I guess the methods may conflict with the existing packages. Because some of methods in my define class OWLAPI_tools.java can be worked.

The modifies project based on your simpleWebMatcher project is https://drive.google.com/file/d/1qNhaNaj9KySbztwgBhqmhNentEQN83l5/view?usp=sharing

My defined class OWLAPI_tools.java in Tools package for parsing ontologies can not work in presented environment.

If MatcherBridge.java in Action package can run successfully in this maven project, then the file called GMap_MELT_OWLAPI.java in de.uni_mannheim.informatik.dws.melt.demomatcher package can be tested.

package de.uni_mannheim.informatik.dws.melt.demomatcher;

import java.net.URL;
import java.util.ArrayList;
import java.util.Properties;

import org.semanticweb.owlapi.model.OWLOntology;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import Actions.GMap_D;
import de.uni_mannheim.informatik.dws.melt.matching_owlapi.MatcherYAAAOwlApi;
import de.uni_mannheim.informatik.dws.melt.yet_another_alignment_api.Alignment;
import de.uni_mannheim.informatik.dws.melt.yet_another_alignment_api.CorrespondenceRelation;
public class GMap_MELT_OWLAPI extends MatcherYAAAOwlApi {  
    private static final Logger LOGGER = LoggerFactory.getLogger(GMap_MELT_OWLAPI.class);
    public GMap_D gmap;
    public ArrayList<String> mappings;

    public Alignment match(URL source, URL target, Alignment inputAlignment, Properties properties) throws Exception    
    {
        Alignment alignment = new Alignment();
        try {           
            gmap  =new GMap_D();            
            gmap.init(source, target);

            LOGGER.info("Matching with GMap completed");

            URL url_alignment=gmap.returnAlignmentFile();           
            mappings=gmap.GetAligenmt();            
            for(String s:mappings)
            {
                System.out.println(s);
                String parts[]=s.split(",");

                alignment.add(parts[0],parts[1],Double.parseDouble(parts[3]),CorrespondenceRelation.EQUIVALENCE);               
            }                       
        }
        catch (Exception e){
            LOGGER.error("Error matching with GMap");
            LOGGER.error(e.getLocalizedMessage());
        }

        return alignment;
    }

    public Alignment match(OWLOntology source, OWLOntology target, Alignment inputAlignment, Properties p)
            throws Exception {
        Alignment alignment = new Alignment();  
        try {                       
            LOGGER.info("Matching with GMap completed");
            mappings=gmap.GetAligenmt();            
            for(String s:mappings)
            {
                System.out.println(s);
                String parts[]=s.split(",");

                alignment.add(parts[0],parts[1],Double.parseDouble(parts[3]),CorrespondenceRelation.EQUIVALENCE);               
            }           
        }           
            catch (Exception e){
                LOGGER.error("Error matching with GMap");
                LOGGER.error(e.getLocalizedMessage());
            }

        return alignment;   
    }

}

My original project is https://github.com/liweizhuo001/GMap1.1, which has finished three tracks in OAEI 2015. Although it is not a maven project and its code is so coarse, I believe that its inputs and outputs are very friendly for most users.

Besides, I hope that MatcherYAAAOwlApi.java could support more parse ways such as supporting local paths or URLs of ontologies.

sven-h commented 3 years ago

Hi @liweizhuo001 ,

the methods in OWLAPI changed over time (since 2015). Thus your code does not work with a new version of OWLAPI which MELT actually uses. But as Jan already mentioned, you can change the version to the one you like. This has really nothing to do with MELT but with your code and further developments in OWLAPI.

I checked your code and searched for the version of OWLAPI which works with your code:

<dependency>
        <groupId>net.sourceforge.owlapi</groupId>
        <artifactId>owlapi-distribution</artifactId>
        <version>3.5.7</version>
</dependency>

Furthermore the stanford NLP dependency was also missing

<dependency>
    <groupId>edu.stanford.nlp</groupId>
    <artifactId>stanford-corenlp</artifactId>
    <version>1.3.4</version>
</dependency>

These two dependencies use really old versions of the libraries but then it can at least compile.

Best regards Sven

liweizhuo001 commented 3 years ago

Thank you very much. I have solved this problem to some extend.

The following code is my instantiated code of GMap_MELT_OWLAPI.java.

package de.uni_mannheim.informatik.dws.melt.demomatcher;
import java.net.URL;
import java.util.ArrayList;
import java.util.Properties;
import org.semanticweb.owlapi.model.OWLOntology;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import Actions.GMap_D;
import de.uni_mannheim.informatik.dws.melt.matching_owlapi.MatcherYAAAOwlApi;
import de.uni_mannheim.informatik.dws.melt.yet_another_alignment_api.Alignment;
import de.uni_mannheim.informatik.dws.melt.yet_another_alignment_api.CorrespondenceRelation;

public class GMap_MELT_OWLAPI extends MatcherYAAAOwlApi {  
    private static final Logger LOGGER = LoggerFactory.getLogger(GMap_MELT_OWLAPI.class);
    public GMap_D gmap;
    public ArrayList<String> mappings;

    public Alignment match(URL source, URL target, Alignment inputAlignment, Properties properties) throws Exception    
    {
        Alignment alignment = new Alignment();
        try {
            gmap  =new GMap_D();            
            gmap.init(source, target);

            LOGGER.info("Matching with GMap completed");

            URL url_alignment=gmap.returnAlignmentFile();

            mappings=gmap.GetAligenmt();

            for(String s:mappings)
            {
                System.out.println(s);
                String parts[]=s.split(",");

                alignment.add(parts[0],parts[1],Double.parseDouble(parts[3]),CorrespondenceRelation.EQUIVALENCE);               
            }

        }
        catch (Exception e){
            LOGGER.error("Error matching with GMap");
            LOGGER.error(e.getLocalizedMessage());
        }

        return alignment;
    }

    public Alignment match(OWLOntology source, OWLOntology target, Alignment inputAlignment, Properties p)
            throws Exception {
        Alignment alignment = new Alignment();

        try {                       
            LOGGER.info("Matching with GMap completed");
            mappings=gmap.GetAligenmt();

            for(String s:mappings)
            {
                System.out.println(s);
                String parts[]=s.split(",");

                alignment.add(parts[0],parts[1],Double.parseDouble(parts[3]),CorrespondenceRelation.EQUIVALENCE);               
            }       
        }       
            catch (Exception e){
                LOGGER.error("Error matching with GMap");
                LOGGER.error(e.getLocalizedMessage());
            }       
        return alignment;   
    }
}

This file is my matcher tested result for MELT. systemAlignment.txt

The next question is how to output the whole results (containing properites) of alignment between two conference ontologies? Because the presented results only contain mappings of class.

I guess there have two ways to achieve my goal:

  1. There exist the code testing for whole results, simialr as

    GMap_MELT_OWLAPI classMatcher = new GMap_MELT_OWLAPI();
    Map<String, IOntologyMatchingToolBridge> matchers = new HashMap<>();
    matchers.put("Class Matcher", classMatcher);
    ExecutionResultSet result = Executor.run(TrackRepository.Conference.V1.getTestCase("confof-sigkdd"), matchers);
  2. I can directly package this modified maven project but I am not sure the below pom.xml is right. The suffix name needs to be changed to ".xml" pom.txt

I sincerely hope that you can tell me the right ways. Thank you very much.

janothan commented 3 years ago

Hi,

(1) you overwrote match(URL source...) and match(OWLOntology source...). Since you extend the MatcherYAAAOwlApi, it is sufficient to only implement match(OWLOntology source...). If you want to only overwrite match(URL source...), just extend MatcherURL.

(2) We are not sure about this question. Your code in option 1 looks good. This will run the matcher on the confof-sigkdd test case. The systemAlignment.rdf generated by EvaluatorCSV contains the complete alignment (with properties). If the matcher only matches classes, you will find only classes in the systemAlignment.rdf file. Hence, missing properties in the system alignment are likely a problem of the matcher implementation. Your pom.xml also looks ok on first sight. Note that this POM will package a docker container for you (not a SEALS package).

We hope this helps, Jan & Sven

liweizhuo001 commented 3 years ago

Thank you very much. I have successfully run My Matcher in my local maven project simpleSealsMatcher and simpleWebMatcher.

The corresponding test file is EvaluateMatcher3.java in de.uni_mannheim.informatik.dws.melt.demomatcher package in simpleSealsMatcher.

The corresponding test file is EvaluationExample3.java in de.uni_mannheim.informatik.dws.melt.demomatcher package in simpleWebMatcher.

However, I can not package the simpleSealsMatcher by the comand line mvn clean package or mvn clean install.

For simpleSealsMatcher2021 (renamed), The linkage of google drive is: https://drive.google.com/file/d/1Eeki-S2mXFYjtzfQmXTn23Wf-nxqz_f8/view?usp=sharing

The error messages focus on the missing of my package.

[error]/users/liweizhuo/eclipse-workspace-new/simplesealmatcher2021/src/main/Java/jws/jws.java: [6,1] the package edu.mit.jwi.item does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplesealmatcher2021/src/main/Java/jws/jws.java: [7,1] the package edu.mit.jwi.data does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplesealmatcher2021/src/main/Java/jws/jws.java: [12,1] the package edu.mit.jwi does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplesealmatcher2021/src/main/Java/jws/jws.java: [13,1] the package edu.mit.jwi does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplesealmatcher2021/src/main/Java/jws/jws.java: [14,1] the package edu.mit.jwi.data does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplesealmatcher2021/src/main/Java/jws/jws.java: [15,1] the package edu.mit.jwi.data.compare does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplesealmatcher2021/src/main/Java/jws/jws.java: [16,1] the package edu.mit.jwi.data.parse does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplesealmatcher2021/src/main/Java/jws/jws.java: [17,1] the package edu.mit.jwi.item does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplesealmatcher2021/src/main/Java/jws/jws.java: [18,1] the package edu.mit.jwi.morph does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplesealmatcher2021/src/main/Java/jws/jws.java: [19,24] the package edu.mit.jwi.item does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplesealmatcher2021/src/main/Java/jws/jws.java: [20,19] the package edu.mit.jwi does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplesealmatcher2021/src/main/Java/jws/jws.java: [37,17] no symbol found

For simpleWebMatcherG (renamed), The linkage of google drive is: https://drive.google.com/file/d/1-t-Q0AmJ2wg5IaX9F00OLVuLI9Kw2hpX/view?usp=sharing Notice that, the following sentence in pom.xml java-cp ... can not be divided in three lines.

<cmd>
<shell>java -cp "${project.build.finalName}.${project.packaging}:lib/*" de.uni_mannheim.informatik.dws.melt.receiver_http.Main</shell>
</cmd>

and need to add below dependency of hermit.

<dependency>
       <groupId>com.hermit-reasoner</groupId>
       <artifactId>org.semanticweb.hermit</artifactId>
      <version>1.3.8.1</version>
</dependency>

Although I finished the package GMap by Web Interface (simpleWebMatcher), I still meet one problem. Its error messages is

2021-08-25 22:52:48 INFO  [main                          ] 148  in MatcherDockerFile    - Load docker image from file /Users/liweizhuo/eclipse-workspace-new/simpleWebMatcherG/target/classes/gmap-1.0-web-latest.tar.gz to docker registry.
2021-08-25 22:53:04 INFO  [main                          ] 171  in MatcherDockerFile    - Starting container from image gmap-1.0-web (port 8080 from container is mapped to port 58900 in host)
2021-08-25 22:53:04 INFO  [main                          ] 182  in MatcherDockerFile    - Container started with id 2caa4c0cb6ba624535c2f07a48f216ed046ebff0ef6c95e9e6418b08272f48e4
2021-08-25 22:53:04 INFO  [main                          ] 184  in MatcherDockerFile    - To see log output of container, run: docker container logs 2caa4c0cb6ba
2021-08-25 22:53:04 INFO  [main                          ] 125  in Track                - Track cache folder is: /Users/liweizhuo/oaei_track_cache
2021-08-25 22:53:04 INFO  [main                          ] 48   in ExecutionRunner      - Running matcher Docker Matcher on testcase confof-sigkdd (track conference).
2021-08-25 22:53:05 INFO  [main                          ] 149  in MatcherHTTPCall      - Execute now the following HTTP request: POST http://localhost:58900/match HTTP/1.1
2021-08-25 22:53:05 INFO  [main                          ] 179  in MatcherHTTPCall      - Endpoint is not ready / an exception occurred. Sleep for 10 seconds and retry...
2021-08-25 22:53:15 INFO  [main                          ] 149  in MatcherHTTPCall      - Execute now the following HTTP request: POST http://localhost:58900/match HTTP/1.1
2021-08-25 22:53:16 INFO  [main                          ] 64   in ExecutionRunner      - Running matcher Docker Matcher on testcase confof-sigkdd (track conference) completed in 11 seconds.
2021-08-25 22:53:16 ERROR [main                          ] 145  in ExecutionResult      - The system alignment given by following URL could not be parsed: file:/var/folders/9c/_pvrhxjs2c110syrwl6vy0b00000gn/T/alignment6297840510060516846.rdf
org.xml.sax.SAXParseException; Premature end of file.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
    at de.uni_mannheim.informatik.dws.melt.yet_another_alignment_api.AlignmentParser.parse(AlignmentParser.java:101)
    at de.uni_mannheim.informatik.dws.melt.yet_another_alignment_api.AlignmentParser.parse(AlignmentParser.java:84)
    at de.uni_mannheim.informatik.dws.melt.matching_eval.ExecutionResult.silentlyParseAlignment(ExecutionResult.java:140)
    at de.uni_mannheim.informatik.dws.melt.matching_eval.ExecutionResult.getSystemAlignment(ExecutionResult.java:176)
    at de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.EvaluatorCSV.getAlignmentExtensions(EvaluatorCSV.java:184)
    at de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.EvaluatorCSV.<init>(EvaluatorCSV.java:146)
    at de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.EvaluatorCSV.<init>(EvaluatorCSV.java:202)
    at de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.EvaluatorCSV.<init>(EvaluatorCSV.java:211)
    at de.uni_mannheim.informatik.dws.melt.demomatcher.EvaluationExample.main(EvaluationExample.java:61)
2021-08-25 22:53:16 INFO  [main                          ] 228  in EvaluatorCSV         - Evaluate matcher Docker Matcher
2021-08-25 22:53:16 INFO  [main                          ] 81   in OntologyCacheJena    - Reading model into cache (file:/Users/liweizhuo/oaei_track_cache/oaei.webdatacommons.org/conference/conference-v1/confof-sigkdd/source.rdf)
2021-08-25 22:53:17 INFO  [main                          ] 81   in OntologyCacheJena    - Reading model into cache (file:/Users/liweizhuo/oaei_track_cache/oaei.webdatacommons.org/conference/conference-v1/confof-sigkdd/target.rdf)
2021-08-25 22:53:17 INFO  [main                          ] 48   in ExecutionRunner      - Running matcher baseLineMatcher on testcase confof-sigkdd (track conference).
2021-08-25 22:53:17 INFO  [main                          ] 64   in ExecutionRunner      - Running matcher baseLineMatcher on testcase confof-sigkdd (track conference) completed in 0 seconds.
2021-08-25 22:53:17 INFO  [main                          ] 237  in EvaluatorCSV         - Writing alignment cube
2021-08-25 22:53:17 INFO  [main                          ] 124  in AlignmentsCube       - Writing conference | confof-sigkdd | Docker Matcher [to file: /Users/liweizhuo/eclipse-workspace-new/simpleWebMatcherG/results/results_2021-08-25_22-53-16/alignmentCube.csv]

I Notice that the generated systemAlignment.rdf is empty! If I run EvaluationExample3.java in de.uni_mannheim.informatik.dws.melt.demomatcher package in simpleWebMatcher. The output file of systemAlignment.rdf is right as I expected.

I do not know how to solve the first problem, and the second problem may be the parsing of Alignment.

Can you help me or guide me how to solve above problems. Thank you very much.

sven-h commented 3 years ago

For the initial answer you had ( by now you figured out some parts already):

For the first part:

It looks like the pom file is automatically formatted. This actually caused the error. The problematic lines are between line 137 and 141:

<cmd>
    <shell>java -cp 
        "${project.build.finalName}.${project.packaging}:lib/*" 
        de.uni_mannheim.informatik.dws.melt.receiver_http.Main</shell>
</cmd>

You can solve it in two ways: 1) You put the shell command in one line like:

<cmd>
    <shell>java -cp "${project.build.finalName}.${project.packaging}:lib/*" de.uni_mannheim.informatik.dws.melt.receiver_http.Main</shell>
</cmd>

2) You add backslash at the end of each line to indicate that the line continues:

<cmd>
    <shell>java -cp \
        "${project.build.finalName}.${project.packaging}:lib/*" \
        de.uni_mannheim.informatik.dws.melt.receiver_http.Main</shell>
</cmd>

The the second part: The compilation does not work because you missed two dependencies:

<dependency>
    <groupId>edu.mit</groupId>
    <artifactId>jwi</artifactId>
    <version>2.2.3</version>
</dependency>

<dependency>
    <groupId>net.sourceforge.owlapi</groupId>
    <artifactId>org.semanticweb.hermit</artifactId>
    <version>1.3.8.413</version>
</dependency>

The first dependency is also a dependency of matching-eval and thus it was not neccessary in the web packageing project (there the scope test was removed and thus the dependency was included).

Furthermore we would like to mention, that you do not necessarily have to adjust two projects at the same time. You can also move the build plugins and dependencies into one project. Then both packages are created within this one project. We attached a working pom which shows this. In this pom, the matching-eval dependency is in scope test this means, that you should put your evaluation code in the maven test folder or remove the scope within the dependency to run the executor in java classes located in src/main/ folder. Furthermore the matching-jena can be removed if you remove also all example matchers from your project.

For the project covering both packagings you can call mvn package to only build the seals package or mvn install to build the seals and web/docker package.

sven-h commented 3 years ago

For the problem with the docker, can you please add the following lines when evaluating your web package?

Thread.sleep(20000); // just to be sure that all logs are written.
dockerMatcher.logAllLinesFromContainer();

Directly after Executor.run.

Such that it looks like:

// Let's run the matchers on the tracks:
ExecutionResultSet result = Executor.run(TrackRepository.Conference.V1, matchers);

Thread.sleep(20000); // just to be sure that all logs are written.
dockerMatcher.logAllLinesFromContainer();

// Step 3: Use your favorite evaluator to interpret the result.
//         The results are serialized in directory: "./results".
EvaluatorCSV evaluatorCSV = new EvaluatorCSV(result);
evaluatorCSV.writeToDirectory();

And send the full log file. Thank you.

liweizhuo001 commented 3 years ago

Thanks for you help, but I still meet the same problem.

I also attached my pom.xml file shows this. pom-new.txt

My packaged Matcher can be download in googleDrive: https://drive.google.com/file/d/15xUeAH2ekhMvGHgUqlbtfL7V04PpGdiE/view?usp=sharing

The test file is named EvaluationMatcher4Docker.java is shown below.

package de.uni_mannheim.informatik.dws.melt.demomatcher;

import de.uni_mannheim.informatik.dws.melt.matching_base.external.docker.MatcherDockerFile;
import de.uni_mannheim.informatik.dws.melt.matching_data.Track;
import de.uni_mannheim.informatik.dws.melt.matching_data.TrackRepository;
import de.uni_mannheim.informatik.dws.melt.matching_eval.ExecutionResultSet;
import de.uni_mannheim.informatik.dws.melt.matching_eval.Executor;
import de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.EvaluatorCSV;
import eu.sealsproject.platform.res.domain.omt.IOntologyMatchingToolBridge;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Make sure docker is running.
 */
public class EvaluationMatcher4Docker {

    @Test
    //public static void main(String[] args) throws Exception {
    public void evalGMApDocker() throws InterruptedException
    { 
        // CASE 3: Web Docker Package
//      File dockerFile = loadFile("simplewebmatcher-1.0-web-latest.tar.gz");
//      MatcherDockerFile dockerMatcher = new MatcherDockerFile("simplewebmatcher-1.0-web", dockerFile);

        File dockerFile = loadFile("gmap-1.0-web-latest.tar.gz");
        MatcherDockerFile dockerMatcher = new MatcherDockerFile("gmap-1.0-web", dockerFile);

        // STEP 2: Run (execute) the 3 matchers to obtain an ExecutionResultSet instance
        // Let's add all tracks we want to evaluate to a list
        List<Track> tracks = new ArrayList<>();
        tracks.add(TrackRepository.Conference.V1);

        // Let's add all matchers to a map (key: matcher name, value: matcher instance)
        Map<String, IOntologyMatchingToolBridge> matchers = new HashMap<>();
        matchers.put("Docker Matcher", dockerMatcher);

        // Let's run the matchers on the tracks:     
        ExecutionResultSet result = Executor.run(TrackRepository.Conference.V1.getTestCase("confof-sigkdd"), matchers);
        //ExecutionResultSet result = Executor.run(TrackRepository.Conference.V1, matchers); //has some problems
        //ExecutionResultSet result = Executor.run(TrackRepository.Anatomy.Default, matchers);

        Thread.sleep(20000); // just to be sure that all logs are written.
        dockerMatcher.logAllLinesFromContainer();

        // Step 3: Use your favorite evaluator to interpret the result.
        //         The results are serialized in directory: "./results".
        EvaluatorCSV evaluatorCSV = new EvaluatorCSV(result);
        evaluatorCSV.writeToDirectory();
      } 

    /**
     * Helper function to load files in class path that contain spaces.
     * @param fileName Name of the file.
     * @return File in case of success, else null.
     */
    private static File loadFile(String fileName){
        try {
            return FileUtils.toFile(EvaluationMatcher4Docker.class.getClassLoader().getResource(fileName).toURI().toURL());
        } catch (URISyntaxException | MalformedURLException exception){
            exception.printStackTrace();
            System.out.println("Could not load file.");
            return null;
        }
    }
}

However, it still meets the same problem, the full log file is listed as follows.

2021-08-26 01:11:58 INFO  [main                          ] 148  in MatcherDockerFile    - Load docker image from file /Users/liweizhuo/eclipse-workspace-new/simpleWebMatcherG/target/classes/gmap-1.0-web-latest.tar.gz to docker registry.
2021-08-26 01:12:02 INFO  [main                          ] 171  in MatcherDockerFile    - Starting container from image gmap-1.0-web (port 8080 from container is mapped to port 50113 in host)
2021-08-26 01:12:03 INFO  [main                          ] 182  in MatcherDockerFile    - Container started with id 4e55b4f0df5428ce92a81e6a8ca555ac59c80f6602036aa9b0f4bee92266ad29
2021-08-26 01:12:03 INFO  [main                          ] 184  in MatcherDockerFile    - To see log output of container, run: docker container logs 4e55b4f0df54
2021-08-26 01:12:03 INFO  [main                          ] 125  in Track                - Track cache folder is: /Users/liweizhuo/oaei_track_cache
2021-08-26 01:12:03 INFO  [main                          ] 48   in ExecutionRunner      - Running matcher Docker Matcher on testcase confof-sigkdd (track conference).
2021-08-26 01:12:03 INFO  [main                          ] 149  in MatcherHTTPCall      - Execute now the following HTTP request: POST http://localhost:50113/match HTTP/1.1
2021-08-26 01:12:03 INFO  [main                          ] 179  in MatcherHTTPCall      - Endpoint is not ready / an exception occurred. Sleep for 10 seconds and retry...
2021-08-26 01:12:13 INFO  [main                          ] 149  in MatcherHTTPCall      - Execute now the following HTTP request: POST http://localhost:50113/match HTTP/1.1
2021-08-26 01:12:14 INFO  [main                          ] 64   in ExecutionRunner      - Running matcher Docker Matcher on testcase confof-sigkdd (track conference) completed in 11 seconds.
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: 2021-08-25 17:12:03 INFO  [main                          ] 169  in log                  - Logging initialized @408ms to org.eclipse.jetty.util.log.Slf4jLog
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: 2021-08-25 17:12:04 INFO  [main                          ] 82   in Main                 - Matching service runs at: http://localhost:8080/match
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: 2021-08-25 17:12:04 INFO  [main                          ] 375  in Server               - jetty-9.4.34.v20201102; built: 2020-11-02T14:15:39.302Z; git: e46af88704a893fc12cb0e3bf46e2c7b48a009e7; jvm 1.8.0_212-b04
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: 2021-08-25 17:12:04 INFO  [main                          ] 916  in ContextHandler       - Started o.e.j.s.ServletContextHandler@5abca1e0{/,null,AVAILABLE}
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: 2021-08-25 17:12:04 INFO  [main                          ] 331  in AbstractConnector    - Started ServerConnector@5f2050f6{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: 2021-08-25 17:12:04 INFO  [main                          ] 415  in Server               - Started @708ms
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: 2021-08-25 17:12:13 INFO  [qtp42121758-14                ] 109  in Main                 - Got multipart request - start matching
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: 2021-08-25 17:12:13 INFO  [qtp42121758-14                ] 216  in Main                 - Server starts matcher class de.uni_mannheim.informatik.dws.melt.demomatcher.GMap_MELT_OWLAPI_URL for task:
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: Source:file:/tmp/MELT-fileupload3998322477777306619/source-674121753720992054.null
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: Target:file:/tmp/MELT-fileupload3998322477777306619/target-6163105943661809947.null
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: InputAlignment:null
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: Parameter:null
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: Load ontology sucessfully!
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: Load ontology sucessfully!
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: 2021-08-25 17:12:14 INFO  [qtp42121758-14                ] 32   in GMap_MELT_OWLAPI_URL - Initialization with GMap completed
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: Loading default properties from tagger dic/bidirectional-distsim-wsj-0-18.tagger
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: Error: No such trained tagger config file found.
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: java.io.IOException: Unable to resolve "dic/bidirectional-distsim-wsj-0-18.tagger" as either class path, filename or URL
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:408)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at edu.stanford.nlp.tagger.maxent.TaggerConfig.<init>(TaggerConfig.java:179)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at edu.stanford.nlp.tagger.maxent.TaggerConfig.<init>(TaggerConfig.java:131)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at edu.stanford.nlp.tagger.maxent.MaxentTagger.<init>(MaxentTagger.java:250)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at Tools.Sim_Tools.initialPOS(Sim_Tools.java:48)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at Actions.GMap_D.align(GMap_D.java:119)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at Actions.GMap_D.returnAlignmentFile(GMap_D.java:103)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at de.uni_mannheim.informatik.dws.melt.demomatcher.GMap_MELT_OWLAPI_URL.match(GMap_MELT_OWLAPI_URL.java:34)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at de.uni_mannheim.informatik.dws.melt.matching_base.MatcherURL.align(MatcherURL.java:52)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at de.uni_mannheim.informatik.dws.melt.matching_base.MatcherURL.align(MatcherURL.java:35)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at de.uni_mannheim.informatik.dws.melt.matching_base.typetransformer.GenericMatcherCaller.runIOntologyMatchingToolBridge(GenericMatcherCaller.java:200)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at de.uni_mannheim.informatik.dws.melt.matching_base.typetransformer.GenericMatcherCaller.runMatcherMultipleRepresentations(GenericMatcherCaller.java:151)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at de.uni_mannheim.informatik.dws.melt.matching_base.typetransformer.GenericMatcherCaller.runMatcher(GenericMatcherCaller.java:74)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at de.uni_mannheim.informatik.dws.melt.receiver_http.Main.runTool(Main.java:221)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at de.uni_mannheim.informatik.dws.melt.receiver_http.Main.access$200(Main.java:39)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at de.uni_mannheim.informatik.dws.melt.receiver_http.Main$MatcherServlet.doPost(Main.java:134)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:791)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1626)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.servlets.QoSFilter.doFilter(QoSFilter.java:202)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.server.Server.handle(Server.java:516)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:773)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:905)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDERR: at java.lang.Thread.run(Thread.java:748)
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: 2021-08-25 17:12:14 ERROR [qtp42121758-14                ] 51   in GMap_MELT_OWLAPI_URL - Error matching with GMap
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: 2021-08-25 17:12:14 ERROR [qtp42121758-14                ] 52   in GMap_MELT_OWLAPI_URL - Unable to resolve "dic/bidirectional-distsim-wsj-0-18.tagger" as either class path, filename or URL
2021-08-26 01:12:34 INFO  [docker-java-stream-1583816416 ] 359  in DockerLogCallback    - STDOUT: 2021-08-25 17:12:14 ERROR [qtp42121758-14                ] 227  in Main                 - The resulting alignment of the matcher is null.
2021-08-26 01:12:35 ERROR [main                          ] 145  in ExecutionResult      - The system alignment given by following URL could not be parsed: file:/var/folders/9c/_pvrhxjs2c110syrwl6vy0b00000gn/T/alignment2193958175208273623.rdf
org.xml.sax.SAXParseException; Premature end of file.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
    at de.uni_mannheim.informatik.dws.melt.yet_another_alignment_api.AlignmentParser.parse(AlignmentParser.java:101)
    at de.uni_mannheim.informatik.dws.melt.yet_another_alignment_api.AlignmentParser.parse(AlignmentParser.java:84)
    at de.uni_mannheim.informatik.dws.melt.matching_eval.ExecutionResult.silentlyParseAlignment(ExecutionResult.java:140)
    at de.uni_mannheim.informatik.dws.melt.matching_eval.ExecutionResult.getSystemAlignment(ExecutionResult.java:176)
    at de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.EvaluatorCSV.getAlignmentExtensions(EvaluatorCSV.java:184)
    at de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.EvaluatorCSV.<init>(EvaluatorCSV.java:146)
    at de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.EvaluatorCSV.<init>(EvaluatorCSV.java:202)
    at de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.EvaluatorCSV.<init>(EvaluatorCSV.java:211)
    at de.uni_mannheim.informatik.dws.melt.demomatcher.EvaluationMatcher4Docker.evalGMApDocker(EvaluationMatcher4Docker.java:56)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:436)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:170)
    at org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:166)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:113)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:58)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:112)
    at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(HierarchicalTestExecutor.java:120)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
    at java.util.Iterator.forEachRemaining(Iterator.java:116)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:120)
    at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(HierarchicalTestExecutor.java:120)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
    at java.util.Iterator.forEachRemaining(Iterator.java:116)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:120)
    at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:55)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:43)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:170)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:154)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90)
    at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:86)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
2021-08-26 01:12:35 INFO  [main                          ] 228  in EvaluatorCSV         - Evaluate matcher Docker Matcher
2021-08-26 01:12:35 INFO  [main                          ] 81   in OntologyCacheJena    - Reading model into cache (file:/Users/liweizhuo/oaei_track_cache/oaei.webdatacommons.org/conference/conference-v1/confof-sigkdd/source.rdf)
2021-08-26 01:12:35 INFO  [main                          ] 81   in OntologyCacheJena    - Reading model into cache (file:/Users/liweizhuo/oaei_track_cache/oaei.webdatacommons.org/conference/conference-v1/confof-sigkdd/target.rdf)
2021-08-26 01:12:35 INFO  [main                          ] 48   in ExecutionRunner      - Running matcher baseLineMatcher on testcase confof-sigkdd (track conference).
2021-08-26 01:12:35 INFO  [main                          ] 64   in ExecutionRunner      - Running matcher baseLineMatcher on testcase confof-sigkdd (track conference) completed in 0 seconds.
2021-08-26 01:12:35 INFO  [main                          ] 237  in EvaluatorCSV         - Writing alignment cube
2021-08-26 01:12:35 INFO  [main                          ] 124  in AlignmentsCube       - Writing conference | confof-sigkdd | Docker Matcher [to file: /Users/liweizhuo/eclipse-workspace-new/simpleWebMatcherG/results/results_2021-08-26_01-12-35/alignmentCube.csv]

I guess that this problem may be the parsing way of Alignment because of the following errors:

at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
at de.uni_mannheim.informatik.dws.melt.yet_another_alignment_api.AlignmentParser.parse(AlignmentParser.java:101)
at de.uni_mannheim.informatik.dws.melt.yet_another_alignment_api.AlignmentParser.parse(AlignmentParser.java:84)
at de.uni_mannheim.informatik.dws.melt.matching_eval.ExecutionResult.silentlyParseAlignment(ExecutionResult.java:140)
at de.uni_mannheim.informatik.dws.melt.matching_eval.ExecutionResult.getSystemAlignment(ExecutionResult.java:176)
at de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.EvaluatorCSV.getAlignmentExtensions(EvaluatorCSV.java:184)
at de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.EvaluatorCSV.<init>(EvaluatorCSV.java:146)
at de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.EvaluatorCSV.<init>(EvaluatorCSV.java:202)
at de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.EvaluatorCSV.<init>(EvaluatorCSV.java:211)

Can you help me or guide me how to solve this problem. Thank you very much.

For my modified maven project simpleSealsMatcher2021 (package renamed -simpleWebMatcherG-v2) The linkage of google drive is: https://drive.google.com/file/d/1VjXzxrl3hPwZMn94r16C7MRgXvrh4VsD/view?usp=sharing

You can download it and reproduce my problem.

sven-h commented 3 years ago

Thank you for uploading the log. When I analyze the log, this part shows why the matcher could not return any results:

STDERR: Loading default properties from tagger dic/bidirectional-distsim-wsj-0-18.tagger
STDERR: Error: No such trained tagger config file found.
STDERR: java.io.IOException: Unable to resolve "dic/bidirectional-distsim-wsj-0-18.tagger" as either class path, filename or URL
STDERR: at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:408)

Please move all files which are necessary for executing the matcher to a path below the oaei-resources folder or the src/main/resources/ folder. Depending on what location you choose the loading strategy is different. See line 21 in the pom file of the example project.

Also adjust the paths in your code where these files are loaded. Please let me know if this solves your issue.

liweizhuo001 commented 3 years ago

For my modified maven project simpleSealsMatcher2021 (package renamed -simpleWebMatcherG-v2) The linkage of google drive is: https://drive.google.com/file/d/1VjXzxrl3hPwZMn94r16C7MRgXvrh4VsD/view?usp=sharing

You can download it and reproduce my problem. I still doubt that this problem may be the parsing way of Alignment.

Now I am too tired because it's 1: 45 am Beijing time. If you have some time, please help me to finish your mentioned operations, and share your experiences.

**Please move all files which are necessary for executing the matcher to a path below the oaei-resources folder or the src/main/resources/ folder. Depending on what location you choose the loading strategy is different. See line 21 in the pom file of the example project.

Also adjust the paths in your code where these files are loaded.**

I will try to finish these operations tomorrow. Thank you very much.

sven-h commented 3 years ago

Hi @liweizhuo001 ,

in issue #122 , it turned out that for the combination of web packaging and OWLAPI, you need to use MELT version 3.1 to work properly. Nevertheless, all required resources should be put into the oaei-resources folder.

Best regards Sven

liweizhuo001 commented 3 years ago

Thank you, I will try to do it.

Now I have successfully packaged GMap by simpleWebMatcher, which sacrifice of my key modular of stanford-postagger.

Because the maven package of stanford-pos-tagger does not exist.

<dependency>
    <groupId>edu.stanford.nlp</groupId>
    <artifactId>stanford-pos-tagger</artifactId>
    <version>3.0.2</version>
</dependency>

However, the maven package of stanford-corenlp lacks the class edu.stanford.nlp.tagger.maxent.ExtractorPrevTwoTags

<dependency>
         <groupId>edu.stanford.nlp</groupId>
         <artifactId>stanford-corenlp</artifactId>
        <version>1.3.4</version>
</dependency>

I have the local jar called stanford-postagger.jar, by which GMap can run completely in local.

configuration_jar.txt stanford-postagger.jar.zip

The hint in pom.xml

   <!-- Accessing the resources:
    - all files in "oaei-resources" folder are stored in the current working directory and can be accessed with 
          Files.readAllLines(Paths.get("oaei-resources", "configuration_oaei.txt"));
    - all files in "src/main/resources" folder are compiled to the resulting jar and can be accessed with
          getClass().getClassLoader().getResourceAsStream("configuration_jar.txt");
    -->

However, I put it to the "src/main/resources" and add update configuration_jar.txt, but it does not work. The packaged gmap-1.0-web-latest.tar.gz meet the below errors.

Maybe the content of configuration_jar.txt is not right. or there are other setting in pom.xml?

The key error is 2021-08-27 16:19:23 INFO [docker-java-stream-1819277657 ] 359 in DockerLogCallback - STDOUT: 2021-08-27 08:19:03 ERROR [qtp42121758-14 ] 58 in GMap_MELT_OWLAPI_URL - edu.stanford.nlp.tagger.maxent.ExtractorPrevTwoTags

Because of the stanford-corenlp( version 1.3.4 ) lacks edu.stanford.nlp.tagger.maxent.ExtractorPrevTwoTags, but my local stanford-postagge own this class. However, if I remove stanford-corenlp, the mvn clean install can not finish and meet errors as lists.

Although my local package can works in reference library but it can not serve for packaging a maven project.

[error]/users/liweizhuo/eclipse-workspace-new/simplewebmatcherg2/src/main/Java/tools/sim _ tools.java: [13,32] the package edu.stanford.nlp.process does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplewebmatcherg2/src/main/Java/tools/sim _ tools.java: [14,38] the package edu.stanford.nlp.tagger.maxent does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplewebmatcherg2/src/main/Java/tools/sim _ tools.java: [18,18] no symbol found
Symbol: class MaxentTagger
Location: class Tools.Sim_Tools
[error]/users/liweizhuo/eclipse-workspace-new/simplewebmatcherg2/src/main/Java/tools/sim _ tools.java: [19,10] no symbol found
Symbol: Class Morphology
Location: class Tools.Sim_Tools
[error]/users/liweizhuo/eclipse-workspace-new/simplewebmatcherg2/src/main/Java/tools/postagger.java: [5,38] the package edu.stanford.nlp.tagger.maxent does not exist

[error]/users/liweizhuo/eclipse-workspace-new/simplewebmatcherg2/src/main/Java/tools/sim _ tools.java: [13,32] the package edu.stanford.nlp.process does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplewebmatcherg2/src/main/Java/tools/sim _ tools.java: [14,38] the package edu.stanford.nlp.tagger.maxent does not exist
[error]/users/liweizhuo/eclipse-workspace-new/simplewebmatcherg2/src/main/Java/tools/sim _ tools.java: [18,18] no symbol found
Symbol: class MaxentTagger
Location: class Tools.Sim_Tools
[error]/users/liweizhuo/eclipse-workspace-new/simplewebmatcherg2/src/main/Java/tools/sim _ tools.java: [19,10] no symbol found
Symbol: Class Morphology
Location: class Tools.Sim_Tools
[error]/users/liweizhuo/eclipse-workspace-new/simplewebmatcherg2/src/main/Java/tools/postagger.java: [5,38] the package edu.stanford.nlp.tagger.maxent does not exist

Therefore, I have to sacrifice this modular temporarily. Can you help me to solve this problems?

The lastest linkage of my project google drive is: https://drive.google.com/file/d/1nMb5ZgbxJ_x2Htrt2asfTZajFB9-kFs-/view?usp=sharing

For my packaged GMap without Standford POS method. The lastest linkage of my packaged in gmap-1.0-web-latest.tar.gz google drive is: https://drive.google.com/file/d/1O2YV6sTB2ofI_Pg2V3cPbwq7DHL41XtC/view

Can you help me to test it deeply?Because only one remoted test can be visited.

It can pass the Conference.V1.getTestCase("confof-sigkdd"), The result files is systemAlignment-confof-sigkdd.txt

but It still failed TrackRepository.Conference.V1( lost the connection). the full log file is

Could not connect to:  : 49154          
java.net.ConnectException: Connection refused (Connection refused)
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at java.net.Socket.connect(Socket.java:538)
    at java.net.Socket.<init>(Socket.java:434)
    at java.net.Socket.<init>(Socket.java:211)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.connect(RemoteTestRunner.java:652)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:451)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)

but It still failed Conference.V1_ALL_TESTCASES and TrackRepository.Anatomy.DefaultConnect refused

sven-h commented 3 years ago

Hi @liweizhuo001 ,

the easiest way is to install the jar file you have into your local repository. I added a section about installing third party jars in the FAQ of MELT. Please have a look there and let me know if it is easy to understand and works in your case.

The command to install your jar file would be:

mvn install:install-file -Dfile=stanford-postagger.jar -DgroupId=edu.stanford.nlp -DartifactId=stanford-postagger -Dversion=1.0 -Dpackaging=jar`

and the jar file needs to be located in the same folder where you execute the command (or change the path to the file).

You can then depend in your project on this file with

<dependency>
    <groupId>edu.stanford.nlp</groupId>
    <artifactId>stanford-postagger</artifactId>
    <version>1.0</version>
</dependency>

Best regards Sven

liweizhuo001 commented 3 years ago

Thank you very much. I have solved it.

For the maven project simpleWebMatcher,

  1. Enter the directory of src/main/resources by comand line.
  2. command to install the stanford-postagger.jar file mvn install:install-file -Dfile=stanford-postagger.jar -DgroupId=pos-tagger -DartifactId=stanford-pos-tagger -Dversion=3.0.2 -Dpackaging=jar
  3. Then add the follow depency in the pom.xml
       <dependency>  
         <groupId>pos-tagger</groupId>  
             <artifactId>stanford-pos-tagger</artifactId>  
         <version>3.0.2</version>  
       </dependency> 
  4. Return the root directory of the maven project by command line. Then, input maven clean install. The expected package can be generated, and I can test my Macther with complete functions :-)

I suggest that you can select some concrete problems and transform them into the introdcution in Matcher Packaging in Melt. It can lower the threshold for participants of OAEI to utilize MELT platform, and make much more researchers join in the community of the ontology matching.