Search in sources :

Example 1 with SPARQL11ProtocolException

use of it.unibo.arces.wot.sepa.engine.protocol.sparql11.SPARQL11ProtocolException in project SEPA by arces-wot.

the class Processor method processUpdate.

public synchronized Response processUpdate(InternalUpdateRequest update) {
    InternalUpdateRequest preRequest = update;
    if (spuManager.doUpdateARQuadsExtraction(update)) {
        try {
            preRequest = ARQuadsAlgorithm.extractARQuads(update, queryProcessor);
        } catch (SEPAProcessingException | SPARQL11ProtocolException | SEPASparqlParsingException e) {
            return new ErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR, "update_processing", e.getMessage());
        }
    }
    // PRE-UPDATE processing
    spuManager.subscriptionsProcessingPreUpdate(preRequest);
    // Endpoint UPDATE
    Response ret;
    try {
        ret = updateEndpoint(preRequest);
    } catch (SEPASecurityException | IOException e) {
        return new ErrorResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR, "sparql11endpoint", e.getMessage());
    }
    // STOP processing?
    if (ret.isError()) {
        logger.error("*** UPDATE ENDPOINT PROCESSING FAILED *** " + ret);
        spuManager.abortSubscriptionsProcessing();
        return ret;
    }
    // POST-UPDATE processing
    spuManager.subscriptionsProcessingPostUpdate(ret);
    return ret;
}
Also used : Response(it.unibo.arces.wot.sepa.commons.response.Response) ErrorResponse(it.unibo.arces.wot.sepa.commons.response.ErrorResponse) SEPASparqlParsingException(it.unibo.arces.wot.sepa.commons.exceptions.SEPASparqlParsingException) SEPASecurityException(it.unibo.arces.wot.sepa.commons.exceptions.SEPASecurityException) SPARQL11ProtocolException(it.unibo.arces.wot.sepa.engine.protocol.sparql11.SPARQL11ProtocolException) IOException(java.io.IOException) InternalUpdateRequest(it.unibo.arces.wot.sepa.engine.scheduling.InternalUpdateRequest) SEPAProcessingException(it.unibo.arces.wot.sepa.commons.exceptions.SEPAProcessingException) ErrorResponse(it.unibo.arces.wot.sepa.commons.response.ErrorResponse)

Aggregations

SEPAProcessingException (it.unibo.arces.wot.sepa.commons.exceptions.SEPAProcessingException)1 SEPASecurityException (it.unibo.arces.wot.sepa.commons.exceptions.SEPASecurityException)1 SEPASparqlParsingException (it.unibo.arces.wot.sepa.commons.exceptions.SEPASparqlParsingException)1 ErrorResponse (it.unibo.arces.wot.sepa.commons.response.ErrorResponse)1 Response (it.unibo.arces.wot.sepa.commons.response.Response)1 SPARQL11ProtocolException (it.unibo.arces.wot.sepa.engine.protocol.sparql11.SPARQL11ProtocolException)1 InternalUpdateRequest (it.unibo.arces.wot.sepa.engine.scheduling.InternalUpdateRequest)1 IOException (java.io.IOException)1