Search in sources :

Example 1 with RootOntologySource

use of org.apache.stanbol.ontologymanager.sources.owlapi.RootOntologySource in project stanbol by apache.

the class SessionResource method manageOntology.

/**
     * 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();
}
Also used : WebApplicationException(javax.ws.rs.WebApplicationException) OWLOntologyCreationException(org.semanticweb.owlapi.model.OWLOntologyCreationException) UnmodifiableOntologyCollectorException(org.apache.stanbol.ontologymanager.servicesapi.collector.UnmodifiableOntologyCollectorException) RootOntologySource(org.apache.stanbol.ontologymanager.sources.owlapi.RootOntologySource) ResponseBuilder(javax.ws.rs.core.Response.ResponseBuilder) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes)

Example 2 with RootOntologySource

use of org.apache.stanbol.ontologymanager.sources.owlapi.RootOntologySource in project stanbol by apache.

the class SessionResource method postOntology.

@POST
@Consumes({ MULTIPART_FORM_DATA })
@Produces({ WILDCARD })
public Response postOntology(MultiPartBody data, @Context HttpHeaders headers) {
    log.debug(" post(FormDataMultiPart data)");
    long before = System.currentTimeMillis();
    ResponseBuilder rb;
    // TODO remove and make sure it is set across the method
    rb = Response.status(BAD_REQUEST);
    IRI location = null, library = null;
    // If found, it takes precedence over location.
    FormFile file = null;
    String format = null;
    Set<String> toAppend = null;
    Set<String> keys = new HashSet<String>();
    //        }
    if (data.getFormFileParameterValues("file").length > 0) {
        file = data.getFormFileParameterValues("file")[0];
    }
    // else {
    if (data.getTextParameterValues("format").length > 0) {
        String value = data.getTextParameterValues("format")[0];
        if (!value.equals("auto")) {
            format = value;
        }
    }
    if (data.getTextParameterValues("url").length > 0) {
        String value = data.getTextParameterValues("url")[0];
        try {
            // To throw 400 if malformed.
            URI.create(value);
            location = IRI.create(value);
        } catch (Exception ex) {
            log.error("Malformed IRI for param url " + value, ex);
            throw new WebApplicationException(ex, BAD_REQUEST);
        }
    }
    if (data.getTextParameterValues("library").length > 0) {
        String value = data.getTextParameterValues("library")[0];
        try {
            // To throw 400 if malformed.
            URI.create(value);
            library = IRI.create(value);
        } catch (Exception ex) {
            log.error("Malformed IRI for param library " + value, ex);
            throw new WebApplicationException(ex, BAD_REQUEST);
        }
    }
    if (data.getTextParameterValues("stored").length > 0) {
        String value = data.getTextParameterValues("stored")[0];
        keys.add(value);
    }
    if (data.getTextParameterValues("scope").length > 0) {
        String value = data.getTextParameterValues("scope")[0];
        log.info("Request to append scope \"{}\".", value);
        if (toAppend == null) {
            toAppend = new HashSet<String>();
        }
        toAppend.add(value);
    }
    boolean fileOk = file != null;
    if (fileOk || location != null || library != null) {
        // File and location take precedence
        // Then add the file
        OntologyInputSource<?> src = null;
        if (fileOk) {
            // File first
            Collection<String> formats;
            if (format == null || "".equals(format.trim()))
                formats = OntologyUtils.getPreferredFormats();
            else
                formats = Collections.singleton(format);
            for (String f : formats) try {
                log.debug("Trying format {}.", f);
                long b4buf = System.currentTimeMillis();
                // Recreate the stream on each attempt
                InputStream content = new BufferedInputStream(new ByteArrayInputStream(file.getContent()));
                log.debug("Streams created in {} ms", System.currentTimeMillis() - b4buf);
                log.debug("Creating ontology input source...");
                b4buf = System.currentTimeMillis();
                OWLOntologyID guessed = OWLUtils.guessOntologyID(content, Parser.getInstance(), f);
                if (guessed != null && !guessed.isAnonymous() && ontologyProvider.hasOntology(guessed)) {
                    rb = Response.status(Status.CONFLICT);
                    this.submitted = guessed;
                    if (headers.getAcceptableMediaTypes().contains(MediaType.TEXT_HTML_TYPE)) {
                        rb.entity(new Viewable("/imports/409", this));
                        rb.header(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_HTML + "; charset=utf-8");
                    }
                } else {
                    content = new BufferedInputStream(new ByteArrayInputStream(file.getContent()));
                    src = new GraphContentInputSource(content, f, ontologyProvider.getStore());
                }
                log.debug("Done in {} ms", System.currentTimeMillis() - b4buf);
                log.info("SUCCESS parse with format {}.", f);
                break;
            } catch (OntologyLoadingException e) {
                log.debug("FAILURE parse with format {}.", f);
                continue;
            } catch (IOException e) {
                log.debug("FAILURE parse with format {} (I/O error).", f);
                continue;
            }
            log.debug("No more formats to try.");
        } else if (location != null) {
            try {
                src = new RootOntologySource(location);
            } catch (Exception e) {
                log.error("Failed to load ontology from " + location, e);
                throw new WebApplicationException(e, BAD_REQUEST);
            }
        } else if (library != null) {
            // This comes last, since it will most likely have a value.
            try {
                long beforeLib = System.currentTimeMillis();
                log.debug("Creating library source for {}", library);
                src = new LibrarySource(library, regMgr);
                log.debug("Library source created in {} ms.", System.currentTimeMillis() - beforeLib);
            } catch (Exception e) {
                log.error("Failed to load ontology library " + library, e);
                throw new WebApplicationException(e, INTERNAL_SERVER_ERROR);
            }
        } else {
            log.error("Bad request");
            log.error(" file is: {}", file);
            throw new WebApplicationException(BAD_REQUEST);
        }
        if (src != null) {
            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);
            // FIXME ugly but will have to do for the time being
            log.debug("Addition done in {} ms.", System.currentTimeMillis() - b4add);
            log.debug("Storage key : {}", key);
            // key.split("::")[1];
            String uri = OntologyUtils.encode(key);
            // uri = uri.substring((ontologyProvider.getGraphPrefix() + "::").length());
            if (uri != null && !uri.isEmpty())
                rb = Response.seeOther(URI.create("/ontonet/session/" + session.getID() + "/" + uri));
            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
            String scid = sc.getID();
            if (!toAppend.contains(scid) && getAppendedScopes().contains(scid)) {
                session.detachScope(scid);
                log.info("Removed scope \"{}\".", scid);
            }
        }
        for (String scid : toAppend) {
            // Then add all the scopes in the list
            if (!getAppendedScopes().contains(scid)) {
                log.info("Appending scope \"{}\" to session \"{}\".", scid, session.getID());
                session.attachScope(scid);
                log.info("Appended scope \"{}\".", scid);
            }
        }
        rb = Response.seeOther(URI.create("/ontonet/session/" + session.getID()));
    }
    // else {
    // log.error("Nothing to do with session {}.", session.getID());
    // throw new WebApplicationException(BAD_REQUEST);
    // }
    // rb.header(HttpHeaders.CONTENT_TYPE, TEXT_HTML + "; charset=utf-8");
    //        addCORSOrigin(servletContext, rb, headers);
    log.info("POST ontology completed in {} ms.", System.currentTimeMillis() - before);
    return rb.build();
}
Also used : IRI(org.semanticweb.owlapi.model.IRI) WebApplicationException(javax.ws.rs.WebApplicationException) FormFile(org.apache.clerezza.jaxrs.utils.form.FormFile) BufferedInputStream(java.io.BufferedInputStream) OWLOntologyID(org.semanticweb.owlapi.model.OWLOntologyID) RootOntologySource(org.apache.stanbol.ontologymanager.sources.owlapi.RootOntologySource) ResponseBuilder(javax.ws.rs.core.Response.ResponseBuilder) HashSet(java.util.HashSet) BufferedInputStream(java.io.BufferedInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) LibrarySource(org.apache.stanbol.ontologymanager.registry.io.LibrarySource) IOException(java.io.IOException) OWLOntologyCreationException(org.semanticweb.owlapi.model.OWLOntologyCreationException) IrremovableOntologyException(org.apache.stanbol.ontologymanager.servicesapi.collector.IrremovableOntologyException) WebApplicationException(javax.ws.rs.WebApplicationException) SessionLimitException(org.apache.stanbol.ontologymanager.servicesapi.session.SessionLimitException) UnmodifiableOntologyCollectorException(org.apache.stanbol.ontologymanager.servicesapi.collector.UnmodifiableOntologyCollectorException) OWLOntologyStorageException(org.semanticweb.owlapi.model.OWLOntologyStorageException) IOException(java.io.IOException) OntologyLoadingException(org.apache.stanbol.ontologymanager.servicesapi.ontology.OntologyLoadingException) OntologyCollectorModificationException(org.apache.stanbol.ontologymanager.servicesapi.collector.OntologyCollectorModificationException) DuplicateSessionIDException(org.apache.stanbol.ontologymanager.servicesapi.session.DuplicateSessionIDException) StoredOntologySource(org.apache.stanbol.ontologymanager.servicesapi.io.StoredOntologySource) OntologyLoadingException(org.apache.stanbol.ontologymanager.servicesapi.ontology.OntologyLoadingException) Scope(org.apache.stanbol.ontologymanager.servicesapi.scope.Scope) ByteArrayInputStream(java.io.ByteArrayInputStream) GraphContentInputSource(org.apache.stanbol.ontologymanager.sources.clerezza.GraphContentInputSource) Viewable(org.apache.stanbol.commons.web.viewable.Viewable) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces)

Example 3 with RootOntologySource

use of org.apache.stanbol.ontologymanager.sources.owlapi.RootOntologySource in project stanbol by apache.

the class ScopeResource method registerScope.

/**
     * At least one between corereg and coreont must be present. Registry iris supersede ontology iris.
     * 
     * @param scopeid
     * @param coreRegistry
     *            a. If it is a well-formed IRI it supersedes <code>coreOntology</code>.
     * @param coreOntologies
     * @param customRegistry
     *            a. If it is a well-formed IRI it supersedes <code>customOntology</code>.
     * @param customOntologies
     * @param activate
     *            if true, the new scope will be activated upon creation.
     * @param uriInfo
     * @param headers
     * @return
     */
