/** * Tells the session that it should manage the ontology obtained by dereferencing the supplied IRI.<br> * <br> * Note that the PUT method cannot be used, as it is not possible to predict what ID the ontology will * have until it is parsed. * * @param content * the ontology physical IRI * @return {@link Status#OK} if the addition was successful, {@link Status#NOT_FOUND} if there is no such * session at all, {@link Status#FORBIDDEN} if the session is locked or cannot modified for some * other reason, {@link Status#INTERNAL_SERVER_ERROR} if some other error occurs. */ @POST @Consumes(value = MediaType.TEXT_PLAIN) public Response manageOntology(String iri, @PathParam("id") String sessionId, @Context HttpHeaders headers) { session = sesMgr.getSession(sessionId); if (session == null) return Response.status(NOT_FOUND).build(); try { session.addOntology(new RootOntologySource(IRI.create(iri))); } catch (UnmodifiableOntologyCollectorException e) { throw new WebApplicationException(e, FORBIDDEN); } catch (OWLOntologyCreationException e) { throw new WebApplicationException(e, INTERNAL_SERVER_ERROR); } ResponseBuilder rb = Response.ok(); // addCORSOrigin(servletContext, rb, headers); return rb.build(); }
src = new GraphContentInputSource(content, mt, ontologyProvider.getStore()); log.debug("SUCCESS parse with media type {}.", mt); OWLOntologyID key = session.addOntology(src); if (key == null || key.isAnonymous()) { log.error("FAILED parse with media type {}.", mt);
for (OWLOntologyID key : struct.getOntologyKeysForSession(sessionId)) try { session.addOntology(new StoredOntologySource(key)); } catch (MissingOntologyException ex) { log.error(
for (OWLOntologyID key : struct.getOntologyKeysForSession(sessionId)) try { session.addOntology(new StoredOntologySource(key)); } catch (MissingOntologyException ex) { log.error(
log.debug("Adding ontology from input source {}", src); long b4add = System.currentTimeMillis(); OWLOntologyID key = session.addOntology(src); if (key == null || key.isAnonymous()) throw new WebApplicationException(INTERNAL_SERVER_ERROR); session.addOntology(new StoredOntologySource(OntologyUtils.decode(key))); rb = Response.seeOther(URI.create("/ontonet/session/" + session.getID()));
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);