Examples of TimeSequence


Examples of org.dbwiki.data.time.TimeSequence

    SchemaNode schema = null;
    if (type == SchemaNodeTypeAttribute) {
      if (_schema.size() == 0) {
        throw new WikiSchemaException(WikiSchemaException.InvalidSchemaType, "Schema root cannot be an attribute");
      }
      schema = new AttributeSchemaNode(_schema.size(), name, parent, new TimeSequence(version));
    } else if (type == SchemaNodeTypeGroup) {
      schema = new GroupSchemaNode(_schema.size(), name, parent, new TimeSequence(version));
    } else {
      throw new WikiSchemaException(WikiSchemaException.InvalidSchemaType, String.valueOf(type));
    }
   
    try {
View Full Code Here

Examples of org.dbwiki.data.time.TimeSequence

            DatabaseTextNode text = values.get(iValue);
            insertTimestamp(con, text, text.getTimestamp().continueAt(version.number()));
            return true;
          }
        }
        attribute.add(update.value(), new TimeSequence(version), node.getpre(),node.getpost());

        return true;
      }
    }
    return false;
View Full Code Here

Examples of org.dbwiki.data.time.TimeSequence

        // a time interval for this node
        end = results.getInt(RelTimesequenceColStop);
        if(schema.hasTimestamp()) {
          schema.getTimestamp().elongate(start, end);
        } else {
          schema.setTimestamp(new TimeSequence(start, end));
        }
      }
     
      add(schema);
    }
View Full Code Here

Examples of org.dbwiki.data.time.TimeSequence

  private TimestampEvaluationResult getEvalResult(QueryNodeSet nodeSet) {
   
    TimestampEvaluationResult evalResult = new TimestampEvaluationResult();
   
    for (WhereCondition condition : _conditions) {
      TimeSequence timestamp = condition.evalTimestamp(nodeSet);
      if (timestamp != null) {
        evalResult.intersect(timestamp);
        if (evalResult.timestamp().isEmpty()) {
          return null;
        }
View Full Code Here

Examples of org.dbwiki.data.time.TimeSequence

        clipped = true;
      }
    }
   
    if (!timestamp.equals("") && !timestamp.equals(TimeSequence.OpenIntervalChar)) {
      return new VersionClause(new TimeSequence(timestamp));
    } else {
      return new VersionClause(new TimeSequence(Integer.MAX_VALUE));
    }
  }
View Full Code Here

Examples of org.dbwiki.data.time.TimeSequence

      Iterator<Counter> elements = labelCounter.values().iterator();
      while (elements.hasNext()) {
        elements.next().reset(1);
      }
      try {
        _resultSchema = new GroupSchemaNode(-1, "result", null, new TimeSequence(1));
        for (SubTreeSelectStatement stmt : _statements) {
          SchemaNode schema = stmt.targetPath().lastElement().entity();
          String label = null;
          if (stmt.label() != null) {
            label = stmt.label();
          } else {
            label = schema.label();
          }
          if (labelCounter.containsKey(label)) {
            Counter counter = labelCounter.get(label);
            label = label + Integer.toString(counter.value());
            stmt.setLabel(label);
            counter.inc();
          }
          SchemaNode renamedSchema = null;
          if (schema.isAttribute()) {
            renamedSchema = new AttributeSchemaNode(-1, label, _resultSchema, schema.getTimestamp());
            //renamedSchema = new AttributeSchemaNode(schema.id(), label, _resultSchema, schema.getTimestamp());
          } else {
            renamedSchema = new GroupSchemaNode(-1, label, _resultSchema, schema.getTimestamp());
            //renamedSchema = new GroupSchemaNode(schema.id(), label, _resultSchema, schema.getTimestamp());
            for (int iChild = 0; iChild < ((GroupSchemaNode)schema).children().size(); iChild++) {
              ((GroupSchemaNode)renamedSchema).children().add(((GroupSchemaNode)schema).children().get(iChild));
            }
          }
        }
      } catch (org.dbwiki.exception.WikiException wikiException) {
        wikiException.printStackTrace();
        return;
      }
    }

    Vector<DatabaseElementNode> outputNodes = new Vector<DatabaseElementNode>();
    for (SubTreeSelectStatement stmt : _statements) {
      DatabaseElementNode node = nodeSet.get(stmt.targetPath().variableName());
      QueryOutputNodeCollector nodeMarker = null;
      if(stmt.label() == null)
        nodeMarker = new QueryOutputNodeCollector(outputNodes);
      else
        try {
          nodeMarker = new QueryOutputNodeCollector(outputNodes, _resultSchema.find(stmt.label()));
        } catch (WikiException e) {
          e.printStackTrace();
        }
      new RelativeXPathConsumer().consume(node, stmt.targetPath(), nodeMarker);
    }
    if (outputNodes.size() > 0) {
      TimeSequence timestamp = null;
      for (int iNode = 0; iNode < outputNodes.size(); iNode++) {
        DatabaseElementNode node = outputNodes.get(iNode);
        if (timestamp != null) {
          timestamp = timestamp.union(node.getTimestamp());
        } else {
          timestamp = node.getTimestamp();
        }
      }
      DatabaseGroupNode result = new ResultGroupNode(_resultSchema, timestamp);
View Full Code Here

Examples of org.dbwiki.data.time.TimeSequence

        }
      }
     
      // If there is no version clause, set it to NOW
      if (versionClause == null) {
        versionClause = new VersionClause(new TimeSequence(Integer.MAX_VALUE));
      }
     
      return new XAQLQuery(selectClause, fromClause, versionClause, whereClause);
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.