Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.RemoveImport


        for (OWLOntology ont : owlOntologyManager.getOntologies()) {
            assert ont != null;
            for (OWLImportsDeclaration decl : ont.getImportsDeclarations()) {
                if (decl.getIRI().equals(
                        ontology.getOntologyID().getOntologyIRI().get())) {
                    changes.add(new RemoveImport(ont, decl));
                    changes.add(new AddImport(ont, owlOntologyManager
                            .getOWLDataFactory().getOWLImportsDeclaration(
                                    newIRI)));
                }
            }
View Full Code Here


        @SuppressWarnings("null")
        OWLImportsDeclaration importsDeclaration = ImportsDeclaration(ontB
                .getOntologyID().getOntologyIRI().get());
        m.applyChange(new AddImport(ontA, importsDeclaration));
        assertTrue(m.getImportsClosure(ontA).contains(ontB));
        m.applyChange(new RemoveImport(ontA, importsDeclaration));
        assertFalse(m.getImportsClosure(ontA).contains(ontB));
        m.applyChange(new AddImport(ontA, importsDeclaration));
        assertTrue(m.getImportsClosure(ontA).contains(ontB));
        m.removeOntology(ontB);
        assertFalse(m.getImportsClosure(ontA).contains(ontB));
View Full Code Here

                            // 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(consumer
                                    .getOntology(), importsDeclaration));
                            for (OWLImportsDeclaration decl : importedOntology
                                    .getImportsDeclarations()) {
                                assert decl != null;
                                man.applyChange(new AddImport(consumer
View Full Code Here

    }

    @Test
    public void testCreateOntologyChange() {
        RemoveImportData data = createData();
        RemoveImport change = data.createOntologyChange(mockOntology);
        assertEquals(mockOntology, change.getOntology());
        assertEquals(mockDeclaration, change.getImportDeclaration());
    }
View Full Code Here

    }

    @Test
    public void testOntologyChangeSymmetry() {
        RemoveImportData data = createData();
        RemoveImport change = new RemoveImport(mockOntology, mockDeclaration);
        assertEquals(change.getChangeData(), data);
    }
View Full Code Here

    }

    @Nonnull
    @Override
    public RemoveImport createOntologyChange(@Nonnull OWLOntology ontology) {
        return new RemoveImport(ontology, getDeclaration());
    }
View Full Code Here

  }
  public void removeImportedOntology(IOntology o) {
    lazyLoad();
    IRI toImport=IRI.create(o.getURI());
    OWLImportsDeclaration importDeclaraton = getOWLDataFactory().getOWLImportsDeclaration(toImport);
    getOWLOntologyManager().applyChange(new RemoveImport(getOWLOntology(),importDeclaraton));
  }
View Full Code Here

  }
  public void removeImportedOntology(IOntology o) {
    lazyLoad();
    IRI toImport=IRI.create(o.getURI());
    OWLImportsDeclaration importDeclaraton = getOWLDataFactory().getOWLImportsDeclaration(toImport);
    getOWLOntologyManager().applyChange(new RemoveImport(getOWLOntology(),importDeclaraton));
  }
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();
                // FIXME Ugly way to check, but we'll get through with it
                if (s.contains("::")) s = s.substring(s.indexOf("::") + 2, s.length());
                boolean managed = managedOntologies.contains(oldImp.getIRI());
                // For space, always go up at least one
View Full Code Here

        List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>();
        OWLDataFactory df = o.getOWLOntologyManager().getOWLDataFactory();

        // TODO manage import rewrites better once the container ID is fully configurable.
        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);
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.