-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fuseki: report number of changes made in SPARQL UPDATE responses #2765
Comments
There is a reason! What can be done is to record the number of adds and deletes attempted for Some operations like And one request can be several operations:
|
@afs Hm, good point! So, this would be a bit more complicated... Maybe store implementations would have the option to report the number of changes in an update? Then, if it can be easily calculated, we could report that. If not, then 🤷 oh well. For multiple queries it is indeed more complex. Maybe the resulting JSON/text message could refer to a series of queries? The main question is if this can be feasibly implemented for simple |
@Ostrzyciel: Counting the number of triples before and after execution could be a way. There is also |
If you want to write a wrapper dataset that manages the counting, go for it. It isn't for all databases. At scale, bulk operations like It isn't always so easy to determine whether a adding a triple is, in fact, a change. An update is a sequence of operations - not one - and a later operation may reverse a change. Retain the state across operations would be a significant memory cost. |
Hm, okay, I think I get it. This would be a ton of work for a feature that's not that important. I think I will close this then, but if anyone wants to pursue this, feel free to reopen. |
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):
Currently Fuseki can return the response in plain text, equivalent HTML, and JSON. For JSON, it looks like this:
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:
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:
jena/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/ServletOps.java
Line 121 in 192f02e
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?
The text was updated successfully, but these errors were encountered: