Examples of AddImport


Examples of org.semanticweb.owlapi.model.AddImport

    }

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

Examples of org.semanticweb.owlapi.model.AddImport

    }

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

Examples of org.semanticweb.owlapi.model.AddImport

        IRI locA = m.getOntologyDocumentIRI(a);
        IRI bIRI = IRI("http://b.com");
        OWLOntology b = m.createOntology(bIRI);
        // import from the document location of a.owl (rather than the
        // ontology IRI)
        m.applyChange(new AddImport(b, df.getOWLImportsDeclaration(locA)));
        assertEquals(1, b.getImportsDeclarations().size());
        assertEquals(1, b.getImports().size());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

    }

    @Override
    public List<OWLOntologyChange> applyChanges(OWLOntology o) {
        List<OWLOntologyChange> list = new ArrayList<>();
        list.add(new AddImport(o, buildObject()));
        return list;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

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

Examples of org.semanticweb.owlapi.model.AddImport

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

Examples of org.semanticweb.owlapi.model.AddImport

                if (o.isAnonymous() && importIri == null) {
                    logger.warn("Anonymous import target "
                                + o.getOntologyID()
                                + " not mapped to physical IRI. Will add extracted axioms to parent ontology.");
                    for (OWLImportsDeclaration im : o.getImportsDeclarations())
                        changes.add(new AddImport(parent, im));
                    for (OWLAxiom im : o.getAxioms())
                        changes.add(new AddAxiom(parent, im));
                } else if (importIri != null) {
                    // An anonymous ontology can still be imported if it has a
                    // valid document IRI.
                    changes.add(new AddImport(parent, owlFactory.getOWLImportsDeclaration(importIri)));
                }
            }

        } // End subtrees cycle.
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

                String s = getID();
                s = s.substring(0, s.indexOf(SUFFIX)); // strip "custom"
                s += SpaceType.CORE.getIRISuffix(); // concatenate "core"
                IRI target = IRI.create(universalPrefix + s);
                o.getOWLOntologyManager().applyChange(
                    new AddImport(o, OWLManager.getOWLDataFactory().getOWLImportsDeclaration(target)));
                break;
            default:
                break;
        }
        return o;
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

            return null;
        }
        List<OWLOntologyChange> additions = new LinkedList<OWLOntologyChange>();
        // The ODP metadata vocabulary is always imported.
        // TODO : also import the ONM meta when it goes online.
        additions.add(new AddImport(ont, __factory.getOWLImportsDeclaration(IRI
                .create("http://www.ontologydesignpatterns.org/schemas/meta.owl"))));
        for (Scope scope : scopes) {
            OWLNamedIndividual iScope = __factory.getOWLNamedIndividual(IRI.create(scope
                    .getDefaultNamespace() + scope.getID()));
            OWLAxiom ax = __factory.getOWLClassAssertionAxiom(cScope, iScope);
View Full Code Here

Examples of org.semanticweb.owlapi.model.AddImport

                List<OWLOntologyChange> additions = new LinkedList<OWLOntologyChange>();
                // Add the import statement for the custom space, if existing and not empty
                OntologySpace spc = getCustomSpace();
                if (spc != null && spc.listManagedOntologies().size() > 0) {
                    IRI spaceIri = IRI.create(universalPrefix + spc.getID());
                    additions.add(new AddImport(ont, df.getOWLImportsDeclaration(spaceIri)));
                }
                // Add the import statement for the core space, if existing and not empty
                spc = getCoreSpace();
                if (spc != null && spc.listManagedOntologies().size() > 0) {
                    IRI spaceIri = IRI.create(universalPrefix + spc.getID());
                    additions.add(new AddImport(ont, df.getOWLImportsDeclaration(spaceIri)));
                }
                mgr.applyChanges(additions);
            }
        } catch (OWLOntologyCreationException e) {
            log.error("Failed to generate an OWL form of scope " + getID(), e);
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.