Examples of AddImport


Examples of org.semanticweb.owlapi.model.AddImport

     *
     * @param declaration
     *        the declaration
     */
    protected void addImport(@Nonnull OWLImportsDeclaration declaration) {
        applyChange(new AddImport(ontology, declaration));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

                    OWLImportsDeclaration decl = owlOntologyManager
                            .getOWLDataFactory().getOWLImportsDeclaration(uri);
                    owlOntologyManager.makeLoadImportRequest(decl,
                            configuration);
                    owlOntologyManager
                            .applyChange(new AddImport(ontology, decl));
                } else {
                    // Ontology annotations
                    OWLLiteral con = getDataFactory().getOWLLiteral(
                            unescapeTagValue(value));
                    OWLAnnotationProperty property = getDataFactory()
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

                            man.applyChange(new RemoveImport(consumer
                                    .getOntology(), importsDeclaration));
                            for (OWLImportsDeclaration decl : importedOntology
                                    .getImportsDeclarations()) {
                                assert decl != null;
                                man.applyChange(new AddImport(consumer
                                        .getOntology(), decl));
                            }
                            for (OWLAnnotation anno : importedOntology
                                    .getAnnotations()) {
                                assert anno != null;
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

    @Override
    void endElement() {
        IRI ontIRI = handler.getIRI(getText().trim());
        OWLImportsDeclaration decl = df.getOWLImportsDeclaration(ontIRI);
        handler.getOWLOntologyManager().applyChange(
                new AddImport(handler.getOntology(), decl));
        handler.getOWLOntologyManager().makeLoadImportRequest(decl,
                handler.getConfiguration());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

        @SuppressWarnings("null")
        @Nonnull
        IRI ont2iri = ont2.getOntologyID().getOntologyIRI().get();
        OWLImportsDeclaration ont2import = ImportsDeclaration(ont1iri);
        ont1.getOWLOntologyManager().applyChange(
                new AddImport(ont2, ont2import));
        OWLAnnotationProperty annoProp = AnnotationProperty(iri("annoProp"));
        OWLAxiom axannoPropdecl = Declaration(annoProp);
        ont1.getOWLOntologyManager().addAxiom(ont1, axannoPropdecl);
        OWLAnnotation inont1anno = Annotation(annoProp, ont1iri);
        OWLAnnotation inont2anno = Annotation(annoProp, ont2iri);
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

        IRI ont2iri = ont2.getOntologyID().getOntologyIRI().get();
        assert ont1iri != null;
        assert ont2iri != null;
        OWLImportsDeclaration ont2import = ImportsDeclaration(ont1iri);
        ont2.getOWLOntologyManager().applyChange(
                new AddImport(ont2, ont2import));
        OWLAnnotationProperty annoProp = AnnotationProperty(iri("annoProp"));
        OWLAxiom axAnnoPropDecl = Declaration(annoProp);
        ont1.getOWLOntologyManager().addAxiom(ont1, axAnnoPropDecl);
        OWLAnnotation inOnt1Anno = Annotation(annoProp, ont1iri);
        OWLAnnotation inOnt2Anno = Annotation(annoProp, ont2iri);
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

        IRI oldIRI = IRI("http://www.semanticweb.org/ontologies/ontA");
        IRI newIRI = IRI("http://www.semanticweb.org/ontologies/ontB");
        OWLOntology ont = m.createOntology(oldIRI);
        OWLOntology importingOnt = m
                .createOntology(IRI("http://www.semanticweb.org/ontologies/ontC"));
        m.applyChange(new AddImport(importingOnt, m.getOWLDataFactory()
                .getOWLImportsDeclaration(
                        ont.getOntologyID().getOntologyIRI().get())));
        assertTrue(m.contains(oldIRI));
        OWLOntologyIRIChanger changer = new OWLOntologyIRIChanger(m);
        m.applyChanges(changer.getChanges(ont, newIRI));
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

    public void testImportsClosureUpdate() throws OWLOntologyCreationException {
        IRI aIRI = IRI("http://a.com");
        OWLOntology ontA = m.createOntology(aIRI);
        IRI bIRI = IRI("http://b.com");
        OWLOntology ontB = m.createOntology(bIRI);
        m.applyChange(new AddImport(ontA, df.getOWLImportsDeclaration(bIRI)));
        assertEquals(2, m.getImportsClosure(ontA).size());
        m.removeOntology(ontB);
        assertEquals(1, m.getImportsClosure(ontA).size());
        m.createOntology(bIRI);
        assertEquals(2, m.getImportsClosure(ontA).size());
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

        OWLOntology ontology1 = manager.createOntology(IRI
                .create(importsBothNameAndVersion));
        OWLOntology ontology2 = manager.createOntology(IRI
                .create(importsBothNameAndOther));
        List<AddImport> changes = new ArrayList<>();
        changes.add(new AddImport(ontology1, factory
                .getOWLImportsDeclaration(IRI.create(ontologyByName))));
        changes.add(new AddImport(ontology1, factory
                .getOWLImportsDeclaration(IRI.create(ontologyByVersion))));
        changes.add(new AddImport(ontology2, factory
                .getOWLImportsDeclaration(IRI.create(ontologyByName))));
        changes.add(new AddImport(ontology2, factory
                .getOWLImportsDeclaration(IRI.create(ontologyByOtherPath))));
        manager.applyChanges(changes);
        manager.saveOntology(ontology1, IRI.create(importsBothNameAndVersion));
        manager.saveOntology(ontology2, IRI.create(importsBothNameAndOther));
        // when
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

        OWLOntology importedOnt = m.createOntology(importedIRI);
        Set<OWLOntology> preImportsClosureCache = new HashSet<>(
                m.getImportsClosure(baseOnt));
        assertTrue(preImportsClosureCache.contains(baseOnt));
        assertFalse(preImportsClosureCache.contains(importedOnt));
        m.applyChange(new AddImport(baseOnt, m.getOWLDataFactory()
                .getOWLImportsDeclaration(importedIRI)));
        Set<OWLOntology> postImportsClosureCache = new HashSet<>(
                m.getImportsClosure(baseOnt));
        assertTrue(postImportsClosureCache.contains(baseOnt));
        assertTrue(postImportsClosureCache.contains(importedOnt));
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.