Examples of TripleKey


Examples of lupos.datastructures.items.TripleKey

    final int order = in.read();
    if (order < 0) {
      return null;
    }
    final Triple t = InputHelper.readLuposTriple(in);
    return new TripleKey(t, new TripleComparator((byte) order));
  }
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

    final int order = in.read();
    if (order < 0) {
      return null;
    }
    final Triple t = InputHelper.readLuposTriple(previousTriple, in);
    return new TripleKey(t, new TripleComparator((byte) order));
  }
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

                    objectIsLazyLiteralOriginalContent));
          }
          break;
        }
      }
      return new InnerNodeEntry(new TripleKey(t, new TripleComparator(
          this.order)), fileName, numberOfTriples, numberDistinctSubjects,
          numberDistinctPredicates, numberDistinctObjects,
          subjectDifferentFromPreviousTriple,
          predicateDifferentFromPreviousTriple,
          objectDifferentFromPreviousTriple);
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

      final boolean leaf = InputHelper.readLuposBoolean(in);
      Triple lastTriple = null;
      if (leaf) { // leaf node reached!
        while (true) {
          DBBPTreeEntry<TripleKey, Triple> e = this.getNextLeafEntry(in,
              (lastTriple == null) ? null : new TripleKey(
                  lastTriple, this.order), lastTriple);
          if (e == null || e.key == null) {
            in.close();
            return -1;
          }
          if (e.value != null) {
            lastTriple = e.value;
          }
          final TripleKey key = e.key;
          final int compare = this.comparator.compare(key, minimum);
          if (compare >= 0) {
            // now find maximum already here or reach the end of
            // this leaf node...
            int dist = -1;
            while (e != null && e.key != null
                && this.comparator.compare(e.key, maximum) <= 0) {
              dist++;
              e = this.getNextLeafEntry(in,
                  (lastTriple == null) ? null
                      : new TripleKey(lastTriple, this.order),
                  lastTriple);
              if (e!=null && e.value != null) {
                lastTriple = e.value;
              }
            }
            in.close();
            return dist;
          }
        }
      } else {
        TripleKey lastKey = null;
        while (true) {
          InnerNodeEntry nextEntry = this.getNextInnerNodeEntryStatistics(
              lastKey, in);
          if (nextEntry == null || nextEntry.fileName <= 0) {
            in.close();
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

      final boolean leaf = InputHelper.readLuposBoolean(in);
      if (leaf) { // leaf node reached!
        Triple lastTriple = null;
        while (true) {
          final DBBPTreeEntry<TripleKey, Triple> e = this.getNextLeafEntry(
              in, (lastTriple == null) ? null : new TripleKey(
                  lastTriple, this.order), lastTriple);
          if (e == null || e.key == null) {
            in.close();
            return dist;
          }
          final TripleKey key = e.key;
          final int compare = this.comparator.compare(key, arg0);
          if (compare > 0) {
            in.close();
            return dist;
          }
          if (e.value != null) {
            lastTriple = e.value;
            dist++;
          }
        }
      } else {
        TripleKey lastKey = null;
        int lastFilename = -1;
        int lastDistance = 0;
        while (true) {
          final InnerNodeEntry nextEntry = this.getNextInnerNodeEntryStatistics(
              lastKey, in);
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

        final boolean leaf =  InputHelper.readLuposBoolean(in);
        if (leaf) { // leaf node reached!
          while (true) {
            final DBBPTreeEntry<TripleKey, Triple> e = LazyLiteralTripleKeyDBBPTreeStatistics.this.getNextLeafEntry(
                in, (this.lastTriple == null) ? null
                    : new TripleKey(this.lastTriple, LazyLiteralTripleKeyDBBPTreeStatistics.this.order),
                this.lastTriple);
            if (e == null || e.key == null) {
              this.currentLeafIn = in;
              this.close();
              return null;
            }
            if (e.value != null) {
              this.lastTriple = e.value;
            }
            final TripleKey key = e.key;
            final int compare = LazyLiteralTripleKeyDBBPTreeStatistics.this.comparator.compare(key, this.arg0);
            if (compare == 0) {
              this.currentLeafIn = in;
              return e.value;
            } else if (compare > 0) {
              this.currentLeafIn = in;
              this.close();
              return null;
            }
          }
        } else {
          TripleKey lastKey = null;
          while (true) {
            final Tuple<TripleKey, Integer> nextEntry = LazyLiteralTripleKeyDBBPTreeStatistics.this.getNextInnerNodeEntry(
                lastKey, in);
            if (nextEntry == null || nextEntry.getSecond() == 0
                || nextEntry.getSecond() < 0) {
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

        this.lastTriple = null;
        if (leaf) { // leaf node reached!
          while (true) {
            final DBBPTreeEntry<TripleKey, Triple> e = LazyLiteralTripleKeyDBBPTreeStatistics.this.getNextLeafEntry(
                in, (this.lastTriple == null) ? null
                    : new TripleKey(this.lastTriple, LazyLiteralTripleKeyDBBPTreeStatistics.this.order),
                this.lastTriple);
            if (e == null || e.key == null) {
              this.currentLeafIn = in;
              this.close();
              return null;
            }
            if (e.value != null) {
              this.lastTriple = e.value;
            }
            final TripleKey key = e.key;
            final int compare = LazyLiteralTripleKeyDBBPTreeStatistics.this.comparator.compare(key, triplekey);
            if (compare == 0) {
              this.currentLeafIn = in;
              return e.value;
            } else if (compare > 0) {
              if (LazyLiteralTripleKeyDBBPTreeStatistics.this.comparator.compare(key, this.arg0) > 0) {
                this.currentLeafIn = in;
                this.close();
                return null;
              } else {
                this.currentLeafIn = in;
                return e.value;
              }
            }
          }
        } else {
          TripleKey lastKey = null;
          while (true) {
            final Tuple<TripleKey, Integer> nextEntry = LazyLiteralTripleKeyDBBPTreeStatistics.this.getNextInnerNodeEntry(
                lastKey, in);
            if (nextEntry == null || nextEntry.getSecond() <= 0) {
              in.close();
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

        if (leaf) { // leaf node reached!
          this.currentLeafIn = in;
          while (countDown >= 0.0) {
            final DBBPTreeEntry<TripleKey, Triple> e = LazyLiteralTripleKeyDBBPTreeStatistics.this.getNextLeafEntry(
                in, (this.lastTriple == null) ? null
                    : new TripleKey(this.lastTriple, LazyLiteralTripleKeyDBBPTreeStatistics.this.order),
                this.lastTriple);
            if (e == null) {
              this.close();
              this.next = null;
              return null;
            }
            if (e.key == null) {
              // next leaf node, but we do big jumps by going over
              // the inner nodes!
              // this case should never happen!
              if (e.filenameOfNextLeafNode >= 0) {
                this.currentLeafIn.close();
                return this.useInnerNodes(countDown, pos,
                    entry, this.innerNodes.size() - 1);
              } else {
                // should never happen!
                this.currentLeafIn.close();
                this.close();
                this.next = null;
                return null;
              }
            }
            if (LazyLiteralTripleKeyDBBPTreeStatistics.this.comparator.compare(e.key, this.arg0) != 0) {
              this.close();
              this.next = null;
              return null;
            }
            if (this.largest != null) {
              if (LazyLiteralTripleKeyDBBPTreeStatistics.this.comparator.compare(e.key, this.largest) > 0) {
                this.close();
                this.next = null;
                return null;
              }
            }
            entry.selectivity += 1.0;
            countDown -= 1.0;
            if (this.lastTriple == null
                || this.lastTriple
                    .getPos(pos)
                    .compareToNotNecessarilySPARQLSpecificationConform(
                        e.value.getPos(pos)) != 0) {
              entry.distinctLiterals += 1.0;
            }
            this.lastTriple = e.value;
            entry.literal = this.lastTriple.getPos(pos);
          }
          // read over the triples with the same literal at position
          // pos
          return this.readOver(this.lastTriple, entry, pos);
        } else {
          TripleKey lastKey = null;
          while (true) {
            final InnerNodeEntry nextEntry = LazyLiteralTripleKeyDBBPTreeStatistics.this.getNextInnerNodeEntryStatistics(
                lastKey, in);
            if (nextEntry == null || nextEntry.fileName <= 0) {
              in.close();
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

        entry.literal = this.lastTriple.getPos(pos);
        double countDown = distance - 1.0;
        while (countDown > 0.0) {
          final DBBPTreeEntry<TripleKey, Triple> e = LazyLiteralTripleKeyDBBPTreeStatistics.this.getNextLeafEntry(
              this.currentLeafIn, (this.lastTriple == null) ? null
                  : new TripleKey(this.lastTriple, LazyLiteralTripleKeyDBBPTreeStatistics.this.order),
              this.lastTriple);
          if (e == null) {
            this.currentLeafIn.close();
            return this.useInnerNodes(countDown, pos, entry,
                this.innerNodes.size() - 1);
View Full Code Here

Examples of lupos.datastructures.items.TripleKey

        final lupos.optimizations.logical.statistics.Entry entry,
        final int pos) {
      while (true) {
        final DBBPTreeEntry<TripleKey, Triple> e = LazyLiteralTripleKeyDBBPTreeStatistics.this.getNextLeafEntry(
            this.currentLeafIn, (lastTriple == null) ? null
                : new TripleKey(lastTriple, LazyLiteralTripleKeyDBBPTreeStatistics.this.order), lastTriple);
        if (e == null) {
          this.close();
          this.next = null;
          return null;
        }
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.