@PUT
@Consumes(MediaType.WILDCARD)
public Response registerScope(@PathParam("scopeid") String scopeid, @QueryParam("corereg") final List<String> coreRegistries, @QueryParam("coreont") final List<String> coreOntologies, @DefaultValue("false") @QueryParam("activate") boolean activate, @Context HttpHeaders headers) {
    log.debug("Request URI {}", uriInfo.getRequestUri());
    scope = onm.getScope(scopeid);
    List<OntologyInputSource<?>> srcs = new ArrayList<OntologyInputSource<?>>(coreOntologies.size() + coreRegistries.size());
    // First thing, check registry sources.
    if (coreRegistries != null)
        for (String reg : coreRegistries) if (reg != null && !reg.isEmpty())
            try {
                // Library IDs are sanitized differently
                srcs.add(new LibrarySource(URIUtils.desanitize(IRI.create(reg)), regMgr));
            } catch (Exception e1) {
                throw new WebApplicationException(e1, BAD_REQUEST);
            // Bad or not supplied core registry, try the ontology.
            }
    // Then ontology sources
    if (coreOntologies != null)
        for (String ont : coreOntologies) if (ont != null && !ont.isEmpty())
            try {
                srcs.add(new RootOntologySource(IRI.create(ont)));
            } catch (OWLOntologyCreationException e2) {
                // If this fails too, throw a bad request.
                throw new WebApplicationException(e2, BAD_REQUEST);
            }
    // Now the creation.
    try {
        // Expand core sources
        List<OntologyInputSource<?>> expanded = new ArrayList<OntologyInputSource<?>>();
        for (OntologyInputSource<?> coreSrc : srcs) if (coreSrc != null) {
            if (coreSrc instanceof SetInputSource) {
                for (Object o : ((SetInputSource<?>) coreSrc).getOntologies()) {
                    OntologyInputSource<?> src = null;
                    if (o instanceof OWLOntology)
                        src = new RootOntologySource((OWLOntology) o);
                    else if (o instanceof Graph)
                        src = new GraphSource((Graph) o);
                    if (src != null)
                        expanded.add(src);
                }
            } else
                // Must be denoting a single ontology
                expanded.add(coreSrc);
        }
        scope = onm.createOntologyScope(scopeid, expanded.toArray(new OntologyInputSource[0]));
        // Setup and register the scope. If no custom space was set, it will
        // still be open for modification.
        scope.setUp();
        onm.setScopeActive(scopeid, activate);
    } catch (DuplicateIDException e) {
        throw new WebApplicationException(e, CONFLICT);
    } catch (Exception ex) {
        throw new WebApplicationException(ex, INTERNAL_SERVER_ERROR);
    }
    ResponseBuilder rb = Response.created(uriInfo.getAbsolutePath());
    // addCORSOrigin(servletContext, rb, headers);
    return rb.build();
}
Also used : SetInputSource(org.apache.stanbol.ontologymanager.servicesapi.io.SetInputSource) WebApplicationException(javax.ws.rs.WebApplicationException) ArrayList(java.util.ArrayList) LibrarySource(org.apache.stanbol.ontologymanager.registry.io.LibrarySource) OWLOntologyCreationException(org.semanticweb.owlapi.model.OWLOntologyCreationException) UnsupportedFormatException(org.apache.clerezza.rdf.core.serializedform.UnsupportedFormatException) IrremovableOntologyException(org.apache.stanbol.ontologymanager.servicesapi.collector.IrremovableOntologyException) WebApplicationException(javax.ws.rs.WebApplicationException) UnmodifiableOntologyCollectorException(org.apache.stanbol.ontologymanager.servicesapi.collector.UnmodifiableOntologyCollectorException) DuplicateIDException(org.apache.stanbol.ontologymanager.servicesapi.collector.DuplicateIDException) OWLOntologyStorageException(org.semanticweb.owlapi.model.OWLOntologyStorageException) IOException(java.io.IOException) OntologyLoadingException(org.apache.stanbol.ontologymanager.servicesapi.ontology.OntologyLoadingException) OntologyCollectorModificationException(org.apache.stanbol.ontologymanager.servicesapi.collector.OntologyCollectorModificationException) ImmutableGraph(org.apache.clerezza.commons.rdf.ImmutableGraph) Graph(org.apache.clerezza.commons.rdf.Graph) OWLOntologyCreationException(org.semanticweb.owlapi.model.OWLOntologyCreationException) DuplicateIDException(org.apache.stanbol.ontologymanager.servicesapi.collector.DuplicateIDException) RootOntologySource(org.apache.stanbol.ontologymanager.sources.owlapi.RootOntologySource) OWLOntology(org.semanticweb.owlapi.model.OWLOntology) GraphSource(org.apache.stanbol.ontologymanager.sources.clerezza.GraphSource) OntologyInputSource(org.apache.stanbol.ontologymanager.servicesapi.io.OntologyInputSource) ResponseBuilder(javax.ws.rs.core.Response.ResponseBuilder) Consumes(javax.ws.rs.Consumes) PUT(javax.ws.rs.PUT)

