Examples of AddImport


Examples of org.semanticweb.owlapi.model.AddImport

        // TODO - individuals
        for (Clause cl : hf.getClauses(OboFormatTag.TAG_IMPORT)) {
            String path = getURI(cl.getValue().toString());
            IRI importIRI = IRI.create(path);
            manager.loadOntology(importIRI);
            AddImport ai = new AddImport(in,
                    fac.getOWLImportsDeclaration(importIRI));
            manager.applyChange(ai);
        }
        postProcess(in);
        return in;
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

                    break label_2;
            }
            switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) {
                case IMPORT: {
                    decl = ImportsDeclaration();
                    applyChange(new AddImport(ontology, decl));
                    man.makeLoadImportRequest(decl, configuration);
                    break;
                }
                case ANNOTATION: {
                    anno = Annotation();
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

            if (ONTOLOGY.matches(section)) {
                ManchesterOWLSyntaxOntologyHeader header = parseOntologyHeader(false);
                for (OWLImportsDeclaration decl : header
                        .getImportsDeclarations()) {
                    assert decl != null;
                    imports.add(new AddImport(ont, decl));
                    ont.getOWLOntologyManager().makeLoadImportRequest(decl,
                            getOntologyLoaderConfiguration());
                    OWLOntology imported = ont.getOWLOntologyManager()
                            .getOntology(decl.getIRI());
                    assert imported != null;
                    for (OWLDeclarationAxiom declaration : imported
                            .getAxioms(AxiomType.DECLARATION)) {
                        processDeclaredEntities(declaration);
                    }
                }
                for (OWLAnnotation anno : header.getAnnotations()) {
                    assert anno != null;
                    ontologyAnnotations
                            .add(new AddOntologyAnnotation(ont, anno));
                }
                ontologyID = header.getOntologyID();
            } else if (DISJOINT_CLASSES.matches(section)) {
                axioms.addAll(parseDisjointClasses());
            } else if (EQUIVALENT_CLASSES.matches(section)) {
                axioms.addAll(parseNaryEquivalentClasses());
            } else if (EQUIVALENT_PROPERTIES.matches(section)) {
                axioms.addAll(parseNaryEquivalentProperties());
            } else if (DISJOINT_PROPERTIES.matches(section)) {
                axioms.addAll(parseDisjointProperties());
            } else if (DIFFERENT_INDIVIDUALS.matches(section)) {
                axioms.addAll(parseDifferentIndividuals());
            } else if (SAME_INDIVIDUAL.matches(section)) {
                axioms.addAll(parseSameIndividual());
            } else if (CLASS.matches(section)) {
                axioms.addAll(parseClassFrame());
            } else if (OBJECT_PROPERTY.matches(section)) {
                axioms.addAll(parseObjectPropertyFrame());
            } else if (DATA_PROPERTY.matches(section)) {
                axioms.addAll(parseDataPropertyFrame());
            } else if (INDIVIDUAL.matches(section)) {
                axioms.addAll(parseIndividualFrame());
            } else if (DATATYPE.matches(section)) {
                axioms.addAll(parseDatatypeFrame());
            } else if (ANNOTATION_PROPERTY.matches(section)) {
                axioms.addAll(parseAnnotationPropertyFrame());
            } else if (VALUE_PARTITION.matches(section)) {
                axioms.addAll(parseValuePartitionFrame());
            } else if (IMPORT.matches(section)) {
                OWLImportsDeclaration decl = parseImportsDeclaration();
                ont.getOWLOntologyManager().makeLoadImportRequest(decl,
                        getOntologyLoaderConfiguration());
                imports.add(new AddImport(ont, decl));
                OWLOntology imported = ont.getOWLOntologyManager().getOntology(
                        decl.getIRI());
                assert imported != null;
                for (OWLDeclarationAxiom declaration : imported
                        .getAxioms(AxiomType.DECLARATION)) {
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

        m.addAxiom(o, DF.getOWLObjectPropertyDomainAxiom(op, c));
        m.addAxiom(o, DF.getOWLObjectPropertyRangeAxiom(op, c));
        m.addAxiom(o, DF.getOWLFunctionalObjectPropertyAxiom(op));
        m.addAxiom(o,
                DF.getOWLAnnotationAssertionAxiom(ap, as, owlannotationvalue));
        m.applyChange(new AddImport(o, DF.getOWLImportsDeclaration(iri)));
        m.addAxiom(o, DF.getOWLAnnotationPropertyDomainAxiom(ap, iri));
        m.addAxiom(o, DF.getOWLAnnotationPropertyRangeAxiom(ap, iri));
        m.addAxiom(o, DF.getOWLSubAnnotationPropertyOfAxiom(ap, ap));
        m.addAxiom(o, DF.getOWLInverseFunctionalObjectPropertyAxiom(op));
        m.addAxiom(o, DF.getOWLReflexiveObjectPropertyAxiom(op));
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

            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

Examples of org.semanticweb.owlapi.model.AddImport

        OWLOntology ontB = manager.createOntology(OWLOntologyDocumentSourceBase
                .getNextDocumentIRI("urn:testontology"));
        OWLImportsDeclaration decl = manager.getOWLDataFactory()
                .getOWLImportsDeclaration(
                        ontB.getOntologyID().getOntologyIRI().get());
        manager.applyChange(new AddImport(ontA, decl));
        assertTrue(manager.getDirectImports(ontA).contains(ontB));
        manager.removeOntology(ontB);
        assertFalse(manager.getDirectImports(ontA).contains(ontB));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

                .getOWLImportsDeclaration(
                        ontB.getOntologyID().getOntologyIRI().get());
        OWLImportsDeclaration declB = manager.getOWLDataFactory()
                .getOWLImportsDeclaration(
                        ontC.getOntologyID().getOntologyIRI().get());
        manager.applyChange(new AddImport(ontA, declA));
        manager.applyChange(new AddImport(ontB, declB));
        assertTrue(manager.getImportsClosure(ontA).contains(ontA));
        assertTrue(manager.getImportsClosure(ontA).contains(ontB));
        assertTrue(manager.getImportsClosure(ontA).contains(ontC));
        assertTrue(manager.getImportsClosure(ontB).contains(ontB));
        assertTrue(manager.getImportsClosure(ontB).contains(ontC));
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

        OWLOntology ontA = manager.createOntology(IRI.create("a"));
        assertTrue(ontA.getDirectImports().size() == 0);
        IRI b = IRI.create("b");
        OWLImportsDeclaration declB = manager.getOWLDataFactory()
                .getOWLImportsDeclaration(b);
        manager.applyChange(new AddImport(ontA, declB));
        Set<IRI> directImportsDocuments = ontA.getDirectImportsDocuments();
        assertEquals(1, directImportsDocuments.size());
        assertTrue(directImportsDocuments.contains(b));
        OWLOntology ontB = manager.createOntology(b);
        directImportsDocuments = ontA.getDirectImportsDocuments();
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

                .getNextDocumentIRI("urn:testontology"));
        assertTrue(m.getImportsClosure(ontA).contains(ontA));
        @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

Examples of org.semanticweb.owlapi.model.AddImport

    }

    @Nonnull
    @Override
    public AddImport createOntologyChange(OWLOntology ontology) {
        return new AddImport(ontology, getDeclaration());
    }
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.