dwslab / melt

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

Empty rdf Files while testing tar.gz file using MatcherYAAAOwlApi #122

Closed alisea47 closed 2 years ago

alisea47 commented 3 years ago

Hi, I met another problem. Could u please take a look?

I modify simpleWebMatcher project using MatcherYAAAOwlApi. I add dependency to pom.xml like this:

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

After package it to simplewebmatchertestowlapi-1.0-web.tar.gz, I used EvaluationExample case 3 to check it. However, a problem happened. My rdf file is empty and here is the whole log file:

2021-08-26 09:30:04 INFO  [main                          ] 171  in MatcherDockerFile    - Starting container from image simplewebmatchertestowlapi-1.0-web (port 8080 from container is mapped to port 49374 in host)
2021-08-26 09:30:07 INFO  [main                          ] 182  in MatcherDockerFile    - Container started with id 7808b1c4654a0695b35486f401a8a321e9fef05e098fbfac6e6efb0265c595d0
2021-08-26 09:30:07 INFO  [main                          ] 184  in MatcherDockerFile    - To see log output of container, run: docker container logs 7808b1c4654a
2021-08-26 09:30:07 INFO  [main                          ] 125  in Track                - Track cache folder is: C:\Users\84917\oaei_track_cache
2021-08-26 09:30:07 INFO  [main                          ] 48   in ExecutionRunner      - Running matcher Docker Matcher on testcase confof-sigkdd (track conference).
2021-08-26 09:30:09 INFO  [main                          ] 149  in MatcherHTTPCall      - Execute now the following HTTP request: POST http://localhost:49374/match HTTP/1.1
2021-08-26 09:30:10 INFO  [main                          ] 64   in ExecutionRunner      - Running matcher Docker Matcher on testcase confof-sigkdd (track conference) completed in 2 seconds.
2021-08-26 09:30:11 ERROR [main                          ] 145  in ExecutionResult      - The system alignment given by following URL could not be parsed: file:/C:/Users/84917/AppData/Local/Temp/alignment9002698976025933244.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.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:196)
    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:62)
2021-08-26 09:30:11 INFO  [main                          ] 228  in EvaluatorCSV         - Evaluate matcher Docker Matcher
2021-08-26 09:30:11 INFO  [main                          ] 81   in OntologyCacheJena    - Reading model into cache (file:/C:/Users/84917/oaei_track_cache/oaei.webdatacommons.org/conference/conference-v1/confof-sigkdd/source.rdf)
2021-08-26 09:30:12 INFO  [main                          ] 81   in OntologyCacheJena    - Reading model into cache (file:/C:/Users/84917/oaei_track_cache/oaei.webdatacommons.org/conference/conference-v1/confof-sigkdd/target.rdf)
2021-08-26 09:30:12 INFO  [main                          ] 48   in ExecutionRunner      - Running matcher baseLineMatcher on testcase confof-sigkdd (track conference).
2021-08-26 09:30:12 INFO  [main                          ] 64   in ExecutionRunner      - Running matcher baseLineMatcher on testcase confof-sigkdd (track conference) completed in 0 seconds.
2021-08-26 09:30:12 INFO  [main                          ] 237  in EvaluatorCSV         - Writing alignment cube
2021-08-26 09:30:12 INFO  [main                          ] 124  in AlignmentsCube       - Writing conference | confof-sigkdd | Docker Matcher [to file: D:\code\java\eclipse\simpleWebMatcher\results\results_2021-08-26_09-30-11\alignmentCube.csv]
The time is 10249 ms

My java version: 1.8.0_301, By the way, I'm not sure if the versionof dependency is right or not. Here is the project: https://zafueducn-my.sharepoint.com/:f:/g/personal/19930003_zafu_edu_cn/EudJQezo5qZMlJKYCeQQizUBR9yEWALXvtqSqubM0KbD-g?e=jf6Fze

Thank u very much!

sven-h commented 3 years ago

Hi @alisea47,

