Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] performance problems

Timothy Redmond tredmond at stanford.edu
Fri Apr 6 15:58:26 PDT 2007


I think that your problem with the deletions is occurring because of an 
interaction with the graphical interface.  My suspicion is that the way 
you are running your code the graphical interface is getting updated 
after each deletion.  I ran the following code:

        int count = 300;
        OWLModel owlModel = ProtegeOWL.createJenaOWLModel();

        OWLNamedClass c = owlModel.createOWLNamedClass("top");
        OWLIndividual[] individuals = new OWLIndividual[count];
        for (int i = 0; i < count; i++) {
            individuals[i] = c.createOWLIndividual("myInstance" + i);
        }
        System.out.println("created class " + c + " with " + 
c.getInstanceCount(false) + " members");
        System.out.println("Starting deletions");
        long start = System.currentTimeMillis();
        for (int i = 0; i < count; i++) {
            individuals[i].delete();
        }
        System.out.println("took " + (System.currentTimeMillis() - 
start)  + "ms");
        System.out.println("class " + c + " now has " + 
c.getInstanceCount(false) + " members");

This reported doing 300 deletions in 172 milliseconds.  This gets 
relatively good performance because the graphical interface is not 
getting updated on each delete.

So the fix to your problem depends on exactly what you are doing.  
Controlling how the graphical interface responds to changes in the 
knowledge base depends on event processing.  If you are running a long 
running thread you may want to do something like

   1. disable event generation and reload the gui
   2. disable event dispatch for the duration of the thread.

The problem with option #2 is that when the event dispatch is turned on 
again a lot of processing must be done.  Here is a skeleton that uses 
option #1:

        boolean eventGeneration= 
getKnowledgeBase().setGenerateEventsEnabled(false);
        boolean undoEnabled = getKnowledgeBase().setUndoEnabled(false);
        try {
            ...
        } finally {
            getKnowledgeBase().setUndoEnabled(undoEnabled);
            getKnowledgeBase().setGenerateEventsEnabled(eventGeneration); 
        }
        
ProjectManager.getProjectManager().getCurrentProjectView().reloadAll();

Also there is apparently a version of the instances tab that handles 
large deletions better than the current version with Protege.  I may be 
able to find a pointer to this.

-Timothy


Amal Zouaq wrote:
> Hello everyone,
>  
> I was wondering if someone experienced some performance problems with 
> a medium-size or big-size ontology ? When trying to delete the 
> instances (either in Protégé or programmatically), Protégé gets 
> blocked, nothing is happening (the number of instances > 500). By 
> program (Protégé OWL API), it is working but it takes a long time to 
> be completed. Any idea about the problem ( I have set Protégé to 256 
> MO instead of 100 MO) ?.
>  
> Thanks,
>  
> Amal.
> ------------------------------------------------------------------------
>
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>   




More information about the protege-owl mailing list