You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Check if the query contains FROM clause and default/named graph URIs
232
224
// which is not allowed by the SPARQL specification
233
225
// (see https://www.w3.org/TR/sparql11-protocol/#query-operation)
234
-
if (query.containsFromClause() && !(defaultGraphUris.isEmpty() && namedGraphUris.isEmpty())) {
226
+
if (query.containsFromClause() && (!defaultGraphUris.isEmpty() || !namedGraphUris.isEmpty())) {
235
227
thrownewIllegalArgumentException(
236
228
"SPARQL query contains FROM clause, but default and named graph URIs are specified. It is not allowed to specify both FROM clause and default/named graph URIs. Please remove FROM clause from the query or remove default/named graph URIs.");
// and the using-graph-uri/using-named-graph-uri parameters are also specified
241
233
// which is not allowed by the SPARQL specification
242
234
// (see https://www.w3.org/TR/sparql11-protocol/#update-operation)
243
-
List<String> sparqlConstants = newArrayList<>();
244
-
ASTUpdateastUpdate = query.getAstUpdate();
245
-
if (astUpdate != null) {
246
-
for (Updateupdate : astUpdate.getUpdates()) {
247
-
Compositecomposite = update.getComposite();
248
-
if (composite != null) {
249
-
Constantwith = composite.getWith();
250
-
if (with != null) {
251
-
sparqlConstants.add(with.getLabel());
252
-
}
253
-
}
254
-
}
255
-
}
256
-
257
-
if (!sparqlConstants.isEmpty() && (!defaultGraphUris.isEmpty() || !namedGraphUris.isEmpty())) {
235
+
if (query.containsWithClause() && (!defaultGraphUris.isEmpty() || !namedGraphUris.isEmpty())) {
258
236
thrownewIllegalArgumentException(
259
-
"SPARQL update query contains USING, USING NAMED, or WITH clause and the using-graph-uri/using-named-graph-uri parameters are also specified. It is not allowed to specify both USING, USING NAMED, or WITH clause and the using-graph-uri/using-named-graph-uri parameters. Please remove USING, USING NAMED, or WITH clause from the query or remove the using-graph-uri/using-named-graph-uri parameters.");
237
+
"SPARQL update query contains USING, USING NAMED, or WITH clause and the using-graph-uri/using-named-graph-uri parameters are also specified."
238
+
+ " It is not allowed to specify both USING, USING NAMED, or WITH clause and the using-graph-uri/using-named-graph-uri parameters."
239
+
+ "Please remove USING, USING NAMED, or WITH clause from the query or remove the using-graph-uri/using-named-graph-uri parameters.");
0 commit comments