/** * Sets the strategy that is used for missing imports handling. See * {@link MissingImportHandlingStrategy} for the strategies and their descriptions. * * @param missingImportHandlingStrategy The strategy to be used. * @return An {@code OWLOntologyLoaderConfiguration} object with the strategy set. * @since 3.3 */ public OWLOntologyLoaderConfiguration setMissingImportHandlingStrategy( MissingImportHandlingStrategy missingImportHandlingStrategy) { // do not make copies if setting the same value if (getMissingImportHandlingStrategy() == missingImportHandlingStrategy) { return this; } OWLOntologyLoaderConfiguration copy = copyConfiguration(); copy.overrides.put(MISSING_IMPORT_HANDLING_STRATEGY, missingImportHandlingStrategy); return copy; }
/** * Sets the strategy that is used for missing imports handling. See * {@link MissingImportHandlingStrategy} for the strategies and their descriptions. * * @param missingImportHandlingStrategy The strategy to be used. * @return An {@code OWLOntologyLoaderConfiguration} object with the strategy set. * @since 3.3 */ public OWLOntologyLoaderConfiguration setMissingImportHandlingStrategy( MissingImportHandlingStrategy missingImportHandlingStrategy) { // do not make copies if setting the same value if (getMissingImportHandlingStrategy() == missingImportHandlingStrategy) { return this; } OWLOntologyLoaderConfiguration copy = copyConfiguration(); copy.overrides.put(MISSING_IMPORT_HANDLING_STRATEGY, missingImportHandlingStrategy); return copy; }
/** * Sets the strategy that is used for missing imports handling. See * {@link MissingImportHandlingStrategy} for the strategies and their descriptions. * * @param missingImportHandlingStrategy The strategy to be used. * @return An {@code OWLOntologyLoaderConfiguration} object with the strategy set. * @since 3.3 */ public OWLOntologyLoaderConfiguration setMissingImportHandlingStrategy( MissingImportHandlingStrategy missingImportHandlingStrategy) { // do not make copies if setting the same value if (getMissingImportHandlingStrategy() == missingImportHandlingStrategy) { return this; } OWLOntologyLoaderConfiguration copy = copyConfiguration(); copy.overrides.put(MISSING_IMPORT_HANDLING_STRATEGY, missingImportHandlingStrategy); return copy; }
@Nullable protected OWLOntology loadImports(OWLImportsDeclaration declaration, OWLOntologyLoaderConfiguration configuration) throws OWLOntologyCreationException { writeLock.lock(); try { importsLoadCount.incrementAndGet(); OWLOntology ont = null; try { ont = loadOntology(declaration.getIRI(), true, configuration); } catch (OWLOntologyCreationException e) { if (configuration .getMissingImportHandlingStrategy() == MissingImportHandlingStrategy.THROW_EXCEPTION) { throw e; } else { // Silent MissingImportEvent evt = new MissingImportEvent(declaration.getIRI(), e); fireMissingImportEvent(evt); } } finally { importsLoadCount.decrementAndGet(); } return ont; } finally { writeLock.unlock(); } }
@Nullable protected OWLOntology loadImports(OWLImportsDeclaration declaration, OWLOntologyLoaderConfiguration configuration) throws OWLOntologyCreationException { writeLock.lock(); try { importsLoadCount.incrementAndGet(); OWLOntology ont = null; try { ont = loadOntology(declaration.getIRI(), true, configuration); } catch (OWLOntologyCreationException e) { if (configuration .getMissingImportHandlingStrategy() == MissingImportHandlingStrategy.THROW_EXCEPTION) { throw e; } else { // Silent MissingImportEvent evt = new MissingImportEvent(declaration.getIRI(), e); fireMissingImportEvent(evt); } } finally { importsLoadCount.decrementAndGet(); } return ont; } finally { writeLock.unlock(); } }
@Nullable protected OWLOntology loadImports(OWLImportsDeclaration declaration, OWLOntologyLoaderConfiguration configuration) throws OWLOntologyCreationException { writeLock.lock(); try { importsLoadCount.incrementAndGet(); OWLOntology ont = null; try { ont = loadOntology(declaration.getIRI(), true, configuration); } catch (OWLOntologyCreationException e) { if (configuration .getMissingImportHandlingStrategy() == MissingImportHandlingStrategy.THROW_EXCEPTION) { throw e; } else { // Silent MissingImportEvent evt = new MissingImportEvent(declaration.getIRI(), e); fireMissingImportEvent(evt); } } finally { importsLoadCount.decrementAndGet(); } return ont; } finally { writeLock.unlock(); } }
@Nullable protected OWLOntology loadImports(OWLImportsDeclaration declaration, OWLOntologyLoaderConfiguration configuration) throws OWLOntologyCreationException { writeLock.lock(); try { importsLoadCount.incrementAndGet(); OWLOntology ont = null; try { ont = loadOntology(declaration.getIRI(), true, configuration); } catch (OWLOntologyCreationException e) { if (configuration .getMissingImportHandlingStrategy() == MissingImportHandlingStrategy.THROW_EXCEPTION) { throw e; } else { // Silent MissingImportEvent evt = new MissingImportEvent(declaration.getIRI(), e); fireMissingImportEvent(evt); } } finally { importsLoadCount.decrementAndGet(); } return ont; } finally { writeLock.unlock(); } }