On Wed, 2011-01-12 at 11:52 -0500, Marco Neumann wrote: > Thank you for the tip Dave. > > OWLMicro seems to be marginally faster but almost insignificant for my > needs. I mostly compute the owl:inverseOf in the following data > (http://www.lotico.com/meetup/2009/locations.txt)
If all you want is inverseOf plus a bit then you could create a tailored rule set (or even just use Java code :)). > I am using the YourKit Java Profiler 9.5.3 and am a bit surprised that > my shiny dual quad core XEON CPUs (8 processors) are hoovering at > around 12% for almost an hour. > > Is there a way to prioritize the reasoner method to take a bit more of > the action? As far as I can tell its the > com.hp.hpl.jena.reasoner.rulesys.impl.RETEEngine at work here. Not that I know of. The reasoner isn't built to make good use of multi-core processors. I'd love to develop a more scalable inference solution for Jena, part of which would involved making better use of parallelism, but time and funding are lacking :( Dave > > Marco > > > > > On Wed, Jan 12, 2011 at 4:16 AM, Dave Reynolds > <[email protected]> wrote: > > On Tue, 2011-01-11 at 20:26 -0500, Marco Neumann wrote: > >> I have the following inference work-flow: > >> > >> Model m = TDBFactory.createModel(directory) ; > >> > >> m.read(data); > >> > >> Reasoner reasoner = ReasonerRegistry.getOWLMiniReasoner(); > >> > >> InfModel inf = ModelFactory.createInfModel(reasoner, m); > >> > >> //up to here everything runs pretty fast > >> > >> m.add(inf.getDeductionsModel()); > >> > >> // here the model.add takes forever to complete > >> > >> m.commit(); > >> > >> Has anyone recommendations to improve performance here or share best > >> practice? > > > > The reasoners do all their work in memory so running over the TDB copy > > just slows things down without any benefit of scalability. > > > > I'd do something like: > > > > Model m = TDBFactory.createModel(directory) ; > > > > Model tmp = ModelFactory.createDefaultModel(); > > tmp.read(data); > > Reasoner reasoner = ReasonerRegistry.getOWLMiniReasoner(); > > InfModel inf = ModelFactory.createInfModel(reasoner, tmp); > > > > m.add(tmp); > > m.add(inf.getDeductionsModel()); > > > > Note 1. Depending on what inferences you want OWLMicro can be notably > > faster than OWLMini. > > > > Note 2. The deductionsModel only contains the forward deductions. When > > you ask an InfModel a query it will also run backward chaining rules so > > to get the entire inference closure you need to ask inf for everything. > > In that case replace the last two lines by: > > m.add( inf ); > > > > If you only want certainly types of inference then ask more specific > > queries to inf and add only those results to m. > > > > Dave > > > > > > > > >
