Examples of addOntology()


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

        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()));
        assertTrue(space.hasOntology(dropId));
        assertTrue(space.hasOntology(nonexId));
View Full Code Here

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

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

        OWLOntology original = src.getRootOntology();
        Assert.assertNotNull(original);
        OntologySpace spc = new CustomSpaceImpl("Test", scopeNs, ontologyProvider);
        spc.addOntology(src);

    }

}
View Full Code Here

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

                } catch (Exception e) {
                    failed.add(url);
                }
                try {
                    // TODO replace with a Clerezza equivalent
                    ontologySpace.addOntology(new RootOntologySource(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.servicesapi.session.Session.addOntology()

            // Register even if some ontologies were to fail to be restored afterwards.
            sessionsByID.put(sessionId, session);
            session.setActive(false); // Restored sessions are inactive at first.
            for (OWLOntologyID key : struct.getOntologyKeysForSession(sessionId))
                try {
                    session.addOntology(new StoredOntologySource(key));
                } catch (MissingOntologyException ex) {
                    log.error(
                        "Could not find an ontology with public key {} to be managed by session \"{}\". Proceeding to next ontology.",
                        key, sessionId);
                    continue;
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.servicesapi.session.Session.addOntology()

    }

    // @Test
    public void zombieSessionClearsContents() throws Exception {
        Session ses = sessionManager.createSession();
        ses.addOntology(new RootOntologySource((IRI
                .create(getClass().getResource("/ontologies/mockfoaf.rdf")))));
        OWLOntologyID expectedKey = new OWLOntologyID(IRI.create("http://xmlns.com/foaf/0.1/"));
        assertTrue(ontologyProvider.hasOntology(expectedKey));
        sessionManager.destroySession(ses.getID());
    }
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.servicesapi.session.Session.addOntology()

    @Test
    public void sessionPreservesManagedOntologies() throws Exception {
        String id = "12345"; // The kind of thing an idiot would have on his luggage.
        Session session = sessionManager.createSession(id);
        // Anonymous ontologies must preserve their public keys!
        session.addOntology(new GraphContentInputSource(getClass().getResourceAsStream(
            "/ontologies/nameless_ontology.owl")));
        // Same for named ontologies...
        session.addOntology(new GraphContentInputSource(getClass().getResourceAsStream(
            "/ontologies/nonexistentcharacters.owl")));
        // ... and versioned ontologies too.
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.servicesapi.session.Session.addOntology()

        Session session = sessionManager.createSession(id);
        // Anonymous ontologies must preserve their public keys!
        session.addOntology(new GraphContentInputSource(getClass().getResourceAsStream(
            "/ontologies/nameless_ontology.owl")));
        // Same for named ontologies...
        session.addOntology(new GraphContentInputSource(getClass().getResourceAsStream(
            "/ontologies/nonexistentcharacters.owl")));
        // ... and versioned ontologies too.
        session.addOntology(new GraphContentInputSource(getClass().getResourceAsStream(
            "/ontologies/versiontest_v1.owl")));
        session.addOntology(new GraphContentInputSource(getClass().getResourceAsStream(
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.servicesapi.session.Session.addOntology()

            "/ontologies/nameless_ontology.owl")));
        // Same for named ontologies...
        session.addOntology(new GraphContentInputSource(getClass().getResourceAsStream(
            "/ontologies/nonexistentcharacters.owl")));
        // ... and versioned ontologies too.
        session.addOntology(new GraphContentInputSource(getClass().getResourceAsStream(
            "/ontologies/versiontest_v1.owl")));
        session.addOntology(new GraphContentInputSource(getClass().getResourceAsStream(
            "/ontologies/versiontest_v2.owl")));
        Collection<OWLOntologyID> managed = session.listManagedOntologies();
        assertEquals(4, managed.size());
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.servicesapi.session.Session.addOntology()

        session.addOntology(new GraphContentInputSource(getClass().getResourceAsStream(
            "/ontologies/nonexistentcharacters.owl")));
        // ... and versioned ontologies too.
        session.addOntology(new GraphContentInputSource(getClass().getResourceAsStream(
            "/ontologies/versiontest_v1.owl")));
        session.addOntology(new GraphContentInputSource(getClass().getResourceAsStream(
            "/ontologies/versiontest_v2.owl")));
        Collection<OWLOntologyID> managed = session.listManagedOntologies();
        assertEquals(4, managed.size());

        // Simulate Stanbol going down.
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.servicesapi.session.Session.addOntology()

             *
             * There is no chance that (2) could be null, as it was previously controlled by the JobManager
             * through the canEnhance() method and the computeEnhancement is always called iff the former
             * returns true.
             */
            session.addOntology(new GraphSource(signaturesGraph));
            session.addOntology(new GraphSource(metadataGraph));
        } catch (UnmodifiableOntologyCollectorException e1) {
            throw new EngineException("Cannot add enhancement graph to OntoNet session for refactoring", e1);
        }

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.