private OWLEntityCreationSet<E> createEntity(@Nonnull String name) { try { return entityFactory.createOWLEntity(entityType, name, Optional.empty()); } catch (OWLEntityCreationException e) { throw new RuntimeException(e); } } }
private OWLEntityCreationSet<E> createEntity(@Nonnull String name) { try { return entityFactory.createOWLEntity(entityType, name, Optional.empty()); } catch (OWLEntityCreationException e) { throw new RuntimeException(e); } } }
private OWLEntity getEntity(OWLEntity entity, String id, IRI base) { try { return fac.createOWLEntity(entity.getClass(), id, base).getOWLEntity(); } catch (OWLEntityCreationException e) { throw new RuntimeException(e); } }
private OWLEntity getEntity(OWLEntity entity, String id, IRI base) { try { return fac.createOWLEntity(entity.getClass(), id, base).getOWLEntity(); } catch (OWLEntityCreationException e) { throw new RuntimeException(e); } }
private OWLEntity getEntity(OWLEntity entity, String id, IRI base) { try { return fac.createOWLEntity(entity.getClass(), id, base).getOWLEntity(); } catch (OWLEntityCreationException e) { throw new RuntimeException(e); } }
private OWLEntity getEntity(OWLEntity entity, String id, IRI base) { try { return fac.createOWLEntity(entity.getClass(), id, base).getOWLEntity(); } catch (OWLEntityCreationException e) { throw new RuntimeException(e); } }
public OWLEntityCreationSet<T> getOWLEntityCreationSet(EntityCreationMode preview) throws RuntimeException { try { if (isEntityIRI()) { IRI iri = getRawIRI(); OWLOntology ontology = owlEditorKit.getModelManager().getActiveOntology(); OWLDataFactory factory = owlEditorKit.getModelManager().getOWLDataFactory(); T owlEntity = CustomOWLEntityFactory.getOWLEntity(factory, type, iri); OWLOntologyChange addDecl = new AddAxiom(ontology, factory.getOWLDeclarationAxiom(owlEntity)); return new OWLEntityCreationSet<>(owlEntity, Collections.singletonList(addDecl)); } else { switch (preview) { case CREATE: return owlEditorKit.getModelManager().getOWLEntityFactory().createOWLEntity(type, getEntityName(), getBaseIRI()); case PREVIEW: return owlEditorKit.getModelManager().getOWLEntityFactory().preview(type, getEntityName(), getBaseIRI()); default: throw new IllegalStateException("Programmer error - report this (with stack trace) to the Protege 4 mailing list"); } } } catch (OWLEntityCreationException e) { throw new RuntimeException(e); } }
public OWLEntityCreationSet<T> getOWLEntityCreationSet(EntityCreationMode preview) throws RuntimeException { try { if (isEntityIRI()) { IRI iri = getRawIRI(); OWLOntology ontology = owlEditorKit.getModelManager().getActiveOntology(); OWLDataFactory factory = owlEditorKit.getModelManager().getOWLDataFactory(); T owlEntity = CustomOWLEntityFactory.getOWLEntity(factory, type, iri); OWLOntologyChange addDecl = new AddAxiom(ontology, factory.getOWLDeclarationAxiom(owlEntity)); return new OWLEntityCreationSet<T>(owlEntity, Collections.singletonList(addDecl)); } else { switch (preview) { case CREATE: return owlEditorKit.getModelManager().getOWLEntityFactory().createOWLEntity(type, getEntityName(), getBaseIRI()); case PREVIEW: return owlEditorKit.getModelManager().getOWLEntityFactory().preview(type, getEntityName(), getBaseIRI()); default: throw new IllegalStateException("Programmer error - report this (with stack trace) to the Protege 4 mailing list"); } } } catch (OWLEntityCreationException e) { throw new RuntimeException(e); } }
public OWLEntityCreationSet<T> getOWLEntityCreationSet() { try { if (useRawIri()) { IRI iri = getRawIRI(); OWLOntology ontology = owlEditorKit.getModelManager().getActiveOntology(); OWLDataFactory factory = owlEditorKit.getModelManager().getOWLDataFactory(); T owlEntity = CustomOWLEntityFactory.getOWLEntity(factory, type, iri); OWLOntologyChange addDecl = new AddAxiom(ontology, factory.getOWLDeclarationAxiom(owlEntity)); return new OWLEntityCreationSet<T>(owlEntity, Collections.singletonList(addDecl)); } else { return owlEditorKit.getModelManager().getOWLEntityFactory().createOWLEntity(type, getEntityName(), getBaseIRI()); } } catch (OWLEntityCreationException e) { return null; } }
public OWLEntityCreationSet<T> getOWLEntityCreationSet(EntityCreationMode preview) throws RuntimeException { try { if (isEntityIRI()) { IRI iri = getRawIRI(); return getCreationSetForIri(iri); } else if(isOboId()) { IRI iri = OboUtilities.getOboLibraryIriFromOboId(getEntityName()); if(owlEditorKit.getOWLModelManager().getActiveOntology().containsEntityInSignature(iri, Imports.INCLUDED)) { throw new OWLEntityCreationException("Entity already exists: " + iri); } return getCreationSetForIri(iri); } else { switch (preview) { case CREATE: return owlEditorKit.getModelManager().getOWLEntityFactory().createOWLEntity(type, getEntityName(), getBaseIRI()); case PREVIEW: return owlEditorKit.getModelManager().getOWLEntityFactory().preview(type, getEntityName(), getBaseIRI()); default: throw new IllegalStateException("Programmer error - report this (with stack trace) to the Protege 4 mailing list"); } } } catch (OWLEntityCreationException e) { throw new RuntimeException(e); } }