@Override public NodeValue exec(NodeValue v) { Node n = v.asNode(); if (!n.isBlank()) throw new ExprEvalException("bnode: not a blank node"); NodeValue nv = NodeValue.makeString(n.getBlankNodeId().getLabelString()); return nv; }
public static void evalPrint(Expr expr, Binding binding) { try { NodeValue r = eval(expr, binding); // System.out.println(r.asQuotedString()) ; Node n = r.asNode(); String s = FmtUtils.stringForNode(n); System.out.println(s); } catch (ExprEvalException ex) { System.out.println("Exception: " + ex.getMessage()); return; } catch (ExprBuildException ex) { System.err.println("Build exception: " + ex.getMessage()); return; } }