Comments (15)
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.
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.
from hermit-reasoner.
It's a matter of command line arguments, nothing should be broken. I'll experiment and let you know.
from hermit-reasoner.
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:
- the set of jars required for OWLAPI (for convenience there are packed releases here https://github.com/owlcs/releases/blob/master/owlapi/5/owlapi-dependencypack-5.1.9.jar ). Unzip this last jar file:
unzip owlapi-dependencypack-5.1.9.jar
. This command extracts the contents of the jar file (it contains a lib folder full of jars). Any zip manipulation program will do.
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)
java-getopt
jar from Maven Central (I used version 1.0.13 https://search.maven.org/artifact/gnu.getopt/java-getopt/1.0.13/jar)trove4j
library https://search.maven.org/artifact/net.sf.trove4j/trove4j/3.0.3/jar- SLF4J https://search.maven.org/artifact/org.slf4j/slf4j-api/1.7.22/jar
- SLF4J implementation https://search.maven.org/artifact/org.slf4j/slf4j-simple/1.7.22/jar
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.
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.
I've documented the solution here https://github.com/owlcs/hermit-reasoner/wiki/HermiT-FAQ
from hermit-reasoner.
-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.
Odd, the file is included in the jar.
from hermit-reasoner.
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.
from hermit-reasoner.
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.
from hermit-reasoner.
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.
from hermit-reasoner.
Related Issues (10)
- Command line module from original HermiT fork
- hermit reasoner: python vs protege HOT 8
- Axioms that violate OWL specs - option to ignore
- Inverses cause false property equivalences HOT 1
- Entailment of disjoint data properties fails HOT 1
- DateTime parsing error in HermiT HOT 5
- Undo unnecessary finals HOT 1
- support for swrl buillt-in atoms HOT 4
- Entailment check is broken with command line 1.4.6.519 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hermit-reasoner.