Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLOntologyManager.applyChanges()


            for (String scopeID : attachedScopes.keySet()) {
                IRI physIRI = attachedScopes.get(scopeID).getDocumentIRI();
                changes.add(new AddImport(o, df.getOWLImportsDeclaration(physIRI)));
            }
            // Commit
            ontologyManager.applyChanges(changes);
        }
        return o;
    }

    protected void fireClosed() {
View Full Code Here


                spc = getCoreSpace();
                if (spc != null && spc.getOntologyCount(false) > 0) {
                    IRI spaceIri = IRI.create(getNamespace() + spc.getID());
                    additions.add(new AddImport(ont, df.getOWLImportsDeclaration(spaceIri)));
                }
                mgr.applyChanges(additions);
            }
        } catch (OWLOntologyCreationException e) {
            log.error("Failed to generate an OWL form of scope " + getID(), e);
            ont = null;
        }
View Full Code Here

        // Create the recipe axiom
        OWLNamedIndividual ontoind = factory.getOWLNamedIndividual(recipe.getRecipeID());

        // Remove the recipe
        ontoind.accept(remover);
        mng.applyChanges(remover.getChanges());
        remover.reset();

        // Check if the recipe ahs been removed
        if (owlmodel.containsIndividualInSignature(recipe.getRecipeID())) return false;
        else return true;
View Full Code Here

        // Create the rule axiom
        OWLNamedIndividual ontoind = factory.getOWLNamedIndividual(IRI.create((ruleNS + rule.getRuleName())));

        // Remove the rule
        ontoind.accept(remover);
        mng.applyChanges(remover.getChanges());
        remover.reset();

        // Check if the recipe ahs been removed
        if (owlmodel.containsIndividualInSignature(IRI.create((ruleNS + rule.getRuleName())))) return false;
        else return true;
View Full Code Here

                for (IRI ontologyIri : managedOntologies) {
                    IRI physIRI = IRI.create(base + ontologyIri);
                    changes.add(new AddImport(root, df.getOWLImportsDeclaration(physIRI)));
                }

                ontologyManager.applyChanges(changes);
            }

        }
        log.debug("OWL export of {} completed in {} ms.", getID(), System.currentTimeMillis() - before);
View Full Code Here

            for (String id : sessionManager.getRegisteredSessionIDs()) {
                IRI sessionid = IRI.create(sessionManager.getNamespace() + sessionManager.getID() + "/" + id);
                OWLNamedIndividual ind = df.getOWLNamedIndividual(sessionid);
                changes.add(new AddAxiom(o, df.getOWLClassAssertionAxiom(cSession, ind)));
            }
            ontMgr.applyChanges(changes);
        } catch (OWLOntologyCreationException e) {
            throw new WebApplicationException(e, INTERNAL_SERVER_ERROR);
        }
        ResponseBuilder rb = Response.ok(o);
        MediaType mediaType = MediaTypeUtil.getAcceptableMediaType(headers, null);
View Full Code Here

      OWLNamedIndividual iScope = __factory.getOWLNamedIndividual(IRI.create(scope.getNamespace()+scope
          .getID()));
      OWLAxiom ax = __factory.getOWLClassAssertionAxiom(cScope, iScope);
      additions.add(new AddAxiom(ont, ax));
    }
    mgr.applyChanges(additions);

    return ont;
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.