/** * Classifies the current active ontologies. */ public boolean classifyAsynchronously(Set<InferenceType> precompute) { if (getCurrentReasonerFactory() instanceof NoOpReasonerInfo) { return true; } final OWLOntology currentOntology = owlModelManager.getActiveOntology(); synchronized (reasonerMap) { if (classificationInProgress) { return false; } runningReasoner = reasonerMap.get(currentOntology); reasonerMap.put(currentOntology, new NoOpReasoner(currentOntology)); classificationInProgress = true; } owlModelManager.fireEvent(EventType.ABOUT_TO_CLASSIFY); Thread currentReasonerThread = new Thread(new ClassificationRunner(currentOntology, precompute), "Classification Thread"); currentReasonerThread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler(){ public void uncaughtException(Thread thread, Throwable throwable) { exceptionHandler.handle(throwable); ProtegeApplication.getErrorLog().logError(throwable); } }); currentReasonerThread.start(); return true; }
public void run() { boolean inconsistencyFound = false; boolean reasonerChanged = false; try { long start = System.currentTimeMillis(); reasonerChanged = ensureRunningReasonerInitialized(); precompute(); logger.info(currentReasonerFactory.getReasonerName() + " classified in " + (System.currentTimeMillis()-start) + "ms"); } catch (InconsistentOntologyException ioe) { inconsistencyFound = true; } finally{ installRunningReasoner(inconsistencyFound, reasonerChanged); } }
Thread currentReasonerThread = new Thread(new ClassificationRunner(currentOntology, precompute), "Classification Thread"); currentReasonerThread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler(){ public void uncaughtException(Thread thread, Throwable throwable) {
try { Stopwatch stopwatch = Stopwatch.createStarted(); reasonerChanged = ensureRunningReasonerInitialized(); if (runningReasoner != null) { precompute(); logger.info("Ontologies processed in {} ms by {}", stopwatch.elapsed(TimeUnit.MILLISECONDS), runningReasoner.getReasonerName()); installRunningReasoner(inconsistencyFound, reasonerChanged); if (reasonerProgressMonitor instanceof Resettable) { ((Resettable) reasonerProgressMonitor).reset();
try { long start = System.currentTimeMillis(); reasonerChanged = ensureRunningReasonerInitialized(); if (runningReasoner != null) { precompute(); logger.info(currentReasonerFactory.getReasonerName() + " classified in " + (System.currentTimeMillis()-start) + "ms"); installRunningReasoner(inconsistencyFound, reasonerChanged); if (reasonerProgressMonitor instanceof Resettable) { ((Resettable) reasonerProgressMonitor).reset();
try { Stopwatch stopwatch = Stopwatch.createStarted(); reasonerChanged = ensureRunningReasonerInitialized(); if (runningReasoner != null) { precompute(); logger.info("Ontologies processed in {} ms by {}", stopwatch.elapsed(TimeUnit.MILLISECONDS), runningReasoner.getReasonerName()); installRunningReasoner(inconsistencyFound, reasonerChanged); if (reasonerProgressMonitor instanceof Resettable) { ((Resettable) reasonerProgressMonitor).reset();
Thread currentReasonerThread = new Thread(new ClassificationRunner(currentOntology, precompute), "Classification Thread"); currentReasonerThread.setUncaughtExceptionHandler((thread, throwable) -> { logger.error("An error occurred during reasoning: {}.", throwable.getMessage(), throwable);
Thread currentReasonerThread = new Thread(new ClassificationRunner(currentOntology, precompute), "Classification Thread"); currentReasonerThread.setUncaughtExceptionHandler((thread, throwable) -> { logger.error("An error occurred during reasoning: {}.", throwable.getMessage(), throwable);