Examples of addOntology()


Examples of org.apache.stanbol.ontologymanager.ontonet.api.scope.CustomOntologySpace.addOntology()

    @Test
    public void testCustomLock() throws Exception {
        CustomOntologySpace space = factory.createCustomOntologySpace(scopeId, inMemorySrc);
        space.setUp();
        try {
            space.addOntology(minorSrc);
            fail("Modification was permitted on locked ontology space.");
        } catch (UnmodifiableOntologyCollectorException e) {
            assertSame(space, e.getOntologyCollector());
        }
    }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.ontonet.api.scope.CustomOntologySpace.addOntology()

        CustomOntologySpace space = null;
        space = factory.createCustomOntologySpace(scopeId, dropSrc);
        IRI dropId = dropSrc.getRootOntology().getOntologyID().getOntologyIRI();
        IRI nonexId = nonexSrc.getRootOntology().getOntologyID().getOntologyIRI();

        space.addOntology(inMemorySrc);
        space.addOntology(nonexSrc);
        // The other remote ontologies may change base IRI...
        assertTrue(space.hasOntology(ont.getOntologyID().getOntologyIRI()) && space.hasOntology(dropId)
                   && space.hasOntology(nonexId));
        space.removeOntology(dropId);
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.ontonet.api.scope.CustomOntologySpace.addOntology()

        space = factory.createCustomOntologySpace(scopeId, dropSrc);
        IRI dropId = dropSrc.getRootOntology().getOntologyID().getOntologyIRI();
        IRI nonexId = nonexSrc.getRootOntology().getOntologyID().getOntologyIRI();

        space.addOntology(inMemorySrc);
        space.addOntology(nonexSrc);
        // The other remote ontologies may change base IRI...
        assertTrue(space.hasOntology(ont.getOntologyID().getOntologyIRI()) && space.hasOntology(dropId)
                   && space.hasOntology(nonexId));
        space.removeOntology(dropId);
        assertFalse(space.hasOntology(dropId));
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.ontonet.api.scope.OntologySpace.addOntology()

        for (UriRef name : tcManager.listTripleCollections())
            log.info("-- {} (a {})", name, tcManager.getTriples(name).getClass().getSimpleName());
        assertEquals(1, tcManager.listTripleCollections().size());
        OntologySpace spc = new CoreOntologySpaceImpl(TestClerezzaInputSources.class.getSimpleName(),
                IRI.create("http://stanbol.apache.org/ontologies/"), provider);
        spc.addOntology(src);
        log.info("After addition to space, TcManager has {} graphs. ", tcManager.listTripleCollections()
                .size());

        for (UriRef name : tcManager.listTripleCollections())
            log.info("-- {} (a {})", name, tcManager.getTriples(name).getClass().getSimpleName());
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.ontonet.api.scope.OntologySpace.addOntology()

                } catch (Exception e) {
                    failed.add(url);
                }
                try {
                    // TODO replace with a Clerezza equivalent
                    ontologySpace.addOntology(new RootOntologyIRISource(physicalIRI, sharedManager));
                    success.add(url);
                } catch (OWLOntologyCreationException e) {
                    log.error("Failed to load ontology from physical location " + physicalIRI
                              + " Continuing with next...", e);
                    failed.add(url);
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.ontonet.api.scope.OntologySpace.addOntology()

        // OntologyInputSource<OWLOntology> src = new OntologyContentInputSource(content,mgr);

        OWLOntology original = src.getRootOntology();

        OntologySpace spc = new CustomOntologySpaceImpl("Test", scopeNs, ontologyProvider);
        spc.addOntology(src);

    }

}
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.ontonet.api.scope.OntologySpace.addOntology()

        if (rootSrc instanceof OntologySpaceSource) {
            OntologySpace spc = ((OntologySpaceSource) rootSrc).asOntologySpace();
            for (OWLOntology o : subtrees)
                try {
                    spc.addOntology(new RootOntologySource(o));
                } catch (UnmodifiableOntologyCollectorException e) {
                    logger.error("Cannot add ontology {} to unmodifiable space {}", o, spc);
                    continue;
                }
        }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.ontonet.api.scope.OntologySpace.addOntology()

                if (cores.length > 0) {
                    OntologySpace corespc = sc.getCoreSpace();
                    corespc.tearDown();
                    for (int i = 0; i < cores.length; i++)
                        try {
                            corespc.addOntology(new RootOntologyIRISource(IRI.create(cores[i])));
                        } catch (Exception ex) {
                            log.warn("Failed to import ontology " + cores[i], ex);
                            continue;
                        }
                }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.ontonet.api.scope.SessionOntologySpace.addOntology()

        SessionOntologySpace s = new SessionOntologySpaceImpl(scopeId, namespace, /* storage, */
        OWLOntologyManagerFactory.createOWLOntologyManager(offline.getOntologySourceLocations().toArray(
            new IRI[0])));
        for (OntologyInputSource<?,?> src : sessionSources)
            try {
                s.addOntology(src);
            } catch (UnmodifiableOntologyCollectorException e) {
                // Should never happen anyway...
                continue;
            }
        // s.setUp();
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.ontonet.api.scope.SessionOntologySpace.addOntology()

    public void testSessionModification() throws Exception {
        SessionOntologySpace space = factory.createSessionOntologySpace(scopeId);
        space.setUp();
        try {
            // First add an in-memory ontology with a few axioms.
            space.addOntology(inMemorySrc);
            // Now add a real online ontology
            space.addOntology(dropSrc);
            // The in-memory ontology must be in the space.
            assertTrue(space.hasOntology(baseIri));
            // The in-memory ontology must still have its axioms.
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.