Example 4 with RootOntologySource

use of org.apache.stanbol.ontologymanager.sources.owlapi.RootOntologySource in project stanbol by apache.

the class ScopeResource method manageOntology.

/**
     * 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("scopeid") String scopeid, @Context HttpHeaders headers) {
    ResponseBuilder rb;
    scope = onm.getScope(scopeid);
    if (scope == null)
        rb = Response.status(NOT_FOUND);
    else
        try {
            OWLOntologyID key = scope.getCustomSpace().addOntology(new RootOntologySource(IRI.create(iri)));
            URI created = getCreatedResource(OntologyUtils.encode(key));
            rb = Response.created(created);
        } catch (UnmodifiableOntologyCollectorException e) {
            throw new WebApplicationException(e, FORBIDDEN);
        } catch (OWLOntologyCreationException e) {
            throw new WebApplicationException(e, INTERNAL_SERVER_ERROR);
        }
    // addCORSOrigin(servletContext, rb, headers);
    return rb.build();
}
Also used : WebApplicationException(javax.ws.rs.WebApplicationException) OWLOntologyCreationException(org.semanticweb.owlapi.model.OWLOntologyCreationException) UnmodifiableOntologyCollectorException(org.apache.stanbol.ontologymanager.servicesapi.collector.UnmodifiableOntologyCollectorException) RootOntologySource(org.apache.stanbol.ontologymanager.sources.owlapi.RootOntologySource) OWLOntologyID(org.semanticweb.owlapi.model.OWLOntologyID) ResponseBuilder(javax.ws.rs.core.Response.ResponseBuilder) URI(java.net.URI) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes)

Example 5 with RootOntologySource

use of org.apache.stanbol.ontologymanager.sources.owlapi.RootOntologySource in project stanbol by apache.

the class RefactorEnhancementEngine method initEngine.

/**
     * Method for adding ontologies to the scope core ontology.
     * <ol>
     * <li>Get all the ontologies from the property.</li>
     * <li>Create a base scope.</li>
     * <li>Retrieve the ontology space from the scope.</li>
     * <li>Add the ontologies to the scope via ontology space.</li>
     * </ol>
     */
