@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(); } }
@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(); } }
@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(); } }
@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 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); }