-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reasoner::getReasonerName returns null #9
Comments
I think java takes ImplementationTitle from Manifest.mf (which is created in the case of ELK by maven) |
I'll enable the issue tracking. There was talk a few months back to move my fork to the owlcs group and make it a complete site - the official home of the fork, so to speak. |
Issues are now enabled. |
HermiT has a manifest.mf file included but it does not contain |
I'm curious why not just |
Strangely enough I can't get the desired behaviour to work. OWLAPI uses the exact same code in There's precious little documentation on troubleshooting this kind of issue. I'm inclined to hardcode the string, as it doesn't make much difference to hardcode it in a pom file or in the Java code. |
Fixed on master branch and version4 branch at https://github.com/ignazio1977/hermit-reasoner/ |
@ignazio1977, I am curious what exactly did not work for you (before you hardcoded the string)? Clearly, the problem was because the "Implementation-Title" was not present in the HermiT Manifest file. Did it not work for you to add "Implementation-Title" to the Manifest file or the code Also, there is a problem with |
I changed the pom to add However,
I haven't been able to change that behaviour. I considered whether the package the classes are in could be part of the problem, but there is no split package to confuse the VM here. According to some Oracle documentation, it is possible to specify I assume I could get the desired result by shading the bundle and applying some transform, but at this point my energy was exhausted :-) Same problem with the |
The failing string is the build section of the implementation version tag, and that was not always including a build timestamp - if I remember correctly, that's a recent change. I'm guessing most users of InferredOntologyGenerator have not used it with recent HermiT versions, or did not get errors generating axioms - as far as I can tell, in InferredOntologyGenerator the reasoner name and version are only used when reporting exceptions, so it might not be as common an occurrence as we'd think. |
Hmm. Do you get |
Note that for |
I created a new project in Eclipse, and lo and behold, everything worked as expected on extracting the implementation title and version from the manifest file. I did not have to play with workspace resolution. Sounds definitely like a fragile setup, though. Most developers using HermiT won't have the HermiT source checked out in their Eclipse workspace, but those who do will get variable results based on non obvious conditions. In OWLAPI |
For the version, a snapshot version looks like this:
Unfortunately the |
Did you have HermiT as a project in the workspace? If not, the workspace resolution would not make a difference. If it is checked out in the workspace, then Eclipse by default includes the project in the class path instead of the jar dependency. If Eclipse cannot find the Manifest file of HermiT (in the project), then returning the reasoners names and versions from Manifest will not work. I guess the Manifest it is only packaged within jar, so Eclipse does not find it. In ELK we specifically change the location of Manifest file for this purpose. See here. |
B.t.w., I cannot compile HermiT from this repository. When I do
It seems like it tries to get a version number from an svn repository, whereas it is a git repository. |
It also does not work for the released version. The current version 1.4.0.432 from maven central, for example, has the following Implementation-Version in Manifest:
What I did in ELK, is just ignored all characters except for digits and dots. See here. |
Yes I did - I had it open yesterday as well, when my test project did not work. That's why I think the difference is subtle and we'll see developers reporting difficult to replicate issues. |
So, how does Eclipse find the HermiT Manifest file in your setup? |
It doesn't - given a maven project that declares a HermiT dependency, accessing the manifest works, but if the HermiT project is added to the Projects section of the eclipse project, eclipse overrides the maven jar with the local project. I'm under the impression that in some situations eclipse will automatically add a workspace project as a dependency when the corresponding maven dependency is added, but not in all situations - hence the variable results we've seen. |
If Eclipse does not find the Manifest file, then how extraction of the implementation title now works for you (after creating a new project)? Can you check the class path of this project? Does it use HermiT from the workspace or from the jar from the local repository? In any case, the problem should be resolved after placing Manifest file in the root of the project as I mentioned. I agree that Eclipse can glitch, but I do not think that this is a good reason to hard-code (particularly the version) values. |
By ensuring the new project does not have the HermiT /project/ in its classpath, only the HermiT /jar/.
Indeed. Now that we know what's going wrong, I'm going to remove the hard coding. |
Calling
Reasoner::getReasonerName
returnsnull
. I'm using release"net.sourceforge.owlapi" % "org.semanticweb.hermit" % "1.4.0.432"
in a Scala application. I see it's implemented asgetClass().getPackage().getImplementationTitle()
; I guess this needs to be in thepom.xml
as in ELK?Sorry to report this here. :-) @ignazio1977 doesn't have Issues enabled on his fork. Is there any other official location for issues?
The text was updated successfully, but these errors were encountered: