diff --git a/redaction-service-v1/redaction-service-server-v1/src/main/resources/drools/all_rules_documine.drl b/redaction-service-v1/redaction-service-server-v1/src/main/resources/drools/all_rules_documine.drl index e9cf3990..a43394da 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/main/resources/drools/all_rules_documine.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/main/resources/drools/all_rules_documine.drl @@ -1584,6 +1584,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI end +rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type" + salience 256 + when + $intersection: Containment( + $container: container, + $contained: contained, + ($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT), + !$container.removed(), + $contained.entityType == EntityType.RECOMMENDATION, + $container.type() == $contained.type(), + !$contained.hasManualChanges() + ) + then + $contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type"); + end + + // Rule unit: X.7 rule "X.7.0: Remove all images" salience 512 diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/acceptance_rules.drl b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/acceptance_rules.drl index 76c80801..00721643 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/acceptance_rules.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/acceptance_rules.drl @@ -1315,6 +1315,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE" end +// Rule unit: X.3 rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION" salience 64 when @@ -1384,6 +1385,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI end +rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type" + salience 256 + when + $intersection: Containment( + $container: container, + $contained: contained, + ($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT), + !$container.removed(), + $contained.entityType == EntityType.RECOMMENDATION, + $container.type() == $contained.type(), + !$contained.hasManualChanges() + ) + then + $contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type"); + end + + // Rule unit: X.6 rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT" salience 32 diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/all_redact_manager_rules.drl b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/all_redact_manager_rules.drl index 625ca7d0..dcc942c5 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/all_redact_manager_rules.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/all_redact_manager_rules.drl @@ -2079,6 +2079,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE" end +// Rule unit: X.3 rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION" salience 64 when @@ -2148,6 +2149,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI end +rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type" + salience 256 + when + $intersection: Containment( + $container: container, + $contained: contained, + ($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT), + !$container.removed(), + $contained.entityType == EntityType.RECOMMENDATION, + $container.type() == $contained.type(), + !$contained.hasManualChanges() + ) + then + $contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type"); + end + + // Rule unit: X.6 rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT" salience 32 diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/documine_flora.drl b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/documine_flora.drl index 6f7b1efc..00f56aca 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/documine_flora.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/documine_flora.drl @@ -1451,6 +1451,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE" end +// Rule unit: X.3 rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION" salience 64 when @@ -1520,6 +1521,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI end +rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type" + salience 256 + when + $intersection: Containment( + $container: container, + $contained: contained, + ($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT), + !$container.removed(), + $contained.entityType == EntityType.RECOMMENDATION, + $container.type() == $contained.type(), + !$contained.hasManualChanges() + ) + then + $contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type"); + end + + // Rule unit: X.7 rule "X.7.0: Remove all images" salience 512 diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/efsa_sanitisation.drl b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/efsa_sanitisation.drl index d2bbd9db..49a7afc7 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/efsa_sanitisation.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/efsa_sanitisation.drl @@ -1042,6 +1042,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE" end +// Rule unit: X.3 rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION" salience 64 when @@ -1111,6 +1112,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI end +rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type" + salience 256 + when + $intersection: Containment( + $container: container, + $contained: contained, + ($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT), + !$container.removed(), + $contained.entityType == EntityType.RECOMMENDATION, + $container.type() == $contained.type(), + !$contained.hasManualChanges() + ) + then + $contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type"); + end + + // Rule unit: X.6 rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT" salience 32 diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/manual_redaction_rules.drl b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/manual_redaction_rules.drl index 3988bd1a..1a088861 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/manual_redaction_rules.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/manual_redaction_rules.drl @@ -363,6 +363,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE" end +// Rule unit: X.3 rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION" salience 64 when @@ -432,6 +433,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI end +rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type" + salience 256 + when + $intersection: Containment( + $container: container, + $contained: contained, + ($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT), + !$container.removed(), + $contained.entityType == EntityType.RECOMMENDATION, + $container.type() == $contained.type(), + !$contained.hasManualChanges() + ) + then + $contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type"); + end + + // Rule unit: X.6 rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT" salience 32 diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/rules.drl b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/rules.drl index 6580da5f..8d902cec 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/rules.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/rules.drl @@ -1408,6 +1408,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI end +rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type" + salience 256 + when + $intersection: Containment( + $container: container, + $contained: contained, + ($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT), + !$container.removed(), + $contained.entityType == EntityType.RECOMMENDATION, + $container.type() == $contained.type(), + !$contained.hasManualChanges() + ) + then + $contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type"); + end + + // Rule unit: X.6 rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT" salience 32 diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/rules_v2.drl b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/rules_v2.drl index d392e0bd..303566f6 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/rules_v2.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/rules_v2.drl @@ -423,6 +423,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE" end +// Rule unit: X.3 rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION" salience 64 when @@ -492,6 +493,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI end +rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type" + salience 256 + when + $intersection: Containment( + $container: container, + $contained: contained, + ($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT), + !$container.removed(), + $contained.entityType == EntityType.RECOMMENDATION, + $container.type() == $contained.type(), + !$contained.hasManualChanges() + ) + then + $contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type"); + end + + // Rule unit: X.6 rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT" salience 32 diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/table_demo.drl b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/table_demo.drl index 2c3027ee..c21da66b 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/table_demo.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/table_demo.drl @@ -513,6 +513,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE" end +// Rule unit: X.3 rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION" salience 64 when @@ -582,6 +583,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI end +rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type" + salience 256 + when + $intersection: Containment( + $container: container, + $contained: contained, + ($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT), + !$container.removed(), + $contained.entityType == EntityType.RECOMMENDATION, + $container.type() == $contained.type(), + !$contained.hasManualChanges() + ) + then + $contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type"); + end + + // Rule unit: X.6 rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT" salience 32 diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/test_rules.drl b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/test_rules.drl index 7aa4c76d..3bc766d6 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/test_rules.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/test/resources/drools/test_rules.drl @@ -396,38 +396,6 @@ rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE" $contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE"); end -rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE" - salience 64 - when - $containment: Containment( - $container: container, - $contained: contained, - $container.entityType == EntityType.FALSE_POSITIVE, - $container.active(), - $contained.entityType == EntityType.ENTITY, - $contained.type() == $container.type(), - !$contained.hasManualChanges() - ) - then - $contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE"); -end - -rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE" - salience 64 - when - $containment: Containment( - $container: container, - $contained: contained, - $container.entityType == EntityType.FALSE_POSITIVE, - $container.active(), - $contained.entityType == EntityType.HINT, - $contained.type() == $container.type(), - !$contained.hasManualChanges() - ) - then - $contained.remove("X.2.1", "remove Entity of type HINT when contained by FALSE_POSITIVE"); -end - rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE" salience 64 when @@ -445,6 +413,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE" end +// Rule unit: X.3 rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION" salience 64 when @@ -514,6 +483,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI end +rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type" + salience 256 + when + $intersection: Containment( + $container: container, + $contained: contained, + ($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT), + !$container.removed(), + $contained.entityType == EntityType.RECOMMENDATION, + $container.type() == $contained.type(), + !$contained.hasManualChanges() + ) + then + $contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type"); + end + + // Rule unit: X.6 rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT" salience 32 diff --git a/redaction-service-v1/redaction-service-server-v1/src/test/resources/performance/dictionaries/EFSA_sanitisation_GFL_v1/rules.drl b/redaction-service-v1/redaction-service-server-v1/src/test/resources/performance/dictionaries/EFSA_sanitisation_GFL_v1/rules.drl index fcb55325..4bebf625 100644 --- a/redaction-service-v1/redaction-service-server-v1/src/test/resources/performance/dictionaries/EFSA_sanitisation_GFL_v1/rules.drl +++ b/redaction-service-v1/redaction-service-server-v1/src/test/resources/performance/dictionaries/EFSA_sanitisation_GFL_v1/rules.drl @@ -995,6 +995,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI end +rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type" + salience 256 + when + $intersection: Containment( + $container: container, + $contained: contained, + ($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT), + !$container.removed(), + $contained.entityType == EntityType.RECOMMENDATION, + $container.type() == $contained.type(), + !$contained.hasManualChanges() + ) + then + $contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type"); + end + + // Rule unit: X.6 rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT" salience 32 diff --git a/redaction-service-v1/rules-management/src/main/resources/all_redact_manager_rules.drl b/redaction-service-v1/rules-management/src/main/resources/all_redact_manager_rules.drl index 9a49cd37..db5da1de 100644 --- a/redaction-service-v1/rules-management/src/main/resources/all_redact_manager_rules.drl +++ b/redaction-service-v1/rules-management/src/main/resources/all_redact_manager_rules.drl @@ -2187,6 +2187,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI end +rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type" + salience 256 + when + $intersection: Containment( + $container: container, + $contained: contained, + ($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT), + !$container.removed(), + $contained.entityType == EntityType.RECOMMENDATION, + $container.type() == $contained.type(), + !$contained.hasManualChanges() + ) + then + $contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type"); + end + + // Rule unit: X.6 rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT" salience 32 diff --git a/redaction-service-v1/rules-management/src/main/resources/all_rules_documine.drl b/redaction-service-v1/rules-management/src/main/resources/all_rules_documine.drl index 1a2d6cb5..4d5359ed 100644 --- a/redaction-service-v1/rules-management/src/main/resources/all_rules_documine.drl +++ b/redaction-service-v1/rules-management/src/main/resources/all_rules_documine.drl @@ -1589,6 +1589,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI end +rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type" + salience 256 + when + $intersection: Containment( + $container: container, + $contained: contained, + ($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT), + !$container.removed(), + $contained.entityType == EntityType.RECOMMENDATION, + $container.type() == $contained.type(), + !$contained.hasManualChanges() + ) + then + $contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type"); + end + + // Rule unit: X.7 rule "X.7.0: Remove all images" salience 512