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
Mon Apr 9 13:17:40 PDT 2007


I did the performance test with a database backend and got about 2 
seconds to delete 300 objects.  Much slower but still reasonable.  So I 
still think that slowness in deleting so many entries is probably due to 
interaction with the gui.  I have included my code.

-Timothy

    public static void main(String[] args) throws Exception
    {
        int count = 300;
        OWLModel owlModel = createOWLModel();

        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");
    }
   
    private static OWLModel createOWLModel() {
        //return ProtegeOWL.createJenaOWLModel();
        CreateOWLDatabaseProjectPlugin creator = new 
CreateOWLDatabaseProjectPlugin();
        creator.setDriver("com.mysql.jdbc.Driver");
        creator.setURL("jdbc:mysql://localhost/protege");
        creator.setTable("test01");
        creator.setUsername("protege");
        creator.setPassword("mypassword");
        Project p = creator.createNewProject(new 
OWLDatabaseKnowledgeBaseFactory());
        return (OWLModel) p.getKnowledgeBase();
    }

>>
>>      
>>     2007/4/6, Timothy Redmond <tredmond at stanford.edu
>>     <mailto:tredmond at stanford.edu>>:
>>
>>
>>         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
>>         <mailto:protege-owl at lists.stanford.edu>
>>         > https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>         <https://mailman.stanford.edu/mailman/listinfo/protege-owl>
>>         >
>>         > Instructions for unsubscribing:
>>         http://protege.stanford.edu/doc/faq.html#01a.03
>>         <http://protege.stanford.edu/doc/faq.html#01a.03>
>>         >
>>
>>         _______________________________________________
>>         protege-owl mailing list
>>         protege-owl at lists.stanford.edu
>>         <mailto: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
>>
>>
>>     _______________________________________________
>>     protege-owl mailing list
>>     protege-owl at lists.stanford.edu
>>     <mailto:protege-owl at lists.stanford.edu>
>>     https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>     <https://mailman.stanford.edu/mailman/listinfo/protege-owl>
>>
>>      
>>     Instructions for unsubscribing:
>>     http://protege.stanford.edu/doc/faq.html#01a.03
>>     <http://protege.stanford.edu/doc/faq.html#01a.03> 
>
>
>     _______________________________________________
>     protege-owl mailing list
>     protege-owl at lists.stanford.edu <mailto:protege-owl at lists.stanford.edu>
>     https://mailman.stanford.edu/mailman/listinfo/protege-owl
>     <https://mailman.stanford.edu/mailman/listinfo/protege-owl>
>
>     Instructions for unsubscribing:
>     http://protege.stanford.edu/doc/faq.html#01a.03
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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