This is an automated email from the ASF dual-hosted git repository.

afs pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena.git


The following commit(s) were added to refs/heads/main by this push:
     new 29b05350ad Migrate sparql:encode to sparql:encode-for-uri
29b05350ad is described below

commit 29b05350ad6ddaf7f5f62c329311e24322db65ed
Author: Andy Seaborne <[email protected]>
AuthorDate: Sat Nov 14 14:44:22 2026 +0000

    Migrate sparql:encode to sparql:encode-for-uri
---
 .../apache/jena/sparql/expr/urifunctions/SPARQLDispatch.java | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git 
a/jena-arq/src/main/java/org/apache/jena/sparql/expr/urifunctions/SPARQLDispatch.java
 
b/jena-arq/src/main/java/org/apache/jena/sparql/expr/urifunctions/SPARQLDispatch.java
index e888879955..6602e0e35a 100644
--- 
a/jena-arq/src/main/java/org/apache/jena/sparql/expr/urifunctions/SPARQLDispatch.java
+++ 
b/jena-arq/src/main/java/org/apache/jena/sparql/expr/urifunctions/SPARQLDispatch.java
@@ -27,6 +27,7 @@ import java.util.Map;
 import java.util.Objects;
 
 import org.apache.jena.atlas.lib.InternalErrorException;
+import org.apache.jena.atlas.logging.Log;
 import org.apache.jena.sparql.expr.NodeValue;
 
 /**
@@ -199,7 +200,8 @@ public class SPARQLDispatch {
         register(map, "contains", SPARQLFuncOp::sparql_contains);
         register(map, "datatype", SPARQLFuncOp::sparql_datatype);
 
-        register(map, "encode", SPARQLFuncOp::sparql_encode);
+        register(map, "encode", deprecated(SPARQLFuncOp::sparql_encode, "Use 
'sparql:encode-for-uri'"));
+        register(map, "encode-for-uri", SPARQLFuncOp::sparql_encode);
         register(map, "floor", SPARQLFuncOp::sparql_floor);
         register(map, "haslang", SPARQLFuncOp::sparql_haslang);
         register(map, "haslangdir", SPARQLFuncOp::sparql_haslangdir);
@@ -271,6 +273,14 @@ public class SPARQLDispatch {
         return Map.copyOf(map);
      }
 
+    // Log deprecation notice.
+    private static Function1 deprecated(Function1 object, String 
deprecatedMsg) {
+        return (NodeValue nv) -> {
+            Log.warnOnce(SPARQLDispatch.class, deprecatedMsg, object);
+            return object.exec(nv);
+        };
+    }
+
     interface Call { NodeValue exec(NodeValue... nv); }
     interface Function0 { NodeValue exec(); }
     interface Function1 { NodeValue exec(NodeValue nv); }

Reply via email to