Ostrzyciel opened a new issue, #2765:
URL: https://github.com/apache/jena/issues/2765

   ### Version
   
   5.1.0
   
   ### Feature
   
   I think it would be useful if the SPARQL UPDATE endpoint in Fuseki returned 
the number of changes made during the update (inserts and deletes). This would 
give the user immediate feedback on whether the query worked as intended or 
not. Quite a few DBs have a feature like that, and it was always very useful 
for me. Currently my workflow to get around this issue is to first issue a 
SELECT query to see what rows would be returned, and then uncomment the 
INSERT/DELETE lines.
   
   This should be fine with the SPARQL spec, which states 
([source](https://www.w3.org/TR/2013/REC-sparql11-protocol-20130321/#update-success)):
   
   > The response body of a successful update request is implementation 
defined. Implementations may use HTTP content negotiation to provide both 
human-readable and machine-processable information about the completed update 
request.
   
   Currently Fuseki can return the response in plain text, equivalent HTML, and 
JSON. For JSON, it looks like this:
   
   ```json
   {
       "statusCode": 200,
       "message": "Update succeeded"
   }
   ```
   
   My suggestion would be to both extend the text message to include the number 
of updates, and add two fields for that in the JSON, so that it's 
machine-readable. Something like this:
   
   ```json
   {
       "statusCode": 200,
       "message": "Update succeeded. Inserted triples: 1234. Deleted triples: 
875.",
       "inserted": 1234,
       "deleted": 875
   }
   ```
   
   This is the simplest approach I can think of, as it would show up fine in 
YASGUI and other clients without any modifications.
   
   The piece of code that would need to be modified is here: 
https://github.com/apache/jena/blob/192f02e31f28b234e6944f323b697dce8f9cb929/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ServletOps.java#L121
   
   I'm just not sure how to get the number of updates programmatically. I'd 
have to dig deeper in the code.
   
   As with #2764, this is nothing urgent, more of a quality-of-life 
improvement. :) I may look into resolving this sometime in the future.
   
   ### Are you interested in contributing a solution yourself?
   
   Perhaps?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to