code: public static RAExpression joinOn(RAExpression re1, RAExpression re2,
                                        java.util.function.Function<ImmutableMap<QualifiedAttributeID, Term>, ImmutableList<Function>> getAtomOnExpression,
                                        TermFactory termFactory) throws IllegalJoinException {
  
          RAExpressionAttributes attributes =
                  RAExpressionAttributes.crossJoin(re1.attributes, re2.attributes);
  
          return new RAExpression(union(re1.dataAtoms, re2.dataAtoms),
                  union(re1.filterAtoms, re2.filterAtoms,
                          getAtomOnExpression.apply(attributes.getAttributes())), attributes, termFactory);
      }
docs: JOIN ON
  
  @param re1 a {@link RAExpression}
  @param re2 a {@link RAExpression}
  @param getAtomOnExpression
  @return a {@link RAExpression}
  @throws IllegalJoinException if the same alias occurs in both arguments