Package org.apache.stanbol.ontologymanager.ontonet.api.scope

Examples of org.apache.stanbol.ontologymanager.ontonet.api.scope.CustomOntologySpace


    }

    @Override
    public CustomOntologySpace createCustomOntologySpace(String scopeId,
                                                         OntologyInputSource<?,?>... customSources) {
        CustomOntologySpace s = new CustomOntologySpaceImpl(scopeId, namespace, /* storage, */
        OWLOntologyManagerFactory.createOWLOntologyManager(offline.getOntologySourceLocations().toArray(
            new IRI[0])));
        configureSpace(s, scopeId, customSources);
        return s;
    }
View Full Code Here


        reset();
    }

    @Test
    public void testAddOntology() throws Exception {
        CustomOntologySpace space = null;
        IRI logicalId = IRI.create(OWLUtils.guessOntologyIdentifier(nonexSrc.getRootOntology())
                .getUnicodeString());

        space = factory.createCustomOntologySpace(scopeId, dropSrc, minorSrc);
        space.addOntology(minorSrc);
        space.addOntology(nonexSrc);

        assertTrue(space.hasOntology(logicalId));
        logicalId = IRI
                .create(OWLUtils.guessOntologyIdentifier(dropSrc.getRootOntology()).getUnicodeString());
        assertTrue(space.hasOntology(logicalId));
    }
View Full Code Here

        }
    }

    @Test
    public void testCreateSpace() throws Exception {
        CustomOntologySpace space = factory.createCustomOntologySpace(scopeId, dropSrc);
        IRI logicalId = IRI.create(OWLUtils.guessOntologyIdentifier(dropSrc.getRootOntology())
                .getUnicodeString());
        assertTrue(space.hasOntology(logicalId));
    }
View Full Code Here

        assertTrue(space.hasOntology(logicalId));
    }

    @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

        assertNotNull(shouldBeNotNull);
    }

    @Test
    public void testRemoveCustomOntology() throws Exception {
        CustomOntologySpace space = null;
        space = factory.createCustomOntologySpace(scopeId, dropSrc);
        IRI dropId = URIUtils.createIRI(OWLUtils.guessOntologyIdentifier(dropSrc.getRootOntology()));
        IRI nonexId = URIUtils.createIRI(OWLUtils.guessOntologyIdentifier(nonexSrc.getRootOntology()));

        space.addOntology(inMemorySrc);
        space.addOntology(nonexSrc);
        // The other remote ontologies may change base IRI...
        // baseIri is maincharacters
        assertTrue(space.hasOntology(baseIri));
        assertTrue(space.hasOntology(dropId));
        assertTrue(space.hasOntology(nonexId));
        space.removeOntology(dropId);
        assertFalse(space.hasOntology(dropId));
        space.removeOntology(nonexId);
        assertFalse(space.hasOntology(nonexId));
        // OntologyUtils.printOntology(space.getTopOntology(), System.err);

    }
View Full Code Here

        reset();
    }

    @Test
    public void testAddOntology() throws Exception {
        CustomOntologySpace space = null;
        IRI logicalId = nonexSrc.getRootOntology().getOntologyID().getOntologyIRI();

        space = factory.createCustomOntologySpace(scopeId, dropSrc);
        space.addOntology(minorSrc);
        space.addOntology(nonexSrc);

        assertTrue(space.hasOntology(logicalId));
        logicalId = dropSrc.getRootOntology().getOntologyID().getOntologyIRI();
        assertTrue(space.hasOntology(logicalId));
    }
View Full Code Here

        }
    }

    @Test
    public void testCreateSpace() throws Exception {
        CustomOntologySpace space = factory.createCustomOntologySpace(scopeId, dropSrc);
        IRI logicalId = dropSrc.getRootOntology().getOntologyID().getOntologyIRI();
        assertTrue(space.hasOntology(logicalId));
    }
View Full Code Here

        assertTrue(space.hasOntology(logicalId));
    }

    @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

        assertNotNull(shouldBeNotNull);
    }

    @Test
    public void testRemoveCustomOntology() throws Exception {
        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);
        assertFalse(space.hasOntology(dropId));
        space.removeOntology(nonexId);
        assertFalse(space.hasOntology(nonexId));
        // OntologyUtils.printOntology(space.getTopOntology(), System.err);

    }
View Full Code Here

    }

    @Override
    public CustomOntologySpace createCustomOntologySpace(String scopeId,
                                                         OntologyInputSource<?,?>... customSources) {
        CustomOntologySpace s = new CustomOntologySpaceImpl(scopeId, namespace, provider);
        configureSpace(s, scopeId, customSources);
        return s;
    }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.ontologymanager.ontonet.api.scope.CustomOntologySpace

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.