public static int getNumberOfForksFromFunctionArgument(String query, boolean sparqlUpdate, int stage) throws IllegalArgumentException{ ParallelSplitFunctionVisitor psfv = new ParallelSplitFunctionVisitor(); if (sparqlUpdate) { List<UpdateExpr> exprs = QueryParserUtil.parseUpdate(QueryLanguage.SPARQL, query, null).getUpdateExprs(); if (exprs.size() > stage) { exprs.get(stage).visit(psfv); } } else { QueryParserUtil.parseQuery(QueryLanguage.SPARQL, query, null).getTupleExpr().visit(psfv); } return psfv.forks; }
@Override public void execute() throws UpdateExecutionException { ParsedUpdate parsedUpdate = getParsedUpdate(); List<UpdateExpr> updateExprs = parsedUpdate.getUpdateExprs(); Map<UpdateExpr, Dataset> datasetMapping = parsedUpdate.getDatasetMapping(); for (UpdateExpr updateExpr : updateExprs) { Dataset activeDataset = getMergedDataset(datasetMapping.get(updateExpr)); try { AbstractQueryPreparer.this.execute(updateExpr, activeDataset, getBindings(), getIncludeInferred(), getMaxExecutionTime()); } catch (UpdateExecutionException e) { if (!updateExpr.isSilent()) { throw e; } } } } }
updateExpr.visit(visitor); visitor.end();
@Override public void execute() throws UpdateExecutionException { ParsedUpdate parsedUpdate = getParsedUpdate(); List<UpdateExpr> updateExprs = parsedUpdate.getUpdateExprs(); Map<UpdateExpr, Dataset> datasetMapping = parsedUpdate.getDatasetMapping(); for (UpdateExpr updateExpr : updateExprs) { Dataset activeDataset = getMergedDataset(datasetMapping.get(updateExpr)); try { AbstractQueryPreparer.this.execute(updateExpr, activeDataset, getBindings(), getIncludeInferred(), getMaxExecutionTime()); } catch (UpdateExecutionException e) { if (!updateExpr.isSilent()) { throw e; } } } } }