private static void addBindings(Query query, List<Argument> arguments, Value... args) { for(int i=0; i<args.length; i++) { Argument argument = arguments.get(i); query.setBinding(argument.getPredicate().getLocalName(), args[i]); } } }
private static void addBindings(Query query, List<Argument> arguments, Value... args) { for(int i=0; i<args.length; i++) { Argument argument = arguments.get(i); query.setBinding(argument.getPredicate().getLocalName(), args[i]); } } }
protected static void addBindings(Query query, Value... args) throws ValueExprEvaluationException { for(int i=1; i<args.length; i+=2) { if(!(args[i] instanceof Literal)) { throw new ValueExprEvaluationException("Argument "+i+" must be a literal"); } query.setBinding(((Literal)args[i]).getLabel(), args[i+1]); } } }
protected static void addArguments(Query query, Value... args) throws ValueExprEvaluationException { for(int i=1; i<args.length; i+=2) { if(!(args[i] instanceof URI)) { throw new ValueExprEvaluationException("Argument "+i+" must be a URI"); } query.setBinding(((URI)args[i]).getLocalName(), args[i+1]); } } }
private void setBindings(Query query, Resource subj, IRI pred, Value obj, Resource... contexts) throws RepositoryException { if (subj != null) { query.setBinding("s", subj); } if (pred != null) { query.setBinding("p", pred); } if (obj != null) { query.setBinding("o", obj); } if (contexts != null && contexts.length > 0) { SimpleDataset dataset = new SimpleDataset(); for (Resource ctx : contexts) { if (ctx == null || ctx instanceof IRI) { dataset.addDefaultGraph((IRI)ctx); } else { throw new RepositoryException("Contexts must be URIs"); } } query.setDataset(dataset); } }
private void setBindings(Query query, Resource subj, URI pred, Value obj, Resource... contexts) throws RepositoryException { if (subj != null) { query.setBinding("s", subj); } if (pred != null) { query.setBinding("p", pred); } if (obj != null) { query.setBinding("o", obj); } if (contexts != null && contexts.length > 0 && (contexts[0] != null || contexts.length > 1)) { DatasetImpl dataset = new DatasetImpl(); for (Resource ctx : contexts) { if (ctx instanceof URI) { dataset.addDefaultGraph((URI) ctx); } else { throw new RepositoryException("Contexts must be URIs"); } } query.setDataset(dataset); } } }
Value bindingValue = ProtocolUtil.parseValueParam(request, parameterName, repositoryCon.getValueFactory()); result.setBinding(bindingName, bindingValue);
Value bindingValue = ProtocolUtil.parseValueParam(request, parameterName, repository.getValueFactory()); result.setBinding(bindingName, bindingValue);
result.setBinding( bindingName, bindingValue );