Examples of TripleKey


Examples of lupos.datastructures.items.TripleKey

          if (secondary.ordinal() == pos + 1) {
            tertiary = innerNode.getFirst().getTripleComparator()
                .getTertiary();
          }
        }
        final TripleKey key = new TripleKey(lastTriple,
            new TripleComparator(primary, secondary, tertiary));
        while (innerNode.getFirst().compareTo(key) < 0) {
          final InnerNodeEntry ine = LazyLiteralTripleKeyDBBPTreeStatistics.this.getNextInnerNodeEntryStatistics(
              innerNode.getFirst(), innerNode.getSecond());
          if (ine == null) {
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

        lastTriple = null;
        if (leaf) { // leaf node reached!
          this.currentLeafIn = in;
          return this.readOver(lastTriple, entry, pos);
        } else {
          TripleKey lastKey = null;
          InnerNodeEntry nextEntry = LazyLiteralTripleKeyDBBPTreeStatistics.this.getNextInnerNodeEntryStatistics(
              lastKey, in);
          final COMPARE primary = nextEntry.key.getTripleComparator()
              .getPrimary();
          final COMPARE secondary = COMPARE.NONE;
          final COMPARE tertiary = COMPARE.NONE;
          final TripleKey key = new TripleKey(lastTriple,
              new TripleComparator(primary, secondary, tertiary));
          while (true) {
            if (nextEntry == null || nextEntry.fileName <= 0) {
              in.close();
              this.close();
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

            }
            break;
          }
        }
      }
      return new DBBPTreeEntry<TripleKey, Triple>(new TripleKey(t,
          new TripleComparator(this.order)), t, filenameOfNextLeafNode);
    } catch (final FileNotFoundException e) {
      e.printStackTrace();
      System.err.println(e);
    } catch (final IOException e) {
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

                objectIsLazyLiteralOriginalContent));
          }
          break;
        }
      }
      return new Tuple<TripleKey, Integer>(new TripleKey(t,
          new TripleComparator(this.order)), fileName);
    } catch (final FileNotFoundException e) {
      e.printStackTrace();
      System.err.println(e);
    } catch (final IOException e) {
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

                    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));
                  }
                }
              }
            }
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

      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.
          final Triple t = ((SIPParallelIterator<Triple, TripleKey>) itt)
              .next(key);
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

                objectIsLazyLiteralOriginalContent));
          }
          break;
        }
      }
      return new Tuple<TripleKey, Integer>(new TripleKey(t,
          new TripleComparator(this.order)), fileName);
    } catch (final FileNotFoundException e) {
      e.printStackTrace();
      System.err.println(e);
    } catch (final IOException e) {
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.