@Override public OWLOntology createOntology(OWLOntologyID ontologyID) throws OWLOntologyCreationException { writeLock.lock(); try { OWLOntology ontology = ontologiesByID.get(ontologyID); if (ontology != null) { throw new OWLOntologyAlreadyExistsException(ontologyID); } IRI documentIRI = computeDocumentIRI(ontologyID); if (documentIRIsByID.values().contains(documentIRI)) { throw new OWLOntologyDocumentAlreadyExistsException(documentIRI); } for (OWLOntologyFactory factory : ontologyFactories) { if (factory.canCreateFromDocumentIRI(documentIRI)) { documentIRIsByID.put(ontologyID, documentIRI); factory.setLock(lock); return factory.createOWLOntology(this, ontologyID, documentIRI, this); } } throw new OWLOntologyFactoryNotFoundException(documentIRI); } finally { writeLock.unlock(); } }
public void addOntologyFactory(OWLOntologyFactory factory) { ontologyFactories.add(0, factory); factory.setOWLOntologyManager(this); }
OWLOntologyLoaderConfiguration configuration) throws OWLOntologyCreationException { for (OWLOntologyFactory factory : ontologyFactories) { if (factory.canAttemptLoading(documentSource)) { try { factory.setLock(lock); OWLOntology ontology = factory.loadOWLOntology(this, documentSource, this, configuration); if (configuration.shouldRepairIllegalPunnings()) { fixIllegalPunnings(ontology);
public OWLOntology createOntology(OWLOntologyID ontologyID) throws OWLOntologyCreationException { OWLOntology ontology = ontologiesByID.get(ontologyID); if (ontology != null) { throw new OWLOntologyAlreadyExistsException(ontologyID); } IRI documentIRI = getDocumentIRIFromMappers(ontologyID, false); if (documentIRI == null) { documentIRI = IRI.generateDocumentIRI(); Collection<IRI> existingDocumentIRIs = documentIRIsByID.values(); while (existingDocumentIRIs.contains(documentIRI)) { documentIRI = IRI.generateDocumentIRI(); } } if (documentIRIsByID.values().contains(documentIRI)) { throw new OWLOntologyDocumentAlreadyExistsException(documentIRI); } for (OWLOntologyFactory factory : ontologyFactories) { if (factory.canCreateFromDocumentIRI(documentIRI)) { documentIRIsByID.put(ontologyID, documentIRI); return factory.createOWLOntology(ontologyID, documentIRI, this); } } throw new OWLOntologyFactoryNotFoundException(documentIRI); }
try { for (OWLOntologyFactory factory : ontologyFactories) { if (factory.canLoad(documentSource)) { OWLOntology ontology = null; try { ontology = factory.loadOWLOntology(documentSource, this); idOfLoadedOntology = ontology.getOntologyID();
OWLOntologyLoaderConfiguration configuration) throws OWLOntologyCreationException { for (OWLOntologyFactory factory : ontologyFactories) { if (factory.canAttemptLoading(documentSource)) { try { factory.setLock(lock); OWLOntology ontology = factory.loadOWLOntology(this, documentSource, this, configuration); if (configuration.shouldRepairIllegalPunnings()) { fixIllegalPunnings(ontology);
@Override public OWLOntology createOntology(OWLOntologyID ontologyID) throws OWLOntologyCreationException { writeLock.lock(); try { OWLOntology ontology = ontologiesByID.get(ontologyID); if (ontology != null) { throw new OWLOntologyAlreadyExistsException(ontologyID); } IRI documentIRI = computeDocumentIRI(ontologyID); if (documentIRIsByID.values().contains(documentIRI)) { throw new OWLOntologyDocumentAlreadyExistsException(documentIRI); } for (OWLOntologyFactory factory : ontologyFactories) { if (factory.canCreateFromDocumentIRI(documentIRI)) { documentIRIsByID.put(ontologyID, documentIRI); factory.setLock(lock); return factory.createOWLOntology(this, ontologyID, documentIRI, this); } } throw new OWLOntologyFactoryNotFoundException(documentIRI); } finally { writeLock.unlock(); } }
OWLOntologyLoaderConfiguration configuration) throws OWLOntologyCreationException { for (OWLOntologyFactory factory : ontologyFactories) { if (factory.canAttemptLoading(documentSource)) { try { factory.setLock(lock); OWLOntology ontology = factory.loadOWLOntology(this, documentSource, this, configuration); if (configuration.shouldRepairIllegalPunnings()) { fixIllegalPunnings(ontology);
@Override public OWLOntology createOntology(OWLOntologyID ontologyID) throws OWLOntologyCreationException { writeLock.lock(); try { OWLOntology ontology = ontologiesByID.get(ontologyID); if (ontology != null) { throw new OWLOntologyAlreadyExistsException(ontologyID); } IRI documentIRI = computeDocumentIRI(ontologyID); if (documentIRIsByID.values().contains(documentIRI)) { throw new OWLOntologyDocumentAlreadyExistsException(documentIRI); } for (OWLOntologyFactory factory : ontologyFactories) { if (factory.canCreateFromDocumentIRI(documentIRI)) { documentIRIsByID.put(ontologyID, documentIRI); factory.setLock(lock); return factory.createOWLOntology(this, ontologyID, documentIRI, this); } } throw new OWLOntologyFactoryNotFoundException(documentIRI); } finally { writeLock.unlock(); } }
OWLOntologyLoaderConfiguration configuration) throws OWLOntologyCreationException { for (OWLOntologyFactory factory : ontologyFactories) { if (factory.canAttemptLoading(documentSource)) { try { factory.setLock(lock); OWLOntology ontology = factory.loadOWLOntology(this, documentSource, this, configuration); if (configuration.shouldRepairIllegalPunnings()) { fixIllegalPunnings(ontology);
@Override public OWLOntology createOntology(OWLOntologyID ontologyID) throws OWLOntologyCreationException { writeLock.lock(); try { OWLOntology ontology = ontologiesByID.get(ontologyID); if (ontology != null) { throw new OWLOntologyAlreadyExistsException(ontologyID); } IRI documentIRI = computeDocumentIRI(ontologyID); if (documentIRIsByID.values().contains(documentIRI)) { throw new OWLOntologyDocumentAlreadyExistsException(documentIRI); } for (OWLOntologyFactory factory : ontologyFactories) { if (factory.canCreateFromDocumentIRI(documentIRI)) { documentIRIsByID.put(ontologyID, documentIRI); factory.setLock(lock); return factory.createOWLOntology(this, ontologyID, documentIRI, this); } } throw new OWLOntologyFactoryNotFoundException(documentIRI); } finally { writeLock.unlock(); } }