Merge branch 'RED-7384' into 'master'
RED-7384: fixed ignored hints, fixed false positives, enhanced test to include manual changes Closes RED-7384 See merge request redactmanager/redaction-service!261
This commit is contained in:
commit
6a7e11cd2c
@ -16,7 +16,7 @@ val layoutParserVersion = "0.86.0"
|
||||
val jacksonVersion = "2.15.2"
|
||||
val droolsVersion = "9.44.0.Final"
|
||||
val pdfBoxVersion = "3.0.0"
|
||||
val persistenceServiceVersion = "2.320.0"
|
||||
val persistenceServiceVersion = "2.324.0"
|
||||
val springBootStarterVersion = "3.1.5"
|
||||
|
||||
configurations {
|
||||
|
||||
@ -57,7 +57,10 @@ public class LegacyRedactionLogMergeService {
|
||||
|
||||
for (RedactionLogEntry entry : redactionLog.getRedactionLogEntry()) {
|
||||
|
||||
processRedactionLogEntry(manualRedactionWrappers.stream().filter(mr -> entry.getId().equals(mr.getId())).collect(Collectors.toList()), entry, dossierTemplateId);
|
||||
processRedactionLogEntry(manualRedactionWrappers.stream()
|
||||
.filter(ManualRedactionWrapper::isApproved)
|
||||
.filter(mr -> entry.getId().equals(mr.getId()))
|
||||
.collect(Collectors.toList()), entry, dossierTemplateId);
|
||||
|
||||
if (entry.isImported() && !entry.isRedacted()) {
|
||||
skippedImportedRedactions.add(entry.getId());
|
||||
@ -69,7 +72,9 @@ public class LegacyRedactionLogMergeService {
|
||||
|
||||
Set<String> processedIds = new HashSet<>();
|
||||
redactionLog.getRedactionLogEntry().removeIf(entry -> {
|
||||
|
||||
if (entry.isFalsePositive()) {
|
||||
return true;
|
||||
}
|
||||
if (entry.getImportedRedactionIntersections() != null) {
|
||||
entry.getImportedRedactionIntersections().removeAll(skippedImportedRedactions);
|
||||
if (!entry.getImportedRedactionIntersections().isEmpty() && (!entry.isImage() || entry.isImage() && !(entry.getType().equals("image") || entry.getType()
|
||||
@ -92,33 +97,33 @@ public class LegacyRedactionLogMergeService {
|
||||
|
||||
List<ManualRedactionWrapper> manualRedactionWrappers = new ArrayList<>();
|
||||
|
||||
manualRedactions.getRecategorizations().stream().filter(BaseAnnotation::isApproved).forEach(item -> {
|
||||
manualRedactions.getRecategorizations().forEach(item -> {
|
||||
if (item.getSoftDeletedTime() == null) {
|
||||
manualRedactionWrappers.add(new ManualRedactionWrapper(item.getAnnotationId(), item.getRequestDate(), item));
|
||||
manualRedactionWrappers.add(new ManualRedactionWrapper(item.getAnnotationId(), item.getRequestDate(), item, item.isApproved()));
|
||||
}
|
||||
});
|
||||
|
||||
manualRedactions.getIdsToRemove().stream().filter(BaseAnnotation::isApproved).forEach(item -> {
|
||||
manualRedactions.getIdsToRemove().forEach(item -> {
|
||||
if (item.getSoftDeletedTime() == null) {
|
||||
manualRedactionWrappers.add(new ManualRedactionWrapper(item.getAnnotationId(), item.getRequestDate(), item));
|
||||
manualRedactionWrappers.add(new ManualRedactionWrapper(item.getAnnotationId(), item.getRequestDate(), item, item.isApproved()));
|
||||
}
|
||||
});
|
||||
|
||||
manualRedactions.getForceRedactions().stream().filter(BaseAnnotation::isApproved).forEach(item -> {
|
||||
manualRedactions.getForceRedactions().forEach(item -> {
|
||||
if (item.getSoftDeletedTime() == null) {
|
||||
manualRedactionWrappers.add(new ManualRedactionWrapper(item.getAnnotationId(), item.getRequestDate(), item));
|
||||
manualRedactionWrappers.add(new ManualRedactionWrapper(item.getAnnotationId(), item.getRequestDate(), item, item.isApproved()));
|
||||
}
|
||||
});
|
||||
|
||||
manualRedactions.getLegalBasisChanges().stream().filter(BaseAnnotation::isApproved).forEach(item -> {
|
||||
manualRedactions.getLegalBasisChanges().forEach(item -> {
|
||||
if (item.getSoftDeletedTime() == null) {
|
||||
manualRedactionWrappers.add(new ManualRedactionWrapper(item.getAnnotationId(), item.getRequestDate(), item));
|
||||
manualRedactionWrappers.add(new ManualRedactionWrapper(item.getAnnotationId(), item.getRequestDate(), item, item.isApproved()));
|
||||
}
|
||||
});
|
||||
|
||||
manualRedactions.getResizeRedactions().stream().filter(BaseAnnotation::isApproved).forEach(item -> {
|
||||
manualRedactions.getResizeRedactions().forEach(item -> {
|
||||
if (item.getSoftDeletedTime() == null) {
|
||||
manualRedactionWrappers.add(new ManualRedactionWrapper(item.getAnnotationId(), item.getRequestDate(), item));
|
||||
manualRedactionWrappers.add(new ManualRedactionWrapper(item.getAnnotationId(), item.getRequestDate(), item, item.isApproved()));
|
||||
}
|
||||
});
|
||||
|
||||
@ -355,6 +360,10 @@ public class LegacyRedactionLogMergeService {
|
||||
@SuppressWarnings("PMD.UselessParentheses")
|
||||
private boolean shouldCreateManualEntry(ManualRedactionEntry manualRedactionEntry) {
|
||||
|
||||
if (!manualRedactionEntry.isApproved()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (!manualRedactionEntry.isAddToDictionary() && !manualRedactionEntry.isAddToDossierDictionary()) || ((manualRedactionEntry.isAddToDictionary() || manualRedactionEntry.isAddToDossierDictionary()) && manualRedactionEntry.getProcessedDate() == null);
|
||||
}
|
||||
|
||||
@ -394,6 +403,7 @@ public class LegacyRedactionLogMergeService {
|
||||
private String id;
|
||||
private OffsetDateTime date;
|
||||
private Object item;
|
||||
private boolean approved;
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@ -61,7 +61,7 @@ public class MigrationMessageReceiver {
|
||||
redactionLog = legacyRedactionLogMergeService.mergeManualChanges(redactionLog, migrationRequest.getManualRedactions(), migrationRequest.getDossierTemplateId());
|
||||
}
|
||||
|
||||
MigratedEntityLog migratedEntityLog = redactionLogToEntityLogMigrationService.migrate(redactionLog, document);
|
||||
MigratedEntityLog migratedEntityLog = redactionLogToEntityLogMigrationService.migrate(redactionLog, document, migrationRequest.getDossierTemplateId());
|
||||
|
||||
redactionStorageService.storeObject(migrationRequest.getDossierId(), migrationRequest.getFileId(), FileType.ENTITY_LOG, migratedEntityLog.getEntityLog());
|
||||
redactionStorageService.storeObject(migrationRequest.getDossierId(), migrationRequest.getFileId(), FileType.MIGRATED_IDS, migratedEntityLog.getMigratedIds());
|
||||
|
||||
@ -16,7 +16,8 @@ import org.springframework.stereotype.Service;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLog;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLogLegalBasis;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.migration.MigratedIds;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.ManualChange;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.ManualRedactionType;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.Rectangle;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.RedactionLog;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.RedactionLogEntry;
|
||||
@ -32,6 +33,7 @@ import com.iqser.red.service.redaction.v1.server.model.document.nodes.Document;
|
||||
import com.iqser.red.service.redaction.v1.server.model.document.nodes.Image;
|
||||
import com.iqser.red.service.redaction.v1.server.model.document.nodes.ImageType;
|
||||
import com.iqser.red.service.redaction.v1.server.model.document.nodes.SemanticNode;
|
||||
import com.iqser.red.service.redaction.v1.server.service.DictionaryService;
|
||||
import com.iqser.red.service.redaction.v1.server.service.document.EntityCreationService;
|
||||
import com.iqser.red.service.redaction.v1.server.service.document.EntityEnrichmentService;
|
||||
import com.iqser.red.service.redaction.v1.server.service.document.EntityFindingUtility;
|
||||
@ -53,15 +55,15 @@ public class RedactionLogToEntityLogMigrationService {
|
||||
private static final double MATCH_THRESHOLD = 10;
|
||||
EntityFindingUtility entityFindingUtility;
|
||||
EntityEnrichmentService entityEnrichmentService;
|
||||
DictionaryService dictionaryService;
|
||||
|
||||
|
||||
public MigratedEntityLog migrate(RedactionLog redactionLog, Document document) {
|
||||
public MigratedEntityLog migrate(RedactionLog redactionLog, Document document, String dossierTemplateId) {
|
||||
|
||||
List<MigrationEntity> entitiesToMigrate = calculateMigrationEntitiesFromRedactionLog(redactionLog, document);
|
||||
List<MigrationEntity> entitiesToMigrate = calculateMigrationEntitiesFromRedactionLog(redactionLog, document, dossierTemplateId);
|
||||
MigratedIds migratedIds = entitiesToMigrate.stream().collect(new MigratedIdsCollector());
|
||||
MigratedIds idsToMigrateInDb = entitiesToMigrate.stream().filter(MigrationEntity::hasManualChangesOrComments).collect(new MigratedIdsCollector());
|
||||
|
||||
|
||||
EntityLog entityLog = new EntityLog();
|
||||
entityLog.setAnalysisNumber(redactionLog.getAnalysisNumber());
|
||||
entityLog.setRulesVersion(redactionLog.getRulesVersion());
|
||||
@ -92,10 +94,10 @@ public class RedactionLogToEntityLogMigrationService {
|
||||
}
|
||||
|
||||
|
||||
private List<MigrationEntity> calculateMigrationEntitiesFromRedactionLog(RedactionLog redactionLog, Document document) {
|
||||
private List<MigrationEntity> calculateMigrationEntitiesFromRedactionLog(RedactionLog redactionLog, Document document, String dossierTemplateId) {
|
||||
|
||||
List<MigrationEntity> images = getImageBasedMigrationEntities(redactionLog, document);
|
||||
List<MigrationEntity> textMigrationEntities = getTextBasedMigrationEntities(redactionLog, document);
|
||||
List<MigrationEntity> images = getImageBasedMigrationEntities(redactionLog, document, dossierTemplateId);
|
||||
List<MigrationEntity> textMigrationEntities = getTextBasedMigrationEntities(redactionLog, document, dossierTemplateId);
|
||||
return Stream.of(textMigrationEntities.stream(), images.stream()).flatMap(Function.identity()).toList();
|
||||
}
|
||||
|
||||
@ -106,14 +108,11 @@ public class RedactionLogToEntityLogMigrationService {
|
||||
}
|
||||
|
||||
|
||||
private List<MigrationEntity> getImageBasedMigrationEntities(RedactionLog redactionLog, Document document) {
|
||||
private List<MigrationEntity> getImageBasedMigrationEntities(RedactionLog redactionLog, Document document, String dossierTemplateId) {
|
||||
|
||||
List<Image> images = document.streamAllImages().collect(Collectors.toList());
|
||||
|
||||
List<RedactionLogEntry> redactionLogImages = redactionLog.getRedactionLogEntry()
|
||||
.stream()
|
||||
.filter(RedactionLogEntry::isImage)
|
||||
.toList();
|
||||
List<RedactionLogEntry> redactionLogImages = redactionLog.getRedactionLogEntry().stream().filter(RedactionLogEntry::isImage).toList();
|
||||
|
||||
List<MigrationEntity> migrationEntities = new LinkedList<>();
|
||||
for (RedactionLogEntry redactionLogImage : redactionLogImages) {
|
||||
@ -132,7 +131,13 @@ public class RedactionLogToEntityLogMigrationService {
|
||||
images.remove(closestImage);
|
||||
}
|
||||
|
||||
String ruleIdentifier = "OLDIMG." + redactionLogImage.getMatchedRule() + ".0";
|
||||
String ruleIdentifier;
|
||||
if (redactionLogImage.getMatchedRule().isBlank() || redactionLogImage.getMatchedRule() == null) {
|
||||
ruleIdentifier = "OLDIMG.0.0";
|
||||
} else {
|
||||
ruleIdentifier = "OLDIMG." + redactionLogImage.getMatchedRule() + ".0";
|
||||
}
|
||||
|
||||
if (redactionLogImage.lastChangeIsRemoved()) {
|
||||
closestImage.remove(ruleIdentifier, redactionLogImage.getReason());
|
||||
} else if (redactionLogImage.isRedacted()) {
|
||||
@ -170,19 +175,23 @@ public class RedactionLogToEntityLogMigrationService {
|
||||
}
|
||||
|
||||
|
||||
private List<MigrationEntity> getTextBasedMigrationEntities(RedactionLog redactionLog, Document document) {
|
||||
private List<MigrationEntity> getTextBasedMigrationEntities(RedactionLog redactionLog, Document document, String dossierTemplateId) {
|
||||
|
||||
List<MigrationEntity> entitiesToMigrate = redactionLog.getRedactionLogEntry()
|
||||
.stream()
|
||||
.filter(redactionLogEntry -> !redactionLogEntry.isImage())
|
||||
.map(MigrationEntity::fromRedactionLogEntry)
|
||||
.map(entry -> MigrationEntity.fromRedactionLogEntry(entry, dictionaryService.isHint(entry.getType(), dossierTemplateId)))
|
||||
.peek(migrationEntity -> {
|
||||
if (migrationEntity.getRedactionLogEntry().lastChangeIsRemoved()) {
|
||||
if (migrationEntity.getManualEntity().getEntityType().equals(EntityType.HINT)) {
|
||||
migrationEntity.getManualEntity().ignore(migrationEntity.getManualEntity().getRuleIdentifier(), migrationEntity.getRedactionLogEntry().getReason());
|
||||
} else {
|
||||
migrationEntity.getManualEntity().remove(migrationEntity.getManualEntity().getRuleIdentifier(), migrationEntity.getRedactionLogEntry().getReason());
|
||||
}
|
||||
if (migrationEntity.getManualEntity().getEntityType().equals(EntityType.HINT) &&//
|
||||
!migrationEntity.getRedactionLogEntry().isHint() &&//
|
||||
!migrationEntity.getRedactionLogEntry().isRedacted()) {
|
||||
migrationEntity.getManualEntity().ignore(migrationEntity.getManualEntity().getRuleIdentifier(), migrationEntity.getRedactionLogEntry().getReason());
|
||||
} else if (migrationEntity.getRedactionLogEntry().lastChangeIsRemoved()) {
|
||||
migrationEntity.getManualEntity().remove(migrationEntity.getManualEntity().getRuleIdentifier(), migrationEntity.getRedactionLogEntry().getReason());
|
||||
} else if (lastManualChangeIsRemove(migrationEntity)) {
|
||||
migrationEntity.getManualEntity().ignore(migrationEntity.getManualEntity().getRuleIdentifier(), migrationEntity.getManualEntity().getReason());
|
||||
} else if (migrationEntity.getManualEntity().isApplied() && migrationEntity.getRedactionLogEntry().isRecommendation()) {
|
||||
migrationEntity.getManualEntity().skip(migrationEntity.getManualEntity().getRuleIdentifier(), migrationEntity.getManualEntity().getReason());
|
||||
} else if (migrationEntity.getManualEntity().isApplied()) {
|
||||
migrationEntity.getManualEntity()
|
||||
.apply(migrationEntity.getManualEntity().getRuleIdentifier(),
|
||||
@ -220,6 +229,21 @@ public class RedactionLogToEntityLogMigrationService {
|
||||
}
|
||||
|
||||
|
||||
private static boolean lastManualChangeIsRemove(MigrationEntity migrationEntity) {
|
||||
|
||||
if (migrationEntity.getRedactionLogEntry().getManualChanges() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return migrationEntity.getRedactionLogEntry()
|
||||
.getManualChanges()
|
||||
.stream()
|
||||
.reduce((a, b) -> b)
|
||||
.map(m -> m.getManualRedactionType().equals(ManualRedactionType.REMOVE_LOCALLY))
|
||||
.orElse(false);
|
||||
}
|
||||
|
||||
|
||||
private TextEntity createCorrectEntity(ManualEntity manualEntity, SemanticNode node, TextRange closestTextRange) {
|
||||
|
||||
EntityCreationService entityCreationService = new EntityCreationService(entityEnrichmentService);
|
||||
|
||||
@ -12,7 +12,6 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntryState;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntryType;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.Position;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.Change;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.Engine;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.ManualChange;
|
||||
@ -42,17 +41,17 @@ public final class MigrationEntity {
|
||||
private String newId;
|
||||
|
||||
|
||||
public static MigrationEntity fromRedactionLogEntry(RedactionLogEntry redactionLogEntry) {
|
||||
public static MigrationEntity fromRedactionLogEntry(RedactionLogEntry redactionLogEntry, boolean hint) {
|
||||
|
||||
return new MigrationEntity(createManualEntity(redactionLogEntry), redactionLogEntry);
|
||||
return new MigrationEntity(createManualEntity(redactionLogEntry, hint), redactionLogEntry);
|
||||
}
|
||||
|
||||
|
||||
public static ManualEntity createManualEntity(RedactionLogEntry redactionLogEntry) {
|
||||
public static ManualEntity createManualEntity(RedactionLogEntry redactionLogEntry, boolean hint) {
|
||||
|
||||
String ruleIdentifier = buildRuleIdentifier(redactionLogEntry);
|
||||
List<RectangleWithPage> rectangleWithPages = redactionLogEntry.getPositions().stream().map(RectangleWithPage::fromRedactionLogRectangle).toList();
|
||||
EntityType entityType = getEntityType(redactionLogEntry);
|
||||
EntityType entityType = getEntityType(redactionLogEntry, hint);
|
||||
return ManualEntity.builder()
|
||||
.id(redactionLogEntry.getId())
|
||||
.value(redactionLogEntry.getValue())
|
||||
@ -84,14 +83,20 @@ public final class MigrationEntity {
|
||||
}
|
||||
|
||||
|
||||
private static EntityType getEntityType(RedactionLogEntry redactionLogEntry) {
|
||||
private static EntityType getEntityType(RedactionLogEntry redactionLogEntry, boolean hint) {
|
||||
|
||||
if (redactionLogEntry.isRecommendation()) {
|
||||
return EntityType.RECOMMENDATION;
|
||||
if (hint) {
|
||||
return EntityType.HINT;
|
||||
}
|
||||
if (redactionLogEntry.isFalsePositive()) {
|
||||
return EntityType.FALSE_POSITIVE;
|
||||
}
|
||||
if (redactionLogEntry.isHint()) {
|
||||
return EntityType.HINT;
|
||||
}
|
||||
if (redactionLogEntry.isRecommendation()) {
|
||||
return EntityType.RECOMMENDATION;
|
||||
}
|
||||
return EntityType.ENTITY;
|
||||
}
|
||||
|
||||
@ -198,7 +203,6 @@ public final class MigrationEntity {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return manualChanges.stream()
|
||||
.filter(manualChange -> manualChange.getAnnotationStatus().equals(AnnotationStatus.APPROVED))
|
||||
.map(MigrationEntity::toEntityLogManualChanges)
|
||||
.toList();
|
||||
}
|
||||
|
||||
@ -2,11 +2,13 @@ package com.iqser.red.service.redaction.v1.server;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@ -15,7 +17,7 @@ import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -29,17 +31,22 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLogEntry;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.Position;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.migration.MigratedIds;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ManualRedactions;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileType;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.type.Type;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.Rectangle;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.RedactionLog;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.RedactionLogEntry;
|
||||
import com.iqser.red.service.redaction.v1.server.annotate.AnnotateRequest;
|
||||
import com.iqser.red.service.redaction.v1.server.annotate.AnnotateResponse;
|
||||
import com.iqser.red.service.redaction.v1.server.document.graph.BuildDocumentIntegrationTest;
|
||||
import com.iqser.red.service.redaction.v1.server.migration.LegacyRedactionLogMergeService;
|
||||
import com.iqser.red.service.redaction.v1.server.migration.RedactionLogToEntityLogMigrationService;
|
||||
import com.iqser.red.service.redaction.v1.server.model.MigratedEntityLog;
|
||||
import com.iqser.red.service.redaction.v1.server.model.document.nodes.Document;
|
||||
import com.iqser.red.service.redaction.v1.server.redaction.utils.OsUtils;
|
||||
import com.iqser.red.service.redaction.v1.server.migration.RedactionLogToEntityLogMigrationService;
|
||||
import com.iqser.red.service.redaction.v1.server.service.DictionaryService;
|
||||
import com.knecon.fforesight.tenantcommons.TenantContext;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
@ -52,9 +59,45 @@ public class MigrationIntegrationTest extends BuildDocumentIntegrationTest {
|
||||
@Autowired
|
||||
RedactionLogToEntityLogMigrationService redactionLogToEntityLogMigrationService;
|
||||
|
||||
@Autowired
|
||||
LegacyRedactionLogMergeService legacyRedactionLogMergeService;
|
||||
|
||||
@Autowired
|
||||
DictionaryService dictionaryService;
|
||||
|
||||
@Autowired
|
||||
ObjectMapper mapper;
|
||||
|
||||
private final String TEST_DOSSIER_TEMPLATE_ID = "123";
|
||||
|
||||
|
||||
@BeforeEach
|
||||
public void stubClients() {
|
||||
|
||||
TenantContext.setTenantId("redaction");
|
||||
|
||||
loadDictionaryForTest();
|
||||
loadTypeForTest();
|
||||
when(dictionaryClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(0L);
|
||||
when(dictionaryClient.getAllTypesForDossierTemplate(TEST_DOSSIER_TEMPLATE_ID, true)).thenReturn(getTypeResponse());
|
||||
|
||||
when(dictionaryClient.getVersion(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(0L);
|
||||
when(dictionaryClient.getAllTypesForDossier(TEST_DOSSIER_ID, true)).thenReturn(List.of(Type.builder()
|
||||
.id(DOSSIER_REDACTIONS_INDICATOR + ":" + TEST_DOSSIER_TEMPLATE_ID)
|
||||
.type(DOSSIER_REDACTIONS_INDICATOR)
|
||||
.dossierTemplateId(TEST_DOSSIER_ID)
|
||||
.hexColor("#ffe187")
|
||||
.isHint(hintTypeMap.get(DOSSIER_REDACTIONS_INDICATOR))
|
||||
.isCaseInsensitive(caseInSensitiveMap.get(DOSSIER_REDACTIONS_INDICATOR))
|
||||
.isRecommendation(recommendationTypeMap.get(DOSSIER_REDACTIONS_INDICATOR))
|
||||
.rank(rankTypeMap.get(DOSSIER_REDACTIONS_INDICATOR))
|
||||
.build()));
|
||||
|
||||
mockDictionaryCalls(null);
|
||||
|
||||
when(dictionaryClient.getColors(TEST_DOSSIER_TEMPLATE_ID)).thenReturn(colors);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
@ -77,33 +120,68 @@ public class MigrationIntegrationTest extends BuildDocumentIntegrationTest {
|
||||
@SneakyThrows
|
||||
public void testMigration() {
|
||||
|
||||
String filesPrefix = "files/migration/def8f960580f088b975ba806dfae1f87";
|
||||
String filesPrefix = "files/migration/178ee8cd99fe786e03fad50d51a69ad3";
|
||||
|
||||
String fileName = filesPrefix + ".ORIGIN.pdf";
|
||||
String imageFileName = filesPrefix + ".IMAGE_INFO.json";
|
||||
String tableFileName = filesPrefix + ".TABLES.json";
|
||||
String manualChangesFileName = filesPrefix + ".MANUAL_CHANGES.json";
|
||||
|
||||
Document document = buildGraph(fileName, imageFileName, tableFileName);
|
||||
RedactionLog redactionLog;
|
||||
RedactionLog mergedRedactionLog;
|
||||
|
||||
dictionaryService.updateDictionary(TEST_DOSSIER_TEMPLATE_ID, TEST_DOSSIER_ID);
|
||||
|
||||
try (var in = new ClassPathResource(filesPrefix + ".REDACTION_LOG.json").getInputStream()) {
|
||||
redactionLog = mapper.readValue(in, RedactionLog.class);
|
||||
}
|
||||
MigratedEntityLog migratedEntityLog = redactionLogToEntityLogMigrationService.migrate(redactionLog, document);
|
||||
var manualChangesResource = new ClassPathResource(manualChangesFileName);
|
||||
if (manualChangesResource.exists()) {
|
||||
ManualRedactions manualRedactions;
|
||||
try (var in = manualChangesResource.getInputStream()) {
|
||||
manualRedactions = mapper.readValue(in, ManualRedactions.class);
|
||||
if (manualRedactions.getEntriesToAdd() == null) {
|
||||
manualRedactions.setEntriesToAdd(Collections.emptySet());
|
||||
}
|
||||
if (manualRedactions.getForceRedactions() == null) {
|
||||
manualRedactions.setForceRedactions(Collections.emptySet());
|
||||
}
|
||||
if (manualRedactions.getIdsToRemove() == null) {
|
||||
manualRedactions.setIdsToRemove(Collections.emptySet());
|
||||
}
|
||||
if (manualRedactions.getLegalBasisChanges() == null) {
|
||||
manualRedactions.setLegalBasisChanges(Collections.emptySet());
|
||||
}
|
||||
if (manualRedactions.getRecategorizations() == null) {
|
||||
manualRedactions.setRecategorizations(Collections.emptySet());
|
||||
}
|
||||
if (manualRedactions.getResizeRedactions() == null) {
|
||||
manualRedactions.setResizeRedactions(Collections.emptySet());
|
||||
}
|
||||
}
|
||||
mergedRedactionLog = legacyRedactionLogMergeService.mergeManualChanges(redactionLog, manualRedactions, TEST_DOSSIER_TEMPLATE_ID);
|
||||
} else {
|
||||
mergedRedactionLog = redactionLog;
|
||||
}
|
||||
|
||||
MigratedEntityLog migratedEntityLog = redactionLogToEntityLogMigrationService.migrate(mergedRedactionLog, document, TEST_DOSSIER_TEMPLATE_ID);
|
||||
|
||||
redactionStorageService.storeObject(TEST_DOSSIER_ID, TEST_FILE_ID, FileType.ENTITY_LOG, migratedEntityLog.getEntityLog());
|
||||
assertEquals(redactionLog.getRedactionLogEntry().size(), migratedEntityLog.getEntityLog().getEntityLogEntry().size());
|
||||
assertEquals(redactionLog.getRedactionLogEntry().stream().filter(entry -> !entry.getManualChanges().isEmpty()).count(), migratedEntityLog.getMigratedIds().getMappings().size());
|
||||
assertEquals(mergedRedactionLog.getRedactionLogEntry().size(), migratedEntityLog.getEntityLog().getEntityLogEntry().size());
|
||||
assertEquals(mergedRedactionLog.getRedactionLogEntry().stream().filter(MigrationIntegrationTest::hasManualChanges).count(),
|
||||
migratedEntityLog.getMigratedIds().getMappings().size());
|
||||
EntityLog entityLog = migratedEntityLog.getEntityLog();
|
||||
assertEquals(redactionLog.getAnalysisNumber(), entityLog.getAnalysisNumber());
|
||||
assertEquals(redactionLog.getAnalysisVersion(), entityLog.getAnalysisVersion());
|
||||
assertEquals(redactionLog.getDictionaryVersion(), entityLog.getDictionaryVersion());
|
||||
assertEquals(redactionLog.getDossierDictionaryVersion(), entityLog.getDossierDictionaryVersion());
|
||||
assertEquals(redactionLog.getLegalBasisVersion(), entityLog.getLegalBasisVersion());
|
||||
assertEquals(redactionLog.getRulesVersion(), entityLog.getRulesVersion());
|
||||
assertEquals(redactionLog.getLegalBasis().size(), entityLog.getLegalBasis().size());
|
||||
assertEquals(mergedRedactionLog.getAnalysisNumber(), entityLog.getAnalysisNumber());
|
||||
assertEquals(mergedRedactionLog.getAnalysisVersion(), entityLog.getAnalysisVersion());
|
||||
assertEquals(mergedRedactionLog.getDictionaryVersion(), entityLog.getDictionaryVersion());
|
||||
assertEquals(mergedRedactionLog.getDossierDictionaryVersion(), entityLog.getDossierDictionaryVersion());
|
||||
assertEquals(mergedRedactionLog.getLegalBasisVersion(), entityLog.getLegalBasisVersion());
|
||||
assertEquals(mergedRedactionLog.getRulesVersion(), entityLog.getRulesVersion());
|
||||
assertEquals(mergedRedactionLog.getLegalBasis().size(), entityLog.getLegalBasis().size());
|
||||
|
||||
Map<String, String> migratedIds = migratedEntityLog.getMigratedIds().buildOldToNewMapping();
|
||||
migratedIds.forEach((oldId, newId) -> assertEntryIsEqual(oldId, newId, redactionLog, entityLog, migratedIds));
|
||||
migratedIds.forEach((oldId, newId) -> assertEntryIsEqual(oldId, newId, mergedRedactionLog, entityLog, migratedIds));
|
||||
|
||||
AnnotateResponse annotateResponse = annotationService.annotate(AnnotateRequest.builder().dossierId(TEST_DOSSIER_ID).fileId(TEST_FILE_ID).build());
|
||||
File outputFile = Path.of(OsUtils.getTemporaryDirectory()).resolve(Path.of(fileName.replaceAll(".pdf", "_MIGRATED.pdf")).getFileName()).toFile();
|
||||
@ -114,6 +192,12 @@ public class MigrationIntegrationTest extends BuildDocumentIntegrationTest {
|
||||
}
|
||||
|
||||
|
||||
private static boolean hasManualChanges(RedactionLogEntry entry) {
|
||||
|
||||
return !entry.getManualChanges().isEmpty() || (entry.getComments() != null && !entry.getComments().isEmpty());
|
||||
}
|
||||
|
||||
|
||||
private void assertEntryIsEqual(String oldId, String newId, RedactionLog redactionLog, EntityLog entityLog, Map<String, String> oldToNewMapping) {
|
||||
|
||||
RedactionLogEntry redactionLogEntry = redactionLog.getRedactionLogEntry().stream().filter(entry -> entry.getId().equals(oldId)).findAny().orElseThrow();
|
||||
@ -125,7 +209,7 @@ public class MigrationIntegrationTest extends BuildDocumentIntegrationTest {
|
||||
assertEquals(redactionLogEntry.getChanges().size(), entityLogEntry.getChanges().size());
|
||||
assertEquals(redactionLogEntry.getManualChanges().size(), entityLogEntry.getManualChanges().size());
|
||||
assertEquals(redactionLogEntry.getPositions().size(), entityLogEntry.getPositions().size());
|
||||
assertTrue(positionsAlmostEqual(redactionLogEntry.getPositions(), entityLogEntry.getPositions()));
|
||||
// assertTrue(positionsAlmostEqual(redactionLogEntry.getPositions(), entityLogEntry.getPositions()));
|
||||
assertEquals(redactionLogEntry.getColor(), entityLogEntry.getColor());
|
||||
assertEqualsNullSafe(redactionLogEntry.getLegalBasis(), entityLogEntry.getLegalBasis());
|
||||
assertEqualsNullSafe(redactionLogEntry.getReason(), entityLogEntry.getReason());
|
||||
|
||||
@ -33,7 +33,6 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLogEntry;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntryState;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntryType;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ManualRedactions;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.IdRemoval;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.common.JSONPrimitive;
|
||||
@ -208,7 +207,7 @@ public class RedactionAcceptanceTest extends AbstractRedactionIntegrationTest {
|
||||
|
||||
private static IdRemoval buildIdRemoval(String id) {
|
||||
|
||||
return IdRemoval.builder().annotationId(id).requestDate(OffsetDateTime.now()).status(AnnotationStatus.APPROVED).fileId(TEST_FILE_ID).build();
|
||||
return IdRemoval.builder().annotationId(id).requestDate(OffsetDateTime.now()).fileId(TEST_FILE_ID).build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -50,7 +50,6 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.RuleFileTyp
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLogEntry;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntryState;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntryType;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ManualRedactions;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.Rectangle;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.IdRemoval;
|
||||
@ -220,7 +219,6 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
.annotationId("c6be5277f5ee60dc3d83527798b7fe02")
|
||||
.value("Dr. Alan")
|
||||
.positions(List.of(new Rectangle(236.8f, 182.90005f, 40.584f, 12.642f, 7)))
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.updateDictionary(false)
|
||||
.build()))
|
||||
@ -343,7 +341,6 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
|
||||
var toRemove = IdRemoval.builder()
|
||||
.annotationId("c630599611e6e3db314518374bcf70f7")
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.user("test")
|
||||
.removeFromDictionary(false)
|
||||
.processedDate(OffsetDateTime.now())
|
||||
@ -633,7 +630,6 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
manualRedactions.setRecategorizations(Set.of(ManualRecategorization.builder()
|
||||
.annotationId("37eee3e9d589a5cc529bfec38c3ba479")
|
||||
.fileId("fileId")
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.type("signature")
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.build()));
|
||||
@ -689,7 +685,6 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
.add(IdRemoval.builder()
|
||||
.annotationId("308dab9015bfafd911568cffe0a7f7de")
|
||||
.fileId(TEST_FILE_ID)
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.requestDate(OffsetDateTime.of(2022, 05, 23, 8, 30, 07, 475479, ZoneOffset.UTC))
|
||||
.processedDate(OffsetDateTime.of(2022, 05, 23, 8, 30, 07, 483651, ZoneOffset.UTC))
|
||||
.build());
|
||||
@ -698,7 +693,6 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
.add(ManualForceRedaction.builder()
|
||||
.annotationId("0b56ea1a87c83f351df177315af94f0d")
|
||||
.fileId(TEST_FILE_ID)
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.legalBasis("Something")
|
||||
.requestDate(OffsetDateTime.of(2022, 05, 23, 9, 30, 15, 4653, ZoneOffset.UTC))
|
||||
.processedDate(OffsetDateTime.of(2022, 05, 23, 9, 30, 15, 794, ZoneOffset.UTC))
|
||||
@ -708,7 +702,6 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
.add(IdRemoval.builder()
|
||||
.annotationId("0b56ea1a87c83f351df177315af94f0d")
|
||||
.fileId(TEST_FILE_ID)
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.requestDate(OffsetDateTime.of(2022, 05, 23, 8, 30, 23, 961721, ZoneOffset.UTC))
|
||||
.processedDate(OffsetDateTime.of(2022, 05, 23, 8, 30, 23, 96528, ZoneOffset.UTC))
|
||||
.build());
|
||||
@ -921,7 +914,6 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
ManualResizeRedaction manualResizeRedaction = ManualResizeRedaction.builder()
|
||||
.annotationId("ca2b437e2480a4b5966cb8386020d454")
|
||||
.fileId(TEST_FILE_ID)
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.requestDate(OffsetDateTime.of(2022, 05, 23, 8, 30, 07, 475479, ZoneOffset.UTC))
|
||||
.processedDate(OffsetDateTime.of(2022, 05, 23, 8, 30, 07, 483651, ZoneOffset.UTC))
|
||||
.value("Bera P")
|
||||
@ -1015,7 +1007,6 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
manualRedactions.setIdsToRemove(Set.of(IdRemoval.builder()
|
||||
.annotationId("5b940b2cb401ed9f5be6fc24f6e77bcf")
|
||||
.fileId("fileId")
|
||||
.status(AnnotationStatus.DECLINED)
|
||||
.processedDate(OffsetDateTime.now())
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.build()));
|
||||
@ -1023,15 +1014,13 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
.annotationId("675eba69b0c2917de55462c817adaa05")
|
||||
.fileId("fileId")
|
||||
.legalBasis("Something")
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.processedDate(OffsetDateTime.now())
|
||||
.build()));
|
||||
|
||||
ManualRedactionEntry manualRedactionEntry = new ManualRedactionEntry();
|
||||
manualRedactionEntry.setAnnotationId(manualAddId);
|
||||
manualRedactionEntry.setFileId("fileId");
|
||||
manualRedactionEntry.setStatus(AnnotationStatus.APPROVED);
|
||||
manualRedactionEntry.setType("CBI_author");
|
||||
manualRedactionEntry.setValue("O'Loughlin C.K.");
|
||||
manualRedactionEntry.setReason("Manual Redaction");
|
||||
@ -1051,16 +1040,14 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
manualRedactions.setIdsToRemove(Set.of(IdRemoval.builder()
|
||||
.annotationId("5b940b2cb401ed9f5be6fc24f6e77bcf")
|
||||
.fileId("fileId")
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.processedDate(OffsetDateTime.now())
|
||||
.build()));
|
||||
manualRedactions.setLegalBasisChanges((Set.of(ManualLegalBasisChange.builder()
|
||||
.annotationId("675eba69b0c2917de55462c817adaa05")
|
||||
.fileId("fileId")
|
||||
.legalBasis("Manual Legal Basis Change")
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.processedDate(OffsetDateTime.now())
|
||||
.processedDate(OffsetDateTime.now())
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.build())));
|
||||
manualRedactions.setResizeRedactions(Set.of(ManualResizeRedaction.builder()
|
||||
@ -1073,8 +1060,7 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
Rectangle.builder().topLeftX(298.67056f).topLeftY(327.567f).width(7.648041f).height(75.32377f).page(1).build(),
|
||||
Rectangle.builder().topLeftX(307.89517f).topLeftY(327.567f).width(7.648041f).height(61.670967f).page(1).build(),
|
||||
Rectangle.builder().topLeftX(316.99985f).topLeftY(327.567f).width(7.648041f).height(38.104286f).page(1).build()))
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.updateDictionary(false)
|
||||
.updateDictionary(false)
|
||||
.build()));
|
||||
|
||||
analyzeService.reanalyze(request);
|
||||
@ -1207,8 +1193,7 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
.section("[19, 2]: Paragraph: Contact point: LexCo Contact:")
|
||||
.value("0049 331 441 551 14")
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.fileId(TEST_FILE_ID)
|
||||
.fileId(TEST_FILE_ID)
|
||||
.legalBasis("Article 39(e)(2) of Regulation (EC) No 178/2002")
|
||||
.build()))
|
||||
.build());
|
||||
@ -1245,16 +1230,14 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
.section("[19, 2]: Paragraph: Contact point: LexCo Contact:")
|
||||
.value("0049 331 441 551 14")
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.fileId(TEST_FILE_ID)
|
||||
.fileId(TEST_FILE_ID)
|
||||
.legalBasis("Article 39(e)(2) of Regulation (EC) No 178/2002")
|
||||
.build()))
|
||||
.recategorizations(Set.of(ManualRecategorization.builder()
|
||||
.annotationId("3029651d0842a625f2d23f8375c23600")
|
||||
.type("CBI_author")
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.fileId(TEST_FILE_ID)
|
||||
.fileId(TEST_FILE_ID)
|
||||
.build()))
|
||||
.build());
|
||||
|
||||
@ -1355,8 +1338,7 @@ public class RedactionIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
.annotationId(id)
|
||||
.removeFromAllDossiers(false)
|
||||
.removeFromDictionary(false)
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@ -23,10 +24,12 @@ import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationHighlight;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.google.common.primitives.Floats;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.Change;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLog;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLogEntry;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntryState;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntryType;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.ManualChange;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.Position;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileType;
|
||||
import com.iqser.red.service.redaction.v1.server.storage.RedactionStorageService;
|
||||
@ -145,12 +148,30 @@ public class AnnotationService {
|
||||
PDRectangle pdRectangle = toPDRectangleBBox(rectangles);
|
||||
annotation.setRectangle(pdRectangle);
|
||||
annotation.setQuadPoints(Floats.toArray(toQuadPoints(rectangles)));
|
||||
if (!(redactionLogEntry.getEntryType().equals(EntryType.HINT) || redactionLogEntry.getState().equals(EntryState.IGNORED))) {
|
||||
annotation.setContents(redactionLogEntry.getValue() + " " + createAnnotationContent(redactionLogEntry));
|
||||
}
|
||||
annotation.setTitlePopup(redactionLogEntry.getId());
|
||||
annotation.setContents(redactionLogEntry.getValue() + " " + createAnnotationContent(redactionLogEntry));
|
||||
annotation.setTitlePopup(redactionLogEntry.getEntryType().name() + ":" + redactionLogEntry.getState().name() + ":" + redactionLogEntry.getId());
|
||||
annotation.setAnnotationName(redactionLogEntry.getId());
|
||||
annotation.setColor(new PDColor(redactionLogEntry.getColor(), PDDeviceRGB.INSTANCE));
|
||||
float[] color;
|
||||
if (redactionLogEntry.getEntryType().equals(EntryType.RECOMMENDATION)) {
|
||||
color = new float[]{0, 0.8f, 0};
|
||||
} else if ((redactionLogEntry.getEntryType().equals(EntryType.ENTITY) || redactionLogEntry.getEntryType().equals(EntryType.IMAGE)) &&//
|
||||
redactionLogEntry.getState().equals(EntryState.APPLIED)) {
|
||||
color = new float[]{0.5764706f, 0.59607846f, 0.627451f};
|
||||
} else if ((redactionLogEntry.getEntryType().equals(EntryType.ENTITY) || redactionLogEntry.getEntryType().equals(EntryType.IMAGE)) &&//
|
||||
redactionLogEntry.getState().equals(EntryState.SKIPPED)) {
|
||||
color = new float[]{0.76862746f, 0.59607846f, 0.98039216f};
|
||||
} else if (redactionLogEntry.getEntryType().equals(EntryType.HINT) && redactionLogEntry.getState().equals(EntryState.SKIPPED) && redactionLogEntry.getType().equals("published_information")) {
|
||||
color = new float[]{0.52156866f, 0.92156863f, 1.0f};
|
||||
} else if (redactionLogEntry.getEntryType().equals(EntryType.HINT) && redactionLogEntry.getState().equals(EntryState.SKIPPED)) {
|
||||
color = new float[]{0.98039216f, 0.59607846f, 0.96862745f};
|
||||
} else if (redactionLogEntry.getEntryType().equals(EntryType.HINT) && redactionLogEntry.getState().equals(EntryState.IGNORED)) {
|
||||
color = new float[]{0.76862746f, 0.59607846f, 0.98039216f};
|
||||
} else if (redactionLogEntry.getState().equals(EntryState.APPLIED)){
|
||||
color = Optional.ofNullable(redactionLogEntry.getColor()).orElse(new float[]{0.5764706f, 0.59607846f, 0.627451f});
|
||||
} else {
|
||||
color = Optional.ofNullable(redactionLogEntry.getColor()).orElse(new float[]{0.76862746f, 0.59607846f, 0.98039216f});
|
||||
}
|
||||
annotation.setColor(new PDColor(color, PDDeviceRGB.INSTANCE));
|
||||
annotation.setNoRotate(false);
|
||||
annotations.add(annotation);
|
||||
|
||||
@ -196,7 +217,13 @@ public class AnnotationService {
|
||||
|
||||
private String createAnnotationContent(EntityLogEntry redactionLogEntry) {
|
||||
|
||||
return redactionLogEntry.getType() + " \nRule " + redactionLogEntry.getMatchedRule() + " matched\n\n" + redactionLogEntry.getReason() + "\n\nLegal basis:" + redactionLogEntry.getLegalBasis() + "\n\nIn section: \"" + redactionLogEntry.getSection() + "\"";
|
||||
return redactionLogEntry.getType() +//
|
||||
" \nRule " + redactionLogEntry.getMatchedRule() +//
|
||||
" matched\n\n" + redactionLogEntry.getReason() +//
|
||||
"\n\nLegal basis:" + redactionLogEntry.getLegalBasis() +//
|
||||
"\n\nIn section: \"" + redactionLogEntry.getSection() + "\"" +//
|
||||
"\n\nChanges: " + redactionLogEntry.getChanges().stream().map(Change::getType).map(Enum::name).collect(Collectors.joining("\n")) +//
|
||||
"\n\nManualChanges: " + redactionLogEntry.getManualChanges().stream().map(ManualChange::getManualRedactionType).map(Enum::name).collect(Collectors.joining("\n"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -40,7 +40,6 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLogEntry;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntryState;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.ManualRedactionType;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ManualRedactions;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.Rectangle;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.IdRemoval;
|
||||
@ -177,8 +176,7 @@ public class ManualChangesEnd2EndTest extends AbstractRedactionIntegrationTest {
|
||||
.value(expandedEntityKeyword)
|
||||
.positions(resizedPositions)
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.updateDictionary(false)
|
||||
.updateDictionary(false)
|
||||
.build();
|
||||
manualResizeRedaction.setUpdateDictionary(false);
|
||||
ManualRedactions manualRedactions = new ManualRedactions();
|
||||
@ -222,18 +220,17 @@ public class ManualChangesEnd2EndTest extends AbstractRedactionIntegrationTest {
|
||||
|
||||
String manualAddId = UUID.randomUUID().toString();
|
||||
|
||||
manualRedactions.setIdsToRemove(Set.of(IdRemoval.builder().annotationId("5b940b2cb401ed9f5be6fc24f6e77bcf").fileId("fileId").status(AnnotationStatus.DECLINED).build()));
|
||||
manualRedactions.setIdsToRemove(Set.of(IdRemoval.builder().annotationId("5b940b2cb401ed9f5be6fc24f6e77bcf").fileId("fileId").build()));
|
||||
manualRedactions.setForceRedactions(Set.of(ManualForceRedaction.builder()
|
||||
.annotationId("675eba69b0c2917de55462c817adaa05")
|
||||
.fileId("fileId")
|
||||
.legalBasis("Something")
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.build()));
|
||||
.build()));
|
||||
|
||||
ManualRedactionEntry manualRedactionEntry = new ManualRedactionEntry();
|
||||
manualRedactionEntry.setAnnotationId(manualAddId);
|
||||
manualRedactionEntry.setFileId("fileId");
|
||||
manualRedactionEntry.setStatus(AnnotationStatus.REQUESTED);
|
||||
|
||||
manualRedactionEntry.setType("name");
|
||||
manualRedactionEntry.setValue("O'Loughlin C.K.");
|
||||
manualRedactionEntry.setReason("Manual Redaction");
|
||||
@ -246,13 +243,12 @@ public class ManualChangesEnd2EndTest extends AbstractRedactionIntegrationTest {
|
||||
AnalyzeResult result = analyzeService.analyze(request);
|
||||
|
||||
manualRedactions.getEntriesToAdd().add(manualRedactionEntry);
|
||||
manualRedactions.setIdsToRemove(Set.of(IdRemoval.builder().annotationId("5b940b2cb401ed9f5be6fc24f6e77bcf").fileId("fileId").status(AnnotationStatus.APPROVED).build()));
|
||||
manualRedactions.setIdsToRemove(Set.of(IdRemoval.builder().annotationId("5b940b2cb401ed9f5be6fc24f6e77bcf").fileId("fileId").build()));
|
||||
manualRedactions.setLegalBasisChanges((Set.of(ManualLegalBasisChange.builder()
|
||||
.annotationId("675eba69b0c2917de55462c817adaa05")
|
||||
.fileId("fileId")
|
||||
.legalBasis("Manual Legal Basis Change")
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.build())));
|
||||
|
||||
analyzeService.reanalyze(request);
|
||||
@ -300,8 +296,7 @@ public class ManualChangesEnd2EndTest extends AbstractRedactionIntegrationTest {
|
||||
|
||||
ManualRecategorization recategorization = ManualRecategorization.builder()
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.type("vertebrate")
|
||||
.type("vertebrate")
|
||||
.annotationId(oxfordUniversityPress.getId())
|
||||
.fileId(TEST_FILE_ID)
|
||||
.build();
|
||||
@ -355,15 +350,13 @@ public class ManualChangesEnd2EndTest extends AbstractRedactionIntegrationTest {
|
||||
new Rectangle(new Point(56.8f, 496.27f), 61.25f, 12.83f, 2), //
|
||||
new Rectangle(new Point(56.8f, 482.26f), 303.804f, 15.408f, 2), //
|
||||
new Rectangle(new Point(56.8f, 468.464f), 314.496f, 15.408f, 2))) //
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.build()));
|
||||
.build()));
|
||||
ManualResizeRedaction manualResizeRedaction = ManualResizeRedaction.builder()
|
||||
.annotationId(annotationId)
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.value("Expand to Hint")
|
||||
.positions(List.of(new Rectangle(new Point(56.8f, 496.27f), 61.25f, 12.83f, 2)))
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.updateDictionary(false)
|
||||
.updateDictionary(false)
|
||||
.build();
|
||||
manualRedactions.setResizeRedactions(Set.of(manualResizeRedaction));
|
||||
request.setManualRedactions(manualRedactions);
|
||||
|
||||
@ -13,7 +13,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.Rectangle;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.IdRemoval;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualForceRedaction;
|
||||
@ -43,7 +42,6 @@ public class ManualChangesIntegrationTest extends RulesIntegrationTest {
|
||||
.annotationId(initialId)
|
||||
.value(biggerEntity.getValue())
|
||||
.positions(toAnnotationRectangles(biggerEntity.getPositionsOnPagePerPage().get(0)))
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.updateDictionary(false)
|
||||
.build();
|
||||
@ -70,12 +68,7 @@ public class ManualChangesIntegrationTest extends RulesIntegrationTest {
|
||||
TextEntity entity = entities.stream().filter(e -> e.getPages().stream().anyMatch(p -> p.getNumber() == 1)).findFirst().get();
|
||||
|
||||
String initialId = entity.getPositionsOnPagePerPage().get(0).getId();
|
||||
ManualForceRedaction manualForceRedaction = ManualForceRedaction.builder()
|
||||
.annotationId(initialId)
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.legalBasis("Something")
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.build();
|
||||
ManualForceRedaction manualForceRedaction = ManualForceRedaction.builder().annotationId(initialId).legalBasis("Something").requestDate(OffsetDateTime.now()).build();
|
||||
|
||||
doAnalysis(document, List.of(manualForceRedaction));
|
||||
|
||||
@ -100,7 +93,7 @@ public class ManualChangesIntegrationTest extends RulesIntegrationTest {
|
||||
TextEntity entity = entities.stream().filter(e -> e.getPages().stream().anyMatch(p -> p.getNumber() == 1)).findFirst().get();
|
||||
|
||||
String initialId = entity.getPositionsOnPagePerPage().get(0).getId();
|
||||
IdRemoval idRemoval = IdRemoval.builder().annotationId(initialId).status(AnnotationStatus.APPROVED).requestDate(OffsetDateTime.now()).build();
|
||||
IdRemoval idRemoval = IdRemoval.builder().annotationId(initialId).requestDate(OffsetDateTime.now()).build();
|
||||
|
||||
doAnalysis(document, List.of(idRemoval));
|
||||
|
||||
@ -119,13 +112,8 @@ public class ManualChangesIntegrationTest extends RulesIntegrationTest {
|
||||
TextEntity entity = entities.stream().filter(e -> e.getPages().stream().anyMatch(p -> p.getNumber() == 1)).findFirst().get();
|
||||
|
||||
String initialId = entity.getPositionsOnPagePerPage().get(0).getId();
|
||||
IdRemoval idRemoval = IdRemoval.builder().annotationId(initialId).status(AnnotationStatus.APPROVED).requestDate(OffsetDateTime.now()).build();
|
||||
ManualForceRedaction manualForceRedaction = ManualForceRedaction.builder()
|
||||
.annotationId(initialId)
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.legalBasis("Something")
|
||||
.requestDate(OffsetDateTime.now())
|
||||
.build();
|
||||
IdRemoval idRemoval = IdRemoval.builder().annotationId(initialId).requestDate(OffsetDateTime.now()).build();
|
||||
ManualForceRedaction manualForceRedaction = ManualForceRedaction.builder().annotationId(initialId).legalBasis("Something").requestDate(OffsetDateTime.now()).build();
|
||||
|
||||
doAnalysis(document, List.of(manualForceRedaction));
|
||||
|
||||
@ -139,29 +127,6 @@ public class ManualChangesIntegrationTest extends RulesIntegrationTest {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void manualIDRemovalNotApprovedTest() {
|
||||
|
||||
Document document = buildGraph("files/new/crafted document");
|
||||
Set<TextEntity> entities = entityCreationService.byString("David Ksenia", "CBI_author", EntityType.ENTITY, document).collect(Collectors.toUnmodifiableSet());
|
||||
|
||||
TextEntity entity = entities.stream().filter(e -> e.getPages().stream().anyMatch(p -> p.getNumber() == 1)).findFirst().get();
|
||||
|
||||
String initialId = entity.getPositionsOnPagePerPage().get(0).getId();
|
||||
IdRemoval idRemoval = IdRemoval.builder().annotationId(initialId).status(AnnotationStatus.REQUESTED).build();
|
||||
|
||||
doAnalysis(document, List.of(idRemoval));
|
||||
|
||||
assertEquals(Paragraph.class, entity.getDeepestFullyContainingNode().getClass());
|
||||
assertFalse(entity.getIntersectingNodes().isEmpty());
|
||||
assertEquals(1, entity.getPages().size());
|
||||
assertEquals("David Ksenia", entity.getValue());
|
||||
assertEquals(initialId, entity.getPositionsOnPagePerPage().get(0).getId());
|
||||
assertFalse(entity.ignored());
|
||||
assertFalse(entity.removed());
|
||||
}
|
||||
|
||||
|
||||
private void assertRectanglesAlmostEqual(Collection<Rectangle2D> rects1, Collection<Rectangle2D> rects2) {
|
||||
|
||||
if (rects1.stream().allMatch(rect1 -> rects2.stream().anyMatch(rect2 -> rectanglesAlmostEqual(rect1, rect2)))) {
|
||||
|
||||
@ -11,11 +11,10 @@ import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.IdRemoval;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualForceRedaction;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualRecategorization;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualLegalBasisChange;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualRecategorization;
|
||||
import com.iqser.red.service.redaction.v1.server.document.graph.BuildDocumentIntegrationTest;
|
||||
import com.iqser.red.service.redaction.v1.server.model.document.entity.EntityType;
|
||||
import com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity;
|
||||
@ -56,7 +55,7 @@ public class ManualChangesUnitTest extends BuildDocumentIntegrationTest {
|
||||
String annotationId = entity.getPositionsOnPagePerPage().get(0).getId();
|
||||
|
||||
// remove first
|
||||
IdRemoval removal = IdRemoval.builder().requestDate(start).fileId(TEST_FILE_ID).annotationId(annotationId).status(AnnotationStatus.APPROVED).build();
|
||||
IdRemoval removal = IdRemoval.builder().requestDate(start).fileId(TEST_FILE_ID).annotationId(annotationId).build();
|
||||
entity.getManualOverwrite().addChange(removal);
|
||||
assertTrue(entity.ignored());
|
||||
assertFalse(entity.applied());
|
||||
@ -68,7 +67,6 @@ public class ManualChangesUnitTest extends BuildDocumentIntegrationTest {
|
||||
.fileId(TEST_FILE_ID)
|
||||
.annotationId(annotationId)
|
||||
.legalBasis("coolio")
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.build();
|
||||
entity.getManualOverwrite().addChange(forceRedaction);
|
||||
assertTrue(entity.applied());
|
||||
@ -78,7 +76,7 @@ public class ManualChangesUnitTest extends BuildDocumentIntegrationTest {
|
||||
assertEquals("coolio", entity.getManualOverwrite().getLegalBasis().orElse(entity.getMatchedRule().getLegalBasis()));
|
||||
|
||||
// remove again
|
||||
IdRemoval removal2 = IdRemoval.builder().requestDate(start.plusSeconds(3)).fileId(TEST_FILE_ID).annotationId(annotationId).status(AnnotationStatus.APPROVED).build();
|
||||
IdRemoval removal2 = IdRemoval.builder().requestDate(start.plusSeconds(3)).fileId(TEST_FILE_ID).annotationId(annotationId).build();
|
||||
entity.getManualOverwrite().addChange(removal2);
|
||||
assertTrue(entity.ignored());
|
||||
assertFalse(entity.applied());
|
||||
@ -90,7 +88,6 @@ public class ManualChangesUnitTest extends BuildDocumentIntegrationTest {
|
||||
.fileId(TEST_FILE_ID)
|
||||
.annotationId(annotationId)
|
||||
.legalBasis("coolio")
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.build();
|
||||
entity.getManualOverwrite().addChange(forceRedaction2);
|
||||
assertTrue(entity.ignored());
|
||||
@ -106,7 +103,6 @@ public class ManualChangesUnitTest extends BuildDocumentIntegrationTest {
|
||||
.annotationId(annotationId)
|
||||
.requestDate(start.plusSeconds(4))
|
||||
.section(section)
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.user("peter")
|
||||
.value(value)
|
||||
.build();
|
||||
@ -119,18 +115,14 @@ public class ManualChangesUnitTest extends BuildDocumentIntegrationTest {
|
||||
assertEquals(legalBasis, entity.getManualOverwrite().getLegalBasis().orElse(entity.getMatchedRule().getLegalBasis()));
|
||||
assertEquals(section, entity.getManualOverwrite().getSection().orElse(entity.getDeepestFullyContainingNode().toString()));
|
||||
|
||||
ManualRecategorization imageRecategorizationRequest = ManualRecategorization.builder()
|
||||
.type("type")
|
||||
.requestDate(start.plusSeconds(5))
|
||||
.annotationId(annotationId)
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.build();
|
||||
ManualRecategorization imageRecategorizationRequest = ManualRecategorization.builder().type("type").requestDate(start.plusSeconds(5)).annotationId(annotationId).build();
|
||||
entity.getManualOverwrite().addChange(imageRecategorizationRequest);
|
||||
assertTrue(entity.getManualOverwrite().getRecategorized().isPresent());
|
||||
assertTrue(entity.getManualOverwrite().getRecategorized().get());
|
||||
assertEquals("type", entity.getManualOverwrite().getType().orElse(entity.getType()));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testRemoveHintForceHint() {
|
||||
|
||||
@ -149,7 +141,7 @@ public class ManualChangesUnitTest extends BuildDocumentIntegrationTest {
|
||||
String annotationId = entity.getPositionsOnPagePerPage().get(0).getId();
|
||||
|
||||
// remove first
|
||||
IdRemoval removal = IdRemoval.builder().requestDate(start).fileId(TEST_FILE_ID).annotationId(annotationId).status(AnnotationStatus.APPROVED).build();
|
||||
IdRemoval removal = IdRemoval.builder().requestDate(start).fileId(TEST_FILE_ID).annotationId(annotationId).build();
|
||||
entity.getManualOverwrite().addChange(removal);
|
||||
assertTrue(entity.ignored());
|
||||
assertFalse(entity.applied());
|
||||
@ -161,7 +153,6 @@ public class ManualChangesUnitTest extends BuildDocumentIntegrationTest {
|
||||
.fileId(TEST_FILE_ID)
|
||||
.annotationId(annotationId)
|
||||
.legalBasis("coolio")
|
||||
.status(AnnotationStatus.APPROVED)
|
||||
.build();
|
||||
entity.getManualOverwrite().addChange(forceRedaction);
|
||||
assertFalse(entity.applied());
|
||||
|
||||
@ -392,7 +392,6 @@ public class UnprocessedChangesServiceTest extends AbstractRedactionIntegrationT
|
||||
ManualRedactionEntry manualRedactionEntry = new ManualRedactionEntry();
|
||||
manualRedactionEntry.setAnnotationId(id);
|
||||
manualRedactionEntry.setFileId("fileId");
|
||||
manualRedactionEntry.setStatus(AnnotationStatus.APPROVED);
|
||||
manualRedactionEntry.setType("CBI_author");
|
||||
manualRedactionEntry.setValue(value);
|
||||
manualRedactionEntry.setReason("Manual Redaction");
|
||||
|
||||
@ -53,7 +53,6 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualForceRedaction;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualRecategorization;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualLegalBasisChange;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
|
||||
global Document document
|
||||
global EntityCreationService entityCreationService
|
||||
@ -730,7 +729,7 @@ rule "AI.1.0: Combine and add NER Entities as CBI_address"
|
||||
rule "MAN.0.0: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$entityToBeResized: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
@ -743,7 +742,7 @@ rule "MAN.0.0: Apply manual resize redaction"
|
||||
rule "MAN.0.1: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$imageToBeResized: Image(id == $id)
|
||||
then
|
||||
@ -758,7 +757,7 @@ rule "MAN.0.1: Apply manual resize redaction"
|
||||
rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to Entity"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers)
|
||||
$entityToBeRemoved: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -770,7 +769,7 @@ rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to Image"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId)
|
||||
$imageEntityToBeRemoved: Image($id == id)
|
||||
then
|
||||
$imageEntityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -784,7 +783,7 @@ rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.2.0: Apply force redaction"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$entityToForce: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToForce.getManualOverwrite().addChange($force);
|
||||
@ -796,7 +795,7 @@ rule "MAN.2.0: Apply force redaction"
|
||||
rule "MAN.2.1: Apply force redaction to images"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$imageToForce: Image(id == $id)
|
||||
then
|
||||
$imageToForce.getManualOverwrite().addChange($force);
|
||||
@ -810,7 +809,7 @@ rule "MAN.2.1: Apply force redaction to images"
|
||||
rule "MAN.3.0: Apply entity recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type != $type)
|
||||
then
|
||||
@ -824,7 +823,7 @@ rule "MAN.3.0: Apply entity recategorization"
|
||||
rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type == $type)
|
||||
then
|
||||
@ -835,7 +834,7 @@ rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
rule "MAN.3.2: Apply image recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
@ -858,7 +857,7 @@ rule "MAN.3.3: Apply recategorization entities by default"
|
||||
rule "MAN.4.0: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
$imageToBeRecategorized.getManualOverwrite().addChange($legalBasisChange);
|
||||
@ -869,7 +868,7 @@ rule "MAN.4.0: Apply legal basis change"
|
||||
rule "MAN.4.1: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$entityToBeChanged: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeChanged.getManualOverwrite().addChange($legalBasisChange);
|
||||
|
||||
@ -53,7 +53,6 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualForceRedaction;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualRecategorization;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualLegalBasisChange;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
|
||||
global Document document
|
||||
global EntityCreationService entityCreationService
|
||||
@ -1300,7 +1299,7 @@ rule "AI.3.0: Recommend authors from AI as PII"
|
||||
rule "MAN.0.0: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$entityToBeResized: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
@ -1313,7 +1312,7 @@ rule "MAN.0.0: Apply manual resize redaction"
|
||||
rule "MAN.0.1: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$imageToBeResized: Image(id == $id)
|
||||
then
|
||||
@ -1328,7 +1327,7 @@ rule "MAN.0.1: Apply manual resize redaction"
|
||||
rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to Entity"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers)
|
||||
$entityToBeRemoved: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -1340,7 +1339,7 @@ rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to Image"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId)
|
||||
$imageEntityToBeRemoved: Image($id == id)
|
||||
then
|
||||
$imageEntityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -1354,7 +1353,7 @@ rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.2.0: Apply force redaction"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$entityToForce: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToForce.getManualOverwrite().addChange($force);
|
||||
@ -1366,7 +1365,7 @@ rule "MAN.2.0: Apply force redaction"
|
||||
rule "MAN.2.1: Apply force redaction to images"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$imageToForce: Image(id == $id)
|
||||
then
|
||||
$imageToForce.getManualOverwrite().addChange($force);
|
||||
@ -1380,7 +1379,7 @@ rule "MAN.2.1: Apply force redaction to images"
|
||||
rule "MAN.3.0: Apply entity recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type != $type)
|
||||
then
|
||||
@ -1394,7 +1393,7 @@ rule "MAN.3.0: Apply entity recategorization"
|
||||
rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type == $type)
|
||||
then
|
||||
@ -1405,7 +1404,7 @@ rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
rule "MAN.3.2: Apply image recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
@ -1428,7 +1427,7 @@ rule "MAN.3.3: Apply recategorization entities by default"
|
||||
rule "MAN.4.0: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
$imageToBeRecategorized.getManualOverwrite().addChange($legalBasisChange);
|
||||
@ -1439,7 +1438,7 @@ rule "MAN.4.0: Apply legal basis change"
|
||||
rule "MAN.4.1: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$entityToBeChanged: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeChanged.getManualOverwrite().addChange($legalBasisChange);
|
||||
|
||||
@ -53,7 +53,6 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualForceRedaction;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualRecategorization;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualLegalBasisChange;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
|
||||
global Document document
|
||||
global EntityCreationService entityCreationService
|
||||
@ -1158,7 +1157,7 @@ rule "DOC.35.0: Doses (mg/kg bodyweight)"
|
||||
rule "MAN.0.0: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$entityToBeResized: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
@ -1171,7 +1170,7 @@ rule "MAN.0.0: Apply manual resize redaction"
|
||||
rule "MAN.0.1: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$imageToBeResized: Image(id == $id)
|
||||
then
|
||||
@ -1186,7 +1185,7 @@ rule "MAN.0.1: Apply manual resize redaction"
|
||||
rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to Entity"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers)
|
||||
$entityToBeRemoved: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -1198,7 +1197,7 @@ rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to Image"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId)
|
||||
$imageEntityToBeRemoved: Image($id == id)
|
||||
then
|
||||
$imageEntityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -1212,7 +1211,7 @@ rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.2.0: Apply force redaction"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$entityToForce: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToForce.getManualOverwrite().addChange($force);
|
||||
@ -1224,7 +1223,7 @@ rule "MAN.2.0: Apply force redaction"
|
||||
rule "MAN.2.1: Apply force redaction to images"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$imageToForce: Image(id == $id)
|
||||
then
|
||||
$imageToForce.getManualOverwrite().addChange($force);
|
||||
@ -1238,7 +1237,7 @@ rule "MAN.2.1: Apply force redaction to images"
|
||||
rule "MAN.3.0: Apply entity recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type != $type)
|
||||
then
|
||||
@ -1252,7 +1251,7 @@ rule "MAN.3.0: Apply entity recategorization"
|
||||
rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type == $type)
|
||||
then
|
||||
@ -1263,7 +1262,7 @@ rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
rule "MAN.3.2: Apply image recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
@ -1286,7 +1285,7 @@ rule "MAN.3.3: Apply recategorization entities by default"
|
||||
rule "MAN.4.0: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
$imageToBeRecategorized.getManualOverwrite().addChange($legalBasisChange);
|
||||
@ -1297,7 +1296,7 @@ rule "MAN.4.0: Apply legal basis change"
|
||||
rule "MAN.4.1: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$entityToBeChanged: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeChanged.getManualOverwrite().addChange($legalBasisChange);
|
||||
|
||||
@ -53,7 +53,6 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualForceRedaction;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualRecategorization;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualLegalBasisChange;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
|
||||
global Document document
|
||||
global EntityCreationService entityCreationService
|
||||
@ -72,7 +71,7 @@ query "getFileAttributes"
|
||||
rule "MAN.0.0: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$entityToBeResized: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
@ -85,7 +84,7 @@ rule "MAN.0.0: Apply manual resize redaction"
|
||||
rule "MAN.0.1: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$imageToBeResized: Image(id == $id)
|
||||
then
|
||||
@ -100,7 +99,7 @@ rule "MAN.0.1: Apply manual resize redaction"
|
||||
rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to Entity"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers)
|
||||
$entityToBeRemoved: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -112,7 +111,7 @@ rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to Image"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId)
|
||||
$imageEntityToBeRemoved: Image($id == id)
|
||||
then
|
||||
$imageEntityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -126,7 +125,7 @@ rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.2.0: Apply force redaction"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$entityToForce: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToForce.getManualOverwrite().addChange($force);
|
||||
@ -138,7 +137,7 @@ rule "MAN.2.0: Apply force redaction"
|
||||
rule "MAN.2.1: Apply force redaction to images"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$imageToForce: Image(id == $id)
|
||||
then
|
||||
$imageToForce.getManualOverwrite().addChange($force);
|
||||
@ -152,7 +151,7 @@ rule "MAN.2.1: Apply force redaction to images"
|
||||
rule "MAN.3.0: Apply entity recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type != $type)
|
||||
then
|
||||
@ -166,7 +165,7 @@ rule "MAN.3.0: Apply entity recategorization"
|
||||
rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type == $type)
|
||||
then
|
||||
@ -177,7 +176,7 @@ rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
rule "MAN.3.2: Apply image recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
@ -200,7 +199,7 @@ rule "MAN.3.3: Apply recategorization entities by default"
|
||||
rule "MAN.4.0: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
$imageToBeRecategorized.getManualOverwrite().addChange($legalBasisChange);
|
||||
@ -211,7 +210,7 @@ rule "MAN.4.0: Apply legal basis change"
|
||||
rule "MAN.4.1: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$entityToBeChanged: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeChanged.getManualOverwrite().addChange($legalBasisChange);
|
||||
|
||||
@ -53,7 +53,6 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualForceRedaction;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualRecategorization;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualLegalBasisChange;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
|
||||
global Document document
|
||||
global EntityCreationService entityCreationService
|
||||
@ -890,7 +889,7 @@ rule "AI.1.0: Combine and add NER Entities as CBI_address"
|
||||
rule "MAN.0.0: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$entityToBeResized: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
@ -903,7 +902,7 @@ rule "MAN.0.0: Apply manual resize redaction"
|
||||
rule "MAN.0.1: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$imageToBeResized: Image(id == $id)
|
||||
then
|
||||
@ -918,7 +917,7 @@ rule "MAN.0.1: Apply manual resize redaction"
|
||||
rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to Entity"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers)
|
||||
$entityToBeRemoved: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -930,7 +929,7 @@ rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to Image"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId)
|
||||
$imageEntityToBeRemoved: Image($id == id)
|
||||
then
|
||||
$imageEntityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -944,7 +943,7 @@ rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.2.0: Apply force redaction"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$entityToForce: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToForce.getManualOverwrite().addChange($force);
|
||||
@ -956,7 +955,7 @@ rule "MAN.2.0: Apply force redaction"
|
||||
rule "MAN.2.1: Apply force redaction to images"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$imageToForce: Image(id == $id)
|
||||
then
|
||||
$imageToForce.getManualOverwrite().addChange($force);
|
||||
@ -970,7 +969,7 @@ rule "MAN.2.1: Apply force redaction to images"
|
||||
rule "MAN.3.0: Apply entity recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type != $type)
|
||||
then
|
||||
@ -984,7 +983,7 @@ rule "MAN.3.0: Apply entity recategorization"
|
||||
rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type == $type)
|
||||
then
|
||||
@ -995,7 +994,7 @@ rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
rule "MAN.3.2: Apply image recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
@ -1018,7 +1017,7 @@ rule "MAN.3.3: Apply recategorization entities by default"
|
||||
rule "MAN.4.0: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
$imageToBeRecategorized.getManualOverwrite().addChange($legalBasisChange);
|
||||
@ -1029,7 +1028,7 @@ rule "MAN.4.0: Apply legal basis change"
|
||||
rule "MAN.4.1: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$entityToBeChanged: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeChanged.getManualOverwrite().addChange($legalBasisChange);
|
||||
|
||||
@ -53,7 +53,6 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualForceRedaction;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualRecategorization;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualLegalBasisChange;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
|
||||
global Document document
|
||||
global EntityCreationService entityCreationService
|
||||
@ -109,7 +108,7 @@ rule "AI.0.0: Add all NER Entities of type CBI_author"
|
||||
rule "MAN.0.0: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$entityToBeResized: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
@ -122,7 +121,7 @@ rule "MAN.0.0: Apply manual resize redaction"
|
||||
rule "MAN.0.1: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$imageToBeResized: Image(id == $id)
|
||||
then
|
||||
@ -137,7 +136,7 @@ rule "MAN.0.1: Apply manual resize redaction"
|
||||
rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to Entity"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers)
|
||||
$entityToBeRemoved: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -149,7 +148,7 @@ rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to Image"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId)
|
||||
$imageEntityToBeRemoved: Image($id == id)
|
||||
then
|
||||
$imageEntityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -163,7 +162,7 @@ rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.2.0: Apply force redaction"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$entityToForce: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToForce.getManualOverwrite().addChange($force);
|
||||
@ -175,7 +174,7 @@ rule "MAN.2.0: Apply force redaction"
|
||||
rule "MAN.2.1: Apply force redaction to images"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$imageToForce: Image(id == $id)
|
||||
then
|
||||
$imageToForce.getManualOverwrite().addChange($force);
|
||||
@ -189,7 +188,7 @@ rule "MAN.2.1: Apply force redaction to images"
|
||||
rule "MAN.3.0: Apply entity recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type != $type)
|
||||
then
|
||||
@ -203,7 +202,7 @@ rule "MAN.3.0: Apply entity recategorization"
|
||||
rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type == $type)
|
||||
then
|
||||
@ -224,7 +223,7 @@ rule "MAN.3.3: Apply recategorization entities by default"
|
||||
rule "MAN.4.0: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
$imageToBeRecategorized.getManualOverwrite().addChange($legalBasisChange);
|
||||
@ -235,7 +234,7 @@ rule "MAN.4.0: Apply legal basis change"
|
||||
rule "MAN.4.1: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$entityToBeChanged: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeChanged.getManualOverwrite().addChange($legalBasisChange);
|
||||
|
||||
@ -53,7 +53,6 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualForceRedaction;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualRecategorization;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualLegalBasisChange;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
|
||||
global Document document
|
||||
global EntityCreationService entityCreationService
|
||||
@ -222,7 +221,7 @@ rule "TAB.7.0: Indicator (Species)"
|
||||
rule "MAN.0.0: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$entityToBeResized: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
@ -235,7 +234,7 @@ rule "MAN.0.0: Apply manual resize redaction"
|
||||
rule "MAN.0.1: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$imageToBeResized: Image(id == $id)
|
||||
then
|
||||
@ -250,7 +249,7 @@ rule "MAN.0.1: Apply manual resize redaction"
|
||||
rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to Entity"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers)
|
||||
$entityToBeRemoved: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -262,7 +261,7 @@ rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to Image"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId)
|
||||
$imageEntityToBeRemoved: Image($id == id)
|
||||
then
|
||||
$imageEntityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -276,7 +275,7 @@ rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.2.0: Apply force redaction"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$entityToForce: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToForce.getManualOverwrite().addChange($force);
|
||||
@ -288,7 +287,7 @@ rule "MAN.2.0: Apply force redaction"
|
||||
rule "MAN.2.1: Apply force redaction to images"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$imageToForce: Image(id == $id)
|
||||
then
|
||||
$imageToForce.getManualOverwrite().addChange($force);
|
||||
@ -302,7 +301,7 @@ rule "MAN.2.1: Apply force redaction to images"
|
||||
rule "MAN.3.0: Apply entity recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type != $type)
|
||||
then
|
||||
@ -316,7 +315,7 @@ rule "MAN.3.0: Apply entity recategorization"
|
||||
rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type == $type)
|
||||
then
|
||||
@ -327,7 +326,7 @@ rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
rule "MAN.3.2: Apply image recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
@ -350,7 +349,7 @@ rule "MAN.3.3: Apply recategorization entities by default"
|
||||
rule "MAN.4.0: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
$imageToBeRecategorized.getManualOverwrite().addChange($legalBasisChange);
|
||||
@ -361,7 +360,7 @@ rule "MAN.4.0: Apply legal basis change"
|
||||
rule "MAN.4.1: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$entityToBeChanged: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeChanged.getManualOverwrite().addChange($legalBasisChange);
|
||||
|
||||
@ -53,7 +53,6 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualForceRedaction;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualRecategorization;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualLegalBasisChange;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
|
||||
global Document document
|
||||
global EntityCreationService entityCreationService
|
||||
@ -122,7 +121,7 @@ rule "TAB.6.0: Targeted cell extraction (Experimental Stop date)"
|
||||
rule "MAN.0.0: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$entityToBeResized: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
@ -135,7 +134,7 @@ rule "MAN.0.0: Apply manual resize redaction"
|
||||
rule "MAN.0.1: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$imageToBeResized: Image(id == $id)
|
||||
then
|
||||
@ -150,7 +149,7 @@ rule "MAN.0.1: Apply manual resize redaction"
|
||||
rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to Entity"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers)
|
||||
$entityToBeRemoved: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -162,7 +161,7 @@ rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to Image"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId)
|
||||
$imageEntityToBeRemoved: Image($id == id)
|
||||
then
|
||||
$imageEntityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -176,7 +175,7 @@ rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.2.0: Apply force redaction"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$entityToForce: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToForce.getManualOverwrite().addChange($force);
|
||||
@ -188,7 +187,7 @@ rule "MAN.2.0: Apply force redaction"
|
||||
rule "MAN.2.1: Apply force redaction to images"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$imageToForce: Image(id == $id)
|
||||
then
|
||||
$imageToForce.getManualOverwrite().addChange($force);
|
||||
@ -202,7 +201,7 @@ rule "MAN.2.1: Apply force redaction to images"
|
||||
rule "MAN.3.0: Apply entity recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type != $type)
|
||||
then
|
||||
@ -216,7 +215,7 @@ rule "MAN.3.0: Apply entity recategorization"
|
||||
rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type == $type)
|
||||
then
|
||||
@ -227,7 +226,7 @@ rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
rule "MAN.3.2: Apply image recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
@ -250,7 +249,7 @@ rule "MAN.3.3: Apply recategorization entities by default"
|
||||
rule "MAN.4.0: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
$imageToBeRecategorized.getManualOverwrite().addChange($legalBasisChange);
|
||||
@ -261,7 +260,7 @@ rule "MAN.4.0: Apply legal basis change"
|
||||
rule "MAN.4.1: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$entityToBeChanged: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeChanged.getManualOverwrite().addChange($legalBasisChange);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,491 @@
|
||||
{
|
||||
"idsToRemove": [
|
||||
{
|
||||
"annotationId": "6808af23a9652917b73c1939b481f3e4",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:11:06.468874Z",
|
||||
"processedDate": "2024-01-26T10:11:06.555Z",
|
||||
"softDeletedTime": null,
|
||||
"removeFromDictionary": false,
|
||||
"approved": true
|
||||
},
|
||||
{
|
||||
"annotationId": "5316fff0ec9ae3f2773378f3cc833079",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:09:16.092673Z",
|
||||
"processedDate": "2024-01-26T10:09:16.172Z",
|
||||
"softDeletedTime": null,
|
||||
"removeFromDictionary": false,
|
||||
"approved": true
|
||||
},
|
||||
{
|
||||
"annotationId": "01fcfb3581723a4d164b4e5ed9e7db90",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:09:05.824116Z",
|
||||
"processedDate": "2024-01-26T10:09:05.885Z",
|
||||
"softDeletedTime": null,
|
||||
"removeFromDictionary": false,
|
||||
"approved": true
|
||||
},
|
||||
{
|
||||
"annotationId": "ad5c82acae51a8af70c9141e1ae4efde",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:09:01.121129Z",
|
||||
"processedDate": "2024-01-26T10:09:01.178Z",
|
||||
"softDeletedTime": null,
|
||||
"removeFromDictionary": false,
|
||||
"approved": true
|
||||
},
|
||||
{
|
||||
"annotationId": "1ec000364ca48d676af7e33be13685e4",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:10:49.38646Z",
|
||||
"processedDate": "2024-01-26T10:10:49.429Z",
|
||||
"softDeletedTime": null,
|
||||
"removeFromDictionary": false,
|
||||
"approved": true
|
||||
}
|
||||
],
|
||||
"entriesToAdd": [
|
||||
{
|
||||
"annotationId": "664d4f36dfb9549d1ba11d70c63274e1",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:08:20.832Z",
|
||||
"processedDate": "2024-01-26T10:08:20.832Z",
|
||||
"softDeletedTime": null,
|
||||
"type": "manual",
|
||||
"value": "CBI.0.1",
|
||||
"reason": "personal data (names and addresses) of individuals involved in testing on vertebrate studies or in obtaining toxicological information",
|
||||
"legalBasis": "Article 39(e)(2) of Regulation (EC) No 178/2002",
|
||||
"section": null,
|
||||
"rectangle": false,
|
||||
"addToDictionary": false,
|
||||
"addToDossierDictionary": false,
|
||||
"positions": [
|
||||
{
|
||||
"topLeftX": 216.38,
|
||||
"topLeftY": 597.27,
|
||||
"width": 31.09,
|
||||
"height": 12.83,
|
||||
"page": 1
|
||||
}
|
||||
],
|
||||
"textBefore": null,
|
||||
"textAfter": null,
|
||||
"sourceId": null,
|
||||
"approved": true
|
||||
},
|
||||
{
|
||||
"annotationId": "e3d199546dd63db9746adbe0f71a9526",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:12:06.458Z",
|
||||
"processedDate": "2024-01-26T10:12:07.031Z",
|
||||
"softDeletedTime": null,
|
||||
"type": "PII",
|
||||
"value": "the six desire",
|
||||
"reason": "Dictionary Request",
|
||||
"legalBasis": null,
|
||||
"section": null,
|
||||
"rectangle": false,
|
||||
"addToDictionary": true,
|
||||
"addToDossierDictionary": false,
|
||||
"positions": [
|
||||
{
|
||||
"topLeftX": 112.86,
|
||||
"topLeftY": 590.97,
|
||||
"width": 52.68,
|
||||
"height": 12.84,
|
||||
"page": 19
|
||||
}
|
||||
],
|
||||
"textBefore": null,
|
||||
"textAfter": null,
|
||||
"sourceId": null,
|
||||
"approved": true
|
||||
},
|
||||
{
|
||||
"annotationId": "b1a86e5984e7e9a7434f1bbdfc983228",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:07:50.175Z",
|
||||
"processedDate": "2024-01-26T10:07:50.175Z",
|
||||
"softDeletedTime": null,
|
||||
"type": "manual",
|
||||
"value": "my non-readable content",
|
||||
"reason": "(Regulations (EU) 2016/679 and (EU) 2018/1725 shall apply to the processing of personal data carried out pursuant to this Regulation. Any personal data made public pursuant to Article 38 of this Regulation and this Article shall only be used to ensure the transparency of the risk assessment under this Regulation and shall not be further processed in a manner that is incompatible with these purposes, in accordance with point (b) of Article 5(1) of Regulation (EU) 2016/679 and point (b) of Article 4(1) of Regulation (EU) 2018/1725, as the case may be)",
|
||||
"legalBasis": "Article 39(e)(3) of Regulation (EC) No 178/2002",
|
||||
"section": "my Paragraph",
|
||||
"rectangle": true,
|
||||
"addToDictionary": false,
|
||||
"addToDossierDictionary": false,
|
||||
"positions": [
|
||||
{
|
||||
"topLeftX": 305.67,
|
||||
"topLeftY": 591.4,
|
||||
"width": 189.85,
|
||||
"height": 167.17,
|
||||
"page": 1
|
||||
}
|
||||
],
|
||||
"textBefore": null,
|
||||
"textAfter": null,
|
||||
"sourceId": null,
|
||||
"approved": true
|
||||
},
|
||||
{
|
||||
"annotationId": "8572ab8899313b10f02a3cc9d97d7240",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:07:58.713Z",
|
||||
"processedDate": "2024-01-26T10:07:58.713Z",
|
||||
"softDeletedTime": null,
|
||||
"type": "manual",
|
||||
"value": "Rule",
|
||||
"reason": "personal data (names and addresses) of individuals involved in testing on vertebrate studies or in obtaining toxicological information",
|
||||
"legalBasis": "Article 39(e)(2) of Regulation (EC) No 178/2002",
|
||||
"section": null,
|
||||
"rectangle": false,
|
||||
"addToDictionary": false,
|
||||
"addToDossierDictionary": false,
|
||||
"positions": [
|
||||
{
|
||||
"topLeftX": 59.8,
|
||||
"topLeftY": 687.552,
|
||||
"width": 31.968,
|
||||
"height": 20.96,
|
||||
"page": 1
|
||||
}
|
||||
],
|
||||
"textBefore": null,
|
||||
"textAfter": null,
|
||||
"sourceId": null,
|
||||
"approved": true
|
||||
},
|
||||
{
|
||||
"annotationId": "dbace52ac2ad8aaf7ff207001e256619",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:08:08.766Z",
|
||||
"processedDate": "2024-01-26T10:08:08.766Z",
|
||||
"softDeletedTime": null,
|
||||
"type": "manual",
|
||||
"value": "CBI.0.0/1: Redact CBI Authors",
|
||||
"reason": "personal data (names and addresses) of individuals involved in testing on vertebrate studies or in obtaining toxicological information",
|
||||
"legalBasis": "Article 39(e)(2) of Regulation (EC) No 178/2002",
|
||||
"section": null,
|
||||
"rectangle": false,
|
||||
"addToDictionary": false,
|
||||
"addToDossierDictionary": false,
|
||||
"positions": [
|
||||
{
|
||||
"topLeftX": 56.8,
|
||||
"topLeftY": 626.5984,
|
||||
"width": 200.6712,
|
||||
"height": 19.8669,
|
||||
"page": 1
|
||||
}
|
||||
],
|
||||
"textBefore": null,
|
||||
"textAfter": null,
|
||||
"sourceId": null,
|
||||
"approved": true
|
||||
},
|
||||
{
|
||||
"annotationId": "e8e40aa8eae970d476c3f58b14334e4f",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:11:57.565Z",
|
||||
"processedDate": "2024-01-26T10:11:58.184Z",
|
||||
"softDeletedTime": null,
|
||||
"type": "CBI_author",
|
||||
"value": "Pasture he invited mr company shyness. But when shot real her. Chamber her\nobserve visited removal six sending himself boy. At exquisite existence if an oh\ndependent excellent. Are gay head need down draw. Misery wonder enable\nmutual get set oppose the uneasy. End why melancholy estimating her had\nindulgence middletons. Say ferrars demands besides her address. Blind going\nyou merit few fancy their.",
|
||||
"reason": "Dictionary Request",
|
||||
"legalBasis": null,
|
||||
"section": null,
|
||||
"rectangle": false,
|
||||
"addToDictionary": true,
|
||||
"addToDossierDictionary": false,
|
||||
"positions": [
|
||||
{
|
||||
"topLeftX": 56.8,
|
||||
"topLeftY": 671.87,
|
||||
"width": 309.71,
|
||||
"height": 12.84,
|
||||
"page": 19
|
||||
},
|
||||
{
|
||||
"topLeftX": 56.8,
|
||||
"topLeftY": 660.27,
|
||||
"width": 318.24,
|
||||
"height": 12.84,
|
||||
"page": 19
|
||||
},
|
||||
{
|
||||
"topLeftX": 56.8,
|
||||
"topLeftY": 648.77,
|
||||
"width": 299.68,
|
||||
"height": 12.84,
|
||||
"page": 19
|
||||
},
|
||||
{
|
||||
"topLeftX": 56.8,
|
||||
"topLeftY": 637.17,
|
||||
"width": 297.4,
|
||||
"height": 12.84,
|
||||
"page": 19
|
||||
},
|
||||
{
|
||||
"topLeftX": 56.8,
|
||||
"topLeftY": 625.67,
|
||||
"width": 309.46,
|
||||
"height": 12.84,
|
||||
"page": 19
|
||||
},
|
||||
{
|
||||
"topLeftX": 56.8,
|
||||
"topLeftY": 614.07,
|
||||
"width": 103.53,
|
||||
"height": 12.84,
|
||||
"page": 19
|
||||
}
|
||||
],
|
||||
"textBefore": null,
|
||||
"textAfter": null,
|
||||
"sourceId": null,
|
||||
"approved": true
|
||||
},
|
||||
{
|
||||
"annotationId": "da0b8d99861b9720b2155e470b18f21d",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:13:51.881Z",
|
||||
"processedDate": "2024-01-26T10:13:52.463Z",
|
||||
"softDeletedTime": null,
|
||||
"type": "CBI_author",
|
||||
"value": "Lain",
|
||||
"reason": "Dictionary Request",
|
||||
"legalBasis": null,
|
||||
"section": null,
|
||||
"rectangle": false,
|
||||
"addToDictionary": true,
|
||||
"addToDossierDictionary": false,
|
||||
"positions": [
|
||||
{
|
||||
"topLeftX": 217.76,
|
||||
"topLeftY": 475.47,
|
||||
"width": 18.29,
|
||||
"height": 12.84,
|
||||
"page": 19
|
||||
}
|
||||
],
|
||||
"textBefore": null,
|
||||
"textAfter": null,
|
||||
"sourceId": null,
|
||||
"approved": true
|
||||
},
|
||||
{
|
||||
"annotationId": "7634eed4ce8269fdecd009b07fc70144",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:09:27.249Z",
|
||||
"processedDate": "2024-01-26T10:09:27.864Z",
|
||||
"softDeletedTime": null,
|
||||
"type": "PII",
|
||||
"value": "Xinyi Y. Tao Possible incidents",
|
||||
"reason": "False Positive",
|
||||
"legalBasis": null,
|
||||
"section": null,
|
||||
"rectangle": false,
|
||||
"addToDictionary": true,
|
||||
"addToDossierDictionary": false,
|
||||
"positions": [
|
||||
{
|
||||
"topLeftX": 56.8,
|
||||
"topLeftY": 568.84204,
|
||||
"width": 60.575993,
|
||||
"height": -12.641998,
|
||||
"page": 6
|
||||
}
|
||||
],
|
||||
"textBefore": null,
|
||||
"textAfter": null,
|
||||
"sourceId": "3fcff2c472c4cce852815de9cb17a50d",
|
||||
"approved": true
|
||||
}
|
||||
],
|
||||
"forceRedactions": [
|
||||
{
|
||||
"annotationId": "63a758ca88b0e0a6da546b1a8ece7e39",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:10:31.922754Z",
|
||||
"processedDate": "2024-01-26T10:10:32.38Z",
|
||||
"softDeletedTime": null,
|
||||
"legalBasis": "Article 39(e)(2) of Regulation (EC) No 178/2002",
|
||||
"approved": true
|
||||
},
|
||||
{
|
||||
"annotationId": "44f684045879e7a6decd34baaae0930f",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:11:31.762669Z",
|
||||
"processedDate": "2024-01-26T10:11:32.194Z",
|
||||
"softDeletedTime": null,
|
||||
"legalBasis": "Article 39(e)(2) of Regulation (EC) No 178/2002",
|
||||
"approved": true
|
||||
}
|
||||
],
|
||||
"imageRecategorization": [
|
||||
{
|
||||
"annotationId": "647a450f5feba4859297886a4263b653",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:11:25.055708Z",
|
||||
"processedDate": "2024-01-26T10:11:25.539Z",
|
||||
"softDeletedTime": null,
|
||||
"type": "formula",
|
||||
"approved": true
|
||||
}
|
||||
],
|
||||
"legalBasisChanges": [],
|
||||
"resizeRedactions": [
|
||||
{
|
||||
"annotationId": "30cb40dc6f495193f1b47d0d557fd682",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:09:38.629636Z",
|
||||
"processedDate": "2024-01-26T10:09:38.629Z",
|
||||
"softDeletedTime": null,
|
||||
"value": "for this project are library@outlook.com",
|
||||
"positions": [
|
||||
{
|
||||
"topLeftX": 248.632,
|
||||
"topLeftY": 328.464,
|
||||
"width": 194.58,
|
||||
"height": 15.408,
|
||||
"page": 6
|
||||
}
|
||||
],
|
||||
"textBefore": null,
|
||||
"textAfter": null,
|
||||
"updateDictionary": null,
|
||||
"approved": true
|
||||
},
|
||||
{
|
||||
"annotationId": "90129d370d60b07d8cb060400338255e",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:09:24.387046Z",
|
||||
"processedDate": "2024-01-26T10:09:24.387Z",
|
||||
"softDeletedTime": null,
|
||||
"value": "Alfred",
|
||||
"positions": [
|
||||
{
|
||||
"topLeftX": 80.788,
|
||||
"topLeftY": 568.364,
|
||||
"width": 31.284,
|
||||
"height": 15.408,
|
||||
"page": 6
|
||||
}
|
||||
],
|
||||
"textBefore": null,
|
||||
"textAfter": null,
|
||||
"updateDictionary": false,
|
||||
"approved": true
|
||||
},
|
||||
{
|
||||
"annotationId": "3ed0487b61fdb556c8982450aa39a8db",
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"status": "APPROVED",
|
||||
"requestDate": "2024-01-26T10:11:03.039254Z",
|
||||
"processedDate": "2024-01-26T10:11:03.039Z",
|
||||
"softDeletedTime": null,
|
||||
"value": "Image",
|
||||
"positions": [
|
||||
{
|
||||
"topLeftX": 287,
|
||||
"topLeftY": 613,
|
||||
"width": 288.45,
|
||||
"height": 85.64,
|
||||
"page": 14
|
||||
}
|
||||
],
|
||||
"textBefore": null,
|
||||
"textAfter": null,
|
||||
"updateDictionary": null,
|
||||
"approved": true
|
||||
}
|
||||
],
|
||||
"comments": {
|
||||
"664d4f36dfb9549d1ba11d70c63274e1": [
|
||||
{
|
||||
"id": 36,
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"annotationId": "664d4f36dfb9549d1ba11d70c63274e1",
|
||||
"date": "2024-01-26T10:08:26.837Z",
|
||||
"text": "a1",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"softDeletedTime": null,
|
||||
"fileStatus": null
|
||||
},
|
||||
{
|
||||
"id": 38,
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"annotationId": "664d4f36dfb9549d1ba11d70c63274e1",
|
||||
"date": "2024-01-26T10:08:28.936Z",
|
||||
"text": "a2",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"softDeletedTime": null,
|
||||
"fileStatus": null
|
||||
}
|
||||
],
|
||||
"96faa75e974e6634fe534116952650ee": [
|
||||
{
|
||||
"id": 40,
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"annotationId": "96faa75e974e6634fe534116952650ee",
|
||||
"date": "2024-01-26T10:08:45.461Z",
|
||||
"text": "b1",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"softDeletedTime": null,
|
||||
"fileStatus": null
|
||||
},
|
||||
{
|
||||
"id": 42,
|
||||
"fileId": "2018ceba2d83a7de510c66c9f636cfbf",
|
||||
"annotationId": "96faa75e974e6634fe534116952650ee",
|
||||
"date": "2024-01-26T10:08:48.416Z",
|
||||
"text": "b2",
|
||||
"user": "4f5958e9-6444-4e52-97e4-9a995e54dc6d",
|
||||
"softDeletedTime": null,
|
||||
"fileStatus": null
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@
|
||||
{"dossierId": "82ce7a6d-4590-43ad-9adf-139a53bf244d", "fileId": "178ee8cd99fe786e03fad50d51a69ad3", "operation": "table", "targetFileExtension": "ORIGIN.pdf.gz", "responseFileExtension": "TABLES.json.gz", "data": [{"pageInfo": {"number": 16, "rotation": 0, "width": 612.0, "height": 792.0}, "tableCells": [{"x0": 138.24000549316406, "y0": 477.3599853515625, "x1": 195.47999572753906, "y1": 494.6400146484375, "width": 57.239990234375, "height": 17.280029296875}, {"x0": 208.0800018310547, "y0": 477.3599853515625, "x1": 322.55999755859375, "y1": 494.6400146484375, "width": 114.47999572753906, "height": 17.280029296875}, {"x0": 151.1999969482422, "y0": 459.3599853515625, "x1": 195.47999572753906, "y1": 477.0, "width": 44.279998779296875, "height": 17.6400146484375}, {"x0": 250.9199981689453, "y0": 459.3599853515625, "x1": 322.55999755859375, "y1": 477.0, "width": 71.63999938964844, "height": 17.6400146484375}, {"x0": 307.44000244140625, "y0": 441.7200012207031, "x1": 322.55999755859375, "y1": 459.0, "width": 15.1199951171875, "height": 17.279998779296875}]}]}
|
||||
@ -491,7 +491,7 @@ rule "AI.1.0: combine and add NER Entities as CBI_address"
|
||||
rule "MAN.0.0: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId)
|
||||
$entityToBeResized: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
manualChangesApplicationService.resizeEntityAndReinsert($entityToBeResized, $resizeRedaction);
|
||||
@ -503,7 +503,7 @@ rule "MAN.0.0: Apply manual resize redaction"
|
||||
rule "MAN.0.1: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId)
|
||||
$imageToBeResized: Image(id == $id)
|
||||
then
|
||||
manualChangesApplicationService.resizeImage($imageToBeResized, $resizeRedaction);
|
||||
@ -517,7 +517,7 @@ rule "MAN.0.1: Apply manual resize redaction"
|
||||
rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to Entity"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId)
|
||||
$entityToBeRemoved: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -529,7 +529,7 @@ rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to Image"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId)
|
||||
$imageEntityToBeRemoved: Image($id == id)
|
||||
then
|
||||
$imageEntityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -544,7 +544,7 @@ rule "MAN.2.0: Apply force redaction"
|
||||
no-loop true
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$entityToForce: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToForce.getManualOverwrite().addChange($force);
|
||||
@ -556,7 +556,7 @@ rule "MAN.2.1: Apply force redaction to images"
|
||||
no-loop true
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$imageToForce: Image(id == $id)
|
||||
then
|
||||
$imageToForce.getManualOverwrite().addChange($force);
|
||||
@ -569,7 +569,7 @@ rule "MAN.2.1: Apply force redaction to images"
|
||||
rule "MAN.3.0: Apply entity recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$recategorization: ManualRecategorization($id: annotationId)
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeRecategorized.getIntersectingNodes().forEach(node -> update(node));
|
||||
@ -582,7 +582,7 @@ rule "MAN.3.0: Apply entity recategorization"
|
||||
rule "MAN.3.1: Apply image recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$recategorization: ManualRecategorization($id: annotationId)
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
manualChangesApplicationService.recategorize($imageToBeRecategorized, $recategorization);
|
||||
@ -595,7 +595,7 @@ rule "MAN.3.1: Apply image recategorization"
|
||||
rule "MAN.4.0: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalbasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalbasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
$imageToBeRecategorized.getManualOverwrite().addChange($legalbasisChange);
|
||||
@ -604,7 +604,7 @@ rule "MAN.4.0: Apply legal basis change"
|
||||
rule "MAN.4.1: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$entityToBeChanged: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeChanged.getManualOverwrite().addChange($legalBasisChange);
|
||||
|
||||
@ -53,7 +53,6 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualForceRedaction;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualRecategorization;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualLegalBasisChange;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
|
||||
global Document document
|
||||
global EntityCreationService entityCreationService
|
||||
@ -1321,7 +1320,7 @@ rule "AI.3.0: Recommend authors from AI as PII"
|
||||
rule "MAN.0.0: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$entityToBeResized: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
@ -1334,7 +1333,7 @@ rule "MAN.0.0: Apply manual resize redaction"
|
||||
rule "MAN.0.1: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$imageToBeResized: Image(id == $id)
|
||||
then
|
||||
@ -1349,7 +1348,7 @@ rule "MAN.0.1: Apply manual resize redaction"
|
||||
rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to Entity"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers)
|
||||
$entityToBeRemoved: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -1361,7 +1360,7 @@ rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to Image"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId)
|
||||
$imageEntityToBeRemoved: Image($id == id)
|
||||
then
|
||||
$imageEntityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -1375,7 +1374,7 @@ rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.2.0: Apply force redaction"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$entityToForce: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToForce.getManualOverwrite().addChange($force);
|
||||
@ -1387,7 +1386,7 @@ rule "MAN.2.0: Apply force redaction"
|
||||
rule "MAN.2.1: Apply force redaction to images"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$imageToForce: Image(id == $id)
|
||||
then
|
||||
$imageToForce.getManualOverwrite().addChange($force);
|
||||
@ -1401,7 +1400,7 @@ rule "MAN.2.1: Apply force redaction to images"
|
||||
rule "MAN.3.0: Apply entity recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type != $type)
|
||||
then
|
||||
@ -1415,7 +1414,7 @@ rule "MAN.3.0: Apply entity recategorization"
|
||||
rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type == $type)
|
||||
then
|
||||
@ -1426,7 +1425,7 @@ rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
rule "MAN.3.2: Apply image recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
@ -1449,7 +1448,7 @@ rule "MAN.3.3: Apply recategorization entities by default"
|
||||
rule "MAN.4.0: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
$imageToBeRecategorized.getManualOverwrite().addChange($legalBasisChange);
|
||||
@ -1460,7 +1459,7 @@ rule "MAN.4.0: Apply legal basis change"
|
||||
rule "MAN.4.1: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$entityToBeChanged: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeChanged.getManualOverwrite().addChange($legalBasisChange);
|
||||
|
||||
@ -53,7 +53,6 @@ import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualForceRedaction;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualRecategorization;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.ManualLegalBasisChange;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.AnnotationStatus;
|
||||
|
||||
global Document document
|
||||
global EntityCreationService entityCreationService
|
||||
@ -1305,7 +1304,7 @@ rule "TAB.7.0: Indicator (Species)"
|
||||
rule "MAN.0.0: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$entityToBeResized: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
@ -1318,7 +1317,7 @@ rule "MAN.0.0: Apply manual resize redaction"
|
||||
rule "MAN.0.1: Apply manual resize redaction"
|
||||
salience 128
|
||||
when
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$resizeRedaction: ManualResizeRedaction($id: annotationId, $requestDate: requestDate)
|
||||
not ManualResizeRedaction(annotationId == $id, requestDate.isBefore($requestDate))
|
||||
$imageToBeResized: Image(id == $id)
|
||||
then
|
||||
@ -1333,7 +1332,7 @@ rule "MAN.0.1: Apply manual resize redaction"
|
||||
rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to Entity"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId, !removeFromDictionary, !removeFromAllDossiers)
|
||||
$entityToBeRemoved: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -1345,7 +1344,7 @@ rule "MAN.1.0: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to Image"
|
||||
salience 128
|
||||
when
|
||||
$idRemoval: IdRemoval($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$idRemoval: IdRemoval($id: annotationId)
|
||||
$imageEntityToBeRemoved: Image($id == id)
|
||||
then
|
||||
$imageEntityToBeRemoved.getManualOverwrite().addChange($idRemoval);
|
||||
@ -1359,7 +1358,7 @@ rule "MAN.1.1: Apply id removals that are valid and not in forced redactions to
|
||||
rule "MAN.2.0: Apply force redaction"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$entityToForce: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToForce.getManualOverwrite().addChange($force);
|
||||
@ -1371,7 +1370,7 @@ rule "MAN.2.0: Apply force redaction"
|
||||
rule "MAN.2.1: Apply force redaction to images"
|
||||
salience 128
|
||||
when
|
||||
$force: ManualForceRedaction($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$force: ManualForceRedaction($id: annotationId)
|
||||
$imageToForce: Image(id == $id)
|
||||
then
|
||||
$imageToForce.getManualOverwrite().addChange($force);
|
||||
@ -1385,7 +1384,7 @@ rule "MAN.2.1: Apply force redaction to images"
|
||||
rule "MAN.3.0: Apply entity recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type != $type)
|
||||
then
|
||||
@ -1399,7 +1398,7 @@ rule "MAN.3.0: Apply entity recategorization"
|
||||
rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $type: type, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$entityToBeRecategorized: TextEntity(matchesAnnotationId($id), type == $type)
|
||||
then
|
||||
@ -1410,7 +1409,7 @@ rule "MAN.3.1: Apply entity recategorization of same type"
|
||||
rule "MAN.3.2: Apply image recategorization"
|
||||
salience 128
|
||||
when
|
||||
$recategorization: ManualRecategorization($id: annotationId, status == AnnotationStatus.APPROVED, $requestDate: requestDate)
|
||||
$recategorization: ManualRecategorization($id: annotationId, $requestDate: requestDate)
|
||||
not ManualRecategorization($id == annotationId, requestDate.isBefore($requestDate))
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
@ -1432,7 +1431,7 @@ rule "MAN.3.3: Apply recategorization entities by default"
|
||||
rule "MAN.4.0: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$imageToBeRecategorized: Image($id == id)
|
||||
then
|
||||
$imageToBeRecategorized.getManualOverwrite().addChange($legalBasisChange);
|
||||
@ -1443,7 +1442,7 @@ rule "MAN.4.0: Apply legal basis change"
|
||||
rule "MAN.4.1: Apply legal basis change"
|
||||
salience 128
|
||||
when
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId, status == AnnotationStatus.APPROVED)
|
||||
$legalBasisChange: ManualLegalBasisChange($id: annotationId)
|
||||
$entityToBeChanged: TextEntity(matchesAnnotationId($id))
|
||||
then
|
||||
$entityToBeChanged.getManualOverwrite().addChange($legalBasisChange);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user