From cfe2c2fcf5ce658a2d5780fab45969ccce799e90 Mon Sep 17 00:00:00 2001 From: Claus Stadler Date: Wed, 30 Oct 2024 16:31:37 +0100 Subject: [PATCH] Macros should now work with Sparql update statements --- .../cli/main/SparqlIntegrateCmdImpls.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rdf-processing-toolkit-cli/src/main/java/org/aksw/sparql_integrate/cli/main/SparqlIntegrateCmdImpls.java b/rdf-processing-toolkit-cli/src/main/java/org/aksw/sparql_integrate/cli/main/SparqlIntegrateCmdImpls.java index 6dcff64..8a68ff8 100644 --- a/rdf-processing-toolkit-cli/src/main/java/org/aksw/sparql_integrate/cli/main/SparqlIntegrateCmdImpls.java +++ b/rdf-processing-toolkit-cli/src/main/java/org/aksw/sparql_integrate/cli/main/SparqlIntegrateCmdImpls.java @@ -44,9 +44,7 @@ import org.aksw.jena_sparql_api.sparql.ext.url.JenaUrlUtils; import org.aksw.jenax.arq.picocli.CmdMixinArq; import org.aksw.jenax.arq.util.dataset.HasDataset; -import org.aksw.jenax.arq.util.query.QueryTransform; import org.aksw.jenax.arq.util.security.ArqSecurity; -import org.aksw.jenax.arq.util.syntax.QueryUtils; import org.aksw.jenax.arq.util.update.UpdateRequestUtils; import org.aksw.jenax.arq.util.update.UpdateTransform; import org.aksw.jenax.arq.util.update.UpdateUtils; @@ -75,6 +73,8 @@ import org.aksw.jenax.sparql.query.rx.RDFDataMgrEx; import org.aksw.jenax.stmt.core.SparqlStmt; import org.aksw.jenax.stmt.core.SparqlStmtMgr; +import org.aksw.jenax.stmt.core.SparqlStmtTransform; +import org.aksw.jenax.stmt.core.SparqlStmtTransforms; import org.aksw.jenax.stmt.core.SparqlStmtUpdate; import org.aksw.jenax.stmt.resultset.SPARQLResultEx; import org.aksw.jenax.stmt.util.SparqlStmtUtils; @@ -600,8 +600,10 @@ public Expr transform(ExprFunctionN func, ExprList args) { return UserDefinedFunctions.expandMacro(udfRegistry, func.copy(args)); } }; - QueryTransform qform = q -> QueryUtils.rewrite(q, op -> Transformer.transform(null, eform, op)); - dataSourceTmp = RdfDataEngines.wrapWithQueryTransform(dataSourceTmp, qform, null); + SparqlStmtTransform stmtTransform = SparqlStmtTransforms.ofExprTransform(eform); + dataSourceTmp = RdfDataEngines.wrapWithStmtTransform(dataSourceTmp, stmtTransform); + // QueryTransform qform = q -> QueryUtils.rewrite(q, op -> Transformer.transform(null, eform, op)); + // dataSourceTmp = RdfDataEngines.wrapWithQueryTransform(dataSourceTmp, qform, null); } RdfDataEngine datasetAndDelete = dataSourceTmp;