kbss-cvut / s-pipes

Tool for execution of RDF-based pipelines.
GNU Lesser General Public License v3.0
4 stars 5 forks source link

Add RestExceptionHandler for handling validationConstraintFail… #248

Closed palagdan closed 1 month ago

palagdan commented 1 month ago

…edException and return detailed information about exception

Resolves #246

blcham commented 1 month ago

Regarding output that you presented, I do not like that failedQuery is not really a query but rather a message -- i would delete first part of it i.e. "Failed validation constraint : \n ": image

I guess we should discuss how to implement this on a meeting. To me it seems best to implement it by extending s-pipes-model: image

Then I would like to output through REST API something like:

{
  "@context": {
    "variable1": "http://onto.fel.cvut.cz/ontologies/s-pipes/variable1",
    "variable2": "http://onto.fel.cvut.cz/ontologies/s-pipes/variable2",
    "module": "http://onto.fel.cvut.cz/ontologies/s-pipes/module",
    "message": "http://onto.fel.cvut.cz/ontologies/s-pipes/message",
    "constraintQuery": "http://onto.fel.cvut.cz/ontologies/s-pipes/constraintQuery",
    "constraintFailureEvidences": {
      "@id": "http://onto.fel.cvut.cz/ontologies/s-pipes/constraintFailureEvidences",
      "@container": "@list"
    },
    "ValidationConstraintError": "http://onto.fel.cvut.cz/ontologies/s-pipes/ValidationConstraintError"
  },
  "@type": "ValidationConstraintError",
  "module": "ExampleModule",
  "message": "Example error message",
  "constraintQuery": "SELECT ?variable1 ?variable2 WHERE { ... }",
  "constraintFailureEvidences": [
    {
      "variable1": "value1_1",
      "variable2": "value1_2"
    },
    {
      "variable1": "value2_1",
      "variable2": "value2_2"
    }
  ]
}

Other ideas:

blcham commented 1 month ago

@palagdan Final output looks like this: image

My only concern is whether we should not include also a list of column names, but i guess we can do it later when needed for the frontend.