Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.RemoveImport


        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)));
                }
            }
        }
        return changes;
View Full Code Here


                        if (includeGraph) {
                            // We should have just included the triples rather than imported them. So,
                            // we remove the imports statement, add the axioms from the imported ontology to
                            // out importing ontology and remove the imported ontology.
                            // WHO EVER THOUGHT THAT THIS WAS A GOOD IDEA?
                            man.applyChange(new RemoveImport(getConsumer().getOntology(), importsDeclaration));

                            for (OWLImportsDeclaration decl : importedOntology.getImportsDeclarations()) {
                                man.applyChange(new AddImport(getConsumer().getOntology(), decl));
                            }
                            for (OWLAnnotation anno : importedOntology.getAnnotations()) {
View Full Code Here

             * TODO manage import rewrites better once the container ID is fully configurable (i.e. instead of
             * going upOne() add "session" or "ontology" if needed). But only do this if we keep considering
             * imported ontologies as *not* managed.
             */
            for (OWLImportsDeclaration oldImp : o.getImportsDeclarations()) {
                changes.add(new RemoveImport(o, oldImp));
                String s = oldImp.getIRI().toString();
                s = s.substring(s.indexOf("::") + 2, s.length());
                boolean managed = managedOntologies.contains(oldImp.getIRI());
                // For space, always go up at least one
                IRI ns = getNamespace();
View Full Code Here

        /*
         * TODO manage import rewrites better once the container ID is fully configurable (i.e. instead of
         * going upOne() add "session" or "ontology" if needed).
         */
        for (OWLImportsDeclaration oldImp : o.getImportsDeclarations()) {
            changes.add(new RemoveImport(o, oldImp));
            String s = oldImp.getIRI().toString();
            if (s.contains("::")) s = s.substring(s.indexOf("::") + 2, s.length());
            IRI target = IRI.create(base + "/" + s);
            changes.add(new AddImport(o, df.getOWLImportsDeclaration(target)));
        }
View Full Code Here

TOP

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

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.