Examples of StoredOntologySource


Examples of org.apache.stanbol.ontologymanager.servicesapi.io.StoredOntologySource

            // 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.io.StoredOntologySource

            Collection<OWLOntologyID> coreOnts = struct.getCoreOntologyKeysForScope(scopeId);
            OntologyInputSource<?>[] srcs = new OntologyInputSource<?>[coreOnts.size()];
            int i = 0;
            for (OWLOntologyID coreOnt : coreOnts) {
                log.debug("Core ontology key : {}", coreOnts);
                srcs[i++] = new StoredOntologySource(coreOnt);
            }
            Scope scope;
            try {
                scope = createOntologyScope(scopeId, srcs);
            } catch (DuplicateIDException e) {
                String dupe = e.getDuplicateID();
                log.warn("Scope \"{}\" already exists and will be reused.", dupe);
                scope = getScope(dupe);
            }
            OntologySpace custom = scope.getCustomSpace();
            // Register even if some ontologies were to fail to be restored afterwards.
            scopeMap.put(scopeId, scope);
            for (OWLOntologyID key : struct.getCustomOntologyKeysForScope(scopeId))
                try {
                    log.debug("Custom ontology key : {}", key);
                    custom.addOntology(new StoredOntologySource(key));
                } catch (MissingOntologyException ex) {
                    log.error(
                        "Could not find an ontology with public key {} to be managed by scope \"{}\". Proceeding to next ontology.",
                        key, scopeId);
                    continue;
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.servicesapi.io.StoredOntologySource

                } else rb = Response.ok();
            } else if (rb == null) rb = Response.status(INTERNAL_SERVER_ERROR);
        }
        if (!keys.isEmpty()) {
            for (String key : keys)
                scope.getCustomSpace().addOntology(new StoredOntologySource(OntologyUtils.decode(key)));
            rb = Response.seeOther(URI.create("/ontonet/ontology/" + scope.getID()));
        }
        // else throw new WebApplicationException(BAD_REQUEST);
        // rb.header(HttpHeaders.CONTENT_TYPE, TEXT_HTML + "; charset=utf-8");
        // FIXME return an appropriate response e.g. 201
View Full Code Here

Examples of org.apache.stanbol.ontologymanager.servicesapi.io.StoredOntologySource

                else rb = Response.seeOther(URI.create("/ontonet/session/" + session.getID()));
            } else if (rb == null) rb = Response.status(INTERNAL_SERVER_ERROR);
        }
        if (!keys.isEmpty()) {
            for (String key : keys)
                session.addOntology(new StoredOntologySource(OntologyUtils.decode(key)));
            rb = Response.seeOther(URI.create("/ontonet/session/" + session.getID()));
        } // Now check scopes
        if (toAppend != null
            && (!toAppend.isEmpty() || (toAppend.isEmpty() && !getAppendedScopes().isEmpty()))) {
            for (Scope sc : getAllScopes()) { // First remove appended scopes not in the list
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.