I added some debugging tips in the documentation. Could you add those lines

Thread.sleep(20000); // just to be sure that all logs are written.
dockerMatcher.logAllLinesFromContainer();  // this will output the log of the container

and send the log again? Thanks

Best regards Sven

alisea47 commented 3 years ago

Hi, @sven-h I added those lines you mentioned and here is the log:

2021-08-26 15:49:49 INFO  [main                          ] 148  in MatcherDockerFile    - Load docker image from file D:\code\java\eclipse\simpleWebMatcher\target\classes\simplewebmatchertestowlapi-1.0-web-latest.tar.gz to docker registry.
2021-08-26 15:49:58 INFO  [main                          ] 171  in MatcherDockerFile    - Starting container from image simplewebmatchertestowlapi-1.0-web (port 8080 from container is mapped to port 55746 in host)
2021-08-26 15:49:59 INFO  [main                          ] 182  in MatcherDockerFile    - Container started with id ee83e922d5a7c1ec23cf0d3d306c0e1d4f526da6b4287c520abddd8c3ac5a221
2021-08-26 15:49:59 INFO  [main                          ] 184  in MatcherDockerFile    - To see log output of container, run: docker container logs ee83e922d5a7
2021-08-26 15:50:20 INFO  [docker-java-stream--2054855460] 359  in DockerLogCallback    - STDOUT: 2021-08-26 07:49:59 INFO  [main                          ] 169  in log                  - Logging initialized @694ms to org.eclipse.jetty.util.log.Slf4jLog
2021-08-26 15:50:20 INFO  [docker-java-stream--2054855460] 359  in DockerLogCallback    - STDOUT: 2021-08-26 07:49:59 INFO  [main                          ] 82   in Main                 - Matching service runs at: http://localhost:8080/match
2021-08-26 15:50:20 INFO  [docker-java-stream--2054855460] 359  in DockerLogCallback    - STDOUT: 2021-08-26 07:49:59 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 15:50:20 INFO  [docker-java-stream--2054855460] 359  in DockerLogCallback    - STDOUT: 2021-08-26 07:49:59 INFO  [main                          ] 916  in ContextHandler       - Started o.e.j.s.ServletContextHandler@a74868d{/,null,AVAILABLE}
2021-08-26 15:50:20 INFO  [docker-java-stream--2054855460] 359  in DockerLogCallback    - STDOUT: 2021-08-26 07:49:59 INFO  [main                          ] 331  in AbstractConnector    - Started ServerConnector@5abca1e0{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2021-08-26 15:50:20 INFO  [docker-java-stream--2054855460] 359  in DockerLogCallback    - STDOUT: 2021-08-26 07:49:59 INFO  [main                          ] 415  in Server               - Started @1022ms
2021-08-26 15:50:20 INFO  [main                          ] 125  in Track                - Track cache folder is: C:\Users\84917\oaei_track_cache
2021-08-26 15:50:20 INFO  [main                          ] 48   in ExecutionRunner      - Running matcher Docker Matcher on testcase confof-sigkdd (track conference).
2021-08-26 15:50:23 INFO  [main                          ] 149  in MatcherHTTPCall      - Execute now the following HTTP request: POST http://localhost:55746/match HTTP/1.1
2021-08-26 15:50:23 INFO  [main                          ] 64   in ExecutionRunner      - Running matcher Docker Matcher on testcase confof-sigkdd (track conference) completed in 3 seconds.
2021-08-26 15:50:25 ERROR [main                          ] 145  in ExecutionResult      - The system alignment given by following URL could not be parsed: file:/C:/Users/84917/AppData/Local/Temp/alignment3366755270497732323.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.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:196)
    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:54)
