HermiT causing OutOfMemory from Protege or Java applications

79 views
Skip to first unread message

ctr...@gmail.com

unread,
Nov 13, 2014, 9:11:37 AM11/13/14
to hermit...@googlegroups.com
 Hi everyone,

I am trying to use HermiT v1.3.8 with Protégé v4.3 and after having modelised my OWL, I try to start HermiT reasonner and to "Export Inferred Ontology".
Launching the reasonner on Protégé causes no problem and my ontology is considered as consistent, but when I try to export it, it causes an OutOfMemory Error after 5 to 10 minutes. I have already tried to modify JVM arguments (increasing -Xmx to 2Gb) but it didn't correct the problem.

To check, I realize the export using Pellet and the export is successful in less than a minute.

I also developped the export using HermiT in a specific Java application and the same error appears when I try to fill the ontology from the reasonner.

I cannot consider my OWL file as a large Ontology model (around 2Mb). Here are some metrics:

Total Number of Classes: 61 (Defined: 61, Imported: 0)
Total Number of Datatype Properties: 11 (Defined: 11, Imported: 0)
Total Number of Object Properties: 23 (Defined: 23, Imported: 0)
Total Number of Annotation Properties: 0 (Defined: 0, Imported: 0)
Total Number of Individuals: 2850 (Defined: 2850, Imported: 0)

Would you have an idea to solve this problem ?

Thank you in advance for your answers.



Ernesto Jimenez-Ruiz

unread,
Feb 16, 2015, 12:39:16 PM2/16/15
to ctr...@gmail.com, hermit...@googlegroups.com
Hi

Sorry for this very late response.

Which inferred axioms are selected for the export? For example, getting all inferred disjointness axioms may be time consuming for large ontologies. Although it does not seem to be the case of your ontology.

Ernesto

--
You received this message because you are subscribed to the Google Groups "HermiT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hermit-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Ernesto Jiménez-Ruiz
Research Assistant
Department of Computer Science
University of Oxford
Wolfson Building, Parks Road, Oxford OX1 3QD, UK

http://krono.act.uji.es/people/Ernesto
http://www.cs.ox.ac.uk/people/ernesto.jimenez-ruiz/


Dhirj Gupta

unread,
May 13, 2015, 5:34:34 PM5/13/15
to hermit...@googlegroups.com, ctr...@gmail.com
I am having the same issue actually. Granted my owl file is significantly larger (40,673 axioms, 6661 logical axiom count, 4047 class count), but even when run with 6gb of ram I am having heap issues.

The issue for me in my app comes when I try to examine the superClasses of a class. Code example below:

for(OWLClass c :ontology.getClassesInSignature(true)) {
   
System.out.println("starting part 2");
   
NodeSet<OWLClass> superclasses = reasoner.getSuperClasses(c, true);
   
System.out.println("reasoner done. moving on to the next part.");
   
....
}

Ultimately what I am trying to do is import an owl ontology into Neo4j (a graph database technology). The first part of my code creates a node for each unique class found in the owl file. Part 2 (the beginning of which is shown above) looks for the super class of each class, and then if one is found it creates a relationship to it. If one is not found, it creates a relationship to an owl:Thing node. However I consistently get a heap error at the line:

NodeSet<OWLClass> superclasses = reasoner.getSuperClasses(c, true);

I can tell the error is here because the line "starting part 2" prints in my console, but the line "reasoner done. moving on to the next part." never prints.

Any ideas?

Ignazio Palmisano

unread,
May 13, 2015, 6:30:38 PM5/13/15
to hermit...@googlegroups.com
On 13 May 2015 at 22:34, Dhirj Gupta <dhirj...@gmail.com> wrote:
> I am having the same issue actually. Granted my owl file is significantly
> larger (40,673 axioms, 6661 logical axiom count, 4047 class count), but even
> when run with 6gb of ram I am having heap issues.
>
> The issue for me in my app comes when I try to examine the superClasses of a
> class. Code example below:
>
> for(OWLClass c :ontology.getClassesInSignature(true)) {
> System.out.println("starting part 2");
> NodeSet<OWLClass> superclasses = reasoner.getSuperClasses(c, true);
> System.out.println("reasoner done. moving on to the next part.");
> ....
> }
>

Is the ontology available for profiling? If necessary, a version with
class and property names replaced with random strings would do.
Cheers,
Ignazio

Ernesto Jimenez-Ruiz

unread,
May 14, 2015, 7:29:22 AM5/14/15
to Dhirj Gupta, hermit...@googlegroups.com, ctr...@gmail.com
Hi

The ontology is medium size so in principle memory should not be a problem. However the ontology may be a hard one.

If the ontology is a hard one, it may make sense to submit it to the OWL Reasoner evaluation workshop:
https://www.w3.org/community/owled/ore-2015-workshop/competition/
As Ignazio suggests an anonymized version would also do the job.

Have you tried other reasoners (Pellet, FaCT++, Konclude)?

Best
Ernesto
 


Ignazio Palmisano

unread,
May 14, 2015, 7:37:01 AM5/14/15
to Ernesto Jimenez-Ruiz, hermit...@googlegroups.com, ctr...@gmail.com, Dhirj Gupta


On 14 May 2015 12:29, "Ernesto Jimenez-Ruiz" <ernesto.ji...@gmail.com> wrote:
>
> Hi
>
> The ontology is medium size so in principle memory should not be a problem. However the ontology may be a hard one.
>
> If the ontology is a hard one, it may make sense to submit it to the OWL Reasoner evaluation workshop:
> https://www.w3.org/community/owled/ore-2015-workshop/competition/
> As Ignazio suggests an anonymized version would also do the job.
>

