-
Notifications
You must be signed in to change notification settings - Fork 666
GH-2701: Fuseki Mod to list and abort running executions. #3184
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
Draft
Aklakan
wants to merge
9
commits into
apache:main
Choose a base branch
from
Aklakan:2025-05-11-exectracker
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
544371d
GH2701: Fuseki Mod to list and abort running executions.
Aklakan 21f7135
initial work on review comments
Aklakan 9db5940
wip (untested): Assembler vocab, GET->POST, parseCheck Boolean->Optio…
Aklakan 3674fd2
UpdateProcessorBase: Removed comment. DatasetGraphOverSparql: Added h…
Aklakan 2ded273
Deletion tests for DatasetGraphOverSparql.
Aklakan 3612a32
wip
Aklakan 6b238d7
exec.tracker -> exectracker
Aklakan 85014ed
Moved status command to POST.
Aklakan 5aa4171
experimental UpdateSource class.
Aklakan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
jena-arq/src/main/java/org/apache/jena/http/sys/UpdateElt.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.jena.http.sys; | ||
|
||
import java.util.Objects; | ||
|
||
import org.apache.jena.update.Update; | ||
import org.apache.jena.update.UpdateRequest; | ||
|
||
/** Update element. Either an Update object or a string. */ | ||
record UpdateElt(Update update, String updateString) { | ||
UpdateElt(Update update) { this(Objects.requireNonNull(update), null); } | ||
UpdateElt(String updateString) { this(null, Objects.requireNonNull(updateString)); } | ||
boolean isParsed() { return update != null; } | ||
|
||
@Override | ||
public String toString() { | ||
return isParsed() | ||
? new UpdateRequest(update()).toString() // Reuse UpdateRequest's serialization approach | ||
: updateString(); | ||
} | ||
} |
110 changes: 110 additions & 0 deletions
110
jena-arq/src/main/java/org/apache/jena/http/sys/UpdateEltAcc.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.jena.http.sys; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.Iterator; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
import org.apache.jena.update.Update; | ||
import org.apache.jena.update.UpdateFactory; | ||
import org.apache.jena.update.UpdateRequest; | ||
|
||
/** Accumulator for update elements. Can build an overall string or UpdateRequest from the elements. */ | ||
public class UpdateEltAcc implements Iterable<UpdateElt> { | ||
/** Delimiter for joining multiple SPARQL update strings into a single one. | ||
* The delimiter takes into account that the last line of a statement may be a single-line-comment. */ | ||
public static final String DELIMITER = "\n;\n"; | ||
|
||
private List<UpdateElt> updateOperations = new ArrayList<>(); | ||
private List<UpdateElt> updateOperationsView = Collections.unmodifiableList(updateOperations); | ||
private boolean isParsed = true; // True iff there are no strings in updateOperations | ||
|
||
public boolean isParsed() { | ||
return isParsed; | ||
} | ||
|
||
public void add(UpdateElt updateElt) { | ||
isParsed = isParsed && updateElt.isParsed(); | ||
updateOperations.add(updateElt); | ||
} | ||
|
||
public void add(Update update) { | ||
add(new UpdateElt(update)); | ||
} | ||
|
||
/** Add a string by parsing it. */ | ||
public void add(String updateRequestString) { | ||
UpdateRequest updateRequest = UpdateFactory.create(updateRequestString); | ||
add(updateRequest); | ||
} | ||
|
||
public void add(UpdateRequest updateRequest) { | ||
updateRequest.getOperations().forEach(this::add); | ||
} | ||
|
||
/** Add a string without parsing it. */ | ||
public void addString(String updateRequestString) { | ||
add(new UpdateElt(updateRequestString)); | ||
} | ||
|
||
/** Attempt to build an UpdateRequest from the state of this accumulator. Attempts to parse any string elements. */ | ||
public UpdateRequest buildUpdateRequest() { | ||
return addToUpdateRequest(new UpdateRequest()); | ||
} | ||
|
||
public UpdateRequest addToUpdateRequest(UpdateRequest updateRequest) { | ||
for (UpdateElt elt : updateOperations) { | ||
if (elt.isParsed()) { | ||
updateRequest.add(elt.update()); | ||
} else { | ||
try { | ||
updateRequest.add(elt.updateString()); | ||
} catch (Exception e) { | ||
// Expose the string that failed to parse | ||
e.addSuppressed(new RuntimeException("Failed to parse: " + elt.updateString())); | ||
throw e; | ||
} | ||
} | ||
} | ||
return updateRequest; | ||
} | ||
|
||
public void clear() { | ||
updateOperations.clear(); | ||
isParsed = true; | ||
} | ||
|
||
public boolean isEmpty() { | ||
return updateOperations.isEmpty(); | ||
} | ||
|
||
@Override | ||
public Iterator<UpdateElt> iterator() { | ||
return updateOperationsView.iterator(); | ||
} | ||
|
||
public String buildString() { | ||
return updateOperations.stream() | ||
.map(UpdateElt::toString) | ||
.collect(Collectors.joining(DELIMITER)); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This duplictates
sendTriplesToStream
.Suggestion - move the triples sending code to
sendTriplesToStream
, callsendTriplesToStream
fromsendGraphToStream(graph, stream, base, prefixes)
and dropsendGraphToStream(graph, stream)
.To me,
sendGraphToStream(graph, stream)
does imply all the graph is sent - but the prefixes aren't which is why itssendTriplesToStream
.