Package lupos.datastructures.items

Examples of lupos.datastructures.items.TripleKey


            }
            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();

            } catch (final IOException e) {
View Full Code Here


      final Triple keyMinimum, final Triple keyMaximum) {
    if (keyMinimum == null) {
      if (keyMaximum == null) {
        switch (collationOrder) {
        case SPO:
          return sixIndices.SPO.prefixSearch(new TripleKey(key,
              CollationOrder.SPO));
        case SOP:
          return sixIndices.SOP.prefixSearch(new TripleKey(key,
              CollationOrder.SOP));
        case PSO:
          return sixIndices.PSO.prefixSearch(new TripleKey(key,
              CollationOrder.PSO));
        case POS:
          return sixIndices.POS.prefixSearch(new TripleKey(key,
              CollationOrder.POS));
        case OSP:
          return sixIndices.OSP.prefixSearch(new TripleKey(key,
              CollationOrder.OSP));
        default:
        case OPS:
          return sixIndices.OPS.prefixSearch(new TripleKey(key,
              CollationOrder.OPS));
        }
      } else {
        switch (collationOrder) {
        case SPO:
          return sixIndices.SPO.prefixSearchMax(new TripleKey(key,
              CollationOrder.SPO),
              new TripleKey(keyMaximum,
                  CollationOrder.SPO));
        case SOP:
          return sixIndices.SOP.prefixSearchMax(new TripleKey(key,
              CollationOrder.SOP),
              new TripleKey(keyMaximum,
                  CollationOrder.SOP));
        case PSO:
          return sixIndices.PSO.prefixSearchMax(new TripleKey(key,
              CollationOrder.PSO),
              new TripleKey(keyMaximum,
                  CollationOrder.PSO));
        case POS:
          return sixIndices.POS.prefixSearchMax(new TripleKey(key,
              CollationOrder.POS),
              new TripleKey(keyMaximum,
                  CollationOrder.POS));
        case OSP:
          return sixIndices.OSP.prefixSearchMax(new TripleKey(key,
              CollationOrder.OSP),
              new TripleKey(keyMaximum,
                  CollationOrder.OSP));
        default:
        case OPS:
          return sixIndices.OPS.prefixSearchMax(new TripleKey(key,
              CollationOrder.OPS),
              new TripleKey(keyMaximum,
                  CollationOrder.OPS));
        }
      }
    } else {
      if (keyMaximum == null) {
        switch (collationOrder) {
        case SPO:
          return sixIndices.SPO.prefixSearch(new TripleKey(key,
              CollationOrder.SPO),
              new TripleKey(keyMinimum,
                  CollationOrder.SPO));
        case SOP:
          return sixIndices.SOP.prefixSearch(new TripleKey(key,
              CollationOrder.SOP),
              new TripleKey(keyMinimum,
                  CollationOrder.SOP));
        case PSO:
          return sixIndices.PSO.prefixSearch(new TripleKey(key,
              CollationOrder.PSO),
              new TripleKey(keyMinimum,
                  CollationOrder.PSO));
        case POS:
          return sixIndices.POS.prefixSearch(new TripleKey(key,
              CollationOrder.POS),
              new TripleKey(keyMinimum,
                  CollationOrder.POS));
        case OSP:
          return sixIndices.OSP.prefixSearch(new TripleKey(key,
              CollationOrder.OSP),
              new TripleKey(keyMinimum,
                  CollationOrder.OSP));
        default:
        case OPS:
          return sixIndices.OPS.prefixSearch(new TripleKey(key,
              CollationOrder.OPS),
              new TripleKey(keyMinimum,
                  CollationOrder.OPS));
        }
      } else {
        switch (collationOrder) {
        case SPO:
          return sixIndices.SPO.prefixSearch(new TripleKey(key,
              CollationOrder.SPO),
              new TripleKey(keyMinimum,
                  CollationOrder.SPO),
              new TripleKey(keyMaximum,
                  CollationOrder.SPO));
        case SOP:
          return sixIndices.SOP.prefixSearch(new TripleKey(key,
              CollationOrder.SOP),
              new TripleKey(keyMinimum,
                  CollationOrder.SOP),
              new TripleKey(keyMaximum,
                  CollationOrder.SOP));
        case PSO:
          return sixIndices.PSO.prefixSearch(new TripleKey(key,
              CollationOrder.PSO),
              new TripleKey(keyMinimum,
                  CollationOrder.PSO),
              new TripleKey(keyMaximum,
                  CollationOrder.PSO));
        case POS:
          return sixIndices.POS.prefixSearch(new TripleKey(key,
              CollationOrder.POS),
              new TripleKey(keyMinimum,
                  CollationOrder.POS),
              new TripleKey(keyMaximum,
                  CollationOrder.POS));
        case OSP:
          return sixIndices.OSP.prefixSearch(new TripleKey(key,
              CollationOrder.OSP),
              new TripleKey(keyMinimum,
                  CollationOrder.OSP),
              new TripleKey(keyMaximum,
                  CollationOrder.OSP));
        default:
        case OPS:
          return sixIndices.OPS.prefixSearch(new TripleKey(key,
              CollationOrder.OPS),
              new TripleKey(keyMinimum,
                  CollationOrder.OPS),
              new TripleKey(keyMaximum,
                  CollationOrder.OPS));
        }
      }
    }
  }
