Package lupos.datastructures.items

Examples of lupos.datastructures.items.Variable


      // process all items
      // for(int i = 0; i < 3; i++){
      for (int i = 0; i < this.substitutionsLiteralLeft.size(); i++) {
        // if the item is an unbound variable
        final Variable item = this.substitutionsLiteralLeft.get(i);
        if ((literal = bindings.get(item)) == null) {
          bindings.add(item, this.substitutionsLiteralRight.get(i));
        }
        // if the item is a variable which is already bound
        // and the value differs from the value of the triple
        // which would be used as binding, a conflict was
        // detected
        else if (!literal.valueEquals(this.substitutionsLiteralRight.get(i))) {
          return null; // join within triple pattern!
        }
      }

      for (int i = 0; i < this.substitutionsVariableLeft.size(); i++) {
        // if the item is an unbound variable
        final Variable item = this.substitutionsVariableLeft.get(i);
        if ((literal = bindings.get(item)) == null) {
          bindings.add(item, oldBinding
              .get(this.substitutionsVariableRight.get(i)));
        }
        // if the item is a variable which is already bound
View Full Code Here


    if (n == null) {
      return;
    }
    if (n instanceof lupos.sparql1_1.ASTVar) {
      try {
        this.usedVariables.add(new Variable(((lupos.sparql1_1.ASTVar) n)
            .getName().toString()));
      } catch (final Exception e) {
        System.err.println(e);
        return;
      }
View Full Code Here

   * @param varJson the JSON object
   * @return a variable
   * @throws JSONException
   */
  public final static Variable createVariableFromJSON(final JSONObject varJson) throws JSONException {
    return new Variable(varJson.getString("name"));
  }
View Full Code Here

      final int mod = 1;
      if (n instanceof lupos.sparql1_1.ASTDescOrder) {
        return null;
      }
      if (n instanceof lupos.sparql1_1.ASTVar) {
        sortCriterium.add(new Variable(((lupos.sparql1_1.ASTVar) n)
            .getName()));
      } else
        return null;
    }
    return sortCriterium;
View Full Code Here

          return null;
        }
        final Bindings newBinding = ReplaceVar.this.bindingsFactory.createInstance();
        for (int i = 0; i < ReplaceVar.this.substitutionsVariableLeft.size(); i++) {

          final Variable itemName = ReplaceVar.this.substitutionsVariableLeft.get(i);
          // always do like this!
          newBinding.add(itemName, oldBinding
              .get(ReplaceVar.this.substitutionsVariableRight.get(i)));
        }
        return newBinding;
View Full Code Here

    // check conditions...
    Iterator<Variable> it = conditions.keySet().iterator();

    while (it.hasNext()) {
      final Variable elem = it.next();
      if (!conditions.get(elem).valueEquals(bind1.get(elem))) {
        conditionFulfilled = false;
      }
    }

    if (conditionFulfilled) {
      final Bindings bnew = bind1.clone();

      it = constants.keySet().iterator();
      while (it.hasNext()) {
        final Variable elem = it.next();
        bind1.add(elem, constants.get(elem));
      }
      result.add(bnew);
    }
View Full Code Here

        }
      }

      for (int i = 0; i < substitutionsVariableLeft.size(); i++) {
        // if the item is an unbound variable
        final Variable itemName = substitutionsVariableLeft.get(i);
        if ((literal = oldBinding.get(itemName)) == null) {
          oldBinding.add(itemName, oldBinding
              .get(substitutionsVariableRight.get(i)));
        }
        // if the item is a variable which is already bound
View Full Code Here

   */
  @Override
  public QueryResult process(final Dataset dataset) {
    final QueryResult queryResult = QueryResult.createInstance();
    if(this.rdfGraph!=null && this.rdfGraph.isVariable()){
      final Variable graphConstraint = (Variable) this.rdfGraph;
      if (this.root.namedGraphs != null && this.root.namedGraphs.size() > 0) {
        // Convert the named graphs' names into URILiterals
        // to be applicable later on
        for (final String name : this.root.namedGraphs) {
          final Bindings graphConstraintBindings = this.bindingsFactory.createInstance();
View Full Code Here

  public TriplePattern(final boolean[] variable, final Literal[] literal,
      final String[] varname) {
    for (int i = 0; i < 3; i++) {
      if (variable[i]) {
        this.items[i] = new Variable(varname[i]);
      } else {
        this.items[i] = literal[i];
      }
    }
    this.computeVariables();
View Full Code Here

      // if the item is a variable
      if (this.items[i].isVariable()) {

        // if the item is an unbound variable
        final Variable item = triple.getVariable((Variable) this.items[i]);
        if ((literal = bindings.get(item)) == null) {
          bindings.add(item, triple.getPos(i));
        }

        // if the item is a variable which is already bound
View Full Code Here

TOP

Related Classes of lupos.datastructures.items.Variable

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.