private void initEngine(RefactorEnhancementEngineConf engineConfiguration) {
    // IRI dulcifierScopeIRI = org.semanticweb.owlapi.model.IRI.create((String) context.getProperties().get(SCOPE));
    String scopeId = engineConfiguration.getScope();
    // Create or get the scope with the configured ID
    try {
        scope = onManager.createOntologyScope(scopeId);
    // No need to deactivate a newly created scope.
    } catch (DuplicateIDException e) {
        scope = onManager.getScope(scopeId);
        onManager.setScopeActive(scopeId, false);
    }
    // All resolvable ontologies stated in the configuration are loaded into the core space.
    OntologySpace ontologySpace = scope.getCoreSpace();
    ontologySpace.tearDown();
    String[] coreScopeOntologySet = engineConfiguration.getScopeCoreOntologies();
    List<String> success = new ArrayList<String>(), failed = new ArrayList<String>();
    try {
        log.info("Will now load requested ontology into the core space of scope '{}'.", scopeId);
        OWLOntologyManager sharedManager = OWLManager.createOWLOntologyManager();
        org.semanticweb.owlapi.model.IRI physicalIRI = null;
        for (int o = 0; o < coreScopeOntologySet.length; o++) {
            String url = coreScopeOntologySet[o];
            try {
                physicalIRI = org.semanticweb.owlapi.model.IRI.create(url);
            } 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);
            }
        }
    } catch (UnmodifiableOntologyCollectorException ex) {
        log.error("Ontology space {} was found locked for modification. Cannot populate.", ontologySpace);
    }
    for (String s : success) log.info(" >> {} : SUCCESS", s);
    for (String s : failed) log.info(" >> {} : FAILED", s);
    ontologySpace.setUp();
    // if (!onManager.containsScope(scopeId)) onManager.registerScope(scope);
    onManager.setScopeActive(scopeId, true);
    /*
         * The first thing to do is to create a recipe in the rule store that can be used by the engine to
         * refactor the enhancement graphs.
         */
    String recipeId = engineConfiguration.getRecipeId();
    Recipe recipe = null;
    try {
        recipe = ruleStore.createRecipe(new IRI(recipeId), null);
    } catch (AlreadyExistingRecipeException e1) {
        log.error("A recipe with ID {} already exists in the store.", recipeId);
    }
    if (recipe != null) {
        log.debug("Initialised blank recipe with ID {}", recipeId);
        /*
             * The set of rule to put in the recipe can be provided by the user. A default set of rules is
             * provided in /META-INF/default/seo_rules.sem. Use the property engine.refactor in the felix
             * console to pass to the engine your set of rules.
             */
        String recipeLocation = engineConfiguration.getRecipeLocation();
        InputStream recipeStream = null;
        String recipeString = null;
        if (recipeLocation != null && !recipeLocation.isEmpty()) {
            Dereferencer dereferencer = new DereferencerImpl();
            try {
                recipeStream = dereferencer.resolve(recipeLocation);
                log.debug("Loaded recipe from external source {}", recipeLocation);
            } catch (FileNotFoundException e) {
                log.error("Recipe Stream is null.", e);
            }
        } else {
            // TODO remove this part (or manage it better in the @Activate method).
            String loc = "/META-INF/default/seo_rules.sem";
            recipeStream = getClass().getResourceAsStream(loc);
            log.debug("Loaded default recipe in {}.", loc);
        }
        if (recipeStream != null) {
            BufferedReader reader = new BufferedReader(new InputStreamReader(recipeStream));
            recipeString = "";
            String line = null;
            try {
                while ((line = reader.readLine()) != null) recipeString += line;
            } catch (IOException e) {
                log.error("Failed to load Refactor Engine recipe from stream. Aborting read. ", e);
                recipeString = null;
            }
        }
        log.debug("Recipe content follows :\n{}", recipeString);
        if (recipeString != null) {
            ruleStore.addRulesToRecipe(recipe, recipeString, null);
            log.debug("Added rules to recipe {}", recipeId);
        }
    }
}
Also used : IRI(org.apache.clerezza.commons.rdf.IRI) Recipe(org.apache.stanbol.rules.base.api.Recipe) ArrayList(java.util.ArrayList) FileNotFoundException(java.io.FileNotFoundException) OWLOntologyCreationException(org.semanticweb.owlapi.model.OWLOntologyCreationException) UnmodifiableOntologyCollectorException(org.apache.stanbol.ontologymanager.servicesapi.collector.UnmodifiableOntologyCollectorException) DuplicateIDException(org.apache.stanbol.ontologymanager.servicesapi.collector.DuplicateIDException) RootOntologySource(org.apache.stanbol.ontologymanager.sources.owlapi.RootOntologySource) OWLOntologyManager(org.semanticweb.owlapi.model.OWLOntologyManager) AlreadyExistingRecipeException(org.apache.stanbol.rules.base.api.AlreadyExistingRecipeException) Dereferencer(org.apache.stanbol.enhancer.engines.refactor.dereferencer.Dereferencer) DereferencerImpl(org.apache.stanbol.enhancer.engines.refactor.dereferencer.DereferencerImpl) InputStreamReader(java.io.InputStreamReader) InputStream(java.io.InputStream) IOException(java.io.IOException) EngineException(org.apache.stanbol.enhancer.servicesapi.EngineException) OWLOntologyCreationException(org.semanticweb.owlapi.model.OWLOntologyCreationException) RecipeConstructionException(org.apache.stanbol.rules.base.api.RecipeConstructionException) ConfigurationException(org.osgi.service.cm.ConfigurationException) RefactoringException(org.apache.stanbol.rules.refactor.api.RefactoringException) FileNotFoundException(java.io.FileNotFoundException) RecipeEliminationException(org.apache.stanbol.rules.base.api.RecipeEliminationException) NoSuchRecipeException(org.apache.stanbol.rules.base.api.NoSuchRecipeException) SessionLimitException(org.apache.stanbol.ontologymanager.servicesapi.session.SessionLimitException) UnmodifiableOntologyCollectorException(org.apache.stanbol.ontologymanager.servicesapi.collector.UnmodifiableOntologyCollectorException) AlreadyExistingRecipeException(org.apache.stanbol.rules.base.api.AlreadyExistingRecipeException) DuplicateIDException(org.apache.stanbol.ontologymanager.servicesapi.collector.DuplicateIDException) IOException(java.io.IOException) OntologySpace(org.apache.stanbol.ontologymanager.servicesapi.scope.OntologySpace) BufferedReader(java.io.BufferedReader)

