Giter Site home page Giter Site logo

Comments (15)

pbouda avatar pbouda commented on August 16, 2024 1

FYI, I was not aware of the FAQ (and not to familiar with Java ...) so I searched a lot until I could build a jar with all dependencies. I cloned this repo and added the following to pom.xml:

<plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
                <archive>
                <manifest>
                        <mainClass>org.semanticweb.HermiT.cli.CommandLine</mainClass>
                </manifest>
                </archive>
                <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
        </configuration>
        <executions>
                <execution>
                <id>make-assembly</id>
                <phase>package</phase>
                <goals>
                        <goal>single</goal>
                </goals>
                </execution>
        </executions>
</plugin>

Then you can build the jar with everything:

mvn clean compile assembly:single

Run the command line:

 java -jar org.semanticweb.hermit-1.4.6.519-SNAPSHOT-jar-with-dependencies.jar YOUR.owl

from hermit-reasoner.

ignazio1977 avatar ignazio1977 commented on August 16, 2024

Sounds to me like this is HermiT 1.3.8, am I right? If so, it's a fairly old build of the library and uses an even older OWLAPI version. It's possible that the best fix is to use a recent HermiT build (e.g., https://search.maven.org/artifact/net.sourceforge.owlapi/org.semanticweb.hermit/1.4.5.456)

The most recent builds include the same command line interface as the old HermiT but I haven't tried it with the -jar option; it might need more classpath setup.

from hermit-reasoner.

mikael1234 avatar mikael1234 commented on August 16, 2024

from hermit-reasoner.

ignazio1977 avatar ignazio1977 commented on August 16, 2024

It's a matter of command line arguments, nothing should be broken. I'll experiment and let you know.

from hermit-reasoner.

ignazio1977 avatar ignazio1977 commented on August 16, 2024

I can get HermiT to run on the command line but it requires manually downloading some libraries and adding them to the classpath.

So, to explain what's going on: HermiT 1.3.8 was packaged as an uber jar, meaning all the dependencies were included - making it impossible to update a dependency without rebuilding the jar, and making conflicts with other libraries common. However, that was convenient for command line use. Stuck with OWLAPI 3, though, which is where a lot of the issues you've found are rooted.

The builds on this fork only include in HermiT a subset of dependencies - the ones not available as Maven dependencies. This simplifies replacing the OWLAPI version but requires more work to run it from the command line.

Specifically, you need to download:

Also the following libraries (for convenience I've put them in the same lib folder as the OWLAPI files; also moved the HermiT jar in there)

The folder looks like this:

  • org.semanticweb.hermit-1.4.5.519.jar
  • lib folder, contains all OWLAPI jars and dependencies, trove, slf4j, getopt

In this folder, this command line will run HermiT:

java -cp org.semanticweb.hermit-1.4.5.519.jar:lib/* org.semanticweb.HermiT.cli.CommandLine -V

(If you're on Windows, use ; to separate the entries in the classpath parameter instead of :)

from hermit-reasoner.

ignazio1977 avatar ignazio1977 commented on August 16, 2024

Actually, this process is needlessly complex. I'll write a pom file for creating HermiT builds that work with the same command line as the original.

from hermit-reasoner.

ignazio1977 avatar ignazio1977 commented on August 16, 2024

I've documented the solution here https://github.com/owlcs/hermit-reasoner/wiki/HermiT-FAQ

from hermit-reasoner.

mikael1234 avatar mikael1234 commented on August 16, 2024

-V works now, but when doing entailment check, there is this error

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.semanticweb.owlapi.utilities.Injector.(Injector.java:43)
at org.semanticweb.owlapi.apibinding.OWLManager.(OWLManager.java:101)
at org.semanticweb.HermiT.cli.CommandLine.main(CommandLine.java:360)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more

So maybe still need some LoggerFactory jar? Thanks for the help!

from hermit-reasoner.

ignazio1977 avatar ignazio1977 commented on August 16, 2024

Odd, the file is included in the jar.

from hermit-reasoner.

ignazio1977 avatar ignazio1977 commented on August 16, 2024

There were bugs on the command line tool - some options were badly set up. Not sure if that was the problem you've seen, I could not replicate the error. 'm updating the fine in the releases project.

from hermit-reasoner.

mikael1234 avatar mikael1234 commented on August 16, 2024

from hermit-reasoner.

ignazio1977 avatar ignazio1977 commented on August 16, 2024

That's the old build. Use the file in the releases project (name contains -packaged and -SNAPSHOT). You should be able to use the original command line, same as the instructions on the hermit web site.

from hermit-reasoner.

mikael1234 avatar mikael1234 commented on August 16, 2024

from hermit-reasoner.

ignazio1977 avatar ignazio1977 commented on August 16, 2024

It's explained in the link I posted above (last question on the list) https://github.com/owlcs/hermit-reasoner/wiki/HermiT-FAQ

from hermit-reasoner.

mikael1234 avatar mikael1234 commented on August 16, 2024

from hermit-reasoner.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.