public boolean equiv(BasicPattern other, NodeIsomorphismMap isoMap) {
    if (this.triples.size() != other.triples.size()) return false;

    for (int i = 0; i < this.triples.size(); i++) {
      Triple t1 = get(i);
      Triple t2 = other.get(i);

      if (!Utils.tripleIso(t1, t2, isoMap)) return false;
    }
    return true;
  }
  /**
   * Return a new basic pattern with the same triples as the input, but ordered as per the index
   * list of this reorder processor.
   */
  @Override
  public BasicPattern reorder(BasicPattern bgp) {
    if (indexes.length != bgp.size()) {
      String str =
          String.format(
              "Expected size = %d : actual basic pattern size = %d", indexes.length, bgp.size());
      Log.fatal(this, str);
      throw new ARQException(str);
    }

    BasicPattern bgp2 = new BasicPattern();
    for (int j = 0; j < indexes.length; j++) {
      int idx = indexes[j];
      Triple t = bgp.get(idx);
      bgp2.add(t);
    }
    return bgp2;
  }