Examples of OntologySpace


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

                OntologyScope sc = null;
                sc = ontologyScopeFactory.createOntologyScope(scopeIRI, new BlankOntologySource());

                // Populate the core space
                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.servicesapi.scope.OntologySpace

    public static OWLOntology buildImportTree(OntologyInputSource<OWLOntology> rootSrc,
                                              Set<OWLOntology> subtrees,
                                              OWLOntologyManager mgr) {

        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.servicesapi.scope.OntologySpace

        if (!(arg0 instanceof OntologySpace)) return false;
        if (this == arg0) return true;
        log.warn(
            "{} only implements weak equality, i.e. managed ontologies are only checked by public key, not by content.",
            getClass());
        OntologySpace sp = (OntologySpace) arg0;
        if (!super.equals(arg0)) return false;
        if (!this.getConnectivityPolicy().equals(sp.getConnectivityPolicy())) return false;
        return true;
    }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.servicesapi.scope.OntologySpace

        // s.setUp();
    }

    @Override
    public OntologySpace createCoreOntologySpace(String scopeId, OntologyInputSource<?>... coreSources) {
        OntologySpace s = new CoreSpaceImpl(scopeId, namespace, ontologyProvider);
        configureSpace(s, scopeId, coreSources);
        return s;
    }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.servicesapi.scope.OntologySpace

        return s;
    }

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

Examples of org.apache.stanbol.ontologymanager.servicesapi.scope.OntologySpace

        reset();
    }

    @Test
    public void testAddOntology() throws Exception {
        OntologySpace space = null;

        OWLOntologyID logicalId = OWLUtils.extractOntologyID(nonexSrc.getRootOntology());
        assertNotNull(logicalId);

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

        logicalId = OWLUtils.extractOntologyID(dropSrc.getRootOntology());
        assertNotNull(logicalId);
        assertTrue(space.hasOntology(logicalId));
    }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.servicesapi.scope.OntologySpace

        assertTrue(space.hasOntology(logicalId));
    }

    @Test
    public void testCoreLock() throws Exception {
        OntologySpace space = factory.createCoreOntologySpace(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.servicesapi.scope.OntologySpace

        }
    }

    @Test
    public void testCreateSpace() throws Exception {
        OntologySpace space = factory.createCustomOntologySpace(scopeId, dropSrc);
        OWLOntologyID logicalId = null;
        Object o = dropSrc.getRootOntology();
        if (o instanceof TripleCollection) logicalId = OWLUtils.extractOntologyID((TripleCollection) o);
        else if (o instanceof OWLOntology) logicalId = OWLUtils.extractOntologyID((OWLOntology) o);
        assertNotNull(logicalId);
        assertTrue(space.hasOntology(logicalId));
    }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.servicesapi.scope.OntologySpace

        assertTrue(space.hasOntology(logicalId));
    }

    @Test
    public void testCustomLock() throws Exception {
        OntologySpace 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.servicesapi.scope.OntologySpace

     * @throws Exception
     *             if an unexpected error occurs.
     */
    @Test
    public void testIdentifiers() throws Exception {
        OntologySpace shouldBeNull = null, shouldBeNotNull = null;

        /* First test space identifiers. */

        // Null identifier (invalid).
        try {
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.