Aggregations

RootOntologySource (org.apache.stanbol.ontologymanager.sources.owlapi.RootOntologySource)11 UnmodifiableOntologyCollectorException (org.apache.stanbol.ontologymanager.servicesapi.collector.UnmodifiableOntologyCollectorException)7 OWLOntologyCreationException (org.semanticweb.owlapi.model.OWLOntologyCreationException)7 OWLOntologyID (org.semanticweb.owlapi.model.OWLOntologyID)5 IOException (java.io.IOException)4 Consumes (javax.ws.rs.Consumes)4 WebApplicationException (javax.ws.rs.WebApplicationException)4 ResponseBuilder (javax.ws.rs.core.Response.ResponseBuilder)4 POST (javax.ws.rs.POST)3 DuplicateIDException (org.apache.stanbol.ontologymanager.servicesapi.collector.DuplicateIDException)3 Scope (org.apache.stanbol.ontologymanager.servicesapi.scope.Scope)3 OWLOntologyManager (org.semanticweb.owlapi.model.OWLOntologyManager)3 InputStream (java.io.InputStream)2 ArrayList (java.util.ArrayList)2 IRI (org.apache.clerezza.commons.rdf.IRI)2 LibrarySource (org.apache.stanbol.ontologymanager.registry.io.LibrarySource)2 IrremovableOntologyException (org.apache.stanbol.ontologymanager.servicesapi.collector.IrremovableOntologyException)2 MissingOntologyException (org.apache.stanbol.ontologymanager.servicesapi.collector.MissingOntologyException)2 OntologyCollectorModificationException (org.apache.stanbol.ontologymanager.servicesapi.collector.OntologyCollectorModificationException)2 OntologyLoadingException (org.apache.stanbol.ontologymanager.servicesapi.ontology.OntologyLoadingException)2