@Override public NodeValue eval(FunctionEnv env) { return NodeValue.makeString(ARQ.NAME+" "+ARQ.VERSION) ; } }
@Override public NodeValue eval(FunctionEnv env) { return NodeValue.makeString(ARQ.NAME+" "+ARQ.VERSION) ; } }
@Override public NodeValue getAccValue() { return NodeValue.makeString(stringSoFar.toString()) ; } }
@Override public NodeValue getAccValue() { return NodeValue.makeString(stringSoFar.toString()) ; } }
public static NodeValue fnConcat(List<NodeValue> args) { StringBuilder sb = new StringBuilder() ; for ( NodeValue arg : args ) { String x = arg.asString() ; sb.append(x) ; } return NodeValue.makeString(sb.toString()) ; }
public static NodeValue fnConcat(List<NodeValue> args) { StringBuilder sb = new StringBuilder() ; for ( NodeValue arg : args ) { String x = arg.asString() ; sb.append(x) ; } return NodeValue.makeString(sb.toString()) ; }
public E_Regex(Expr expr, String pattern, String flags) { super(name, expr, NodeValue.makeString(pattern), NodeValue.makeString(flags)) ; init(getArg(2), getArg(3)) ; }
public E_Regex(Expr expr, String pattern, String flags) { super(name, expr, NodeValue.makeString(pattern), NodeValue.makeString(flags)) ; init(getArg(2), getArg(3)) ; }
public static NodeValue javaSubstring(NodeValue nvString, NodeValue nvStart, NodeValue nvFinish) { try { String string = nvString.getString() ; int start = nvStart.getInteger().intValue() ; if ( nvFinish == null ) return NodeValue.makeString(string.substring(start)) ; int finish = nvFinish.getInteger().intValue() ; return NodeValue.makeString(string.substring(start, finish)) ; } catch (IndexOutOfBoundsException ex) { throw new ExprEvalException("IndexOutOfBounds", ex) ; } }
public static NodeValue dtGetTZ(NodeValue nv) { DateTimeStruct dts = parseAnyDT(nv) ; if ( dts == null ) throw new ExprEvalException("Not a data/time value: "+nv) ; if ( dts.timezone == null) return NodeValue.nvEmptyString ; return NodeValue.makeString(dts.timezone) ; }
/** * {@inheritDoc} */ @Override public NodeValue exec(NodeValue v) { return NodeValue.makeString(SemanticElement.removePrefix(v.asNode())); }
public static NodeValue dtGetTZ(NodeValue nv) { DateTimeStruct dts = parseAnyDT(nv) ; if ( dts == null ) throw new ExprEvalException("Not a data/time value: "+nv) ; if ( dts.timezone == null) return NodeValue.nvEmptyString ; return NodeValue.makeString(dts.timezone) ; }
public static NodeValue str(NodeValue nv) { return NodeValue.makeString(str(nv.asNode())) ; }
@Override public NodeValue exec(NodeValue v) { Node n = v.asNode() ; if ( ! n.isURI() ) throw new ExprEvalException("Not a URI: "+FmtUtils.stringForNode(n)) ; String str = n.getNameSpace() ; return NodeValue.makeString(str) ; } }
@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 ; } }
@Override public NodeValue exec(NodeValue v) { Node n = v.asNode() ; if ( ! n.isURI() ) throw new ExprEvalException("Not a URI: "+FmtUtils.stringForNode(n)) ; String str = n.getLocalName() ; return NodeValue.makeString(str) ; } }
@Override public NodeValue exec(NodeValue v) { Node n = v.asNode() ; if ( ! n.isURI() ) throw new ExprEvalException("Not a URI: "+FmtUtils.stringForNode(n)) ; String str = n.getNameSpace() ; return NodeValue.makeString(str) ; } }
@Override public NodeValue exec(NodeValue v) { Node n = v.asNode() ; if ( ! n.isURI() ) throw new ExprEvalException("Not a URI: "+FmtUtils.stringForNode(n)) ; String str = n.getLocalName() ; return NodeValue.makeString(str) ; } }
@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 String str(Node node) { if ( node.isLiteral() ) return node.getLiteral().getLexicalForm() ; if ( node.isURI() ) return node.getURI() ; // if ( node.isBlank() ) return node.getBlankNodeId().getLabelString() ; // if ( node.isBlank() ) return "" ; if ( node.isBlank() ) NodeValue.raise(new ExprTypeException("Blank node: "+node)) ; NodeValue.raise(new ExprEvalException("Not a string: "+node)) ; return "[undef]" ; }