use of com.hp.hpl.jena.sparql.engine.binding.Binding in project stanbol by apache.
the class CreateURI method execEvaluated.
@Override
public QueryIterator execEvaluated(Binding binding, PropFuncArg argumentSubject, Node predicate, PropFuncArg argumentObject, ExecutionContext execCxt) {
Binding b = null;
if (argumentObject.getArg().isLiteral()) {
Node ref = argumentSubject.getArg();
if (ref.isVariable()) {
String argumentString = argumentObject.getArg().toString().replace("\"", "");
//STANBOL-621: Binding1 has no longer a public constructor
//b = new Binding1(binding, Var.alloc(ref), NodeFactory.createURI(argumentString));
b = BindingFactory.binding(binding, Var.alloc(ref), NodeFactory.createURI(argumentString));
}
}
if (b == null) {
b = binding;
}
return IterLib.result(b, execCxt);
}
use of com.hp.hpl.jena.sparql.engine.binding.Binding in project stanbol by apache.
the class RdfIndexingSource method debug.
public void debug() {
String entityVar = "s";
String fieldVar = "p";
String valueVar = "o";
StringBuilder qb = new StringBuilder();
qb.append(String.format("SELECT ?%s ?%s ?%s \n", entityVar, fieldVar, //for the select
valueVar));
qb.append("{ \n");
qb.append(String.format(" ?%s ?%s ?%s . \n", entityVar, fieldVar, //for the where
valueVar));
qb.append("} \n");
log.debug("EntityDataIterator Query: \n" + qb.toString());
Query q = QueryFactory.create(qb.toString(), Syntax.syntaxARQ);
ResultSet rs = QueryExecutionFactory.create(q, indexingDataset.toDataset()).execSelect();
Var s = Var.alloc(entityVar);
Var p = Var.alloc(fieldVar);
Var o = Var.alloc(valueVar);
while (rs.hasNext()) {
Binding b = rs.nextBinding();
log.debug("{} {} {}", new Object[] { b.get(s), b.get(p), b.get(o) });
}
}