2021-08-26 15:50:25 INFO  [main                          ] 228  in EvaluatorCSV         - Evaluate matcher Docker Matcher
2021-08-26 15:50:25 INFO  [main                          ] 81   in OntologyCacheJena    - Reading model into cache (file:/C:/Users/84917/oaei_track_cache/oaei.webdatacommons.org/conference/conference-v1/confof-sigkdd/source.rdf)
2021-08-26 15:50:26 INFO  [main                          ] 81   in OntologyCacheJena    - Reading model into cache (file:/C:/Users/84917/oaei_track_cache/oaei.webdatacommons.org/conference/conference-v1/confof-sigkdd/target.rdf)
2021-08-26 15:50:26 INFO  [main                          ] 48   in ExecutionRunner      - Running matcher baseLineMatcher on testcase confof-sigkdd (track conference).
2021-08-26 15:50:26 INFO  [main                          ] 64   in ExecutionRunner      - Running matcher baseLineMatcher on testcase confof-sigkdd (track conference) completed in 0 seconds.
2021-08-26 15:50:26 INFO  [main                          ] 237  in EvaluatorCSV         - Writing alignment cube
2021-08-26 15:50:26 INFO  [main                          ] 124  in AlignmentsCube       - Writing conference | confof-sigkdd | Docker Matcher [to file: D:\code\java\eclipse\simpleWebMatcher\results\results_2021-08-26_15-50-25\alignmentCube.csv]
The time is 38276 ms

Thanks a lot!

sven-h commented 3 years ago

Hi @alisea47,

i can reproduce your error. In MELT 3.0 the OWLAPI was not fully included during web packaging. Can you try with the new MELT version 3.1 and package your matcher again. This should solve your problem.

I also saw in your main method, that you load the docker file from the resources folder with the loadFile method. If you run mvn install the docker file ending with .tar.gz will always be stored in the target folder. To test you can also use

// CASE 3: Web Docker Package
MatcherDockerFile dockerMatcher = new MatcherDockerFile("simplewebmatchertestowlapi-1.0-web", 
        new File("target/simplewebmatchertestowlapi-1.0-web-latest.tar.gz"));

which will directly use the generated file from the target directory. For the submission, you will not need the docker file in your resources folder but just submit the generated docker file (with the corresponding image name).

If this fixes your error, please let me know by closing this issue. Otherwise, send me again the generated full log file.

Best regards Sven

alisea47 commented 3 years ago

Hi, @sven-h First of all, let me confirm with you whether I understand what you mean. I re-downloaded melt form https://github.com/dwslab/melt. Then based on simpleWebMatcher package my project again.

However, it seems not to support MatcherYAAAOwlApi, the error message is:


Exception in thread "main" java.lang.NoClassDefFoundError: de/uni_mannheim/informatik/dws/melt/matching_owlapi/MatcherYAAAOwlApi
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    at de.uni_mannheim.informatik.dws.melt.demomatcher.EvaluationInnerCode.main(EvaluationInnerCode.java:31)
Caused by: java.lang.ClassNotFoundException: de.uni_mannheim.informatik.dws.melt.matching_owlapi.MatcherYAAAOwlApi
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    ... 13 more

And I want to ask if the MELT version depends on the sentences in pom.xml:

    <properties>
        <matching.version>3.0</matching.version>
    </properties>

Can I change it to

    <properties>
        <matching.version>3.1</matching.version>
    </properties>

?

Thanks!

sven-h commented 3 years ago

Hi @alisea47 if you want to use MatcherYAAAOwlApi you need the dependency

<dependency>
      <groupId>de.uni-mannheim.informatik.dws.melt</groupId>
      <artifactId>matching-owlapi</artifactId>
      <version>${matching.version}</version>
</dependency> 

which is included transitively if you have matching-eval inlcuded as well (without the test scope). The reason why we put matching-eval in test scope is to reduce the number of dependencies when packaging the matcher. Thus they are not included.

Changing the version is done as you showed. Just change <matching.version>3.0</matching.version> to <matching.version>3.1</matching.version> .

Best regards Sven

janothan commented 3 years ago

Hi @alisea47, if the answer provided by Sven solved your issue, please close it 🙂

sven-h commented 2 years ago

Please reopen this issue in case it still persists.