Skip to content

Commit

Permalink
[Fix] Fix processing of _pInputGraphURL parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
blcham committed Nov 24, 2021
1 parent d7616a3 commit 85a141c
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import cz.cvut.spipes.manager.SPipesScriptManager;
import cz.cvut.spipes.modules.Module;
import cz.cvut.spipes.rest.util.*;
import cz.cvut.spipes.util.JenaUtils;
import cz.cvut.spipes.util.RDFMimeType;
import org.apache.jena.query.QuerySolution;
import org.apache.jena.query.QuerySolutionMap;
Expand Down Expand Up @@ -237,7 +238,7 @@ private ExecutionContext extractInputExecutionContext(final Model inputDataModel
// FILE WHERE TO GET INPUT GRAPH
URL inputGraphURL = null;
if (paramHelper.hasParameterValue(P_INPUT_GRAPH_URL)) {
inputGraphURL = paramHelper.parseParameterValueAsUrl(P_INPUT_BINDING_URL);
inputGraphURL = paramHelper.parseParameterValueAsUrl(P_INPUT_GRAPH_URL);
logParam(P_INPUT_GRAPH_URL, inputGraphURL.toString());
}

Expand All @@ -257,7 +258,11 @@ private ExecutionContext extractInputExecutionContext(final Model inputDataModel
}
LOG.info("- input variable binding ={}", inputVariablesBinding);

return ExecutionContextFactory.createContext(inputDataModel, inputVariablesBinding);
Model unionModel = Optional.ofNullable(inputGraphURL)
.map(url -> JenaUtils.createUnion(inputDataModel,loadModelFromUrl(url.toString())))
.orElse(inputDataModel);

return ExecutionContextFactory.createContext(unionModel, inputVariablesBinding);
}

private File extractOutputBindingPath(final MultiValueMap<String, String> parameters) {
Expand Down

0 comments on commit 85a141c

Please sign in to comment.