Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.SetOntologyID


    }


    private void checkForOntologyIDChange(OWLOntologyChange change) {
        if (change instanceof SetOntologyID) {
            SetOntologyID setID = (SetOntologyID) change;
            OWLOntology existingOntology = ontologiesByID.get(((SetOntologyID) change).getNewOntologyID());
            if (existingOntology != null && !change.getOntology().equals(existingOntology)) {
                throw new OWLOntologyRenameException(change, ((SetOntologyID) change).getNewOntologyID());
            }
            renameOntology(setID.getOriginalOntologyID(), setID.getNewOntologyID());
            resetImportsClosureCache();
        }
    }
View Full Code Here


     *         specified ontology, and also update the imports declarations in any ontologies
     *         which import the specified ontology.
     */
    public List<OWLOntologyChange> getChanges(OWLOntology ontology, IRI newIRI) {
        List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>();
        changes.add(new SetOntologyID(ontology, new OWLOntologyID(newIRI, ontology.getOntologyID().getVersionIRI())));
        for (OWLOntology ont : owlOntologyManager.getOntologies()) {
            for (OWLImportsDeclaration decl : ont.getImportsDeclarations()) {
                if (decl.getIRI().equals(ontology.getOntologyID().getOntologyIRI())) {
                    changes.add(new RemoveImport(ont, decl));
                    changes.add(new AddImport(ont, owlOntologyManager.getOWLDataFactory().getOWLImportsDeclaration(newIRI)));
View Full Code Here

    IRI versionIRI = IRI.create(ontologyIRI + "/version1");
    // Note that we MUST specify an ontology IRI if we want to specify a
    // version IRI
    OWLOntologyID newOntologyID = new OWLOntologyID(ontologyIRI, versionIRI);
    // Create the change that will set our version IRI
    SetOntologyID setOntologyID = new SetOntologyID(ontology, newOntologyID);
    // Apply the change
    manager.applyChange(setOntologyID);
    System.out.println("Ontology: " + ontology);
   
    currentOntologyID = ontology.getOntologyID();//set the global field for ontologies
View Full Code Here

    IRI versionIRI = IRI.create(ontologyIRI + "/version1");
    // Note that we MUST specify an ontology IRI if we want to specify a
    // version IRI
    OWLOntologyID newOntologyID = new OWLOntologyID(ontologyIRI, versionIRI);
    // Create the change that will set our version IRI
    SetOntologyID setOntologyID = new SetOntologyID(ontology, newOntologyID);
    // Apply the change
    manager.applyChange(setOntologyID);
    System.out.println("Ontology: " + ontology);
   
    currentOntologyID = ontology.getOntologyID();//set the global field for ontologies
View Full Code Here

    IRI versionIRI = IRI.create(ontologyIRI + "/version1");
    // Note that we MUST specify an ontology IRI if we want to specify a
    // version IRI
    OWLOntologyID newOntologyID = new OWLOntologyID(ontologyIRI, versionIRI);
    // Create the change that will set our version IRI
    SetOntologyID setOntologyID = new SetOntologyID(ontology, newOntologyID);
    // Apply the change
    manager.applyChange(setOntologyID);
    System.out.println("Ontology: " + ontology);
   
    currentOntologyID = ontology.getOntologyID();//set the global field for ontologies
View Full Code Here

            IRI versionIri = id.getVersionIRI();
            if (versionIri == null) {
                log.info("    No OWL version IRI Found . Will set to own ID. ");
                versionIri = IRI.create(getNamespace() + getID());
                OWLOntologyID newId = new OWLOntologyID(ontologyIRI, versionIri);
                OWLOntologyChange change = new SetOntologyID(ontology, newId);
                ontology.getOWLOntologyManager().applyChange(change);
                log.info("    Set OWL version IRI : {} . ", versionIri);
            } else log.info("    Found OWL version IRI {} . Will not claim ownership. ", versionIri);
        }
View Full Code Here

    protected void applyChange(OWLOntologyChange change) {
        owlOntologyManager.applyChange(change);
    }

    protected void setOntologyID(OWLOntologyID ontologyID) {
        applyChange(new SetOntologyID(ontology, ontologyID));
    }
View Full Code Here

            // Do we need to change the ontology IRI?
            IRI ontologyIRIToSet = chooseOntologyIRI();
            if (ontologyIRIToSet != null) {
                IRI versionIRI = ontology.getOntologyID().getVersionIRI();
                applyChange(new SetOntologyID(ontology, new OWLOntologyID(ontologyIRIToSet, versionIRI)));
            }

            if (tripleProcessor.isLoggable(Level.FINE)) {
                tripleProcessor.fine("Loaded " + ontology.getOntologyID());
            }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.SetOntologyID

Copyright © 2018 www.massapicom. 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.