Dhirj emailed me separately - the ontology is NIF Gross Anatomy.
Cheers,
I.

Dhirj Gupta

unread,
May 14, 2015, 7:22:24 PM5/14/15
to Ignazio Palmisano, Ernesto Jimenez-Ruiz, hermit...@googlegroups.com, ctr...@gmail.com
Thanks guys.

@Ernesto - It looks like the deadline to submit ontologies to the workshop was the 1st, and so has already passed :/  Also, am I correct in assuming that a hard ontology simply means that it is very complex, with lots of connections? I feel like either way, this ontology should be readable though since protege is able to open it properly... I will stubbornly keep trying.

@Ignazio - Thanks for the recommendation for the profiler. I downloaded VirtualVM and started playing around with it. Very cool!

You both mentioned getting an anonymized version of the ontology. What does this mean, and how can I do this? Is there a simple process you know of?



Many thanks!

Dhirj Gupta

unread,
May 14, 2015, 7:33:55 PM5/14/15
to Ignazio Palmisano, Ernesto Jimenez-Ruiz, hermit-users, ctroppe
I should also mention that as I continue to try different things in my java app, using the built in OWLAPI getSuperClasses(ontology) method seemed to work where the hermiT reasoner failed. My program now starts processing the superClasses of each class as I specify, but then after about a minute or two of this it stops working. My thoughts are that it becomes a memory issue / slow search methods that I have written. 

Ignazio Palmisano

unread,
May 15, 2015, 2:22:30 AM5/15/15
to hermit-users
On 15 May 2015 at 00:33, Dhirj Gupta <dhirj...@gmail.com> wrote:
> I should also mention that as I continue to try different things in my java
> app, using the built in OWLAPI getSuperClasses(ontology) method seemed to
> work where the hermiT reasoner failed.

The problem is that the two methods are not equivalent. The OWLAPI
call does not do any inference, and will only return the asserted
superclasses (it will miss superclasses that can be found by
reasoning).


>> You both mentioned getting an anonymized version of the ontology. What
>> does this mean, and how can I do this? Is there a simple process you know
>> of?
>>

Anonymized means that all IRIs for classes/properties/individuals are
changed to something else, less meaningful. For example, rename Person
to A10000 and hasFather to P100000.
That's useful for ontologies which cannot be shared with the community
because they have commercial value, or their disclosure is not allowed
by any other reason. For a reasoner, the two versions are equivalent
and so we can test performances on both; but the ontology is a lot
less significant to a human, and so is much less likely to be a
violation of secrecy.
Cheers,
I.

Dhirj Gupta

unread,
May 15, 2015, 10:04:58 PM5/15/15
to Ignazio Palmisano, hermit-users


I - The problem is that the two methods are not equivalent. The OWLAPI


call does not do any inference, and will only return the asserted
superclasses (it will miss superclasses that can be found by
reasoning).

D - Gotcha... Well that's depressing... Lol. Maybe I can still get what I need from it though so I'll keep trying.

I - Anonymization
D - So anonymization wouldn't have any impact on a reasoner's ability to process super classes then, it sounds like.

I'll try other reasoners as Ernesto suggested then, just in case.

Are there any other suggestions for reading the ontology that I might be able to look into? Perhaps if I can find a computer with sufficiently high RAM, might I be able to just "brute force" it?

You received this message because you are subscribed to a topic in the Google Groups "HermiT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hermit-users/LObaChQVQBA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hermit-users...@googlegroups.com.

Dhirj Gupta

unread,
May 16, 2015, 2:51:52 PM5/16/15
to Ignazio Palmisano, Ernesto Jimenez-Ruiz, hermit-users

Ernesto - you described the ontology as a "hard" ontology. I just want to make sure my understanding is correct - this just means that it is complex right? It does not refer to some kind of protection?

I ask because my current understanding is that since the ontology I'm working with is considered free for public use, that there is no problem with me trying to unlock the ontology and exporting it to Neo4j. If "hard" refers to a special protection though, that may not be the case.

Ignazio Palmisano

unread,
May 16, 2015, 2:57:33 PM5/16/15
to hermit-users
On 16 May 2015 at 19:51, Dhirj Gupta <dhirj...@gmail.com> wrote:
> Ernesto - you described the ontology as a "hard" ontology. I just want to
> make sure my understanding is correct - this just means that it is complex
> right? It does not refer to some kind of protection?
>

No, hard refers simply to the ontology being complex to reason with -
This means the ontology is hitting a weakness in a reasoner, or it
might be complex in such a way that reasoning on it tends towards the
worst complexity cases for OWL 2 DL. It is difficult to tell whether
an ontology is difficult to reason with; a rule of thumb is, large
numbers of definitions, cardinality restrictions, disjunctions,
probably point to a difficult ontology.
Cheers,
I.

Ernesto Jimenez-Ruiz

unread,
May 16, 2015, 2:57:56 PM5/16/15
to Dhirj Gupta, Ignazio Palmisano, hermit-users
Yes, I meant that is was challenging for reasoners.

If incomplete reasoning may do the job for your application, try to run ELK (https://code.google.com/p/elk-reasoner/). It will give you an approximation of the classification since ELK is a reasoner for the OWL 2 EL profile and NIF Gross Anatomy is outside this profile.

Ernesto


Reply all
Reply to author
Forward
0 new messages