- if (!allFound.isEmpty()) {
- for (Map<String, String> raw : allFound) {
- EdgeRule converted = new EdgeRule(raw);
- String alphabetizedKey = alpher.buildAlphabetizedKey(raw.get(EdgeField.FROM.toString()), raw.get(EdgeField.TO.toString()));
- rules.put(alphabetizedKey, converted);
+ for (Map<String, String> raw : allFound) {
+ EdgeRule converted = new EdgeRule(raw);
+ if (converted.getFrom().equals(converted.getTo())) {
+ /* the way the code worked in the past was with outs and
+ * when we switched it to in the same-node-type to
+ * same-node-type parent child edges were failing because all
+ * of the calling code would pass the parent as the left argument,
+ * so it was either in that method swap the parent/child,
+ * flip the edge rule or make all callers swap. the last seemed
+ * like a bad idea. and felt like the edge flip was the better
+ * of the remaining 2 */
+ converted.flipDirection();