/** * Join clauses and its {@link QualifierValue} which have the same * relationship type and target. Try to resolve conflicts for multiple * statements. E.g., min=2 and min=3 is resolved to min=2, or max=2 and * max=4 is resolved to max=4. It will not merge conflicting exact * cardinality statements. TODO How to merge "all_some", and "all_only"? * * @param clauses the clauses * @return normalized list of {@link Clause} */ public static List<Clause> normalizeRelationshipClauses(List<Clause> clauses) { List<Clause> normalized = new ArrayList<>(); while (!clauses.isEmpty()) { Clause target = clauses.remove(0); List<Clause> similar = findSimilarClauses(clauses, target); normalized.add(target); mergeSimilarIntoTarget(target, similar); } return normalized; }
/** * Join clauses and its {@link QualifierValue} which have the same * relationship type and target. Try to resolve conflicts for multiple * statements. E.g., min=2 and min=3 is resolved to min=2, or max=2 and * max=4 is resolved to max=4. It will not merge conflicting exact * cardinality statements. TODO How to merge "all_some", and "all_only"? * * @param clauses the clauses * @return normalized list of {@link Clause} */ public static List<Clause> normalizeRelationshipClauses(List<Clause> clauses) { List<Clause> normalized = new ArrayList<>(); while (!clauses.isEmpty()) { Clause target = clauses.remove(0); List<Clause> similar = findSimilarClauses(clauses, target); normalized.add(target); mergeSimilarIntoTarget(target, similar); } return normalized; }
/** * Join clauses and its {@link QualifierValue} which have the same * relationship type and target. Try to resolve conflicts for multiple * statements. E.g., min=2 and min=3 is resolved to min=2, or max=2 and * max=4 is resolved to max=4. It will not merge conflicting exact * cardinality statements. TODO How to merge "all_some", and "all_only"? * * @param clauses the clauses * @return normalized list of {@link Clause} */ public static List<Clause> normalizeRelationshipClauses(List<Clause> clauses) { List<Clause> normalized = new ArrayList<>(); while (!clauses.isEmpty()) { Clause target = clauses.remove(0); List<Clause> similar = findSimilarClauses(clauses, target); normalized.add(target); mergeSimilarIntoTarget(target, similar); } return normalized; }
/** * Join clauses and its {@link QualifierValue} which have the same * relationship type and target. Try to resolve conflicts for multiple * statements. E.g., min=2 and min=3 is resolved to min=2, or max=2 and * max=4 is resolved to max=4. It will not merge conflicting exact * cardinality statements. TODO How to merge "all_some", and "all_only"? * * @param clauses the clauses * @return normalized list of {@link Clause} */ public static List<Clause> normalizeRelationshipClauses(List<Clause> clauses) { List<Clause> normalized = new ArrayList<>(); while (!clauses.isEmpty()) { Clause target = clauses.remove(0); List<Clause> similar = findSimilarClauses(clauses, target); normalized.add(target); mergeSimilarIntoTarget(target, similar); } return normalized; }