public Value evaluate(ValueConstant valueConstant, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { return valueConstant.getValue(); }
/** * Evaluate a {@link ValueConstant} query model node. * @param valueConstant * @param bindings the set of named value bindings * @return the {@link Value} of {@code valueConstant} * @throws ValueExprEvaluationException * @throws QueryEvaluationException */ private Value evaluate(ValueConstant valueConstant, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { return valueConstant.getValue(); }
@Override public boolean equals(Object other) { if (other instanceof ValueConstant) { ValueConstant o = (ValueConstant)other; return value.equals(o.getValue()); } return false; }
@Override public boolean equals(Object other) { if (other instanceof ValueConstant) { ValueConstant o = (ValueConstant)other; return value.equals(o.getValue()); } return false; }
@Override public void meet(ValueConstant node) throws RuntimeException { String key = node.getValue().toString(); if(constantMap.containsKey(key)) { int count = constantMap.get(key); count += 1; constantMap.put(key, count); } else { constantMap.put(key,1); } }
private Value getValue(ValueExpr valueExpr) { if (valueExpr instanceof ValueConstant) { return ((ValueConstant)valueExpr).getValue(); } else if (valueExpr instanceof Var) { return ((Var)valueExpr).getValue(); } else { return null; } }
protected boolean isResource(ValueExpr valueExpr) { if (valueExpr instanceof ValueConstant) { Value value = ((ValueConstant)valueExpr).getValue(); return value instanceof Resource; } if (valueExpr instanceof Var) { Value value = ((Var)valueExpr).getValue(); return value instanceof Resource; } return false; } }
/** * @inheritDoc */ @Override public void meet(ValueConstant theVal) throws Exception { mBuffer.append(RenderUtils.getSPARQLQueryString(theVal.getValue())); }
/** * @inheritDoc */ @Override public void meet(ValueConstant theVal) throws Exception { mBuffer.append(RenderUtils.getSerqlQueryString(theVal.getValue())); }
private Value getValue(ValueExpr valueExpr) { if (valueExpr instanceof ValueConstant) { return ((ValueConstant)valueExpr).getValue(); } else if (valueExpr instanceof Var) { return ((Var)valueExpr).getValue(); } else { return null; } }
/** * @inheritDoc */ @Override public void meet(ValueConstant theVal) throws Exception { mBuffer.append(RenderUtils.getSerqlQueryString(theVal.getValue())); }
/** * @inheritDoc */ @Override public void meet(ValueConstant theVal) throws Exception { mBuffer.append(RenderUtils.getSPARQLQueryString(theVal.getValue())); }
static Value getValue(ValueExpr v) { Value value = null; if (v instanceof ValueConstant) { value = ((ValueConstant)v).getValue(); } else if (v instanceof Var) { value = ((Var)v).getValue(); } return value; }
@Override public void meet(ValueConstant node) throws RuntimeException { checkForSearchType(node.getValue()); super.meet(node); } @Override
@Override public FunctionCall visit(ASTFunctionCall node, Object data) throws VisitorException { ValueConstant vc = (ValueConstant)node.getURI().jjtAccept(this, null); assert vc.getValue() instanceof IRI; FunctionCall functionCall = new FunctionCall(vc.getValue().toString()); for (ASTValueExpr argExpr : node.getArgList().getElements()) { functionCall.addArg((ValueExpr)argExpr.jjtAccept(this, null)); } return functionCall; }
@Override public FunctionCall visit(ASTFunctionCall node, Object data) throws VisitorException { ValueConstant vc = (ValueConstant)node.getURI().jjtAccept(this, null); assert vc.getValue() instanceof IRI; FunctionCall functionCall = new FunctionCall(vc.getValue().toString()); for (ASTValueExpr argExpr : node.getArgList().getElements()) { functionCall.addArg((ValueExpr)argExpr.jjtAccept(this, null)); } return functionCall; }
@Override public FunctionCall visit(ASTFunctionCall node, Object data) throws VisitorException { ValueConstant vc = (ValueConstant)node.getURI().jjtAccept(this, null); assert vc.getValue() instanceof IRI; FunctionCall functionCall = new FunctionCall(vc.getValue().toString()); for (ASTValueExpr argExpr : node.getArgList().getElements()) { functionCall.addArg((ValueExpr)argExpr.jjtAccept(this, null)); } return functionCall; }
private static double parseTemporalDuration(ValueConstant valConst) { Value val = valConst.getValue(); Preconditions.checkArgument(val instanceof Literal); Literal literal = (Literal) val; String stringVal = literal.getLabel(); IRI dataType = literal.getDatatype(); Preconditions.checkArgument(dataType.equals(XMLSchema.DECIMAL) || dataType.equals(XMLSchema.DOUBLE) || dataType.equals(XMLSchema.FLOAT) || dataType.equals(XMLSchema.INTEGER) || dataType.equals(XMLSchema.INT)); return Double.parseDouble(stringVal); }
@Override public void meet(Create node) throws RDFHandlerException { if (node.isSilent()) { handler.handleStatement( valueFactory.createStatement(subject, SP.SILENT_PROPERTY, BooleanLiteral.TRUE)); } if (node.getGraph() != null) { handler.handleStatement(valueFactory.createStatement(subject, SP.GRAPH_IRI_PROPERTY, node.getGraph().getValue())); } }