View Full Code Here

      dbbptree = ((OptimizedDBBPTreeGeneration<TripleKey, Triple>) index).getDBBPTree();
    } else if(index instanceof DBBPTree){
      dbbptree = (DBBPTree<TripleKey, Triple>) index;
    }
    if(dbbptree!=null){
      return dbbptree.getMaximum(new TripleKey(key, this.collationOrder)).getPos(pos);
    }
    return null;
  }
View Full Code Here

      }
      i++;
    }
    final CollationOrder order = getCollationOrder(tp, cv);
    return indices.getDBBPTreeStatistics(order).getVarBucket(
        new TripleKey(key, order),
        keyMinimum == null ? null : new TripleKey(keyMinimum, order),
        keyMaximum == null ? null : new TripleKey(keyMaximum, order),
        pos);
  }
View Full Code Here

                    System.err.println(e);
                    e.printStackTrace();
                }
            }
        } else {
          this.SPO.put(new TripleKey(t, new TripleComparator(CollationOrder.SPO)), t);
          this.SOP.put(new TripleKey(t, new TripleComparator(CollationOrder.SOP)), t);
          this.PSO.put(new TripleKey(t, new TripleComparator(CollationOrder.PSO)), t);
          this.POS.put(new TripleKey(t, new TripleComparator(CollationOrder.POS)), t);
          this.OSP.put(new TripleKey(t, new TripleComparator(CollationOrder.OSP)), t);
          this.OPS.put(new TripleKey(t, new TripleComparator(CollationOrder.OPS)), t);
        }
    }
View Full Code Here

    }

    @Override
    public boolean contains(final Triple t) {
      this.waitForAdderThreads();
        return (this.SPO.get(new TripleKey(t, new TripleComparator(CollationOrder.SPO))) != null);
    }
View Full Code Here

        this.OPS = this.getDatastructure(CollationOrder.OPS);
    }

    @Override
    public void remove(final Triple t) {
      this.SPO.remove(new TripleKey(t, new TripleComparator(CollationOrder.SPO)));
      this.SOP.remove(new TripleKey(t, new TripleComparator(CollationOrder.SOP)));
      this.PSO.remove(new TripleKey(t, new TripleComparator(CollationOrder.PSO)));
      this.POS.remove(new TripleKey(t, new TripleComparator(CollationOrder.POS)));
      this.OSP.remove(new TripleKey(t, new TripleComparator(CollationOrder.OSP)));
      this.OPS.remove(new TripleKey(t, new TripleComparator(CollationOrder.OPS)));
    }
View Full Code Here

        @Override
        public void run() {
            try {
                while (this.bbt.hasNext()) {
                    final Triple t = this.bbt.get();
                    this.ps.put(new TripleKey(t, new TripleComparator(this.order)), t);
                }
            } catch (final InterruptedException e) {
                System.err.println(e);
                e.printStackTrace();
            }
View Full Code Here

        literals[i] = (Literal) this.items[i];
      } else {
        literals[i] = k.get((Variable) this.items[i]);
      }
    }
    final TripleKey tk = new TripleKey(new Triple(literals[0], literals[1],
        literals[2]), order);
    return tk;
  }
View Full Code Here

        literals[i] = (Literal) this.items[i];
      } else {
        literals[i] = t[i];
      }
    }
    final TripleKey tk = new TripleKey(new Triple(literals[0], literals[1],
        literals[2]), order);
    return tk;
  }
View Full Code Here

TOP

Related Classes of lupos.datastructures.items.TripleKey

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.