Package lupos.datastructures.items.literal

Examples of lupos.datastructures.items.literal.LazyLiteral


          @Override
          public Entry<TripleKey, Triple> next() {
            if(this.triple==null){
              return null;
            }
            final Triple t = new Triple(new LazyLiteral(this.triple[GeneratorFromFinalRun.this.primaryMap]),
                new LazyLiteral(this.triple[GeneratorFromFinalRun.this.secondaryMap]),
                new LazyLiteral(this.triple[GeneratorFromFinalRun.this.tertiaryMap]));

            final TripleKey key = new TripleKey(t, GeneratorFromFinalRun.this.order);

            try {
              this.triple = this.it.next();
View Full Code Here


      final Iterator<Bindings> itbSize = qrSize.oneTimeIterator();
      while (itbSize.hasNext()) {
        final Bindings b = itbSize.next();
        for (final Variable v : b.getVariableSet()) {
          final LazyLiteral ll = (LazyLiteral) b.get(v);
          final int pos = hmvi.get(v);
          if (minArray[pos] == null || minArray[pos] > ll.getCode()) {
            minArray[pos] = ll.getCode();
          }
          if (maxArray[pos] == null || maxArray[pos] < ll.getCode()) {
            maxArray[pos] = ll.getCode();
          }
        }
        size++;

        for (int i = 0; i < minArray.length; i++) {
View Full Code Here

                // else
                // System.out.println(current.getKey());
                if (t.getPos(pos).originalStringDiffers()) {
          t.setPos(pos, new LazyLiteralOriginalContent(current.getValue(), t.getPos(pos).originalString()));
        } else {
          t.setPos(pos, new LazyLiteral(current.getValue()));
        }
                next.consume(t);
            } catch (final NullPointerException e) {
                System.err.println(e);
                e.printStackTrace();
View Full Code Here

    return null;
  }

  public static Literal getLiteral(final int code, final int pos, final int codeForOriginalContent, final boolean objectIsLazyLiteralOriginalContent) {
    if (!objectIsLazyLiteralOriginalContent || pos != 2) {
      return new LazyLiteral(code);
    } else {
      return new LazyLiteralOriginalContent(code, codeForOriginalContent);
    }
  }
View Full Code Here

                      // if (code >=
                      // LazyLiteral.maxID())
                      // keyTriple[i] = lastTriple
                      // .getPos(i);
                      // else {
                      keyTriple[i] = new LazyLiteral(code);
                      useKey = true;
                      // }
                    } else {
                      keyTriple[i] = null;
                    }
                  } else {
                    keyTriple[i] = null;
                  }
                }
                if (useKey) {
                  // do distancepreserving jump over the gap!
                  final TripleKey key = tp.getKey(keyTriple,
                      order);
                  t = itt.next(key);
                } else {
                  t = (considerLastTriple) ? this.lastTriple : itt
                      .next();
                }
                this.lastTriple = t;
                if (t == null) {
                  return null;
                }
              } while ((tp.getBloomFilters()[0] != null && !tp
                  .getBloomFilters()[0]
                  .get((Math.abs(this.lastTriple.getPos(0)
                      .hashCode()) % SIPFilterOperator.NUMBEROFBITSFORBLOOMFILTER)))
                  || (tp.getBloomFilters()[1] != null && !tp
                      .getBloomFilters()[1]
                      .get((Math.abs(this.lastTriple.getPos(1)
                          .hashCode()) % SIPFilterOperator.NUMBEROFBITSFORBLOOMFILTER)))
                  || (tp.getBloomFilters()[2] != null && !tp
                      .getBloomFilters()[2]
                      .get((Math.abs(this.lastTriple.getPos(2)
                          .hashCode()) % SIPFilterOperator.NUMBEROFBITSFORBLOOMFILTER))));
            } else {
              t = itt.next();
            }
            if (t != null) {
              this.lastTriple = t;
              final Bindings znext = tp.process(t, false);
              if (znext != null) {
                return znext;
              }
            }
          }
          return null;
        }

        private Bindings computeNext(final Bindings k) {
          if (!(itt instanceof SIPParallelIterator)) {
            return this.computeNext();
          }
          final TripleKey key = tp.getKey(k, order);
          while (itt.hasNext()) {
            // also consider inner joins in triple patterns like
            // ?a ?a ?b.
            // Furthermore, do distancepreserving jump over the gap
            // using bloom filters!
            if (tp.getBloomFilters() != null) {
              for (int i = 0; i < 3; i++) {
                if (tp.getBloomFilters()[i] != null
                    && key.getTriple().getPos(i) != null) {
                  int index = (Math.abs(key.getTriple()
                      .getPos(i).hashCode()) % SIPFilterOperator.NUMBEROFBITSFORBLOOMFILTER);
                  if (!tp.getBloomFilters()[i].get(index)) {
                    final int startIndex = index;
                    index++;
                    while ((index % tp.getBloomFilters()[i]
                        .size()) != startIndex
                        && !tp.getBloomFilters()[i]
                            .get(index
                                % tp
                                    .getBloomFilters()[i]
                                    .size())) {
                      index++;
                    }
                    // all bits in the bloom filter are
                    // set
                    // to 0?
                    if (index
                        % tp.getBloomFilters()[i]
                            .size() == startIndex) {
                      return null;
                    }
                    // distancepreserving jump over the
                    // gap!
                    final int code = ((LazyLiteral) key
                        .getTriple().getPos(i))
                        .getCode()
                        + (index - startIndex);
                    // if (code < LazyLiteral.maxID())
                    key.getTriple().setPos(i,
                        new LazyLiteral(code));
                  }
                }
              }
            }
            final Triple t = itt.next(key);
View Full Code Here

TOP

Related Classes of lupos.datastructures.items.literal.LazyLiteral

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.