Package org.openrdf.model

Examples of org.openrdf.model.Value


    public boolean equals(Object other) {
      if (other instanceof Key && other.hashCode() == hash) {
        BindingSet otherSolution = ((Key)other).bindingSet;

        for (String name : group.getGroupBindingNames()) {
          Value v1 = bindingSet.getValue(name);
          Value v2 = otherSolution.getValue(name);

          if (!ObjectUtil.nullEquals(v1, v2)) {
            return false;
          }
        }
View Full Code Here


    }

    @Override
    public void meet(Var var) {
      if (!var.hasValue() && bindings.hasBinding(var.getName())) {
        Value value = bindings.getValue(var.getName());
        var.setValue(value);
      }
    }
View Full Code Here

        if (!isConstant(arg)) {
          return;
        }
      }
      try {
        Value value = strategy.evaluate(naryValueOp, EmptyBindingSet.getInstance());
        naryValueOp.replaceWith(new ValueConstant(value));
      }
      catch (ValueExprEvaluationException e) {
        // TODO: incompatible values types(?), remove the affected part of
        // the query tree
View Full Code Here

      }

      // All arguments are constant

      try {
        Value value = strategy.evaluate(functionCall, EmptyBindingSet.getInstance());
        functionCall.replaceWith(new ValueConstant(value));
      }
      catch (ValueExprEvaluationException e) {
        // TODO: incompatible values types(?), remove the affected part of
        // the query tree
View Full Code Here

      return false;
    }

    protected boolean isResource(ValueExpr valueExpr) {
      if (valueExpr instanceof ValueConstant) {
        Value value = ((ValueConstant)valueExpr).getValue();

        if (value instanceof Resource) {
          return true;
        }
      }
View Full Code Here

    throws StoreException
  {
    QueryBindingSet targetBindings = new QueryBindingSet(sourceBindings);

    for (ExtensionElem extElem : extension.getElements()) {
      Value targetValue = strategy.evaluate(extElem.getExpr(), sourceBindings);

      if (targetValue != null) {
        // Potentially overwrites bindings from super
        targetBindings.setBinding(extElem.getName(), targetValue);
      }
View Full Code Here

  @Override
  protected boolean accept(Statement st) {
    Resource subj = st.getSubject();
    URI pred = st.getPredicate();
    Value obj = st.getObject();
    Resource context = st.getContext();

    if (subjVar != null) {
      if (subjVar.equals(predVar) && !subj.equals(pred)) {
        return false;
      }
      if (subjVar.equals(objVar) && !subj.equals(obj)) {
        return false;
      }
      if (subjVar.equals(conVar) && !subj.equals(context)) {
        return false;
      }
    }

    if (predVar != null) {
      if (predVar.equals(objVar) && !pred.equals(obj)) {
        return false;
      }
      if (predVar.equals(conVar) && !pred.equals(context)) {
        return false;
      }
    }

    if (objVar != null) {
      if (objVar.equals(conVar) && !obj.equals(context)) {
        return false;
      }
    }

    return true;
View Full Code Here

    final Var subjVar = sp.getSubjectVar();
    final Var predVar = sp.getPredicateVar();
    final Var objVar = sp.getObjectVar();
    final Var conVar = sp.getContextVar();

    Value subjValue = getVarValue(subjVar, bindings);
    Value predValue = getVarValue(predVar, bindings);
    Value objValue = getVarValue(objVar, bindings);
    Value contextValue = getVarValue(conVar, bindings);

    Cursor<? extends Statement> stIter = null;

    try {
      Resource[] contexts;
View Full Code Here

  }

  public Value evaluate(Var var, BindingSet bindings)
    throws ValueExprEvaluationException, StoreException
  {
    Value value = var.getValue();

    if (value == null) {
      value = bindings.getValue(var.getName());
    }
View Full Code Here

  public Value evaluate(Bound node, BindingSet bindings)
    throws StoreException
  {
    try {
      Value argValue = evaluate(node.getArg(), bindings);
      return BooleanLiteralImpl.valueOf(argValue != null);
    }
    catch (ValueExprEvaluationException e) {
      return BooleanLiteralImpl.FALSE;
    }
View Full Code Here

TOP

Related Classes of org.openrdf.model.Value

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.