/** * Add the axiom to all the given ontologies. */ public static void addAxiom(OWLAxiom axiom, Set<OWLOntology> ontologies, OWLOntologyManager manager) { for (OWLOntology ont : ontologies) { manager.applyChange(new AddAxiom(ont, axiom)); } } }
@Override public ChangeApplied applyChange(OWLOntologyChange change) throws OWLOntologyRenameException { if (sealed) { throw new DirectChangeApplicationNotAllowedException(); } return delegate.applyChange(change); }
protected void applyChange(OWLOntologyChange chg) { try { man.applyChange(chg); } catch(OWLOntologyChangeException e) { e.printStackTrace(); } }
/** * Add the axiom to all the given ontologies. * * @param axiom * @param ontologies * @param _manager */ public static void addAxiom(final OWLAxiom axiom, final Set<OWLOntology> ontologies, final OWLOntologyManager manager) { for (final OWLOntology ont : ontologies) manager.applyChange(new AddAxiom(ont, axiom)); }
public boolean handleDelete() { try { manager.applyChange(new RemoveAxiom(ontology, axiom)); return true; } catch (OWLOntologyChangeException e) { throw new OWLRuntimeException(e); } }
public boolean handleDelete() { try { manager.applyChange(new RemoveAxiom(ontology, axiom)); return true; } catch (OWLOntologyChangeException e) { throw new OWLRuntimeException(e); } }
public boolean handleDelete() { try { manager.applyChange(new RemoveAxiom(ontology, axiom)); return true; } catch (OWLOntologyChangeException e) { throw new OWLRuntimeException(e); } }
public void linkIndividuals(IIndividual source, IIndividual destination, IProperty link) { OWLObjectPropertyAssertionAxiom axiom = manager.manager.getOWLDataFactory() .getOWLObjectPropertyAssertionAxiom(((Property) link)._owl .asOWLObjectProperty(), ((Individual) source).individual, ((Individual) destination).individual); AddAxiom addAxiom = new AddAxiom(ontology, axiom); manager.manager.applyChange(addAxiom); } }
private void createEquivalentClass(OWLClassExpression classExpression) { OWLAxiom ax = getDataFactory() .getOWLEquivalentClassesAxiom(CollectionFactory.createSet(getCurrentClass(), classExpression)); getOWLOntologyManager().applyChange(new AddAxiom(ontology, ax)); }
public void addImport(IOntology ontology) { if (!this.ontology.getImports().contains(((Ontology) ontology).ontology)) { OWLDataFactory factory = this.ontology.getOWLOntologyManager() .getOWLDataFactory(); OWLImportsDeclaration imp = factory.getOWLImportsDeclaration(IRI .create(((Ontology) ontology).ontology.getOntologyID() .getOntologyIRI().toString())); this.ontology.getOWLOntologyManager() .applyChange(new AddImport(this.ontology, imp)); this.imported.add(ontology.getConceptSpace()); } }
private void createEquivalentClass(OWLClassExpression classExpression) { OWLAxiom ax = getDataFactory() .getOWLEquivalentClassesAxiom(CollectionFactory.createSet(getCurrentClass(), classExpression)); getOWLOntologyManager().applyChange(new AddAxiom(ontology, ax)); }
private void createEquivalentClass(OWLClassExpression classExpression) { OWLAxiom ax = getDataFactory() .getOWLEquivalentClassesAxiom(CollectionFactory.createSet(getCurrentClass(), classExpression)); getOWLOntologyManager().applyChange(new AddAxiom(ontology, ax)); }
@Override void endElement() { IRI ontIRI = handler.getIRI(getText().trim()); OWLImportsDeclaration decl = df.getOWLImportsDeclaration(ontIRI); handler.getOWLOntologyManager().applyChange(new AddImport(handler.getOntology(), decl)); handler.getOWLOntologyManager().makeLoadImportRequest(decl, handler.getConfiguration()); }
@Override void endElement() { IRI ontIRI = handler.getIRI(getText().trim()); OWLImportsDeclaration decl = df.getOWLImportsDeclaration(ontIRI); handler.getOWLOntologyManager().applyChange(new AddImport(handler.getOntology(), decl)); handler.getOWLOntologyManager().makeLoadImportRequest(decl, handler.getConfiguration()); }
public void endElement() throws OWLParserException, UnloadableImportException { IRI ontIRI = getIRI(getText().trim()); OWLImportsDeclaration decl = getOWLDataFactory().getOWLImportsDeclaration(ontIRI); getOWLOntologyManager().applyChange(new AddImport(getOntology(), decl)); getOWLOntologyManager().makeLoadImportRequest(decl); }
void handleChild(AxiomEH<? extends OWLAxiom, ?> h) { OWLAxiom axiom = h.getOWLObject(); if (!axiom.isAnnotationAxiom() || handler.getConfiguration().isLoadAnnotationAxioms()) { handler.getOWLOntologyManager().applyChange(new AddAxiom(handler.getOntology(), axiom)); } }
void handleChild(AxiomEH<? extends OWLAxiom, ?> h) { OWLAxiom axiom = h.getOWLObject(); if (!axiom.isAnnotationAxiom() || handler.getConfiguration().isLoadAnnotationAxioms()) { handler.getOWLOntologyManager().applyChange(new AddAxiom(handler.getOntology(), axiom)); } }
@Override public void endElement() throws OWLParserException, UnloadableImportException { IRI ontIRI = getIRI(getText().trim()); OWLImportsDeclaration decl = getOWLDataFactory().getOWLImportsDeclaration(ontIRI); getOWLOntologyManager().applyChange(new AddImport(getOntology(), decl)); getOWLOntologyManager().makeLoadImportRequest(decl, getConfiguration()); }
@Override public void handleChild(AbstractOWLAxiomElementHandler handler) throws OWLXMLParserException { OWLAxiom axiom = handler.getOWLObject(); if(!axiom.isAnnotationAxiom() || getConfiguration().isLoadAnnotationAxioms()) { getOWLOntologyManager().applyChange(new AddAxiom(getOntology(), axiom)); } }
public void addLabel(OWLClass cls, String label) { OWLAnnotationProperty property = factory.getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL.getIRI()); OWLAnnotation commentAnno = factory.getOWLAnnotation(property, factory.getOWLLiteral(label, "en")); OWLAxiom ax = factory.getOWLAnnotationAssertionAxiom(cls.getIRI(), commentAnno); manager.applyChange(new AddAxiom(ontology, ax)); }