From 30408868e03d9f5ac3cbfdb4f85de07b00c31eb9 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 1 Dec 2023 11:25:50 +0000 Subject: [PATCH 001/159] Revert temporary changes --- src/main/cliapp/src/constants/FilterFields.js | 2 +- src/main/cliapp/src/constants/SortFields.js | 2 +- .../constructsPage/ConstructsTable.js | 12 +-- .../constructsPage/GenomicComponentsDialog.js | 14 ++-- .../constructsPage/mockData/mockData.js | 2 +- .../curation_api/model/entities/Allele.java | 10 ++- .../model/entities/Construct.java | 6 +- .../curation_api/model/entities/Gene.java | 2 +- .../model/entities/GenomicEntity.java | 10 +-- .../AlleleGeneAssociation.java | 4 +- .../ConstructGenomicEntityAssociation.java | 8 +- .../AlleleGeneAssociationService.java | 4 +- ...structGenomicEntityAssociationService.java | 8 +- .../AlleleGeneAssociationValidator.java | 14 ++-- ...ructGenomicEntityAssociationValidator.java | 24 +++--- .../AlleleGeneAssociationDTOValidator.java | 4 +- ...tGenomicEntityAssociationDTOValidator.java | 8 +- .../v0.30.0.1__linkml_v2.0.0_update.sql | 10 +++ ...AlleleGeneAssociationBulkUploadITCase.java | 10 +-- ...omicEntityAssociationBulkUploadITCase.java | 14 ++-- .../AlleleGeneAssociationITCase.java | 40 +++++----- ...nstructGenomicEntityAssociationITCase.java | 76 +++++++++---------- 22 files changed, 148 insertions(+), 136 deletions(-) create mode 100644 src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql diff --git a/src/main/cliapp/src/constants/FilterFields.js b/src/main/cliapp/src/constants/FilterFields.js index 51df9beef..96ad3dfcf 100644 --- a/src/main/cliapp/src/constants/FilterFields.js +++ b/src/main/cliapp/src/constants/FilterFields.js @@ -146,7 +146,7 @@ export const FIELD_SETS = Object.freeze({ }, constructGenomicComponentsFieldSet: { filterName: "constructGenomicComponentsFilter", - fields: ["constructGenomicEntityAssociations.objectGenomicEntity.symbol", "constructGenomicEntityAssociations.objectGenomicEntity.name", "constructGenomicEntityAssociations.objectGenomicEntity.curie", "constructGenomicEntityAssociations.relation.name"], + fields: ["constructGenomicEntityAssociations.object.symbol", "constructGenomicEntityAssociations.object.name", "constructGenomicEntityAssociations.object.curie", "constructGenomicEntityAssociations.relation.name"], }, daConditionRelationsHandleFieldSet: { filterName: "daConditionRelationHandleFilter", diff --git a/src/main/cliapp/src/constants/SortFields.js b/src/main/cliapp/src/constants/SortFields.js index 022c104f4..ddc7e0855 100644 --- a/src/main/cliapp/src/constants/SortFields.js +++ b/src/main/cliapp/src/constants/SortFields.js @@ -97,7 +97,7 @@ export const SORT_FIELDS = Object.freeze([ "secondaryIdentifiers", "taxonText", "constructComponents.componentSymbol", - "constructGenomicEntityAssociations.objectGenomicEntity.symbol", + "constructGenomicEntityAssociations.object.symbol", "variantStatus.name", "variantType.name", "sourceGeneralConsequence.name" diff --git a/src/main/cliapp/src/containers/constructsPage/ConstructsTable.js b/src/main/cliapp/src/containers/constructsPage/ConstructsTable.js index 3f3652c1a..2c8717b86 100644 --- a/src/main/cliapp/src/containers/constructsPage/ConstructsTable.js +++ b/src/main/cliapp/src/containers/constructsPage/ConstructsTable.js @@ -274,12 +274,12 @@ export const ConstructsTable = () => { const componentSet = new Set(); for(var i = 0; i < rowData.constructGenomicEntityAssociations.length; i++){ let symbolValue = ""; - if (rowData.constructGenomicEntityAssociations[i]?.objectGenomicEntity.geneSymbol || rowData.constructGenomicEntityAssociations[i]?.objectGenomicEntity.alleleSymbol) { - symbolValue = rowData.constructGenomicEntityAssociations[i].objectGenomicEntity.geneSymbol ? rowData.constructGenomicEntityAssociations[i].objectGenomicEntity.geneSymbol.displayText : rowData.constructGenomicEntityAssociations[i].objectGenomicEntity.alleleSymbol.displayText; - } else if (rowData.constructGenomicEntityAssociations[i]?.objectGenomicEntity.name) { - symbolValue = rowData.constructGenomicEntityAssociations[i].objectGenomicEntity.name; + if (rowData.constructGenomicEntityAssociations[i]?.object.geneSymbol || rowData.constructGenomicEntityAssociations[i]?.object.alleleSymbol) { + symbolValue = rowData.constructGenomicEntityAssociations[i].object.geneSymbol ? rowData.constructGenomicEntityAssociations[i].object.geneSymbol.displayText : rowData.constructGenomicEntityAssociations[i].object.alleleSymbol.displayText; + } else if (rowData.constructGenomicEntityAssociations[i]?.object.name) { + symbolValue = rowData.constructGenomicEntityAssociations[i].object.name; } else { - symbolValue = rowData.constructGenomicEntityAssociations[i].objectGenomicEntity.curie; + symbolValue = rowData.constructGenomicEntityAssociations[i].object.curie; } let relationName = ""; if (rowData.constructGenomicEntityAssociations[i]?.relation?.name) { @@ -380,7 +380,7 @@ export const ConstructsTable = () => { filterConfig: FILTER_CONFIGS.constructComponentsFilterConfig, }, { - field: "constructGenomicEntityAssociations.objectGenomicEntity.symbol", + field: "constructGenomicEntityAssociations.object.symbol", header: "Component Associations", body: genomicComponentsTemplate, sortable: { isInEditMode }, diff --git a/src/main/cliapp/src/containers/constructsPage/GenomicComponentsDialog.js b/src/main/cliapp/src/containers/constructsPage/GenomicComponentsDialog.js index 423e3eacd..33527d5bb 100644 --- a/src/main/cliapp/src/containers/constructsPage/GenomicComponentsDialog.js +++ b/src/main/cliapp/src/containers/constructsPage/GenomicComponentsDialog.js @@ -90,13 +90,13 @@ export const GenomicComponentsDialog = ({ const componentTemplate = (rowData) => { let componentDisplayValue = ""; - if (rowData.objectGenomicEntity.geneSymbol || rowData.objectGenomicEntity.alleleSymbol) { - let symbolValue = rowData.objectGenomicEntity.geneSymbol ? rowData.objectGenomicEntity.geneSymbol.displayText : rowData.objectGenomicEntity.alleleSymbol.displayText; - componentDisplayValue = symbolValue + ' (' + rowData.objectGenomicEntity.curie + ')'; - } else if (rowData.objectGenomicEntity.name) { - componentDisplayValue = rowData.objectGenomicEntity.name + ' (' + rowData.objectGenomicEntity.curie + ')'; + if (rowData.object.geneSymbol || rowData.object.alleleSymbol) { + let symbolValue = rowData.object.geneSymbol ? rowData.object.geneSymbol.displayText : rowData.object.alleleSymbol.displayText; + componentDisplayValue = symbolValue + ' (' + rowData.object.curie + ')'; + } else if (rowData.object.name) { + componentDisplayValue = rowData.object.name + ' (' + rowData.object.curie + ')'; } else { - componentDisplayValue = rowData.objectGenomicEntity.curie; + componentDisplayValue = rowData.object.curie; } return ( <> @@ -131,7 +131,7 @@ export const GenomicComponentsDialog = ({ - + evidenceTemplate(rowData)}/> diff --git a/src/main/cliapp/src/containers/constructsPage/mockData/mockData.js b/src/main/cliapp/src/containers/constructsPage/mockData/mockData.js index f9e3861c7..086c0cd94 100644 --- a/src/main/cliapp/src/containers/constructsPage/mockData/mockData.js +++ b/src/main/cliapp/src/containers/constructsPage/mockData/mockData.js @@ -657,7 +657,7 @@ export const data = { "name": "expresses (RO:0002292)", "definition": "Indicates that the construct expresses the indicated GenomicEntity" }, - "objectGenomicEntity": { + "object": { "type": "Gene", "createdBy": { "internal": false, diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java index 89cee5ede..c42a00a24 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java @@ -36,6 +36,7 @@ import jakarta.persistence.CascadeType; import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; import jakarta.persistence.Index; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; @@ -59,8 +60,9 @@ public class Allele extends GenomicEntity { @IndexedEmbedded(includePaths = {"primaryCrossReferenceCurie", "crossReferences.referencedCurie", "crossReferences.displayName", "curie", "primaryCrossReferenceCurie_keyword", "crossReferences.referencedCurie_keyword", "crossReferences.displayName_keyword", "curie_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) - @ManyToMany - @JoinTable(indexes = { @Index(columnList = "allele_curie"), @Index(columnList = "references_curie") }) + @ManyToMany(fetch = FetchType.EAGER) + @Fetch(FetchMode.JOIN) + @JoinTable(indexes = { @Index(columnList = "allele_curie"), @Index(columnList = "references_curie"), @Index(columnList = "allele_curie, references_curie") }) @JsonView({ View.FieldsAndLists.class, View.AlleleView.class }) private List references; @@ -139,8 +141,8 @@ public class Allele extends GenomicEntity { @JsonView({ View.FieldsAndLists.class, View.AlleleView.class }) private List alleleNomenclatureEvents; - @IndexedEmbedded(includePaths = {"objectGene.curie", "objectGene.geneSymbol.displayText", "objectGene.geneSymbol.formatText", "objectGene.geneFullName.displayText", "objectGene.geneFullName.formatText", - "objectGene.curie_keyword", "objectGene.geneSymbol.displayText_keyword", "objectGene.geneSymbol.formatText_keyword", "objectGene.geneFullName.displayText_keyword", "objectGene.geneFullName.formatText_keyword"}) + @IndexedEmbedded(includePaths = {"object.curie", "object.geneSymbol.displayText", "object.geneSymbol.formatText", "object.geneFullName.displayText", "object.geneFullName.formatText", + "object.curie_keyword", "object.geneSymbol.displayText_keyword", "object.geneSymbol.formatText_keyword", "object.geneFullName.displayText_keyword", "object.geneFullName.formatText_keyword"}) @OneToMany(mappedBy = "subject", cascade = CascadeType.ALL) @JsonView({ View.FieldsAndLists.class, View.AlleleDetailView.class }) private List alleleGeneAssociations; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java index ddbc52995..0111711e8 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java @@ -79,9 +79,9 @@ public class Construct extends Reagent { @JsonView({ View.FieldsAndLists.class, View.ConstructView.class }) private List constructComponents; - @IndexedEmbedded(includePaths = {"objectGenomicEntity.curie", "objectGenomicEntity.name", "objectGenomicEntity.symbol", "relation.name", - "objectGenomicEntity.curie_keyword", "objectGenomicEntity.name_keyword", "objectGenomicEntity.symbol_keyword", "relation.name_keyword"}) - @OneToMany(mappedBy = "subjectConstruct", cascade = CascadeType.ALL) + @IndexedEmbedded(includePaths = {"object.curie", "object.name", "object.symbol", "relation.name", + "object.curie_keyword", "object.name_keyword", "object.symbol_keyword", "relation.name_keyword"}) + @OneToMany(mappedBy = "subject", cascade = CascadeType.ALL) @JsonView({ View.FieldsAndLists.class, View.ConstructView.class }) private List constructGenomicEntityAssociations; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java index 3fb40aa88..0083d07ac 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java @@ -81,7 +81,7 @@ public class Gene extends GenomicEntity { @IndexedEmbedded(includePaths = {"subject.curie", "subject.alleleSymbol.displayText", "subject.alleleSymbol.formatText", "subject.alleleFullName.displayText", "subject.alleleFullName.formatText", "subject.curie_keyword", "subject.alleleSymbol.displayText_keyword", "subject.alleleSymbol.formatText_keyword", "subject.alleleFullName.displayText_keyword", "subject.alleleFullName.formatText_keyword"}) - @OneToMany(mappedBy = "objectGene", cascade = CascadeType.ALL) + @OneToMany(mappedBy = "object", cascade = CascadeType.ALL) @JsonView({ View.FieldsAndLists.class, View.GeneDetailView.class }) private List alleleGeneAssociations; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java index 829b35f0a..c3c68ddf0 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java @@ -45,11 +45,11 @@ public class GenomicEntity extends BiologicalEntity { @JsonView({ View.FieldsAndLists.class }) private List crossReferences; - @IndexedEmbedded(includePaths = {"constructSubject.curie", "constructSubject.constructSymbol.displayText", "constructSubject.constructSymbol.formatText", - "constructSubject.constructFullName.displayText", "constructSubject.constructFullName.formatText", "constructSubject.modEntityId", - "constructSubject.curie_keyword", "constructSubject.constructSymbol.displayText_keyword", "constructSubject.constructSymbol.formatText_keyword", - "constructSubject.constructFullName.displayText_keyword", "constructSubject.constructFullName.formatText_keyword", "constructSubject.modEntityId_keyword",}) - @OneToMany(mappedBy = "objectGenomicEntity", cascade = CascadeType.ALL) + @IndexedEmbedded(includePaths = {"subject.curie", "subject.constructSymbol.displayText", "subject.constructSymbol.formatText", + "subject.constructFullName.displayText", "subject.constructFullName.formatText", "subject.modEntityId", + "subject.curie_keyword", "subject.constructSymbol.displayText_keyword", "subject.constructSymbol.formatText_keyword", + "subject.constructFullName.displayText_keyword", "subject.constructFullName.formatText_keyword", "subject.modEntityId_keyword",}) + @OneToMany(mappedBy = "object", cascade = CascadeType.ALL) @JsonView({ View.FieldsAndLists.class, View.GeneDetailView.class }) private List constructGenomicEntityAssociations; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java index 47ac7edda..ed1d38cab 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java @@ -34,7 +34,7 @@ @Schema(name = "AlleleGeneAssociation", description = "POJO representing an association between an allele and a gene") @Table(indexes = { @Index(name = "allelegeneassociation_subject_index", columnList = "subject_curie"), - @Index(name = "allelegeneassociation_object_index", columnList = "objectGene_curie") + @Index(name = "allelegeneassociation_object_index", columnList = "object_curie") }) public class AlleleGeneAssociation extends AlleleGenomicEntityAssociation { @@ -52,5 +52,5 @@ public class AlleleGeneAssociation extends AlleleGenomicEntityAssociation { @OneToOne @JsonView({ View.FieldsOnly.class }) @JsonIgnoreProperties({"alleleGeneAssociations", "constructGenomicEntityAssociations"}) - private Gene objectGene; + private Gene object; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java index 6fe6fba28..256b35112 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java @@ -41,8 +41,8 @@ @AGRCurationSchemaVersion(min = "1.11.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { EvidenceAssociation.class }) @Schema(name = "ConstructGenomicEntityAssociation", description = "POJO representing an association between a construct and a genomic entity") @Table(indexes = { - @Index(name = "constructgenomicentityassociation_subject_index", columnList = "subjectConstruct_id"), - @Index(name = "constructgenomicentityassociation_object_index", columnList = "objectGenomicEntity_curie"), + @Index(name = "constructgenomicentityassociation_subject_index", columnList = "subject_id"), + @Index(name = "constructgenomicentityassociation_object_index", columnList = "object_curie"), @Index(name = "constructgenomicentityassociation_relation_index", columnList = "relation_id") }) public class ConstructGenomicEntityAssociation extends EvidenceAssociation { @@ -55,7 +55,7 @@ public class ConstructGenomicEntityAssociation extends EvidenceAssociation { @JsonView({ View.FieldsOnly.class }) @JsonIgnoreProperties("constructGenomicEntityAssociations") @Fetch(FetchMode.JOIN) - private Construct subjectConstruct; + private Construct subject; @IndexedEmbedded(includeDepth = 1) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @@ -68,7 +68,7 @@ public class ConstructGenomicEntityAssociation extends EvidenceAssociation { @OneToOne @JsonView({ View.FieldsOnly.class }) @JsonIgnoreProperties({"alleleGeneAssociations", "constructGenomicEntityAssociations"}) - private GenomicEntity objectGenomicEntity; + private GenomicEntity object; @IndexedEmbedded(includeDepth = 1) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) diff --git a/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java b/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java index 02ee18b55..44fbb63c6 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java @@ -142,7 +142,7 @@ public ObjectResponse getAssociation(String alleleCurie, Map params = new HashMap<>(); params.put("subject.curie", alleleCurie); params.put("relation.name", relationName); - params.put("objectGene.curie", geneCurie); + params.put("object.curie", geneCurie); SearchResponse resp = alleleGeneAssociationDAO.findByParams(params); if (resp != null && resp.getSingleResult() != null) @@ -167,7 +167,7 @@ private void addAssociationToAllele(AlleleGeneAssociation association) { } private void addAssociationToGene(AlleleGeneAssociation association) { - Gene gene = association.getObjectGene(); + Gene gene = association.getObject(); List currentAssociations = gene.getAlleleGeneAssociations(); if (currentAssociations == null) currentAssociations = new ArrayList<>(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java b/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java index 1509c130d..ecc6de290 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java @@ -131,9 +131,9 @@ public ObjectResponse getAssociation(Long con ConstructGenomicEntityAssociation association = null; Map params = new HashMap<>(); - params.put("subjectConstruct.id", constructId); + params.put("subject.id", constructId); params.put("relation.name", relationName); - params.put("objectGenomicEntity.curie", genomicEntityCurie); + params.put("object.curie", genomicEntityCurie); SearchResponse resp = constructGenomicEntityAssociationDAO.findByParams(params); if (resp != null && resp.getSingleResult() != null) @@ -146,7 +146,7 @@ public ObjectResponse getAssociation(Long con } private void addAssociationToConstruct(ConstructGenomicEntityAssociation association) { - Construct construct = association.getSubjectConstruct(); + Construct construct = association.getSubject(); List currentAssociations = construct.getConstructGenomicEntityAssociations(); if (currentAssociations == null) currentAssociations = new ArrayList<>(); @@ -158,7 +158,7 @@ private void addAssociationToConstruct(ConstructGenomicEntityAssociation associa } private void addAssociationToGenomicEntity(ConstructGenomicEntityAssociation association) { - GenomicEntity genomicEntity = association.getObjectGenomicEntity(); + GenomicEntity genomicEntity = association.getObject(); List currentAssociations = genomicEntity.getConstructGenomicEntityAssociations(); if (currentAssociations == null) currentAssociations = new ArrayList<>(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java index c4398f115..5bf67fc5c 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java @@ -53,7 +53,7 @@ public AlleleGeneAssociation validateAlleleGeneAssociation(AlleleGeneAssociation } Gene object = validateObject(uiEntity, dbEntity); - dbEntity.setObjectGene(object); + dbEntity.setObject(object); VocabularyTerm relation = validateRelation(uiEntity, dbEntity); dbEntity.setRelation(relation); @@ -89,19 +89,19 @@ private Allele validateSubject(AlleleGeneAssociation uiEntity, AlleleGeneAssocia } private Gene validateObject(AlleleGeneAssociation uiEntity, AlleleGeneAssociation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getObjectGene()) || StringUtils.isBlank(uiEntity.getObjectGene().getCurie())) { - addMessageResponse("objectGene", ValidationConstants.REQUIRED_MESSAGE); + if (ObjectUtils.isEmpty(uiEntity.getObject()) || StringUtils.isBlank(uiEntity.getObject().getCurie())) { + addMessageResponse("object", ValidationConstants.REQUIRED_MESSAGE); return null; } - Gene objectEntity = geneDAO.find(uiEntity.getObjectGene().getCurie()); + Gene objectEntity = geneDAO.find(uiEntity.getObject().getCurie()); if (objectEntity == null) { - addMessageResponse("objectGene", ValidationConstants.INVALID_MESSAGE); + addMessageResponse("object", ValidationConstants.INVALID_MESSAGE); return null; } - if (objectEntity.getObsolete() && (dbEntity.getObjectGene() == null || !objectEntity.getCurie().equals(dbEntity.getObjectGene().getCurie()))) { - addMessageResponse("objectGene", ValidationConstants.OBSOLETE_MESSAGE); + if (objectEntity.getObsolete() && (dbEntity.getObject() == null || !objectEntity.getCurie().equals(dbEntity.getObject().getCurie()))) { + addMessageResponse("object", ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java index b8caf16a3..1031b500a 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java @@ -66,11 +66,11 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati if (validateConstruct) { Construct subject = validateSubject(uiEntity, dbEntity); - dbEntity.setSubjectConstruct(subject); + dbEntity.setSubject(subject); } GenomicEntity object = validateObject(uiEntity, dbEntity); - dbEntity.setObjectGenomicEntity(object); + dbEntity.setObject(object); VocabularyTerm relation = validateRelation(uiEntity, dbEntity); dbEntity.setRelation(relation); @@ -93,19 +93,19 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati } private Construct validateSubject(ConstructGenomicEntityAssociation uiEntity, ConstructGenomicEntityAssociation dbEntity) { - String field = "subjectConstruct"; - if (ObjectUtils.isEmpty(uiEntity.getSubjectConstruct())) { + String field = "subject"; + if (ObjectUtils.isEmpty(uiEntity.getSubject())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } - Construct subjectEntity = constructDAO.find(uiEntity.getSubjectConstruct().getId()); + Construct subjectEntity = constructDAO.find(uiEntity.getSubject().getId()); if (subjectEntity == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubjectConstruct() == null || !subjectEntity.getId().equals(dbEntity.getSubjectConstruct().getId()))) { + if (subjectEntity.getObsolete() && (dbEntity.getSubject() == null || !subjectEntity.getId().equals(dbEntity.getSubject().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -115,19 +115,19 @@ private Construct validateSubject(ConstructGenomicEntityAssociation uiEntity, Co } private GenomicEntity validateObject(ConstructGenomicEntityAssociation uiEntity, ConstructGenomicEntityAssociation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getObjectGenomicEntity()) || StringUtils.isBlank(uiEntity.getObjectGenomicEntity().getCurie())) { - addMessageResponse("objectGenomicEntity", ValidationConstants.REQUIRED_MESSAGE); + if (ObjectUtils.isEmpty(uiEntity.getObject()) || StringUtils.isBlank(uiEntity.getObject().getCurie())) { + addMessageResponse("object", ValidationConstants.REQUIRED_MESSAGE); return null; } - GenomicEntity objectEntity = genomicEntityDAO.find(uiEntity.getObjectGenomicEntity().getCurie()); + GenomicEntity objectEntity = genomicEntityDAO.find(uiEntity.getObject().getCurie()); if (objectEntity == null) { - addMessageResponse("objectGenomicEntity", ValidationConstants.INVALID_MESSAGE); + addMessageResponse("object", ValidationConstants.INVALID_MESSAGE); return null; } - if (objectEntity.getObsolete() && (dbEntity.getObjectGenomicEntity() == null || !objectEntity.getCurie().equals(dbEntity.getObjectGenomicEntity().getCurie()))) { - addMessageResponse("objectGenomicEntity", ValidationConstants.OBSOLETE_MESSAGE); + if (objectEntity.getObsolete() && (dbEntity.getObject() == null || !objectEntity.getCurie().equals(dbEntity.getObject().getCurie()))) { + addMessageResponse("object", ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java index dbf05490b..f3e4254b2 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java @@ -40,7 +40,7 @@ public AlleleGeneAssociation validateAlleleGeneAssociationDTO(AlleleGeneAssociat HashMap params = new HashMap<>(); params.put("subject.curie", dto.getAlleleCurie()); params.put("relation.name", dto.getRelationName()); - params.put("objectGene.curie", dto.getGeneCurie()); + params.put("object.curie", dto.getGeneCurie()); SearchResponse searchResponse = alleleGeneAssociationDAO.findByParams(params); if (searchResponse != null && searchResponse.getResults().size() == 1) { @@ -72,7 +72,7 @@ public AlleleGeneAssociation validateAlleleGeneAssociationDTO(AlleleGeneAssociat Gene gene = geneDAO.find(dto.getGeneCurie()); if (gene == null) agaResponse.addErrorMessage("gene_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGeneCurie() + ")"); - association.setObjectGene(gene); + association.setObject(gene); } if (StringUtils.isNotEmpty(dto.getRelationName())) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java index 8959daf8a..ecd38d04e 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java @@ -74,9 +74,9 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati ConstructGenomicEntityAssociation association = null; if (construct != null && StringUtils.isNotBlank(dto.getGenomicEntityRelationName()) && StringUtils.isNotBlank(dto.getGenomicEntityCurie())) { HashMap params = new HashMap<>(); - params.put("subjectConstruct.id", construct.getId()); + params.put("subject.id", construct.getId()); params.put("relation.name", dto.getGenomicEntityRelationName()); - params.put("objectGenomicEntity.curie", dto.getGenomicEntityCurie()); + params.put("object.curie", dto.getGenomicEntityCurie()); SearchResponse searchResponse = constructGenomicEntityAssociationDAO.findByParams(params); if (searchResponse != null && searchResponse.getResults().size() == 1) { @@ -86,7 +86,7 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati if (association == null) association = new ConstructGenomicEntityAssociation(); - association.setSubjectConstruct(construct); + association.setSubject(construct); ObjectResponse eviResponse = validateEvidenceAssociationDTO(association, dto); assocResponse.addErrorMessages(eviResponse.getErrorMessages()); @@ -98,7 +98,7 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati GenomicEntity genomicEntity = genomicEntityDAO.find(dto.getGenomicEntityCurie()); if (genomicEntity == null) assocResponse.addErrorMessage("genomic_entity_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGenomicEntityCurie() + ")"); - association.setObjectGenomicEntity(genomicEntity); + association.setObject(genomicEntity); } if (StringUtils.isNotEmpty(dto.getGenomicEntityRelationName())) { diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql new file mode 100644 index 000000000..3db8998cf --- /dev/null +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -0,0 +1,10 @@ +-- Revert temporary changes to association table columns + +ALTER TABLE constructgenomicentityassociation RENAME subjectconstruct_id TO subject_id; +ALTER TABLE constructgenomicentityassociation_aud RENAME subjectconstruct_id TO subject_id; + +ALTER TABLE constructgenomicentityassociation RENAME objectgenomicentity_curie TO object_curie; +ALTER TABLE constructgenomicentityassociation_aud RENAME objectgenomicentity_curie TO object_curie; + +ALTER TABLE allelegeneassociation RENAME objectgene_curie TO object_curie; +ALTER TABLE allelegeneassociation_aud RENAME objectgene_curie TO object_curie; \ No newline at end of file diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java index 9e86cabe0..40be55c28 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java @@ -76,7 +76,7 @@ public void alleleGeneAssociationBulkUploadCheckFields() throws Exception { then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.objectGene.curie", is(geneCurie)). + body("entity.object.curie", is(geneCurie)). body("entity.subject.curie", is(alleleCurie)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference)). @@ -104,7 +104,7 @@ public void alleleGeneAssociationBulkUploadCheckFields() throws Exception { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relationName)). - body("entity.alleleGeneAssociations[0].objectGene.curie", is(geneCurie)). + body("entity.alleleGeneAssociations[0].object.curie", is(geneCurie)). body("entity.alleleGeneAssociations[0].subject", not(hasKey("alleleGeneAssociations"))); RestAssured.given(). @@ -114,8 +114,8 @@ public void alleleGeneAssociationBulkUploadCheckFields() throws Exception { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relationName)). - body("entity.alleleGeneAssociations[0].objectGene.curie", is(geneCurie)). - body("entity.alleleGeneAssociations[0].objectGene", not(hasKey("alleleGeneAssociations"))); + body("entity.alleleGeneAssociations[0].object.curie", is(geneCurie)). + body("entity.alleleGeneAssociations[0].object", not(hasKey("alleleGeneAssociations"))); } @Test @@ -131,7 +131,7 @@ public void alleleGeneAssociationBulkUploadUpdateCheckFields() throws Exception then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.objectGene.curie", is(geneCurie)). + body("entity.object.curie", is(geneCurie)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2)). body("entity.evidenceCode.curie", is(evidenceCodeCurie2)). diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java index bc6333fba..1cd698405 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java @@ -68,8 +68,8 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.objectGenomicEntity.curie", is(geneCurie)). - body("entity.subjectConstruct.modEntityId", is(constructModEntityId)). + body("entity.object.curie", is(geneCurie)). + body("entity.subject.modEntityId", is(constructModEntityId)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference)). body("entity.internal", is(true)). @@ -96,8 +96,8 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce body("entity.modEntityId", is(constructModEntityId)). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relationName)). - body("entity.constructGenomicEntityAssociations[0].objectGenomicEntity.curie", is(geneCurie)). - body("entity.constructGenomicEntityAssociations[0].subjectConstruct", not(hasKey("constructGenomicEntityAssociations"))); + body("entity.constructGenomicEntityAssociations[0].object.curie", is(geneCurie)). + body("entity.constructGenomicEntityAssociations[0].subject", not(hasKey("constructGenomicEntityAssociations"))); RestAssured.given(). when(). @@ -106,8 +106,8 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relationName)). - body("entity.constructGenomicEntityAssociations[0].objectGenomicEntity.curie", is(geneCurie)). - body("entity.constructGenomicEntityAssociations[0].objectGenomicEntity", not(hasKey("constructGenomicEntityAssociations"))); + body("entity.constructGenomicEntityAssociations[0].object.curie", is(geneCurie)). + body("entity.constructGenomicEntityAssociations[0].object", not(hasKey("constructGenomicEntityAssociations"))); } @Test @@ -121,7 +121,7 @@ public void constructGenomicEntityAssociationBulkUploadUpdateCheckFields() throw then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.objectGenomicEntity.curie", is(geneCurie)). + body("entity.object.curie", is(geneCurie)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2)). body("entity.internal", is(false)). diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java index c721cb61f..b75624266 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java @@ -96,7 +96,7 @@ public void createValidAlleleGeneAssociation() { AlleleGeneAssociation association = new AlleleGeneAssociation(); association.setSubject(allele); - association.setObjectGene(gene); + association.setObject(gene); association.setRelation(relation); association.setEvidenceCode(ecoTerm); association.setInternal(true); @@ -118,7 +118,7 @@ public void createValidAlleleGeneAssociation() { then(). statusCode(200). body("entity.relation.name", is(relation.getName())). - body("entity.objectGene.curie", is(gene.getCurie())). + body("entity.object.curie", is(gene.getCurie())). body("entity.subject.curie", is(allele.getCurie())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference.getCurie())). @@ -142,7 +142,7 @@ public void createValidAlleleGeneAssociation() { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relation.getName())). - body("entity.alleleGeneAssociations[0].objectGene.curie", is(gene.getCurie())). + body("entity.alleleGeneAssociations[0].object.curie", is(gene.getCurie())). body("entity.alleleGeneAssociations[0].subject", not(hasKey("alleleGeneAssociations"))); RestAssured.given(). @@ -152,8 +152,8 @@ public void createValidAlleleGeneAssociation() { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relation.getName())). - body("entity.alleleGeneAssociations[0].objectGene.curie", is(gene.getCurie())). - body("entity.alleleGeneAssociations[0].objectGene", not(hasKey("alleleGeneAssociations"))); + body("entity.alleleGeneAssociations[0].object.curie", is(gene.getCurie())). + body("entity.alleleGeneAssociations[0].object", not(hasKey("alleleGeneAssociations"))); } @Test @@ -162,7 +162,7 @@ public void editAlleleGeneAssociation() { AlleleGeneAssociation association = getAlleleGeneAssociation(allele.getCurie(), relation.getName(), gene.getCurie()); association.setSubject(allele2); association.setRelation(relation2); - association.setObjectGene(gene2); + association.setObject(gene2); association.setEvidenceCode(ecoTerm2); association.setInternal(false); association.setObsolete(false); @@ -183,7 +183,7 @@ public void editAlleleGeneAssociation() { then(). statusCode(200). body("entity.relation.name", is(relation2.getName())). - body("entity.objectGene.curie", is(gene2.getCurie())). + body("entity.object.curie", is(gene2.getCurie())). body("entity.subject.curie", is(allele2.getCurie())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2.getCurie())). @@ -216,7 +216,7 @@ public void createAlleleGeneAssociationWithMissingRequiredFieldsLevel1() { body("errorMessages", is(aMapWithSize(3))). body("errorMessages.subject", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.objectGene", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.object", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @@ -225,7 +225,7 @@ public void createAlleleGeneAssociationWithMissingRequiredFieldsLevel2() { AlleleGeneAssociation association = new AlleleGeneAssociation(); association.setSubject(allele2); association.setRelation(relation); - association.setObjectGene(gene); + association.setObject(gene); Note emptyNote = new Note(); association.setRelatedNote(emptyNote); @@ -249,7 +249,7 @@ public void createAlleleGeneAssociationWithEmptyRequiredFieldsLevel2() { AlleleGeneAssociation association = new AlleleGeneAssociation(); association.setSubject(allele2); association.setRelation(relation); - association.setObjectGene(gene); + association.setObject(gene); Note invalidNote = new Note(); invalidNote.setNoteType(noteType); @@ -272,7 +272,7 @@ public void editAlleleGeneAssociationWithMissingRequiredFieldsLevel1() { AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getCurie(), relation2.getName(), gene2.getCurie()); association.setSubject(null); association.setRelation(null); - association.setObjectGene(null); + association.setObject(null); RestAssured.given(). contentType("application/json"). @@ -284,7 +284,7 @@ public void editAlleleGeneAssociationWithMissingRequiredFieldsLevel1() { body("errorMessages", is(aMapWithSize(3))). body("errorMessages.subject", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.objectGene", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.object", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @@ -350,7 +350,7 @@ public void createAlleleGeneAssociationWithInvalidFields() { AlleleGeneAssociation association = new AlleleGeneAssociation(); association.setSubject(nonPersistedAllele); association.setRelation(noteType); - association.setObjectGene(nonPersistedGene); + association.setObject(nonPersistedGene); association.setEvidence(List.of(nonPersistedReference)); association.setRelatedNote(invalidNote); association.setEvidenceCode(nonPersistedEcoTerm); @@ -365,7 +365,7 @@ public void createAlleleGeneAssociationWithInvalidFields() { body("errorMessages", is(aMapWithSize(6))). body("errorMessages.subject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.objectGene", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.object", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidenceCode", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relatedNote", is(String.join(" | ", List.of( @@ -393,7 +393,7 @@ public void editAlleleGeneAssociationWithInvalidFields() { AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getCurie(), relation2.getName(), gene2.getCurie()); association.setSubject(nonPersistedAllele); association.setRelation(noteType); - association.setObjectGene(nonPersistedGene); + association.setObject(nonPersistedGene); association.setEvidence(List.of(nonPersistedReference)); association.setRelatedNote(invalidNote); association.setEvidenceCode(nonPersistedEcoTerm); @@ -408,7 +408,7 @@ public void editAlleleGeneAssociationWithInvalidFields() { body("errorMessages", is(aMapWithSize(6))). body("errorMessages.subject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.objectGene", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.object", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidenceCode", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relatedNote", is(String.join(" | ", List.of( @@ -423,7 +423,7 @@ public void createAlleleGeneAssociationWithObsoleteFields() { association.setSubject(obsoleteAllele); association.setRelation(obsoleteRelation); - association.setObjectGene(obsoleteGene); + association.setObject(obsoleteGene); association.setEvidenceCode(obsoleteEcoTerm); association.setEvidence(List.of(obsoleteReference)); @@ -444,7 +444,7 @@ public void createAlleleGeneAssociationWithObsoleteFields() { body("errorMessages", is(aMapWithSize(6))). body("errorMessages.subject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.objectGene", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.object", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidenceCode", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relatedNote", is(String.join(" | ", List.of( @@ -459,7 +459,7 @@ public void editAlleleGeneAssociationWithObsoleteFields() { association.setSubject(obsoleteAllele); association.setRelation(obsoleteRelation); - association.setObjectGene(obsoleteGene); + association.setObject(obsoleteGene); association.setEvidenceCode(obsoleteEcoTerm); association.setEvidence(List.of(obsoleteReference)); @@ -479,7 +479,7 @@ public void editAlleleGeneAssociationWithObsoleteFields() { body("errorMessages", is(aMapWithSize(6))). body("errorMessages.subject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.objectGene", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.object", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidenceCode", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relatedNote", is(String.join(" | ", List.of( diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java index 2c04c7809..64d9e21c3 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java @@ -89,8 +89,8 @@ public void createValidConstructGenomicEntityAssociation() { loadRequiredEntities(); ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubjectConstruct(construct); - association.setObjectGenomicEntity(gene); + association.setSubject(construct); + association.setObject(gene); association.setRelation(relation); association.setInternal(true); association.setObsolete(true); @@ -111,8 +111,8 @@ public void createValidConstructGenomicEntityAssociation() { then(). statusCode(200). body("entity.relation.name", is(relation.getName())). - body("entity.objectGenomicEntity.curie", is(gene.getCurie())). - body("entity.subjectConstruct.curie", is(construct.getCurie())). + body("entity.object.curie", is(gene.getCurie())). + body("entity.subject.curie", is(construct.getCurie())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference.getCurie())). body("entity.internal", is(true)). @@ -134,8 +134,8 @@ public void createValidConstructGenomicEntityAssociation() { statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relation.getName())). - body("entity.constructGenomicEntityAssociations[0].objectGenomicEntity.curie", is(gene.getCurie())). - body("entity.constructGenomicEntityAssociations[0].subjectConstruct", not(hasKey("constructGeneAssociations"))); + body("entity.constructGenomicEntityAssociations[0].object.curie", is(gene.getCurie())). + body("entity.constructGenomicEntityAssociations[0].subject", not(hasKey("constructGeneAssociations"))); RestAssured.given(). when(). @@ -144,17 +144,17 @@ public void createValidConstructGenomicEntityAssociation() { statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relation.getName())). - body("entity.constructGenomicEntityAssociations[0].objectGenomicEntity.curie", is(gene.getCurie())). - body("entity.constructGenomicEntityAssociations[0].subjectConstruct", not(hasKey("constructGeneAssociations"))); + body("entity.constructGenomicEntityAssociations[0].object.curie", is(gene.getCurie())). + body("entity.constructGenomicEntityAssociations[0].subject", not(hasKey("constructGeneAssociations"))); } @Test @Order(2) public void editConstructGenomicEntityAssociation() { ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct.getId(), relation.getName(), gene.getCurie()); - association.setSubjectConstruct(construct2); + association.setSubject(construct2); association.setRelation(relation2); - association.setObjectGenomicEntity(gene2); + association.setObject(gene2); association.setInternal(false); association.setObsolete(false); association.setEvidence(List.of(reference2)); @@ -174,8 +174,8 @@ public void editConstructGenomicEntityAssociation() { then(). statusCode(200). body("entity.relation.name", is(relation2.getName())). - body("entity.objectGenomicEntity.curie", is(gene2.getCurie())). - body("entity.subjectConstruct.modEntityId", is(construct2.getModEntityId())). + body("entity.object.curie", is(gene2.getCurie())). + body("entity.subject.modEntityId", is(construct2.getModEntityId())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2.getCurie())). body("entity.internal", is(false)). @@ -204,18 +204,18 @@ public void createConstructGenomicEntityAssociationWithMissingRequiredFieldsLeve then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.subjectConstruct", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.subject", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.objectGenomicEntity", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.object", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @Order(4) public void createConstructGenomicEntityAssociationWithMissingRequiredFieldsLevel2() { ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubjectConstruct(construct2); + association.setSubject(construct2); association.setRelation(relation); - association.setObjectGenomicEntity(gene); + association.setObject(gene); Note emptyNote = new Note(); association.setRelatedNotes(List.of(emptyNote)); @@ -237,9 +237,9 @@ public void createConstructGenomicEntityAssociationWithMissingRequiredFieldsLeve @Order(5) public void createConstructGenomicEntityAssociationWithEmptyRequiredFieldsLevel2() { ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubjectConstruct(construct2); + association.setSubject(construct2); association.setRelation(relation); - association.setObjectGenomicEntity(gene); + association.setObject(gene); Note invalidNote = new Note(); invalidNote.setNoteType(noteType); @@ -260,9 +260,9 @@ public void createConstructGenomicEntityAssociationWithEmptyRequiredFieldsLevel2 @Order(6) public void editConstructGenomicEntityAssociationWithMissingRequiredFieldsLevel1() { ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getCurie()); - association.setSubjectConstruct(null); + association.setSubject(null); association.setRelation(null); - association.setObjectGenomicEntity(null); + association.setObject(null); RestAssured.given(). contentType("application/json"). @@ -272,9 +272,9 @@ public void editConstructGenomicEntityAssociationWithMissingRequiredFieldsLevel1 then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.subjectConstruct", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.subject", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.objectGenomicEntity", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.object", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @@ -338,9 +338,9 @@ public void createConstructGenomicEntityAssociationWithInvalidFields() { invalidNote.setFreeText("Invalid"); ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubjectConstruct(nonPersistedConstruct); + association.setSubject(nonPersistedConstruct); association.setRelation(noteType); - association.setObjectGenomicEntity(nonPersistedGene); + association.setObject(nonPersistedGene); association.setEvidence(List.of(nonPersistedReference)); association.setRelatedNotes(List.of(invalidNote)); @@ -352,9 +352,9 @@ public void createConstructGenomicEntityAssociationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subjectConstruct", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.subject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.objectGenomicEntity", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.object", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relatedNotes", is(String.join(" | ", List.of( "noteType - " + ValidationConstants.INVALID_MESSAGE, @@ -379,9 +379,9 @@ public void editConstructGenomicEntityAssociationWithInvalidFields() { invalidNote.setFreeText("Invalid"); ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getCurie()); - association.setSubjectConstruct(nonPersistedConstruct); + association.setSubject(nonPersistedConstruct); association.setRelation(noteType); - association.setObjectGenomicEntity(nonPersistedGene); + association.setObject(nonPersistedGene); association.setEvidence(List.of(nonPersistedReference)); association.setRelatedNotes(List.of(invalidNote)); @@ -393,9 +393,9 @@ public void editConstructGenomicEntityAssociationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subjectConstruct", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.subject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.objectGenomicEntity", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.object", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relatedNotes", is(String.join(" | ", List.of( "noteType - " + ValidationConstants.INVALID_MESSAGE, @@ -407,9 +407,9 @@ public void editConstructGenomicEntityAssociationWithInvalidFields() { public void createConstructGenomicEntityAssociationWithObsoleteFields() { ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubjectConstruct(obsoleteConstruct); + association.setSubject(obsoleteConstruct); association.setRelation(obsoleteRelation); - association.setObjectGenomicEntity(obsoleteGene); + association.setObject(obsoleteGene); association.setEvidence(List.of(obsoleteReference)); Note note = new Note(); @@ -427,9 +427,9 @@ public void createConstructGenomicEntityAssociationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subjectConstruct", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.subject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.objectGenomicEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.object", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relatedNotes", is(String.join(" | ", List.of( "noteType - " + ValidationConstants.OBSOLETE_MESSAGE, @@ -441,9 +441,9 @@ public void createConstructGenomicEntityAssociationWithObsoleteFields() { public void editConstructGenomicEntityAssociationWithObsoleteFields() { ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getCurie()); - association.setSubjectConstruct(obsoleteConstruct); + association.setSubject(obsoleteConstruct); association.setRelation(obsoleteRelation); - association.setObjectGenomicEntity(obsoleteGene); + association.setObject(obsoleteGene); association.setEvidence(List.of(obsoleteReference)); Note note = association.getRelatedNotes().get(0); @@ -460,9 +460,9 @@ public void editConstructGenomicEntityAssociationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subjectConstruct", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.subject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.objectGenomicEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.object", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relatedNotes", is(String.join(" | ", List.of( "noteType - " + ValidationConstants.OBSOLETE_MESSAGE, From 70bf7f579c6974934942b82e8651a676eb34e683 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 1 Dec 2023 13:14:49 +0000 Subject: [PATCH 002/159] Refactor entity classes --- .../curation_api/model/entities/Agent.java | 2 +- .../model/entities/Association.java | 11 +-- .../model/entities/BiologicalEntity.java | 22 ++---- .../model/entities/CrossReference.java | 9 +-- .../model/entities/DataProvider.java | 9 +-- .../curation_api/model/entities/Gene.java | 2 +- .../entities/InformationContentEntity.java | 4 +- .../curation_api/model/entities/Note.java | 5 +- .../curation_api/model/entities/Person.java | 9 ++- .../model/entities/PersonSetting.java | 5 +- .../curation_api/model/entities/Reagent.java | 53 ++------------ .../model/entities/ResourceDescriptor.java | 5 +- .../entities/ResourceDescriptorPage.java | 7 +- .../curation_api/model/entities/Species.java | 26 ++++--- .../curation_api/model/entities/Synonym.java | 6 +- .../model/entities/Vocabulary.java | 5 +- .../model/entities/VocabularyTerm.java | 7 +- .../model/entities/VocabularyTermSet.java | 5 +- .../model/entities/base/AuditedObject.java | 26 ++++++- ...rieAuditedObject.java => CurieObject.java} | 34 ++++++--- .../entities/base/GeneratedAuditedObject.java | 35 --------- .../model/entities/base/SubmittedObject.java | 71 +++++++++++++++++++ .../entities/base/UniqueIdAuditedObject.java | 2 +- .../model/entities/bulkloads/BulkLoad.java | 3 +- .../entities/bulkloads/BulkLoadFile.java | 3 +- .../bulkloads/BulkLoadFileException.java | 3 +- .../bulkloads/BulkLoadFileHistory.java | 3 +- .../entities/bulkloads/BulkLoadGroup.java | 3 +- .../curationreports/CurationReport.java | 3 +- .../curationreports/CurationReportGroup.java | 3 +- .../CurationReportHistory.java | 3 +- .../model/entities/ontology/OntologyTerm.java | 4 +- .../orthology/GeneToGeneOrthology.java | 5 +- .../slotAnnotations/SlotAnnotation.java | 5 +- .../CurieAuditedObjectValidator.java | 6 +- .../v0.30.0.1__linkml_v2.0.0_update.sql | 6 +- 36 files changed, 201 insertions(+), 209 deletions(-) rename src/main/java/org/alliancegenome/curation_api/model/entities/base/{CurieAuditedObject.java => CurieObject.java} (50%) delete mode 100644 src/main/java/org/alliancegenome/curation_api/model/entities/base/GeneratedAuditedObject.java create mode 100644 src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Agent.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Agent.java index 8d4ae71b1..f6942d4cb 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Agent.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Agent.java @@ -15,6 +15,6 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @MappedSuperclass -public class Agent extends UniqueIdAuditedObject { +public class Agent extends AuditedObject { } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java index 9c446032f..a667e8404 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java @@ -3,15 +3,12 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.envers.Audited; import jakarta.persistence.Entity; -import jakarta.persistence.Index; import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; -import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; @@ -22,12 +19,6 @@ @Inheritance(strategy = InheritanceType.JOINED) @Schema(name = "association", description = "POJO that represents an association") @AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) - -@Table(indexes = { - @Index(name = "association_createdby_index", columnList = "createdBy_id"), - @Index(name = "association_updatedby_index", columnList = "updatedBy_id"), -}) - -public class Association extends GeneratedAuditedObject { +public class Association extends AuditedObject { } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java index e09052072..966055c42 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java @@ -3,12 +3,9 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.bridges.BiologicalEntityTypeBridge; -import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.CurieAuditedObject; +import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; import org.alliancegenome.curation_api.model.entities.ontology.NCBITaxonTerm; import org.alliancegenome.curation_api.view.View; -import org.hibernate.annotations.Fetch; -import org.hibernate.annotations.FetchMode; import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.bridge.mapping.annotation.TypeBinderRef; @@ -40,23 +37,16 @@ @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) -@AGRCurationSchemaVersion(min = "1.7.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -@Table(indexes = { @Index(name = "biologicalentity_createdby_index", columnList = "createdBy_id"), @Index(name = "biologicalentity_updatedby_index", columnList = "updatedBy_id"), - @Index(name = "biologicalentity_taxon_index", columnList = "taxon_curie"), @Index(name = "biologicalentity_dataprovider_index", columnList = "dataprovider_id")}) -public class BiologicalEntity extends CurieAuditedObject { +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SubmittedObject.class }) +@Table(indexes = { + @Index(name = "biologicalentity_taxon_index", columnList = "taxon_curie") +}) +public class BiologicalEntity extends SubmittedObject { @IndexedEmbedded(includePaths = {"name", "curie", "name_keyword", "curie_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @JsonView({ View.FieldsOnly.class }) private NCBITaxonTerm taxon; - - @IndexedEmbedded(includePaths = {"sourceOrganization.abbreviation", "sourceOrganization.fullName", "sourceOrganization.shortName", "crossReference.displayName", "crossReference.referencedCurie", - "sourceOrganization.abbreviation_keyword", "sourceOrganization.fullName_keyword", "sourceOrganization.shortName_keyword", "crossReference.displayName_keyword", "crossReference.referencedCurie_keyword"}) - @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) - @ManyToOne - @Fetch(FetchMode.SELECT) - @JsonView({ View.FieldsOnly.class }) - private DataProvider dataProvider; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/CrossReference.java b/src/main/java/org/alliancegenome/curation_api/model/entities/CrossReference.java index 69bab30ce..05c2fb527 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/CrossReference.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/CrossReference.java @@ -3,7 +3,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.Fetch; @@ -35,9 +34,11 @@ @ToString(callSuper = true) @Schema(name = "CrossReference", description = "POJO that represents the Cross Reference") @AGRCurationSchemaVersion(min = "1.6.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -@Table(indexes = { @Index(name = "crossreference_createdby_index", columnList = "createdBy_id"), @Index(name = "crossreference_updatedby_index", columnList = "updatedBy_id"), - @Index(name = "crossreference_resourcedescriptorpage_index", columnList = "resourcedescriptorpage_id"), @Index(name = "crossreference_referencedcurie_index", columnList = "referencedcurie")}) -public class CrossReference extends GeneratedAuditedObject { +@Table(indexes = { + @Index(name = "crossreference_resourcedescriptorpage_index", columnList = "resourcedescriptorpage_id"), + @Index(name = "crossreference_referencedcurie_index", columnList = "referencedcurie") +}) +public class CrossReference extends AuditedObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "referencedCurie_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/DataProvider.java b/src/main/java/org/alliancegenome/curation_api/model/entities/DataProvider.java index 5ff0c4d52..a0c51a5c5 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/DataProvider.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/DataProvider.java @@ -3,7 +3,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.envers.Audited; @@ -28,9 +27,11 @@ @ToString(callSuper = true) @Schema(name = "DataProvider", description = "POJO that represents the data provider") @AGRCurationSchemaVersion(min = "1.6.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -@Table(indexes = { @Index(name = "dataprovider_createdby_index", columnList = "createdBy_id"), @Index(name = "dataprovider_updatedby_index", columnList = "updatedBy_id"), - @Index(name = "dataprovider_crossreference_index", columnList = "crossreference_id"), @Index(name = "dataprovider_sourceorganization_index", columnList = "sourceorganization_id")}) -public class DataProvider extends GeneratedAuditedObject { +@Table(indexes = { + @Index(name = "dataprovider_crossreference_index", columnList = "crossreference_id"), + @Index(name = "dataprovider_sourceorganization_index", columnList = "sourceorganization_id") +}) +public class DataProvider extends AuditedObject { @IndexedEmbedded(includeDepth = 1) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java index 0083d07ac..dc68b9cba 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java @@ -39,7 +39,7 @@ @ToString(exclude = { "geneDiseaseAnnotations", "geneSymbol", "geneFullName", "geneSystematicName", "geneSynonyms", "geneSecondaryIds", "alleleGeneAssociations" }, callSuper = true) @Schema(name = "Gene", description = "POJO that represents the Gene") @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { GenomicEntity.class }, partial = true) -@Table(indexes = { @Index(name = "gene_taxon_index", columnList = "geneType_curie"), }) +@Table(indexes = { @Index(name = "gene_genetype_index", columnList = "geneType_curie"), }) public class Gene extends GenomicEntity { @ManyToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java index e735027c3..54a65a6fc 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java @@ -3,7 +3,7 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.CurieAuditedObject; +import org.alliancegenome.curation_api.model.entities.base.CurieObject; import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -26,6 +26,6 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = Reference.class, name = "Reference") }) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Table(indexes = { @Index(name = "informationcontent_createdby_index", columnList = "createdBy_id"), @Index(name = "informationcontent_updatedby_index", columnList = "updatedBy_id"), }) -public class InformationContentEntity extends CurieAuditedObject { +public class InformationContentEntity extends CurieObject { } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java index 050680823..ab79bd1ce 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.bridges.FreeTextValueBridge; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.envers.Audited; @@ -42,8 +41,8 @@ @AttributeOverride(name = "internal", column = @Column(columnDefinition = "boolean default true", nullable = false)) @Schema(name = "Note", description = "POJO that represents the Note") @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -@Table(indexes = { @Index(name = "Note_noteType_index", columnList = "noteType_id"), @Index(name = "Note_createdby_index", columnList = "createdBy_id"), @Index(name = "Note_updatedby_index", columnList = "updatedBy_id"),}) -public class Note extends GeneratedAuditedObject { +@Table(indexes = { @Index(name = "Note_noteType_index", columnList = "noteType_id")}) +public class Note extends AuditedObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer", valueBridge = @ValueBridgeRef(type = FreeTextValueBridge.class)) @KeywordField(name = "freeText_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer", valueBridge = @ValueBridgeRef(type = FreeTextValueBridge.class)) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java index 949d66f6a..97843dcb4 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java @@ -38,13 +38,18 @@ @JsonIgnoreProperties(ignoreUnknown = true) @AGRCurationSchemaVersion(min = "1.3.2", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Agent.class }) @Table(indexes = { - @Index(name = "person_createdby_index", columnList = "createdBy_id"), - @Index(name = "person_updatedby_index", columnList = "updatedBy_id"), @Index(name = "person_uniqueid_index", columnList = "uniqueid"), @Index(name = "person_allianceMember_index", columnList = "allianceMember_id"), }) public class Person extends Agent { + @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") + @KeywordField(name = "uniqueId_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") + @Column(unique = true, length = 2000) + @JsonView({ View.FieldsOnly.class }) + @EqualsAndHashCode.Include + protected String uniqueId; + @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "firstName_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") @JsonView({ View.FieldsOnly.class, View.PersonSettingView.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java b/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java index 4927663b4..7fe700b74 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.hibernate.annotations.JdbcTypeCode; import org.hibernate.envers.Audited; @@ -33,12 +32,10 @@ @AGRCurationSchemaVersion(min = "1.3.2", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id") @Table(indexes = { - @Index(name = "personsetting_createdby_index", columnList = "createdBy_id"), - @Index(name = "personsetting_updatedby_index", columnList = "updatedBy_id"), @Index(name = "personsetting_person_index", columnList = "person_id"), @Index(name = "personsetting_settingskey_index", columnList = "settingskey") }) -public class PersonSetting extends GeneratedAuditedObject { +public class PersonSetting extends AuditedObject { @ManyToOne private Person person; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java index bddd73484..cd00ede1e 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java @@ -4,18 +4,14 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; +import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; -import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; import com.fasterxml.jackson.annotation.JsonView; @@ -27,9 +23,7 @@ import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; -import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; -import jakarta.persistence.UniqueConstraint; import lombok.Data; import lombok.EqualsAndHashCode; @@ -39,24 +33,13 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @Inheritance(strategy = InheritanceType.JOINED) @Schema(name = "reagent", description = "POJO that represents a reagent") -@AGRCurationSchemaVersion(min = "1.10.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SubmittedObject.class }) -@Table( - indexes = { - @Index(name = "reagent_curie_index", columnList = "curie"), - @Index(name = "reagent_uniqueId_index", columnList = "uniqueId"), - @Index(name = "reagent_modEntityId_index", columnList = "modEntityId"), - @Index(name = "reagent_modInternalId_index", columnList = "modInternalId"), - @Index(name = "reagent_dataprovider_index", columnList = "dataProvider_id"), - @Index(name = "reagent_createdby_index", columnList = "createdBy_id"), - @Index(name = "reagent_updatedby_index", columnList = "updatedBy_id") - }, uniqueConstraints = { - @UniqueConstraint(name = "reagent_modEntityId_uk", columnNames = "modEntityId"), - @UniqueConstraint(name = "reagent_modInternalId_uk", columnNames = "modInternalId"), - } -) +@Table(indexes = { + @Index(name = "reagent_uniqueId_index", columnList = "uniqueId") +}) -public class Reagent extends GeneratedAuditedObject { +public class Reagent extends SubmittedObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "uniqueId_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") @@ -65,30 +48,6 @@ public class Reagent extends GeneratedAuditedObject { @EqualsAndHashCode.Include protected String uniqueId; - @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") - @KeywordField(name = "curie_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") - @JsonView({ View.FieldsOnly.class }) - @EqualsAndHashCode.Include - protected String curie; - - @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") - @KeywordField(name = "modEntityId_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") - @JsonView({ View.FieldsOnly.class }) - @EqualsAndHashCode.Include - private String modEntityId; - - @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") - @KeywordField(name = "modInternalId_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") - @JsonView({ View.FieldsOnly.class }) - @EqualsAndHashCode.Include - private String modInternalId; - - @IndexedEmbedded(includeDepth = 2) - @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) - @ManyToOne - @JsonView({ View.FieldsOnly.class }) - protected DataProvider dataProvider; - @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "secondaryIdentifiers_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") @ElementCollection diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java index 4ae8e2145..820165442 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.envers.Audited; @@ -28,7 +27,6 @@ import jakarta.persistence.Index; import jakarta.persistence.JoinTable; import jakarta.persistence.OneToMany; -import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -41,8 +39,7 @@ @ToString(exclude = {"resourcePages"}) @AGRCurationSchemaVersion(min = "1.5.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Schema(name = "ResourceDescriptor", description = "Annotation class representing a resource descriptor") -@Table(indexes = { @Index(name = "resourcedescriptor_createdby_index", columnList = "createdBy_id"), @Index(name = "resourcedescriptor_updatedby_index", columnList = "updatedBy_id"), }) -public class ResourceDescriptor extends GeneratedAuditedObject { +public class ResourceDescriptor extends AuditedObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "prefix_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java index d5f1e4a91..851972d3a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java @@ -3,7 +3,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.envers.Audited; @@ -34,11 +33,9 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString() @AGRCurationSchemaVersion(min = "1.5.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -@Table(indexes = { @Index(name = "resourcedescriptorpage_resourcedescriptor_id_index", columnList = "resourcedescriptor_id"), - @Index(name = "resourcedescriptorpage_createdby_id_index", columnList = "createdby_id"), - @Index(name = "resourcedescriptorpage_updatedby_id_index", columnList = "updatedby_id")}) +@Table(indexes = { @Index(name = "resourcedescriptorpage_resourcedescriptor_id_index", columnList = "resourcedescriptor_id")}) @Schema(name = "ResourceDescriptorPage", description = "Annotation class representing a resource descriptor page") -public class ResourceDescriptorPage extends GeneratedAuditedObject { +public class ResourceDescriptorPage extends AuditedObject { @IndexedEmbedded(includeDepth = 1) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java index 6bc4322d6..ae74d7b8d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java @@ -1,15 +1,12 @@ package org.alliancegenome.curation_api.model.entities; -import jakarta.persistence.*; +import java.util.List; import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.CurieAuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.model.entities.ontology.NCBITaxonTerm; import org.alliancegenome.curation_api.view.View; -import org.apache.lucene.document.FieldType; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; import org.hibernate.envers.Audited; @@ -17,24 +14,33 @@ import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.*; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; + import com.fasterxml.jackson.annotation.JsonView; +import jakarta.persistence.ElementCollection; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToOne; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; -import java.util.List; - @Audited @Entity @Data @Indexed @NoArgsConstructor @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@AGRCurationSchemaVersion(min = "1.2.4", max = LinkMLSchemaConstants.LATEST_RELEASE,dependencies = { AuditedObject.class }) -@Table(indexes = { @Index(name = "species_createdby_index", columnList = "createdBy_id"), @Index(name = "species_updatedby_index", columnList = "updatedBy_id") }) -public class Species extends GeneratedAuditedObject { +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE,dependencies = { AuditedObject.class }) +public class Species extends AuditedObject { @IndexedEmbedded(includePaths = {"name", "curie", "name_keyword", "curie_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java index 746703af6..00d726e18 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java @@ -3,7 +3,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; @@ -16,8 +15,6 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; -import jakarta.persistence.Index; -import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; @@ -28,8 +25,7 @@ @NoArgsConstructor @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @AGRCurationSchemaVersion(min = "1.2.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -@Table(indexes = { @Index(name = "synonym_createdby_index", columnList = "createdBy_id"), @Index(name = "synonym_updatedby_index", columnList = "updatedBy_id") }) -public class Synonym extends GeneratedAuditedObject { +public class Synonym extends AuditedObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "name_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java index 9242553ca..69decb257 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.envers.Audited; @@ -40,8 +39,6 @@ @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Table( indexes = { - @Index(name = "vocabulary_createdby_index", columnList = "createdBy_id"), - @Index(name = "vocabulary_updatedby_index", columnList = "updatedBy_id"), @Index(name = "vocabulary_name_index", columnList = "name"), @Index(name = "vocabulary_vocabularylabel_index", columnList = "vocabularylabel") }, @@ -50,7 +47,7 @@ @UniqueConstraint(name = "vocabulary_vocabularyLabel_uk", columnNames = "vocabularyLabel"), } ) -public class Vocabulary extends GeneratedAuditedObject { +public class Vocabulary extends AuditedObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "name_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java index 0a307d082..7949ca165 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.envers.Audited; @@ -41,13 +40,11 @@ @ToString(exclude = { "vocabulary", "vocabularyTermSets" }) @Table(indexes = { @Index(name = "vocabularyterm_name_index", columnList = "name"), - @Index(name = "vocabularyterm_vocabulary_id_index", columnList = "vocabulary_id"), - @Index(name = "vocabularyterm_createdby_index", columnList = "createdBy_id"), - @Index(name = "vocabularyterm_updatedby_index", columnList = "updatedBy_id"), + @Index(name = "vocabularyterm_vocabulary_id_index", columnList = "vocabulary_id") }) @Schema(name = "VocabularyTerm", description = "POJO that represents the Vocabulary Term") @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -public class VocabularyTerm extends GeneratedAuditedObject { +public class VocabularyTerm extends AuditedObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "name_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java index 03fc31251..3273631bc 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.envers.Audited; @@ -41,15 +40,13 @@ indexes = { @Index(name = "vocabularytermset_name_index", columnList = "name"), @Index(name = "vocabularytermset_vocabularylabel_index", columnList = "vocabularylabel"), - @Index(name = "vocabularytermset_createdby_id_index", columnList = "createdby_id"), - @Index(name = "vocabularytermset_updatedby_id_index", columnList = "updatedby_id"), @Index(name = "vocabularytermset_vocabularytermsetvocabulary_id_index", columnList = "vocabularytermsetvocabulary_id") }, uniqueConstraints = { @UniqueConstraint(name = "vocabularytermset_vocabularyLabel_uk", columnNames = "vocabularyLabel"), } ) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -public class VocabularyTermSet extends GeneratedAuditedObject { +public class VocabularyTermSet extends AuditedObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "name_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java index 37576f7e3..882f596de 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java @@ -8,16 +8,20 @@ import org.alliancegenome.curation_api.model.bridges.OffsetDateTimeValueBridge; import org.alliancegenome.curation_api.model.entities.Person; import org.alliancegenome.curation_api.view.View; +import org.alliancegenome.curation_api.view.View.VocabularyTermSetView; import org.hibernate.annotations.CreationTimestamp; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.UpdateTimestamp; +import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.bridge.mapping.annotation.ValueBridgeRef; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.DocumentId; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; @@ -25,19 +29,37 @@ import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Index; import jakarta.persistence.ManyToOne; -import jakarta.persistence.MappedSuperclass; +import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@MappedSuperclass +@Audited +@Entity @ToString(exclude = { "createdBy", "updatedBy" }) @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE) +@Table(indexes = { + @Index(name = "auditedobject_createdby_index", columnList = "createdBy_id"), + @Index(name = "auditedobject_updatedby_index", columnList = "updatedBy_id") +}) public class AuditedObject extends BaseEntity { + @Id + @DocumentId + @GenericField(aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES) + @GeneratedValue(strategy = GenerationType.SEQUENCE) + @JsonView({ View.FieldsOnly.class, View.PersonSettingView.class, VocabularyTermSetView.class }) + @EqualsAndHashCode.Include + protected Long id; + @IndexedEmbedded(includePaths = {"uniqueId", "uniqueId_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieAuditedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java similarity index 50% rename from src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieAuditedObject.java rename to src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java index 9a392bac8..2017f0cb3 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieAuditedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java @@ -1,30 +1,44 @@ package org.alliancegenome.curation_api.model.entities.base; +import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; +import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.view.View; +import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.DocumentId; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; import com.fasterxml.jackson.annotation.JsonView; -import jakarta.persistence.Id; -import jakarta.persistence.MappedSuperclass; +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @Data -@EqualsAndHashCode(onlyExplicitlyIncluded = true) -@MappedSuperclass -@ToString() -//@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "curie") -public class CurieAuditedObject extends AuditedObject { +@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@Inheritance(strategy = InheritanceType.JOINED) +@Audited +@Entity +@ToString(callSuper = true) +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) +@Table( + indexes = { + @Index(name = "curieobject_curie_index", columnList = "curie") + }, + uniqueConstraints = { + @UniqueConstraint(name = "curieobject_curie_uk", columnNames = "curie") + } +) +public class CurieObject extends AuditedObject { - @Id - @DocumentId @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "curie_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") @JsonView({ View.FieldsOnly.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/GeneratedAuditedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/GeneratedAuditedObject.java deleted file mode 100644 index bcf479b7d..000000000 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/GeneratedAuditedObject.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.alliancegenome.curation_api.model.entities.base; - -import org.alliancegenome.curation_api.view.View; -import org.alliancegenome.curation_api.view.View.VocabularyTermSetView; -import org.hibernate.search.engine.backend.types.Aggregable; -import org.hibernate.search.engine.backend.types.Searchable; -import org.hibernate.search.engine.backend.types.Sortable; -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.DocumentId; -import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField; - -import com.fasterxml.jackson.annotation.JsonView; - -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.MappedSuperclass; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.ToString; - -@Data -@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@MappedSuperclass -@ToString() -public class GeneratedAuditedObject extends AuditedObject { - - @Id - @DocumentId - @GenericField(aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES) - @GeneratedValue(strategy = GenerationType.SEQUENCE) - @JsonView({ View.FieldsOnly.class, View.PersonSettingView.class, VocabularyTermSetView.class }) - @EqualsAndHashCode.Include - protected Long id; - -} diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java new file mode 100644 index 000000000..dda7c87c8 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java @@ -0,0 +1,71 @@ +package org.alliancegenome.curation_api.model.entities.base; + +import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; +import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; +import org.alliancegenome.curation_api.model.entities.DataProvider; +import org.alliancegenome.curation_api.view.View; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; +import org.hibernate.envers.Audited; +import org.hibernate.search.engine.backend.types.Aggregable; +import org.hibernate.search.engine.backend.types.Searchable; +import org.hibernate.search.engine.backend.types.Sortable; +import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; + +import com.fasterxml.jackson.annotation.JsonView; + +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Audited +@Entity +@Inheritance(strategy = InheritanceType.JOINED) +@Data +@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@ToString(callSuper = true) +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { CurieObject.class }) +@Table(indexes = { + @Index(name = "submittedobject_modentityid_index", columnList = "modentityid"), + @Index(name = "submittedobject_modinternalid_index", columnList = "modinternalid"), + @Index(name = "submittedobject_dataprovider_index", columnList = "dataprovider_id") + }, + uniqueConstraints = { + @UniqueConstraint(name = "submittedobject_modentityid_uk", columnNames = "modentityid"), + @UniqueConstraint(name = "submittedobject_modinternalid_uk", columnNames = "modinternalid"), + } +) +public class SubmittedObject extends CurieObject { + + @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") + @KeywordField(name = "modEntityId_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") + @JsonView({ View.FieldsOnly.class }) + @EqualsAndHashCode.Include + private String modEntityId; + + @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") + @KeywordField(name = "modInternalId_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") + @JsonView({ View.FieldsOnly.class }) + @EqualsAndHashCode.Include + private String modInternalId; + + @IndexedEmbedded(includePaths = {"sourceOrganization.abbreviation", "sourceOrganization.fullName", "sourceOrganization.shortName", "crossReference.displayName", "crossReference.referencedCurie", + "sourceOrganization.abbreviation_keyword", "sourceOrganization.fullName_keyword", "sourceOrganization.shortName_keyword", "crossReference.displayName_keyword", "crossReference.referencedCurie_keyword"}) + @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) + @ManyToOne + @Fetch(FetchMode.SELECT) + @JsonView({ View.FieldsOnly.class }) + private DataProvider dataProvider; + +} diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/UniqueIdAuditedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/UniqueIdAuditedObject.java index 8cf720ecd..7b9620646 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/UniqueIdAuditedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/UniqueIdAuditedObject.java @@ -19,7 +19,7 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @MappedSuperclass @ToString(callSuper = true) -public class UniqueIdAuditedObject extends GeneratedAuditedObject { +public class UniqueIdAuditedObject extends AuditedObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "uniqueId_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java index 6a4b8ed67..01ed6887d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java @@ -8,7 +8,6 @@ import org.alliancegenome.curation_api.enums.OntologyBulkLoadType; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.hibernate.envers.Audited; @@ -41,7 +40,7 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(exclude = { "group" }, callSuper = true) @AGRCurationSchemaVersion(min = "1.2.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -public abstract class BulkLoad extends GeneratedAuditedObject { +public abstract class BulkLoad extends AuditedObject { @JsonView({ View.FieldsOnly.class }) private String name; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFile.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFile.java index eea63b495..90527616c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFile.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFile.java @@ -9,7 +9,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.bridges.OffsetDateTimeValueBridge; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; @@ -41,7 +40,7 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(exclude = { "bulkLoad" }) @AGRCurationSchemaVersion(min = "1.3.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -public class BulkLoadFile extends GeneratedAuditedObject { +public class BulkLoadFile extends AuditedObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer", valueBridge = @ValueBridgeRef(type = OffsetDateTimeValueBridge.class)) @KeywordField(name = "dateLastLoaded_keyword", sortable = Sortable.YES, searchable = Searchable.YES, aggregable = Aggregable.YES, valueBridge = @ValueBridgeRef(type = OffsetDateTimeValueBridge.class)) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileException.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileException.java index 5ba079f7d..d5a19c71c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileException.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileException.java @@ -4,7 +4,6 @@ import org.alliancegenome.curation_api.exceptions.ObjectUpdateException.ObjectUpdateExceptionData; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.hibernate.annotations.JdbcTypeCode; import org.hibernate.annotations.OnDelete; @@ -30,7 +29,7 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(exclude = { "bulkLoadFileHistory", "exception" }, callSuper = true) @AGRCurationSchemaVersion(min = "1.2.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -public class BulkLoadFileException extends GeneratedAuditedObject { +public class BulkLoadFileException extends AuditedObject { // TODO: define in LinkML once class definition matured diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileHistory.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileHistory.java index 22819309f..017f0af73 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileHistory.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileHistory.java @@ -7,7 +7,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.hibernate.annotations.OnDelete; import org.hibernate.annotations.OnDeleteAction; @@ -33,7 +32,7 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(exclude = { "bulkLoadFile", "exceptions" }, callSuper = true) @AGRCurationSchemaVersion(min = "1.2.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -public class BulkLoadFileHistory extends GeneratedAuditedObject { +public class BulkLoadFileHistory extends AuditedObject { @JsonView({ View.FieldsOnly.class }) private LocalDateTime loadStarted; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadGroup.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadGroup.java index 243d6b331..59a1f17c7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadGroup.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadGroup.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.hibernate.envers.Audited; @@ -24,7 +23,7 @@ @ToString //@ToString(exclude = {"loads"}) @AGRCurationSchemaVersion(min = "1.2.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -public class BulkLoadGroup extends GeneratedAuditedObject { +public class BulkLoadGroup extends AuditedObject { @JsonView({ View.FieldsOnly.class }) private String name; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java index 7898a7d32..e30f44bbf 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.enums.JobStatus; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.hibernate.envers.Audited; @@ -32,7 +31,7 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(exclude = { "curationReportGroup", "curationReportHistory" }, callSuper = true) @AGRCurationSchemaVersion(min = "1.2.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -public class CurationReport extends GeneratedAuditedObject { +public class CurationReport extends AuditedObject { @JsonView({ View.FieldsOnly.class }) private String name; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportGroup.java b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportGroup.java index c9337e188..204900e7f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportGroup.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportGroup.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.hibernate.envers.Audited; @@ -23,7 +22,7 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString @AGRCurationSchemaVersion(min = "1.2.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -public class CurationReportGroup extends GeneratedAuditedObject { +public class CurationReportGroup extends AuditedObject { @JsonView({ View.FieldsOnly.class }) private String name; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportHistory.java b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportHistory.java index d70e780ea..241503679 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportHistory.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportHistory.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.enums.JobStatus; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.hibernate.envers.Audited; @@ -30,7 +29,7 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(exclude = { "curationReport" }, callSuper = true) @AGRCurationSchemaVersion(min = "1.2.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -public class CurationReportHistory extends GeneratedAuditedObject { +public class CurationReportHistory extends AuditedObject { @ManyToOne private CurationReport curationReport; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java index 2a6c43485..14dc12f02 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java @@ -9,7 +9,7 @@ import org.alliancegenome.curation_api.model.entities.CrossReference; import org.alliancegenome.curation_api.model.entities.Synonym; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.CurieAuditedObject; +import org.alliancegenome.curation_api.model.entities.base.CurieObject; import org.alliancegenome.curation_api.view.View; import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; @@ -48,7 +48,7 @@ @Index(name = "ontologyterm_createdby_index", columnList = "createdBy_id"), @Index(name = "ontologyterm_updatedby_index", columnList = "updatedBy_id") }) -public class OntologyTerm extends CurieAuditedObject { +public class OntologyTerm extends CurieObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "name_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java index f21008e2d..295fb3e77 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java @@ -4,7 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.Gene; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.envers.Audited; @@ -33,12 +32,10 @@ @Schema(name = "GeneToGeneOrthology", description = "POJO that represents orthology between two genes") @AGRCurationSchemaVersion(min = "1.7.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Table(indexes = { - @Index(name = "genetogeneorthology_createdby_index", columnList = "createdBy_id"), - @Index(name = "genetogeneorthology_updatedby_index", columnList = "updatedBy_id"), @Index(name = "genetogeneorthology_subjectgene_index", columnList = "subjectgene_curie"), @Index(name = "genetogeneorthology_objectgene_index", columnList = "objectgene_curie") }) -public class GeneToGeneOrthology extends GeneratedAuditedObject { +public class GeneToGeneOrthology extends AuditedObject { @IndexedEmbedded(includePaths = {"geneSymbol.displayText", "geneSymbol.formatText", "geneSymbol.displayText_keyword", "geneSymbol.formatText_keyword", "curie", "curie_keyword", "taxon.curie", "taxon.name", "taxon.curie_keyword", "taxon.name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java index 1d5ec709a..9f09e17e1 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.InformationContentEntity; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.GeneratedAuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.envers.Audited; @@ -22,7 +21,6 @@ import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; -import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -33,10 +31,9 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @Inheritance(strategy = InheritanceType.JOINED) @Schema(name = "SlotAnnotation", description = "POJO that represents a SlotAnnotation") -@Table(indexes = { @Index(name = "slotannotation_createdby_index", columnList = "createdBy_id"), @Index(name = "slotannotation_updatedby_index", columnList = "updatedBy_id"), }) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -public class SlotAnnotation extends GeneratedAuditedObject { +public class SlotAnnotation extends AuditedObject { @IndexedEmbedded(includeDepth = 2) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/CurieAuditedObjectValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/CurieAuditedObjectValidator.java index d37fa2728..5d15b2844 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/CurieAuditedObjectValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/CurieAuditedObjectValidator.java @@ -1,12 +1,12 @@ package org.alliancegenome.curation_api.services.validation; import org.alliancegenome.curation_api.constants.ValidationConstants; -import org.alliancegenome.curation_api.model.entities.base.CurieAuditedObject; +import org.alliancegenome.curation_api.model.entities.base.CurieObject; import org.apache.commons.lang3.StringUtils; -public class CurieAuditedObjectValidator extends AuditedObjectValidator { +public class CurieAuditedObjectValidator extends AuditedObjectValidator { - public String validateCurie(CurieAuditedObject uiEntity) { + public String validateCurie(CurieObject uiEntity) { String curie = uiEntity.getCurie(); if (StringUtils.isBlank(curie)) { addMessageResponse("curie", ValidationConstants.REQUIRED_MESSAGE); diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index 3db8998cf..b864e7089 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -7,4 +7,8 @@ ALTER TABLE constructgenomicentityassociation RENAME objectgenomicentity_curie T ALTER TABLE constructgenomicentityassociation_aud RENAME objectgenomicentity_curie TO object_curie; ALTER TABLE allelegeneassociation RENAME objectgene_curie TO object_curie; -ALTER TABLE allelegeneassociation_aud RENAME objectgene_curie TO object_curie; \ No newline at end of file +ALTER TABLE allelegeneassociation_aud RENAME objectgene_curie TO object_curie; + +-- Random cleanup + +ALTER INDEX gene_taxon_index RENAME TO gene_genetype_index; \ No newline at end of file From 4e305f8390fa2ee6d5b8b5c4f121b34145602271 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Mon, 4 Dec 2023 13:48:36 +0000 Subject: [PATCH 003/159] Refactor DTO classes --- .../constants/LinkMLSchemaConstants.java | 2 +- .../model/ingest/dto/BiologicalEntityDTO.java | 13 ++------ .../model/ingest/dto/ReagentDTO.java | 18 ++--------- .../ingest/dto/base/SubmittedObjectDTO.java | 31 +++++++++++++++++++ .../v0.30.0.1__linkml_v2.0.0_update.sql | 5 ++- .../curation_api/base/BaseITCase.java | 6 ++-- 6 files changed, 44 insertions(+), 31 deletions(-) create mode 100644 src/main/java/org/alliancegenome/curation_api/model/ingest/dto/base/SubmittedObjectDTO.java diff --git a/src/main/java/org/alliancegenome/curation_api/constants/LinkMLSchemaConstants.java b/src/main/java/org/alliancegenome/curation_api/constants/LinkMLSchemaConstants.java index 5fcbbcfe5..3468390a0 100644 --- a/src/main/java/org/alliancegenome/curation_api/constants/LinkMLSchemaConstants.java +++ b/src/main/java/org/alliancegenome/curation_api/constants/LinkMLSchemaConstants.java @@ -2,7 +2,7 @@ public final class LinkMLSchemaConstants { - public static final String LATEST_RELEASE = "1.11.0"; + public static final String LATEST_RELEASE = "2.0.0"; public static final String MIN_ONTOLOGY_RELEASE = "1.2.4"; public static final String MAX_ONTOLOGY_RELEASE = LATEST_RELEASE; diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/BiologicalEntityDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/BiologicalEntityDTO.java index c65ad8057..9584ce810 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/BiologicalEntityDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/BiologicalEntityDTO.java @@ -2,7 +2,7 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.alliancegenome.curation_api.model.ingest.dto.base.AuditedObjectDTO; +import org.alliancegenome.curation_api.model.ingest.dto.base.SubmittedObjectDTO; import org.alliancegenome.curation_api.view.View; import com.fasterxml.jackson.annotation.JsonProperty; @@ -11,16 +11,9 @@ import lombok.Data; @Data -@AGRCurationSchemaVersion(min = "1.7.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObjectDTO.class }) -public class BiologicalEntityDTO extends AuditedObjectDTO { - - @JsonView({ View.FieldsOnly.class }) - private String curie; +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SubmittedObjectDTO.class }) +public class BiologicalEntityDTO extends SubmittedObjectDTO { @JsonProperty("taxon_curie") private String taxonCurie; - - @JsonView({ View.FieldsOnly.class }) - @JsonProperty("data_provider_dto") - private DataProviderDTO dataProviderDto; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ReagentDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ReagentDTO.java index 3621cce7b..742f4d82a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ReagentDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ReagentDTO.java @@ -4,7 +4,7 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.alliancegenome.curation_api.model.ingest.dto.base.AuditedObjectDTO; +import org.alliancegenome.curation_api.model.ingest.dto.base.SubmittedObjectDTO; import org.alliancegenome.curation_api.view.View; import com.fasterxml.jackson.annotation.JsonProperty; @@ -15,21 +15,9 @@ @Setter @Getter -@AGRCurationSchemaVersion(min = "1.10.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObjectDTO.class, DataProviderDTO.class }) -public class ReagentDTO extends AuditedObjectDTO { +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SubmittedObjectDTO.class }) +public class ReagentDTO extends SubmittedObjectDTO { - @JsonView({ View.FieldsOnly.class }) - @JsonProperty("mod_entity_id") - private String modEntityId; - - @JsonView({ View.FieldsOnly.class }) - @JsonProperty("mod_internal_id") - private String modInternalId; - - @JsonView({ View.FieldsOnly.class }) - @JsonProperty("data_provider_dto") - private DataProviderDTO dataProviderDto; - @JsonView({ View.FieldsAndLists.class }) @JsonProperty("secondary_identifiers") private List secondaryIdentifiers; diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/base/SubmittedObjectDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/base/SubmittedObjectDTO.java new file mode 100644 index 000000000..a9ebbe5cc --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/base/SubmittedObjectDTO.java @@ -0,0 +1,31 @@ +package org.alliancegenome.curation_api.model.ingest.dto.base; + +import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; +import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; +import org.alliancegenome.curation_api.model.ingest.dto.DataProviderDTO; +import org.alliancegenome.curation_api.view.View; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonView; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObjectDTO.class, DataProviderDTO.class }) +public class SubmittedObjectDTO extends AuditedObjectDTO { + + @JsonView({ View.FieldsOnly.class }) + @JsonProperty("mod_entity_id") + private String modEntityId; + + @JsonView({ View.FieldsOnly.class }) + @JsonProperty("mod_internal_id") + private String modInternalId; + + @JsonView({ View.FieldsOnly.class }) + @JsonProperty("data_provider_dto") + private DataProviderDTO dataProviderDto; + +} diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index b864e7089..b9e3c2b88 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -11,4 +11,7 @@ ALTER TABLE allelegeneassociation_aud RENAME objectgene_curie TO object_curie; -- Random cleanup -ALTER INDEX gene_taxon_index RENAME TO gene_genetype_index; \ No newline at end of file +ALTER INDEX gene_taxon_index RENAME TO gene_genetype_index; + +ALTER TABLE organization DROP COLUMN uniqueid; +ALTER TABLE organization_aud DROP COLUMN uniqueid; \ No newline at end of file diff --git a/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java b/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java index cf1362a7c..7fd3b1b54 100644 --- a/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java @@ -247,7 +247,7 @@ public DataProvider createDataProvider(String organizationAbbreviation, Boolean DataProvider dataProvider = new DataProvider(); Organization sourceOrganization = getOrganization(organizationAbbreviation); if (sourceOrganization == null) - sourceOrganization = createOrganization(organizationAbbreviation, organizationAbbreviation, false); + sourceOrganization = createOrganization(organizationAbbreviation, false); dataProvider.setSourceOrganization(sourceOrganization); dataProvider.setObsolete(obsolete); @@ -402,10 +402,9 @@ public Note createNote(VocabularyTerm vocabularyTerm, String text, Boolean inter return note; } - public Organization createOrganization(String uniqueId, String abbreviation, Boolean obsolete) { + public Organization createOrganization(String abbreviation, Boolean obsolete) { Organization organization = new Organization(); organization.setAbbreviation(abbreviation); - organization.setUniqueId(uniqueId); organization.setObsolete(obsolete); ObjectResponse response = RestAssured.given(). @@ -1168,7 +1167,6 @@ public void loadMPTerm(String curie, String name) throws Exception { public void loadOrganization(String abbreviation) throws Exception { Organization organization = new Organization(); - organization.setUniqueId(abbreviation); organization.setAbbreviation(abbreviation); organization.setObsolete(false); From f6a56675395f0a8fe71998bda9515b6c43af5267 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 7 Dec 2023 14:09:06 +0000 Subject: [PATCH 004/159] Big old refactor --- .../constants/ValidationConstants.java | 1 + .../base/BaseEntityCrudController.java | 11 +-- .../base/BaseOntologyTermController.java | 2 +- .../base/CurieObjectCrudController.java | 21 +++++ .../base/SubmittedObjectCrudController.java | 34 +++++++ .../AGMDiseaseAnnotationCrudController.java | 5 ++ .../AffectedGenomicModelCrudController.java | 4 +- .../crud/AlleleCrudController.java | 4 +- ...AlleleDiseaseAnnotationCrudController.java | 5 ++ .../crud/BiologicalEntityCrudController.java | 4 +- .../crud/ConstructCrudController.java | 4 +- .../crud/DiseaseAnnotationCrudController.java | 5 ++ .../controllers/crud/GeneCrudController.java | 4 +- .../GeneDiseaseAnnotationCrudController.java | 5 ++ ...nformationContentEntityCrudController.java | 4 +- .../crud/MoleculeCrudController.java | 4 +- .../crud/ReferenceCrudController.java | 8 +- .../crud/VariantCrudController.java | 4 +- .../dao/AffectedGenomicModelDAO.java | 16 ++-- .../curation_api/dao/AlleleDAO.java | 22 +++-- .../curation_api/dao/GeneDAO.java | 40 ++++----- .../curation_api/dao/MoleculeDAO.java | 4 - .../curation_api/dao/VariantDAO.java | 14 +++ .../curation_api/dao/base/BaseSQLDAO.java | 89 +++++++++++-------- .../base/BaseCurieCrudInterface.java | 76 ---------------- .../base/BaseOntologyTermCrudInterface.java | 2 +- .../base/CurieObjectCrudInterface.java | 31 +++++++ .../base/SubmittedObjectCrudInterface.java | 33 +++++++ .../AffectedGenomicModelCrudInterface.java | 6 +- .../interfaces/crud/AlleleCrudInterface.java | 8 +- .../crud/BiologicalEntityCrudInterface.java | 4 +- .../crud/ConstructCrudInterface.java | 8 +- .../crud/CrossReferenceCrudInterface.java | 4 +- .../interfaces/crud/GeneCrudInterface.java | 8 +- ...InformationContentEntityCrudInterface.java | 4 +- .../crud/MoleculeCrudInterface.java | 4 +- .../crud/OrganizationCrudInterface.java | 4 +- .../crud/ReferenceCrudInterface.java | 8 +- .../interfaces/crud/VariantCrudInterface.java | 8 +- .../jobs/executors/AgmExecutor.java | 20 ++--- .../jobs/executors/AlleleExecutor.java | 20 ++--- .../jobs/executors/GeneExecutor.java | 20 ++--- .../jobs/executors/LoadFileExecutor.java | 22 ++--- .../jobs/executors/VariantExecutor.java | 20 ++--- .../bridges/BiologicalEntityTypeBridge.java | 3 +- .../model/entities/GenomicEntity.java | 2 +- .../model/entities/base/SubmittedObject.java | 16 ++++ .../ingest/dto/AGMDiseaseAnnotationDTO.java | 22 ++--- .../dto/AlleleDiseaseAnnotationDTO.java | 14 +-- .../ingest/dto/DiseaseAnnotationDTO.java | 10 +-- .../ingest/dto/GeneDiseaseAnnotationDTO.java | 10 +-- .../AlleleGeneAssociationDTO.java | 6 +- .../AlleleGenomicEntityAssociationDTO.java | 4 +- .../ConstructGenomicEntityAssociationDTO.java | 4 +- .../services/AGMDiseaseAnnotationService.java | 9 +- .../services/AffectedGenomicModelService.java | 22 ++--- .../AlleleDiseaseAnnotationService.java | 9 +- .../curation_api/services/AlleleService.java | 26 +++--- .../services/BiologicalEntityService.java | 4 +- .../services/ConditionRelationService.java | 8 +- .../services/ConstructService.java | 13 ++- .../services/DiseaseAnnotationService.java | 6 +- .../ExperimentalConditionService.java | 8 +- .../GeneDiseaseAnnotationService.java | 10 +-- .../curation_api/services/GeneService.java | 28 +++--- .../InformationContentEntityService.java | 6 +- .../services/MoleculeService.java | 19 ++-- .../services/OrganizationService.java | 4 +- .../services/ReferenceService.java | 10 +-- .../curation_api/services/VariantService.java | 45 ++++++---- .../AlleleGeneAssociationService.java | 5 +- ...structGenomicEntityAssociationService.java | 5 +- .../services/base/BaseDTOCrudService.java | 2 - .../services/base/BaseEntityCrudService.java | 10 +-- .../base/BaseOntologyTermService.java | 16 ++-- .../services/base/CurieObjectCrudService.java | 26 ++++++ .../base/SubmittedObjectCrudService.java | 35 ++++++++ .../DiseaseAnnotationUniqueIdHelper.java | 2 +- ...DiseaseAnnotationUniqueIdUpdateHelper.java | 6 +- .../ReferenceSynchronisationHelper.java | 14 +-- .../services/ontology/EcoTermService.java | 2 +- .../ontology/NcbiTaxonTermService.java | 2 +- .../AGMDiseaseAnnotationValidator.java | 26 +++--- .../AffectedGenomicModelValidator.java | 49 +++------- .../AlleleDiseaseAnnotationValidator.java | 18 ++-- .../services/validation/AlleleValidator.java | 38 ++------ .../validation/AnnotationValidator.java | 6 +- .../validation/BiologicalEntityValidator.java | 51 +++-------- .../ConditionRelationValidator.java | 1 + .../validation/CrossReferenceValidator.java | 1 + .../validation/DataProviderValidator.java | 1 + .../DiseaseAnnotationValidator.java | 31 ++++--- .../ExperimentalConditionValidator.java | 37 ++++---- .../GeneDiseaseAnnotationValidator.java | 12 +-- .../services/validation/GeneValidator.java | 44 +++------ .../validation/GenomicEntityValidator.java | 38 ++++++-- .../validation/MoleculeValidator.java | 48 +++++++--- .../services/validation/NoteValidator.java | 1 + .../services/validation/PersonValidator.java | 1 + .../services/validation/ReagentValidator.java | 7 +- .../validation/ReferenceValidator.java | 1 + .../services/validation/VariantValidator.java | 54 ++++------- .../VocabularyTermSetValidator.java | 1 + .../validation/VocabularyTermValidator.java | 1 + .../validation/VocabularyValidator.java | 1 + .../EvidenceAssociationValidator.java | 2 +- .../AlleleGeneAssociationValidator.java | 12 +-- ...leleGenomicEntityAssociationValidator.java | 4 +- ...ructGenomicEntityAssociationValidator.java | 6 +- .../{ => base}/AuditedObjectValidator.java | 2 +- .../CurieObjectValidator.java} | 4 +- .../base/SubmittedObjectValidator.java | 72 +++++++++++++++ .../dto/AGMDiseaseAnnotationDTOValidator.java | 38 ++++---- .../dto/AffectedGenomicModelDTOValidator.java | 29 +++--- .../validation/dto/AlleleDTOValidator.java | 12 ++- .../AlleleDiseaseAnnotationDTOValidator.java | 26 +++--- .../dto/AnnotationDTOValidator.java | 13 +-- .../dto/DiseaseAnnotationDTOValidator.java | 26 +++--- .../ExperimentalConditionDTOValidator.java | 2 +- .../validation/dto/GeneDTOValidator.java | 13 ++- .../GeneDiseaseAnnotationDTOValidator.java | 18 ++-- .../validation/dto/ReagentDTOValidator.java | 19 +--- .../validation/dto/VariantDTOValidator.java | 19 +++- .../AlleleGeneAssociationDTOValidator.java | 56 ++++++------ ...tGenomicEntityAssociationDTOValidator.java | 26 +++--- .../validation/dto/base/BaseDTOValidator.java | 16 ++++ .../dto/fms/OrthologyFmsDTOValidator.java | 45 +++++----- .../SlotAnnotationValidator.java | 39 ++++---- ...nctionalImpactSlotAnnotationValidator.java | 4 +- ...nheritanceModeSlotAnnotationValidator.java | 4 +- ...leMutationTypeSlotAnnotationValidator.java | 8 +- .../bulk/01_gene/AF_01_all_fields.json | 2 +- .../EN_01_empty_non_required_fields.json | 2 +- .../bulk/01_gene/ER_01_empty_curie.json | 2 +- .../bulk/01_gene/ER_02_empty_taxon.json | 2 +- .../ER_03_empty_gene_symbol_display_text.json | 2 +- ..._04_empty_gene_full_name_display_text.json | 2 +- ...pty_gene_systematic_name_display_text.json | 2 +- ...ER_06_empty_gene_synonym_display_text.json | 2 +- .../ER_07_empty_gene_symbol_format_text.json | 2 +- ...R_08_empty_gene_full_name_format_text.json | 2 +- ...mpty_gene_systematic_name_format_text.json | 2 +- .../ER_10_empty_gene_synonym_format_text.json | 2 +- .../ER_11_empty_gene_symbol_name_type.json | 2 +- .../ER_12_empty_gene_full_name_name_type.json | 2 +- ..._empty_gene_systematic_name_name_type.json | 2 +- .../ER_14_empty_gene_synonym_name_type.json | 2 +- ...ider_source_organization_abbreviation.json | 2 +- ...ider_cross_reference_referenced_curie.json | 2 +- ...provider_cross_reference_display_name.json | 2 +- ..._data_provider_cross_reference_prefix.json | 2 +- ...ta_provider_cross_reference_page_area.json | 2 +- ..._empty_gene_secondary_id_secondary_id.json | 2 +- .../01_gene/IV_01_invalid_date_created.json | 2 +- .../01_gene/IV_02_invalid_date_updated.json | 2 +- .../bulk/01_gene/IV_03_invalid_taxon.json | 2 +- .../IV_04_invalid_gene_symbol_name_type.json | 2 +- ...V_05_invalid_gene_full_name_name_type.json | 2 +- ...nvalid_gene_systematic_name_name_type.json | 2 +- .../IV_07_invalid_gene_synonym_name_type.json | 2 +- ..._08_invalid_gene_symbol_synonym_scope.json | 2 +- ..._invalid_gene_full_name_synonym_scope.json | 2 +- ...id_gene_systematic_name_synonym_scope.json | 2 +- ...11_invalid_gene_synonym_synonym_scope.json | 2 +- .../IV_12_invalid_gene_symbol_evidence.json | 2 +- ...IV_13_invalid_gene_full_name_evidence.json | 2 +- ...invalid_gene_systematic_name_evidence.json | 2 +- .../IV_15_invalid_gene_synonym_evidence.json | 2 +- ...ider_source_organization_abbreviation.json | 2 +- ..._data_provider_cross_reference_prefix.json | 2 +- ...ta_provider_cross_reference_page_area.json | 2 +- ...19_invalid_gene_secondary_id_evidence.json | 2 +- .../MN_01_no_non_required_fields_level_1.json | 2 +- .../MN_02_no_non_required_fields_level_2.json | 2 +- .../bulk/01_gene/MR_02_no_taxon.json | 2 +- .../bulk/01_gene/MR_03_no_gene_symbol.json | 2 +- .../MR_04_no_gene_symbol_display_text.json | 2 +- .../MR_05_no_gene_full_name_display_text.json | 2 +- ..._no_gene_systematic_name_display_text.json | 2 +- .../MR_07_no_gene_synonym_display_text.json | 2 +- .../MR_08_no_gene_symbol_format_text.json | 2 +- .../MR_09_no_gene_full_name_format_text.json | 2 +- ...0_no_gene_systematic_name_format_text.json | 2 +- .../MR_11_no_gene_synonym_format_text.json | 2 +- .../MR_12_no_gene_symbol_name_type.json | 2 +- .../MR_13_no_gene_full_name_name_type.json | 2 +- ..._14_no_gene_systematic_name_name_type.json | 2 +- .../MR_15_no_gene_synonym_name_type.json | 2 +- .../bulk/01_gene/MR_16_no_data_provider.json | 2 +- ...ider_source_organization_abbreviation.json | 2 +- ...ider_cross_reference_referenced_curie.json | 2 +- ...provider_cross_reference_display_name.json | 2 +- ..._data_provider_cross_reference_prefix.json | 2 +- ...ta_provider_cross_reference_page_area.json | 2 +- ..._22_no_gene_secondary_id_secondary_id.json | 2 +- ...D_01_update_all_except_default_fields.json | 2 +- ...E_01_update_empty_non_required_fields.json | 2 +- ...update_no_non_required_fields_level_1.json | 2 +- ...update_no_non_required_fields_level_2.json | 2 +- .../01_gene/VT_01_valid_taxon_for_HUMAN.json | 2 +- .../01_gene/VT_02_valid_taxon_for_RGD.json | 2 +- .../bulk/02_allele/AF_01_all_fields.json | 2 +- .../bulk/02_allele/DN_01_duplicate_notes.json | 2 +- .../EN_01_empty_non_required_fields.json | 2 +- .../bulk/02_allele/ER_01_empty_curie.json | 2 +- .../bulk/02_allele/ER_02_empty_taxon.json | 2 +- ...y_allele_mutation_type_mutation_types.json | 2 +- ...R_04_empty_allele_symbol_display_text.json | 2 +- ...5_empty_allele_full_name_display_text.json | 2 +- ..._06_empty_allele_synonym_display_text.json | 2 +- ...ER_07_empty_allele_symbol_format_text.json | 2 +- ...08_empty_allele_full_name_format_text.json | 2 +- ...R_09_empty_allele_synonym_format_text.json | 2 +- .../ER_10_empty_allele_symbol_name_type.json | 2 +- ...R_11_empty_allele_full_name_name_type.json | 2 +- .../ER_12_empty_allele_synonym_name_type.json | 2 +- ...mpty_allele_secondary_id_secondary_id.json | 2 +- ...ele_inheritance_mode_inheritance_mode.json | 2 +- ...ider_source_organization_abbreviation.json | 2 +- ...ider_cross_reference_referenced_curie.json | 2 +- ...provider_cross_reference_display_name.json | 2 +- ..._data_provider_cross_reference_prefix.json | 2 +- ...ta_provider_cross_reference_page_area.json | 2 +- ...functional_impacts_functional_impacts.json | 2 +- ...n_status_germline_transmission_status.json | 2 +- ...22_empty_related_notes_note_type_name.json | 2 +- .../ER_23_empty_related_notes_free_text.json | 2 +- ...llele_database_status_database_status.json | 2 +- ...omenclature_events_nomenclature_event.json | 2 +- .../02_allele/IV_01_invalid_date_created.json | 2 +- .../02_allele/IV_02_invalid_date_updated.json | 2 +- .../bulk/02_allele/IV_03_invalid_taxon.json | 2 +- .../IV_04_invalid_in_collection.json | 2 +- .../02_allele/IV_05_invalid_reference.json | 2 +- ...id_allele_mutation_type_mutation_type.json | 2 +- ...invalid_allele_mutation_type_evidence.json | 2 +- ...IV_08_invalid_allele_symbol_name_type.json | 2 +- ...09_invalid_allele_full_name_name_type.json | 2 +- ...V_10_invalid_allele_synonym_name_type.json | 2 +- ...1_invalid_allele_symbol_synonym_scope.json | 2 +- ...nvalid_allele_full_name_synonym_scope.json | 2 +- ..._invalid_allele_synonym_synonym_scope.json | 2 +- .../IV_14_invalid_allele_symbol_evidence.json | 2 +- ..._15_invalid_allele_full_name_evidence.json | 2 +- ...IV_16_invalid_allele_synonym_evidence.json | 2 +- ..._invalid_allele_secondary_id_evidence.json | 2 +- ...ele_inheritance_mode_inheritance_mode.json | 2 +- ...llele_inheritance_mode_phenotype_term.json | 2 +- ...alid_allele_inheritance_mode_evidence.json | 2 +- ...ider_source_organization_abbreviation.json | 2 +- ..._data_provider_cross_reference_prefix.json | 2 +- ...ta_provider_cross_reference_page_area.json | 2 +- ...functional_impacts_functional_impacts.json | 2 +- ...ele_functional_impacts_phenotype_term.json | 2 +- ...id_allele_functional_impacts_evidence.json | 2 +- ...n_status_germline_transmission_status.json | 2 +- ...germline_transmission_status_evidence.json | 2 +- ..._invalid_related_notes_note_type_name.json | 2 +- .../IV_30_invalid_related_notes_evidence.json | 2 +- ...llele_database_status_database_status.json | 2 +- ...valid_allele_database_status_evidence.json | 2 +- ...omenclature_events_nomenclature_event.json | 2 +- ...d_allele_nomenclature_events_evidence.json | 2 +- .../MN_01_no_non_required_fields_level_1.json | 2 +- .../MN_02_no_non_required_fields_level_2.json | 2 +- .../bulk/02_allele/MR_02_no_taxon.json | 2 +- ...o_allele_mutation_type_mutation_types.json | 2 +- .../02_allele/MR_04_no_allele_symbol.json | 2 +- .../MR_05_no_allele_symbol_display_text.json | 2 +- ...R_06_no_allele_full_name_display_text.json | 2 +- .../MR_07_no_allele_synonym_display_text.json | 2 +- .../MR_08_no_allele_symbol_format_text.json | 2 +- ...MR_09_no_allele_full_name_format_text.json | 2 +- .../MR_10_no_allele_synonym_format_text.json | 2 +- .../MR_11_no_allele_symbol_name_type.json | 2 +- .../MR_12_no_allele_full_name_name_type.json | 2 +- .../MR_13_no_allele_synonym_name_type.json | 2 +- ...4_no_allele_secondary_id_secondary_id.json | 2 +- ...ele_inheritance_mode_inheritance_mode.json | 2 +- .../02_allele/MR_16_no_data_provider.json | 2 +- ...ider_source_organization_abbreviation.json | 2 +- ...ider_cross_reference_referenced_curie.json | 2 +- ...provider_cross_reference_display_name.json | 2 +- ..._data_provider_cross_reference_prefix.json | 2 +- ...ta_provider_cross_reference_page_area.json | 2 +- ...functional_impacts_functional_impacts.json | 2 +- ...n_status_germline_transmission_status.json | 2 +- ...MR_24_no_related_notes_note_type_name.json | 2 +- .../MR_25_no_related_notes_free_text.json | 2 +- ...llele_database_status_database_status.json | 2 +- ...omenclature_events_nomenclature_event.json | 2 +- .../bulk/02_allele/SI_01_secondary_ids.json | 2 +- ...D_01_update_all_except_default_fields.json | 2 +- ...E_01_update_empty_non_required_fields.json | 2 +- ...update_no_non_required_fields_level_1.json | 2 +- ...update_no_non_required_fields_level_2.json | 2 +- .../VT_01_valid_taxon_for_HUMAN.json | 2 +- .../02_allele/VT_02_valid_taxon_for_RGD.json | 2 +- .../bulk/03_agm/AF_01_all_fields.json | 2 +- .../EN_01_empty_non_required_fields.json | 2 +- .../bulk/03_agm/ER_01_empty_curie.json | 2 +- .../bulk/03_agm/ER_02_empty_taxon.json | 2 +- .../bulk/03_agm/ER_03_empty_subtype.json | 2 +- ...ider_source_organization_abbreviation.json | 2 +- ...ider_cross_reference_referenced_curie.json | 2 +- ...provider_cross_reference_display_name.json | 2 +- ..._data_provider_cross_reference_prefix.json | 2 +- ...ta_provider_cross_reference_page_area.json | 2 +- .../03_agm/IV_01_invalid_date_created.json | 2 +- .../03_agm/IV_02_invalid_date_updated.json | 2 +- .../bulk/03_agm/IV_03_invalid_taxon.json | 2 +- .../bulk/03_agm/IV_04_invalid_subtype.json | 2 +- ...ider_source_organization_abbreviation.json | 2 +- ..._data_provider_cross_reference_prefix.json | 2 +- ...ta_provider_cross_reference_page_area.json | 2 +- .../03_agm/MN_01_no_non_required_fields.json | 2 +- .../resources/bulk/03_agm/MR_02_no_taxon.json | 2 +- .../bulk/03_agm/MR_03_no_subtype.json | 2 +- .../bulk/03_agm/MR_04_no_data_provider.json | 2 +- ...ider_source_organization_abbreviation.json | 2 +- ...ider_cross_reference_referenced_curie.json | 2 +- ...provider_cross_reference_display_name.json | 2 +- ..._data_provider_cross_reference_prefix.json | 2 +- ...ta_provider_cross_reference_page_area.json | 2 +- ...D_01_update_all_except_default_fields.json | 2 +- ...E_01_update_empty_non_required_fields.json | 2 +- .../UM_01_update_no_non_required_fields.json | 2 +- .../03_agm/VT_01_valid_taxon_for_HUMAN.json | 2 +- .../03_agm/VT_02_valid_taxon_for_RGD.json | 2 +- .../AF_01_all_fields_gene_annotation.json | 8 +- .../AF_02_all_fields_allele_annotation.json | 10 +-- .../AF_03_all_fields_agm_annotation.json | 14 +-- .../DN_01_duplicate_notes.json | 8 +- .../ED_01_empty_disease_genetic_modifier.json | 8 +- ...pty_disease_genetic_modifier_relation.json | 8 +- ...disease_genetic_modifier_and_relation.json | 8 +- ...04_empty_condition_relation_reference.json | 8 +- ...ndition_relation_handle_and_reference.json | 8 +- ...quired_fields_level_1_gene_annotation.json | 8 +- ...ired_fields_level_1_allele_annotation.json | 10 +-- ...equired_fields_level_1_agm_annotation.json | 14 +-- ..._04_empty_non_required_fields_level_2.json | 8 +- .../ER_01_empty_subject.json | 8 +- .../ER_02_empty_object.json | 8 +- ...mpty_disease_relation_gene_annotation.json | 8 +- ...ty_disease_relation_allele_annotation.json | 10 +-- ...empty_disease_relation_agm_annotation.json | 14 +-- .../ER_06_empty_evidence_codes.json | 8 +- .../ER_07_empty_single_reference.json | 8 +- .../ER_08_empty_data_provider.json | 8 +- .../ER_09_empty_condition_relations_type.json | 8 +- ...tion_relation_experimental_conditions.json | 8 +- .../ER_11_empty_condition_class.json | 8 +- .../ER_12_empty_related_note_type.json | 8 +- .../ER_13_empty_related_note_free_text.json | 8 +- ...ider_source_organization_abbreviation.json | 8 +- ...ider_source_organization_abbreviation.json | 8 +- ...ider_cross_reference_referenced_curie.json | 8 +- ...provider_cross_reference_display_name.json | 8 +- ..._data_provider_cross_reference_prefix.json | 8 +- .../IV_01_invalid_date_created.json | 8 +- .../IV_02_invalid_date_updated.json | 8 +- .../IV_03_invalid_subject.json | 8 +- .../IV_04_invalid_object.json | 8 +- ...alid_disease_relation_gene_annotation.json | 8 +- ...id_disease_relation_allele_annotation.json | 8 +- ...valid_disease_relation_agm_annotation.json | 8 +- .../IV_08_invalid_evidence_code.json | 8 +- .../IV_09_invalid_single_reference.json | 8 +- .../IV_10_invalid_genetic_sex.json | 8 +- .../IV_11_invalid_sgd_strain_background.json | 8 +- .../IV_12_invalid_with.json | 8 +- .../IV_13_invalid_disease_qualifier.json | 8 +- .../IV_14_invalid_genetic_modifier.json | 8 +- ..._15_invalid_genetic_modifier_relation.json | 8 +- .../IV_16_invalid_annotation_type.json | 8 +- ...ider_source_organization_abbreviation.json | 8 +- ...ider_source_organization_abbreviation.json | 8 +- ...valid_inferred_gene_allele_annotation.json | 8 +- ...valid_asserted_gene_allele_annotation.json | 10 +-- ..._invalid_inferred_gene_agm_annotation.json | 12 +-- ..._invalid_asserted_gene_agm_annotation.json | 14 +-- ...nvalid_inferred_allele_agm_annotation.json | 12 +-- ...nvalid_asserted_allele_agm_annotation.json | 12 +-- ...IV_25_invalid_condition_relation_type.json | 8 +- ...d_condition_relation_single_reference.json | 8 +- .../IV_27_invalid_condition_class.json | 8 +- .../IV_28_non_slim_condition_class.json | 8 +- .../IV_29_invalid_condition_id.json | 8 +- ...IV_30_invalid_condition_gene_ontology.json | 8 +- .../IV_31_invalid_condition_anatomy.json | 8 +- .../IV_32_invalid_condition_taxon.json | 8 +- .../IV_33_invalid_condition_chemical.json | 8 +- .../IV_34_invalid_related_note_type.json | 8 +- .../IV_35_invalid_related_note_reference.json | 8 +- ...ta_provider_cross_reference_page_area.json | 8 +- ...ta_provider_cross_reference_page_area.json | 8 +- ..._data_provider_cross_reference_prefix.json | 8 +- ..._data_provider_cross_reference_prefix.json | 8 +- .../MD_01_no_disease_genetic_modifier.json | 6 +- ..._no_disease_genetic_modifier_relation.json | 8 +- ..._disease_genetic_modifier_or_relation.json | 6 +- ...MD_04_no_condition_relation_reference.json | 8 +- ...ondition_relation_handle_or_reference.json | 8 +- .../MM_01_mismatched_note_reference.json | 8 +- ...smatched_condition_relation_reference.json | 8 +- ...quired_fields_level_1_gene_annotation.json | 2 +- ...ired_fields_level_1_allele_annotation.json | 2 +- ...equired_fields_level_1_agm_annotation.json | 2 +- .../MN_04_no_non_required_fields_level_2.json | 8 +- .../MR_01_no_subject.json | 6 +- .../MR_02_no_object.json | 8 +- ...3_no_disease_relation_gene_annotation.json | 8 +- ...no_disease_relation_allele_annotation.json | 10 +-- ...05_no_disease_relation_agm_annotation.json | 14 +-- .../MR_06_no_evidence_codes.json | 8 +- .../MR_07_no_single_reference.json | 8 +- .../MR_08_no_data_provider.json | 6 +- .../MR_09_no_condition_relations_type.json | 8 +- ...tion_relation_experimental_conditions.json | 8 +- .../MR_11_no_condition_class.json | 8 +- .../MR_12_no_related_note_type.json | 8 +- .../MR_13_no_related_note_free_text.json | 8 +- ...ider_source_organization_abbreviation.json | 8 +- ...ider_source_organization_abbreviation.json | 8 +- ...ider_cross_reference_referenced_curie.json | 8 +- ...provider_cross_reference_display_name.json | 8 +- ..._data_provider_cross_reference_prefix.json | 8 +- .../SI_01_secondary_ids.json | 8 +- ...except_default_fields_gene_annotation.json | 8 +- ...cept_default_fields_allele_annotation.json | 10 +-- ..._except_default_fields_agm_annotation.json | 14 +-- ...quired_fields_level_1_gene_annotation.json | 8 +- ...ired_fields_level_1_allele_annotation.json | 10 +-- ...equired_fields_level_1_agm_annotation.json | 14 +-- ...ate_empty_non_required_fields_level_2.json | 8 +- ...quired_fields_level_1_gene_annotation.json | 2 +- ...ired_fields_level_1_allele_annotation.json | 2 +- ...equired_fields_level_1_agm_annotation.json | 2 +- ...update_no_non_required_fields_level_2.json | 8 +- .../US_01_unsupported_evidence_code.json | 8 +- .../VS_01_valid_subject_gene_for_HUMAN.json | 8 +- .../VS_02_valid_subject_gene_for_RGD.json | 8 +- .../VS_03_valid_subject_allele_for_HUMAN.json | 10 +-- .../VS_04_valid_subject_allele_for_RGD.json | 10 +-- .../VS_05_valid_subject_agm_for_HUMAN.json | 14 +-- .../VS_06_valid_subject_agm_for_RGD.json | 14 +-- .../bulk/06_variant/AF_01_all_fields.json | 2 +- .../06_variant/DN_01_duplicate_notes.json | 2 +- .../EN_01_empty_non_required_fields.json | 2 +- .../bulk/06_variant/ER_01_empty_curie.json | 2 +- .../bulk/06_variant/ER_02_empty_taxon.json | 2 +- .../06_variant/ER_03_empty_variant_type.json | 2 +- ...ider_source_organization_abbreviation.json | 2 +- ...ider_cross_reference_referenced_curie.json | 2 +- ...provider_cross_reference_display_name.json | 2 +- ..._data_provider_cross_reference_prefix.json | 2 +- ...ta_provider_cross_reference_page_area.json | 2 +- .../ER_09_empty_related_notes_note_type.json | 2 +- .../ER_10_empty_related_notes_free_text.json | 2 +- .../IV_01_invalid_date_created.json | 2 +- .../IV_02_invalid_date_updated.json | 2 +- .../bulk/06_variant/IV_03_invalid_taxon.json | 2 +- .../IV_04_invalid_variant_type.json | 2 +- .../IV_05_invalid_variant_status.json | 2 +- ...06_invalid_source_general_consequence.json | 2 +- ...ider_source_organization_abbreviation.json | 2 +- ..._data_provider_cross_reference_prefix.json | 2 +- ...ta_provider_cross_reference_page_area.json | 2 +- ...IV_10_invalid_related_notes_note_type.json | 2 +- .../IV_11_invalid_related_notes_evidence.json | 2 +- .../MN_01_no_non_required_fields_level_1.json | 2 +- .../MN_02_no_non_required_fields_level_2.json | 2 +- .../bulk/06_variant/MR_02_no_taxon.json | 2 +- .../06_variant/MR_03_no_variant_type.json | 2 +- .../06_variant/MR_04_no_data_provider.json | 2 +- ...ider_source_organization_abbreviation.json | 2 +- ...ider_cross_reference_referenced_curie.json | 2 +- ...provider_cross_reference_display_name.json | 2 +- ..._data_provider_cross_reference_prefix.json | 2 +- ...ta_provider_cross_reference_page_area.json | 2 +- .../MR_10_no_related_notes_note_type.json | 2 +- .../MR_11_no_related_notes_free_text.json | 2 +- ...D_01_update_all_except_default_fields.json | 2 +- ...E_01_update_empty_non_required_fields.json | 2 +- ...update_no_non_required_fields_level_1.json | 2 +- ...update_no_non_required_fields_level_2.json | 2 +- .../AF_01_all_fields.json | 4 +- .../ER_01_empty_subject.json | 4 +- .../ER_02_empty_relation.json | 4 +- .../ER_03_empty_object.json | 4 +- .../ER_04_empty_related_note_note_type.json | 4 +- .../ER_05_empty_related_note_free_text.json | 4 +- .../IV_01_invalid_subject.json | 4 +- .../IV_02_invalid_relation.json | 4 +- .../IV_03_invalid_object.json | 4 +- .../IV_04_invalid_date_created.json | 4 +- .../IV_05_invalid_date_updated.json | 4 +- .../IV_06_invalid_evidence_code.json | 4 +- .../IV_07_invalid_evidence.json | 4 +- .../IV_08_invalid_related_note_note_type.json | 4 +- .../MR_01_no_subject.json | 2 +- .../MR_02_no_relation.json | 4 +- .../MR_03_no_object.json | 2 +- .../MR_04_no_related_note_note_type.json | 4 +- .../MR_05_no_related_note_free_text.json | 4 +- ...D_01_update_all_except_default_fields.json | 4 +- ...E_01_update_empty_non_required_fields.json | 4 +- ...update_no_non_required_fields_level_1.json | 4 +- ...update_no_non_required_fields_level_2.json | 4 +- .../AF_01_all_fields.json | 2 +- .../ER_01_empty_subject.json | 2 +- .../ER_02_empty_relation.json | 2 +- .../ER_03_empty_object.json | 2 +- .../ER_04_empty_related_note_note_type.json | 2 +- .../ER_05_empty_related_note_free_text.json | 2 +- .../IV_01_invalid_subject.json | 2 +- .../IV_02_invalid_relation.json | 2 +- .../IV_03_invalid_object.json | 2 +- .../IV_04_invalid_date_created.json | 2 +- .../IV_05_invalid_date_updated.json | 2 +- .../IV_06_invalid_evidence.json | 2 +- .../IV_07_invalid_related_note_note_type.json | 2 +- .../MR_01_no_subject.json | 2 +- .../MR_02_no_relation.json | 2 +- .../MR_04_no_related_note_note_type.json | 2 +- .../MR_05_no_related_note_free_text.json | 2 +- ...D_01_update_all_except_default_fields.json | 2 +- ...E_01_update_empty_non_required_fields.json | 2 +- ...update_no_non_required_fields_level_1.json | 2 +- ...update_no_non_required_fields_level_2.json | 2 +- 531 files changed, 1912 insertions(+), 1728 deletions(-) create mode 100644 src/main/java/org/alliancegenome/curation_api/controllers/base/CurieObjectCrudController.java create mode 100644 src/main/java/org/alliancegenome/curation_api/controllers/base/SubmittedObjectCrudController.java delete mode 100644 src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseCurieCrudInterface.java create mode 100644 src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java create mode 100644 src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java create mode 100644 src/main/java/org/alliancegenome/curation_api/services/base/CurieObjectCrudService.java create mode 100644 src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java rename src/main/java/org/alliancegenome/curation_api/services/validation/{ => base}/AuditedObjectValidator.java (97%) rename src/main/java/org/alliancegenome/curation_api/services/validation/{CurieAuditedObjectValidator.java => base/CurieObjectValidator.java} (74%) create mode 100644 src/main/java/org/alliancegenome/curation_api/services/validation/base/SubmittedObjectValidator.java diff --git a/src/main/java/org/alliancegenome/curation_api/constants/ValidationConstants.java b/src/main/java/org/alliancegenome/curation_api/constants/ValidationConstants.java index 968b5677d..14d1d5aec 100644 --- a/src/main/java/org/alliancegenome/curation_api/constants/ValidationConstants.java +++ b/src/main/java/org/alliancegenome/curation_api/constants/ValidationConstants.java @@ -5,6 +5,7 @@ public final class ValidationConstants { public static final String INVALID_MESSAGE = "Not a valid entry"; public static final String OBSOLETE_MESSAGE = "Obsolete term specified"; public static final String REQUIRED_MESSAGE = "Required field is empty"; + public static final String REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE = "Field is required unless value is populated for "; public static final String DEPENDENCY_MESSAGE_PREFIX = "Invalid without value for "; public static final String NON_UNIQUE_MESSAGE = "Field value is not unique"; public static final String UNSUPPORTED_MESSAGE = "Unsupported value specified"; diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/base/BaseEntityCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/base/BaseEntityCrudController.java index dec1bb10a..4041e8479 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/base/BaseEntityCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/base/BaseEntityCrudController.java @@ -4,7 +4,6 @@ import java.util.List; import org.alliancegenome.curation_api.dao.base.BaseEntityDAO; -import org.alliancegenome.curation_api.interfaces.base.BaseCurieCrudInterface; import org.alliancegenome.curation_api.interfaces.base.BaseIdCrudInterface; import org.alliancegenome.curation_api.model.entities.base.BaseEntity; import org.alliancegenome.curation_api.model.input.Pagination; @@ -13,7 +12,7 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.base.BaseEntityCrudService; -public abstract class BaseEntityCrudController, E extends BaseEntity, D extends BaseEntityDAO> implements BaseIdCrudInterface, BaseCurieCrudInterface { +public abstract class BaseEntityCrudController, E extends BaseEntity, D extends BaseEntityDAO> implements BaseIdCrudInterface { protected BaseEntityCrudService service; @@ -35,10 +34,6 @@ public ObjectResponse get(Long id) { return service.get(id); } - public ObjectResponse get(String curie) { - return service.get(curie); - } - public ObjectResponse update(E entity) { return service.update(entity); } @@ -47,10 +42,6 @@ public ObjectResponse delete(Long id) { return service.delete(id); } - public ObjectResponse delete(String curie) { - return service.delete(curie); - } - public SearchResponse findByField(String field, String value) { return service.findByField(field, value); } diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/base/BaseOntologyTermController.java b/src/main/java/org/alliancegenome/curation_api/controllers/base/BaseOntologyTermController.java index 57bce9a37..5890d4a75 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/base/BaseOntologyTermController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/base/BaseOntologyTermController.java @@ -10,7 +10,7 @@ import org.alliancegenome.curation_api.services.helpers.GenericOntologyLoadHelper; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; -public abstract class BaseOntologyTermController, E extends OntologyTerm, D extends BaseEntityDAO> extends BaseEntityCrudController> { +public abstract class BaseOntologyTermController, E extends OntologyTerm, D extends BaseEntityDAO> extends CurieObjectCrudController> { private GenericOntologyLoadHelper loader; diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/base/CurieObjectCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/base/CurieObjectCrudController.java new file mode 100644 index 000000000..d358d984f --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/controllers/base/CurieObjectCrudController.java @@ -0,0 +1,21 @@ +package org.alliancegenome.curation_api.controllers.base; + +import org.alliancegenome.curation_api.dao.base.BaseEntityDAO; +import org.alliancegenome.curation_api.interfaces.base.CurieObjectCrudInterface; +import org.alliancegenome.curation_api.model.entities.base.CurieObject; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.services.base.CurieObjectCrudService; + +public abstract class CurieObjectCrudController, E extends CurieObject, D extends BaseEntityDAO> extends BaseEntityCrudController implements CurieObjectCrudInterface { + + protected CurieObjectCrudService service; + + public ObjectResponse get(String curie) { + return service.get(curie); + } + + public ObjectResponse delete(String curie) { + return service.delete(curie); + } + +} diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/base/SubmittedObjectCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/base/SubmittedObjectCrudController.java new file mode 100644 index 000000000..3a72b50c7 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/controllers/base/SubmittedObjectCrudController.java @@ -0,0 +1,34 @@ +package org.alliancegenome.curation_api.controllers.base; + +import org.alliancegenome.curation_api.dao.base.BaseEntityDAO; +import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; +import org.alliancegenome.curation_api.exceptions.ObjectUpdateException; +import org.alliancegenome.curation_api.interfaces.base.SubmittedObjectCrudInterface; +import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; +import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.services.base.SubmittedObjectCrudService; + +public abstract class SubmittedObjectCrudController, E extends SubmittedObject, T extends BaseDTO, D extends BaseEntityDAO> extends CurieObjectCrudController implements SubmittedObjectCrudInterface { + + protected SubmittedObjectCrudService service; + + @Override + public ObjectResponse get(String identifierString) { + return service.get(identifierString); + } + + @Override + public ObjectResponse delete(String identifierString) { + return service.delete(identifierString); + } + + public E upsert(T dto) throws ObjectUpdateException { + return upsert(dto, null); + } + + public E upsert(T dto, BackendBulkDataProvider dataProvider) throws ObjectUpdateException { + return service.upsert(dto, dataProvider); + } + +} diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/AGMDiseaseAnnotationCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/AGMDiseaseAnnotationCrudController.java index 5cef6e4bf..51e1ca6a8 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/AGMDiseaseAnnotationCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/AGMDiseaseAnnotationCrudController.java @@ -9,6 +9,7 @@ import org.alliancegenome.curation_api.model.entities.AGMDiseaseAnnotation; import org.alliancegenome.curation_api.model.ingest.dto.AGMDiseaseAnnotationDTO; import org.alliancegenome.curation_api.response.APIResponse; +import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.AGMDiseaseAnnotationService; import jakarta.annotation.PostConstruct; @@ -33,4 +34,8 @@ protected void init() { public APIResponse updateAgmDiseaseAnnotations(String dataProvider, List annotations) { return agmDiseaseAnnotationExecutor.runLoad(dataProvider, annotations); } + + public ObjectResponse get(String identifierString) { + return agmDiseaseAnnotationService.get(identifierString); + } } diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/AffectedGenomicModelCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/AffectedGenomicModelCrudController.java index c14cdca80..27fa088ec 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/AffectedGenomicModelCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/AffectedGenomicModelCrudController.java @@ -2,7 +2,7 @@ import java.util.List; -import org.alliancegenome.curation_api.controllers.base.BaseDTOCrudController; +import org.alliancegenome.curation_api.controllers.base.SubmittedObjectCrudController; import org.alliancegenome.curation_api.dao.AffectedGenomicModelDAO; import org.alliancegenome.curation_api.interfaces.crud.AffectedGenomicModelCrudInterface; import org.alliancegenome.curation_api.jobs.executors.AgmExecutor; @@ -16,7 +16,7 @@ import jakarta.inject.Inject; @RequestScoped -public class AffectedGenomicModelCrudController extends BaseDTOCrudController implements AffectedGenomicModelCrudInterface { +public class AffectedGenomicModelCrudController extends SubmittedObjectCrudController implements AffectedGenomicModelCrudInterface { @Inject AffectedGenomicModelService affectedGenomicModelService; diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/AlleleCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/AlleleCrudController.java index a1259fe03..0b193257a 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/AlleleCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/AlleleCrudController.java @@ -2,7 +2,7 @@ import java.util.List; -import org.alliancegenome.curation_api.controllers.base.BaseDTOCrudController; +import org.alliancegenome.curation_api.controllers.base.SubmittedObjectCrudController; import org.alliancegenome.curation_api.dao.AlleleDAO; import org.alliancegenome.curation_api.interfaces.crud.AlleleCrudInterface; import org.alliancegenome.curation_api.jobs.executors.AlleleExecutor; @@ -16,7 +16,7 @@ import jakarta.inject.Inject; @RequestScoped -public class AlleleCrudController extends BaseDTOCrudController implements AlleleCrudInterface { +public class AlleleCrudController extends SubmittedObjectCrudController implements AlleleCrudInterface { @Inject AlleleService alleleService; diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/AlleleDiseaseAnnotationCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/AlleleDiseaseAnnotationCrudController.java index 864b8b131..4194f68a4 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/AlleleDiseaseAnnotationCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/AlleleDiseaseAnnotationCrudController.java @@ -9,6 +9,7 @@ import org.alliancegenome.curation_api.model.entities.AlleleDiseaseAnnotation; import org.alliancegenome.curation_api.model.ingest.dto.AlleleDiseaseAnnotationDTO; import org.alliancegenome.curation_api.response.APIResponse; +import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.AlleleDiseaseAnnotationService; import jakarta.annotation.PostConstruct; @@ -34,4 +35,8 @@ protected void init() { public APIResponse updateAlleleDiseaseAnnotations(String dataProvider, List annotations) { return alleleDiseaseAnnotationExecutor.runLoad(dataProvider, annotations); } + + public ObjectResponse get(String identifierString) { + return alleleDiseaseAnnotationService.get(identifierString); + } } diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/BiologicalEntityCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/BiologicalEntityCrudController.java index b6e5b9ac0..5784bddcd 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/BiologicalEntityCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/BiologicalEntityCrudController.java @@ -1,6 +1,6 @@ package org.alliancegenome.curation_api.controllers.crud; -import org.alliancegenome.curation_api.controllers.base.BaseEntityCrudController; +import org.alliancegenome.curation_api.controllers.base.CurieObjectCrudController; import org.alliancegenome.curation_api.dao.BiologicalEntityDAO; import org.alliancegenome.curation_api.interfaces.crud.BiologicalEntityCrudInterface; import org.alliancegenome.curation_api.model.entities.BiologicalEntity; @@ -11,7 +11,7 @@ import jakarta.inject.Inject; @RequestScoped -public class BiologicalEntityCrudController extends BaseEntityCrudController implements BiologicalEntityCrudInterface { +public class BiologicalEntityCrudController extends CurieObjectCrudController implements BiologicalEntityCrudInterface { @Inject BiologicalEntityService biologicalEntityService; diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/ConstructCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/ConstructCrudController.java index 38be6f008..85cab928c 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/ConstructCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/ConstructCrudController.java @@ -2,7 +2,7 @@ import java.util.List; -import org.alliancegenome.curation_api.controllers.base.BaseDTOCrudController; +import org.alliancegenome.curation_api.controllers.base.SubmittedObjectCrudController; import org.alliancegenome.curation_api.dao.ConstructDAO; import org.alliancegenome.curation_api.interfaces.crud.ConstructCrudInterface; import org.alliancegenome.curation_api.jobs.executors.ConstructExecutor; @@ -16,7 +16,7 @@ import jakarta.inject.Inject; @RequestScoped -public class ConstructCrudController extends BaseDTOCrudController +public class ConstructCrudController extends SubmittedObjectCrudController implements ConstructCrudInterface { @Inject diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/DiseaseAnnotationCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/DiseaseAnnotationCrudController.java index bae47e0df..4046db7f0 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/DiseaseAnnotationCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/DiseaseAnnotationCrudController.java @@ -4,6 +4,7 @@ import org.alliancegenome.curation_api.dao.DiseaseAnnotationDAO; import org.alliancegenome.curation_api.interfaces.crud.DiseaseAnnotationCrudInterface; import org.alliancegenome.curation_api.model.entities.DiseaseAnnotation; +import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.DiseaseAnnotationService; import jakarta.annotation.PostConstruct; @@ -21,4 +22,8 @@ public class DiseaseAnnotationCrudController extends BaseEntityCrudController get(String identifierString) { + return diseaseAnnotationService.get(identifierString); + } } diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneCrudController.java index e54a92902..549cf8510 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneCrudController.java @@ -2,7 +2,7 @@ import java.util.List; -import org.alliancegenome.curation_api.controllers.base.BaseDTOCrudController; +import org.alliancegenome.curation_api.controllers.base.SubmittedObjectCrudController; import org.alliancegenome.curation_api.dao.GeneDAO; import org.alliancegenome.curation_api.interfaces.crud.GeneCrudInterface; import org.alliancegenome.curation_api.jobs.executors.GeneExecutor; @@ -17,7 +17,7 @@ import jakarta.inject.Inject; @RequestScoped -public class GeneCrudController extends BaseDTOCrudController implements GeneCrudInterface { +public class GeneCrudController extends SubmittedObjectCrudController implements GeneCrudInterface { @Inject GeneService geneService; diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneDiseaseAnnotationCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneDiseaseAnnotationCrudController.java index eefe974e6..4bdb7471e 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneDiseaseAnnotationCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneDiseaseAnnotationCrudController.java @@ -9,6 +9,7 @@ import org.alliancegenome.curation_api.model.entities.GeneDiseaseAnnotation; import org.alliancegenome.curation_api.model.ingest.dto.GeneDiseaseAnnotationDTO; import org.alliancegenome.curation_api.response.APIResponse; +import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.GeneDiseaseAnnotationService; import jakarta.annotation.PostConstruct; @@ -34,4 +35,8 @@ protected void init() { public APIResponse updateGeneDiseaseAnnotations(String dataProvider, List annotations) { return geneDiseaseAnnotationExecutor.runLoad(dataProvider, annotations); } + + public ObjectResponse get(String identifierString) { + return geneDiseaseAnnotationService.get(identifierString); + } } diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/InformationContentEntityCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/InformationContentEntityCrudController.java index eadc0fe3f..9bfe35e6d 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/InformationContentEntityCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/InformationContentEntityCrudController.java @@ -1,6 +1,6 @@ package org.alliancegenome.curation_api.controllers.crud; -import org.alliancegenome.curation_api.controllers.base.BaseEntityCrudController; +import org.alliancegenome.curation_api.controllers.base.CurieObjectCrudController; import org.alliancegenome.curation_api.dao.InformationContentEntityDAO; import org.alliancegenome.curation_api.interfaces.crud.InformationContentEntityCrudInterface; import org.alliancegenome.curation_api.model.entities.InformationContentEntity; @@ -11,7 +11,7 @@ import jakarta.inject.Inject; @RequestScoped -public class InformationContentEntityCrudController extends BaseEntityCrudController +public class InformationContentEntityCrudController extends CurieObjectCrudController implements InformationContentEntityCrudInterface { @Inject diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/MoleculeCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/MoleculeCrudController.java index 07deabcc5..f7ce3c29b 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/MoleculeCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/MoleculeCrudController.java @@ -1,6 +1,6 @@ package org.alliancegenome.curation_api.controllers.crud; -import org.alliancegenome.curation_api.controllers.base.BaseEntityCrudController; +import org.alliancegenome.curation_api.controllers.base.CurieObjectCrudController; import org.alliancegenome.curation_api.dao.MoleculeDAO; import org.alliancegenome.curation_api.interfaces.crud.MoleculeCrudInterface; import org.alliancegenome.curation_api.jobs.executors.MoleculeExecutor; @@ -16,7 +16,7 @@ import jakarta.inject.Inject; @RequestScoped -public class MoleculeCrudController extends BaseEntityCrudController implements MoleculeCrudInterface { +public class MoleculeCrudController extends CurieObjectCrudController implements MoleculeCrudInterface { @Inject MoleculeService moleculeService; diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/ReferenceCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/ReferenceCrudController.java index 566c1d925..454085168 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/ReferenceCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/ReferenceCrudController.java @@ -1,6 +1,6 @@ package org.alliancegenome.curation_api.controllers.crud; -import org.alliancegenome.curation_api.controllers.base.BaseEntityCrudController; +import org.alliancegenome.curation_api.controllers.base.CurieObjectCrudController; import org.alliancegenome.curation_api.dao.ReferenceDAO; import org.alliancegenome.curation_api.interfaces.crud.ReferenceCrudInterface; import org.alliancegenome.curation_api.model.entities.Reference; @@ -12,7 +12,7 @@ import jakarta.inject.Inject; @RequestScoped -public class ReferenceCrudController extends BaseEntityCrudController implements ReferenceCrudInterface { +public class ReferenceCrudController extends CurieObjectCrudController implements ReferenceCrudInterface { @Inject ReferenceService referenceService; @@ -27,7 +27,7 @@ public void synchroniseReferences() { referenceService.synchroniseReferences(); } - public ObjectResponse synchroniseReference(String curie) { - return referenceService.synchroniseReference(curie); + public ObjectResponse synchroniseReference(Long id) { + return referenceService.synchroniseReference(id); } } diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/VariantCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/VariantCrudController.java index 75103bbeb..cda64f5ea 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/VariantCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/VariantCrudController.java @@ -2,7 +2,7 @@ import java.util.List; -import org.alliancegenome.curation_api.controllers.base.BaseDTOCrudController; +import org.alliancegenome.curation_api.controllers.base.SubmittedObjectCrudController; import org.alliancegenome.curation_api.dao.VariantDAO; import org.alliancegenome.curation_api.interfaces.crud.VariantCrudInterface; import org.alliancegenome.curation_api.jobs.executors.VariantExecutor; @@ -16,7 +16,7 @@ import jakarta.inject.Inject; @RequestScoped -public class VariantCrudController extends BaseDTOCrudController implements VariantCrudInterface { +public class VariantCrudController extends SubmittedObjectCrudController implements VariantCrudInterface { @Inject VariantService variantService; diff --git a/src/main/java/org/alliancegenome/curation_api/dao/AffectedGenomicModelDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/AffectedGenomicModelDAO.java index 55a74eef7..45531015e 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/AffectedGenomicModelDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/AffectedGenomicModelDAO.java @@ -1,6 +1,7 @@ package org.alliancegenome.curation_api.dao; import java.math.BigInteger; +import java.util.ArrayList; import java.util.List; import org.alliancegenome.curation_api.dao.base.BaseSQLDAO; @@ -16,13 +17,16 @@ protected AffectedGenomicModelDAO() { super(AffectedGenomicModel.class); } - public List findReferencingDiseaseAnnotations(String agmCurie) { - Query jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AGMDiseaseAnnotation ada WHERE ada.subject.curie = :agmCurie"); - jpqlQuery.setParameter("agmCurie", agmCurie); - List results = (List) jpqlQuery.getResultList(); + public List findReferencingDiseaseAnnotations(Long agmId) { + List results = new ArrayList<>(); - jpqlQuery = entityManager.createNativeQuery("SELECT diseaseannotation_id FROM diseaseannotation_biologicalentity db WHERE diseasegeneticmodifiers_curie = :agmCurie"); - jpqlQuery.setParameter("agmCurie", agmCurie); + Query jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AGMDiseaseAnnotation ada WHERE ada.subject.id = :agmId"); + jpqlQuery.setParameter("agmId", agmId); + for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) + results.add(nativeResult.longValue()); + + jpqlQuery = entityManager.createNativeQuery("SELECT diseaseannotation_id FROM diseaseannotation_biologicalentity db WHERE diseasegeneticmodifiers_id = :agmId"); + jpqlQuery.setParameter("agmId", agmId); for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) results.add(nativeResult.longValue()); diff --git a/src/main/java/org/alliancegenome/curation_api/dao/AlleleDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/AlleleDAO.java index cea89498b..3a3e75085 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/AlleleDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/AlleleDAO.java @@ -1,6 +1,7 @@ package org.alliancegenome.curation_api.dao; import java.math.BigInteger; +import java.util.ArrayList; import java.util.List; import org.alliancegenome.curation_api.dao.base.BaseSQLDAO; @@ -16,17 +17,20 @@ protected AlleleDAO() { super(Allele.class); } - public List findReferencingDiseaseAnnotationIds(String alleleCurie) { - Query jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AlleleDiseaseAnnotation ada WHERE ada.subject.curie = :alleleCurie"); - jpqlQuery.setParameter("alleleCurie", alleleCurie); - List results = (List) jpqlQuery.getResultList(); + public List findReferencingDiseaseAnnotationIds(Long alleleId) { + List results = new ArrayList<>(); + Query jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AlleleDiseaseAnnotation ada WHERE ada.subject.id = :alleleId"); + jpqlQuery.setParameter("alleleId", alleleId); + for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) + results.add(nativeResult.longValue()); - jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AGMDiseaseAnnotation ada WHERE ada.inferredAllele.curie = :alleleCurie OR ada.assertedAllele.curie = :alleleCurie"); - jpqlQuery.setParameter("alleleCurie", alleleCurie); - results.addAll((List) jpqlQuery.getResultList()); + jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AGMDiseaseAnnotation ada WHERE ada.inferredAllele.id = :alleleId OR ada.assertedAllele.id = :alleleId"); + jpqlQuery.setParameter("alleleId", alleleId); + for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) + results.add(nativeResult.longValue()); - jpqlQuery = entityManager.createNativeQuery("SELECT diseaseannotation_id FROM diseaseannotation_biologicalentity db WHERE diseasegeneticmodifiers_curie = :alleleCurie"); - jpqlQuery.setParameter("alleleCurie", alleleCurie); + jpqlQuery = entityManager.createNativeQuery("SELECT diseaseannotation_id FROM diseaseannotation_biologicalentity db WHERE diseasegeneticmodifiers_id = :alleleId"); + jpqlQuery.setParameter("alleleId", alleleId); for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) results.add(nativeResult.longValue()); diff --git a/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java index def872bd0..7a8ec6eef 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java @@ -16,49 +16,45 @@ protected GeneDAO() { super(Gene.class); } - public Gene getByIdOrCurie(String id) { - return find(id); - } - - public List findReferencingDiseaseAnnotations(String geneCurie) { - Query jpqlQuery = entityManager.createQuery("SELECT gda.id FROM GeneDiseaseAnnotation gda WHERE gda.subject.curie = :geneCurie"); - jpqlQuery.setParameter("geneCurie", geneCurie); + public List findReferencingDiseaseAnnotations(Long geneId) { + Query jpqlQuery = entityManager.createQuery("SELECT gda.id FROM GeneDiseaseAnnotation gda WHERE gda.subject.id = :geneId"); + jpqlQuery.setParameter("geneId", geneId); List results = (List) jpqlQuery.getResultList(); - jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AGMDiseaseAnnotation ada WHERE ada.inferredGene.curie = :geneCurie"); - jpqlQuery.setParameter("geneCurie", geneCurie); + jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AGMDiseaseAnnotation ada WHERE ada.inferredGene.id = :geneId"); + jpqlQuery.setParameter("geneId", geneId); results.addAll((List) jpqlQuery.getResultList()); - jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AlleleDiseaseAnnotation ada WHERE ada.inferredGene.curie = :geneCurie"); - jpqlQuery.setParameter("geneCurie", geneCurie); + jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AlleleDiseaseAnnotation ada WHERE ada.inferredGene.id = :geneId"); + jpqlQuery.setParameter("geneId", geneId); results.addAll((List) jpqlQuery.getResultList()); - jpqlQuery = entityManager.createNativeQuery("SELECT diseaseannotation_id FROM diseaseannotation_gene gda WHERE with_curie = :geneCurie"); - jpqlQuery.setParameter("geneCurie", geneCurie); + jpqlQuery = entityManager.createNativeQuery("SELECT diseaseannotation_id FROM diseaseannotation_gene gda WHERE with_id = :geneId"); + jpqlQuery.setParameter("geneId", geneId); for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) results.add(nativeResult.longValue()); - jpqlQuery = entityManager.createNativeQuery("SELECT agmdiseaseannotation_id FROM agmdiseaseannotation_gene gda WHERE assertedgenes_curie = :geneCurie"); - jpqlQuery.setParameter("geneCurie", geneCurie); + jpqlQuery = entityManager.createNativeQuery("SELECT agmdiseaseannotation_id FROM agmdiseaseannotation_gene gda WHERE assertedgenes_id = :geneId"); + jpqlQuery.setParameter("geneId", geneId); for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) results.add(nativeResult.longValue()); - jpqlQuery = entityManager.createNativeQuery("SELECT allelediseaseannotation_id FROM allelediseaseannotation_gene gda WHERE assertedgenes_curie = :geneCurie"); - jpqlQuery.setParameter("geneCurie", geneCurie); + jpqlQuery = entityManager.createNativeQuery("SELECT allelediseaseannotation_id FROM allelediseaseannotation_gene gda WHERE assertedgenes_id = :geneId"); + jpqlQuery.setParameter("geneId", geneId); for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) results.add(nativeResult.longValue()); - jpqlQuery = entityManager.createNativeQuery("SELECT diseaseannotation_id FROM diseaseannotation_biologicalentity db WHERE diseasegeneticmodifiers_curie = :geneCurie"); - jpqlQuery.setParameter("geneCurie", geneCurie); + jpqlQuery = entityManager.createNativeQuery("SELECT diseaseannotation_id FROM diseaseannotation_biologicalentity db WHERE diseasegeneticmodifiers_id = :geneId"); + jpqlQuery.setParameter("geneId", geneId); for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) results.add(nativeResult.longValue()); return results; } - public List findReferencingOrthologyPairs(String curie) { - Query jpqlQuery = entityManager.createQuery("SELECT o.id FROM GeneToGeneOrthology o WHERE o.subjectGene.curie = :curie OR o.objectGene.curie = :curie"); - jpqlQuery.setParameter("curie", curie); + public List findReferencingOrthologyPairs(Long geneId) { + Query jpqlQuery = entityManager.createQuery("SELECT o.id FROM GeneToGeneOrthology o WHERE o.subjectGene.id = :geneId OR o.objectGene.id = :geneId"); + jpqlQuery.setParameter("geneId", geneId); return (List) jpqlQuery.getResultList(); } diff --git a/src/main/java/org/alliancegenome/curation_api/dao/MoleculeDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/MoleculeDAO.java index a86a5cf70..3da067d58 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/MoleculeDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/MoleculeDAO.java @@ -12,8 +12,4 @@ protected MoleculeDAO() { super(Molecule.class); } - public Molecule getByIdOrCurie(String id) { - return find(id); - } - } diff --git a/src/main/java/org/alliancegenome/curation_api/dao/VariantDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/VariantDAO.java index aa8119dfa..361ad1131 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/VariantDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/VariantDAO.java @@ -1,9 +1,14 @@ package org.alliancegenome.curation_api.dao; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; + import org.alliancegenome.curation_api.dao.base.BaseSQLDAO; import org.alliancegenome.curation_api.model.entities.Variant; import jakarta.enterprise.context.ApplicationScoped; +import jakarta.persistence.Query; @ApplicationScoped public class VariantDAO extends BaseSQLDAO { @@ -12,4 +17,13 @@ protected VariantDAO() { super(Variant.class); } + public List findReferencingDiseaseAnnotationIds(Long variantId) { + List results = new ArrayList<>(); + Query jpqlQuery = entityManager.createNativeQuery("SELECT diseaseannotation_id FROM diseaseannotation_biologicalentity db WHERE diseasegeneticmodifiers_id = :variantId"); + jpqlQuery.setParameter("variantId", variantId); + for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) + results.add(nativeResult.longValue()); + + return results; + } } diff --git a/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java index c9ce2c50e..de3645cdf 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java @@ -91,11 +91,44 @@ public List persist(List entities) { entityManager.persist(entities); return entities; } + + public E findByCurie(String curie) { + Log.debug("SqlDAO: findByCurie: " + curie + " " + myClass); + if (curie != null) { + SearchResponse response = findByField("curie", curie); + if (response == null || response.getSingleResult() == null) { + Log.debug("Entity Not Found: " + curie); + return null; + } + E entity = response.getSingleResult(); + Log.debug("Entity Found: " + entity); + return entity; + } else { + Log.debug("Input Param is null: " + curie); + return null; + } + } - public E find(String id) { - Log.debug("SqlDAO: find: " + id + " " + myClass); + public E findByIdentifierString(String id) { + Log.debug("SqlDAO: findByIdentifierString: " + id + " " + myClass); if (id != null) { - E entity = entityManager.find(myClass, id); + SearchResponse response = null; + if (id.startsWith("AGRKB:")) { + response = findByField("curie", id); + } else { + if (response == null || response.getSingleResult() == null) { + response = findByField("modEntityId", id); + if (response == null || response.getSingleResult() == null) + response = findByField("modInternalId", id); + } + } + + if (response == null || response.getSingleResult() == null) { + Log.debug("Entity Not Found: " + id); + return null; + } + + E entity = response.getSingleResult(); Log.debug("Entity Found: " + entity); return entity; } else { @@ -116,19 +149,19 @@ public E find(Long id) { } } - public List findFilteredIds(Map params) { - List primaryKeys = new ArrayList<>(); + public List findFilteredIds(Map params) { + List primaryKeys = new ArrayList<>(); SearchResponse results = findByParams(params); for (E entity : results.getResults()) { - String pkString = returnStringId(entity); - if (pkString != null) - primaryKeys.add(pkString); + Long pk = returnId(entity); + if (pk != null) + primaryKeys.add(pk); } return primaryKeys; } - public SearchResponse findAllIds() { + public SearchResponse findAllIds() { CriteriaBuilder cb = entityManager.getCriteriaBuilder(); CriteriaQuery findQuery = cb.createQuery(myClass); Root rootEntry = findQuery.from(myClass); @@ -140,14 +173,14 @@ public SearchResponse findAllIds() { Long totalResults = entityManager.createQuery(countQuery).getSingleResult(); TypedQuery allQuery = entityManager.createQuery(all); - SearchResponse results = new SearchResponse(); + SearchResponse results = new SearchResponse(); - List primaryKeys = new ArrayList<>(); + List primaryKeys = new ArrayList<>(); for (E entity : allQuery.getResultList()) { - String pkString = returnStringId(entity); - if (pkString != null) - primaryKeys.add(pkString); + Long pk = returnId(entity); + if (pk != null) + primaryKeys.add(pk); } results.setResults(primaryKeys); @@ -155,18 +188,14 @@ public SearchResponse findAllIds() { return results; } - private String returnStringId(E entity) { - String pkString = null; + private Long returnId(E entity) { + Long pk = null; try { - pkString = (String) entityManager.getEntityManagerFactory().getPersistenceUnitUtil().getIdentifier(entity); + pk = (Long) entityManager.getEntityManagerFactory().getPersistenceUnitUtil().getIdentifier(entity); } catch (ClassCastException e) { - try { - pkString = Long.toString((Long) entityManager.getEntityManagerFactory().getPersistenceUnitUtil().getIdentifier(entity)); - } catch (Exception ex) { - Log.error("Could not convert entity ID to string: " + ex.getMessage()); - } + Log.error("Could not convert entity ID to string: " + e.getMessage()); } - return pkString; + return pk; } public SearchResponse findAll() { @@ -209,20 +238,6 @@ public E merge(E entity) { return entity; } - @Transactional - public E remove(String id) { - Log.debug("SqlDAO: remove: " + id); - E entity = find(id); - - try { - entityManager.remove(entity); - entityManager.flush(); - } catch (PersistenceException e) { - handlePersistenceException(entity, e); - } - return entity; - } - @Transactional public E remove(Long id) { Log.debug("SqlDAO: remove: " + id); diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseCurieCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseCurieCrudInterface.java deleted file mode 100644 index 03e578935..000000000 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseCurieCrudInterface.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.alliancegenome.curation_api.interfaces.base; - -import java.util.HashMap; -import java.util.List; - -import org.alliancegenome.curation_api.model.entities.base.BaseEntity; -import org.alliancegenome.curation_api.response.ObjectListResponse; -import org.alliancegenome.curation_api.response.ObjectResponse; -import org.alliancegenome.curation_api.response.SearchResponse; -import org.alliancegenome.curation_api.view.View; -import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody; -import org.eclipse.microprofile.openapi.annotations.tags.Tag; - -import com.fasterxml.jackson.annotation.JsonView; - -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.DELETE; -import jakarta.ws.rs.DefaultValue; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.POST; -import jakarta.ws.rs.PUT; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.PathParam; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.QueryParam; -import jakarta.ws.rs.core.MediaType; - -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) -public interface BaseCurieCrudInterface { - - @POST - @Path("/") - @JsonView(View.FieldsOnly.class) - public ObjectResponse create(E entity); - - @POST - @Path("/multiple") - @JsonView(View.FieldsOnly.class) - public ObjectListResponse create(List entities); - - @GET - @Path("/{curie}") - @JsonView(View.FieldsOnly.class) - public ObjectResponse get(@PathParam("curie") String curie); - - @PUT - @Path("/") - @JsonView(View.FieldsOnly.class) - public ObjectResponse update(E entity); - - @DELETE - @Path("/{curie}") - @JsonView(View.FieldsOnly.class) - public ObjectResponse delete(@PathParam("curie") String curie); - - @POST - @Path("/find") - @Tag(name = "Relational Database Browsing Endpoints") - @JsonView(View.FieldsAndLists.class) - public SearchResponse find(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); - - @POST - @Path("/search") - @Tag(name = "Search Database Browsing Endpoints") - @JsonView({ View.FieldsAndLists.class }) - public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); - - @GET - @Path("/reindex") - @Tag(name = "Reindex Endpoints") - public void reindex(@DefaultValue("1000") @QueryParam("batchSizeToLoadObjects") Integer batchSizeToLoadObjects, @DefaultValue("10000") @QueryParam("idFetchSize") Integer idFetchSize, - @DefaultValue("0") @QueryParam("limitIndexedObjectsTo") Integer limitIndexedObjectsTo, @DefaultValue("4") @QueryParam("threadsToLoadObjects") Integer threadsToLoadObjects, - @DefaultValue("14400") @QueryParam("transactionTimeout") Integer transactionTimeout, @DefaultValue("1") @QueryParam("typesToIndexInParallel") Integer typesToIndexInParallel); - -} diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseOntologyTermCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseOntologyTermCrudInterface.java index 441319028..ed56a1cd4 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseOntologyTermCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseOntologyTermCrudInterface.java @@ -18,7 +18,7 @@ import jakarta.ws.rs.core.MediaType; @Tag(name = "CRUD - Ontology - Bulk") -public interface BaseOntologyTermCrudInterface extends BaseCurieCrudInterface { +public interface BaseOntologyTermCrudInterface extends CurieObjectCrudInterface { @POST @Path("/bulk/owl") diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java new file mode 100644 index 000000000..bd8a7de7f --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java @@ -0,0 +1,31 @@ +package org.alliancegenome.curation_api.interfaces.base; + +import org.alliancegenome.curation_api.model.entities.base.CurieObject; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.view.View; + +import com.fasterxml.jackson.annotation.JsonView; + +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; + +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public interface CurieObjectCrudInterface extends BaseIdCrudInterface { + + @GET + @Path("/{curie}") + @JsonView(View.FieldsOnly.class) + public ObjectResponse get(@PathParam("curie") String curie); + + @DELETE + @Path("/{curie}") + @JsonView(View.FieldsOnly.class) + public ObjectResponse delete(@PathParam("curie") String curie); + +} diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java new file mode 100644 index 000000000..5c03eec00 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java @@ -0,0 +1,33 @@ +package org.alliancegenome.curation_api.interfaces.base; + +import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.view.View; + +import com.fasterxml.jackson.annotation.JsonView; + +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; + +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public interface SubmittedObjectCrudInterface extends CurieObjectCrudInterface { + + @Override + @GET + @Path("/{identifierString}") + @JsonView(View.FieldsOnly.class) + public ObjectResponse get(@PathParam("identifierString") String identifierString); + + @Override + @DELETE + @Path("/{identifierString}") + @JsonView(View.FieldsOnly.class) + public ObjectResponse delete(@PathParam("identifierString") String identifierString); + +} diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AffectedGenomicModelCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AffectedGenomicModelCrudInterface.java index 80a350531..4a7344a4a 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AffectedGenomicModelCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AffectedGenomicModelCrudInterface.java @@ -2,8 +2,8 @@ import java.util.List; -import org.alliancegenome.curation_api.interfaces.base.BaseCurieCrudInterface; import org.alliancegenome.curation_api.interfaces.base.BaseDTOCrudControllerInterface; +import org.alliancegenome.curation_api.interfaces.base.SubmittedObjectCrudInterface; import org.alliancegenome.curation_api.model.entities.AffectedGenomicModel; import org.alliancegenome.curation_api.model.ingest.dto.AffectedGenomicModelDTO; import org.alliancegenome.curation_api.response.APIResponse; @@ -24,11 +24,11 @@ @Tag(name = "CRUD - Affected Genomic Models") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface AffectedGenomicModelCrudInterface extends BaseCurieCrudInterface, BaseDTOCrudControllerInterface { +public interface AffectedGenomicModelCrudInterface extends SubmittedObjectCrudInterface, BaseDTOCrudControllerInterface { @Override @JsonView(View.FieldsAndLists.class) - public ObjectResponse get(@PathParam("curie") String curie); + public ObjectResponse get(@PathParam("identifierString") String identifierString); @POST @Path("/bulk/{dataProvider}/agms") diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AlleleCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AlleleCrudInterface.java index 60e8caa46..a7a276ed8 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AlleleCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AlleleCrudInterface.java @@ -3,8 +3,8 @@ import java.util.HashMap; import java.util.List; -import org.alliancegenome.curation_api.interfaces.base.BaseCurieCrudInterface; import org.alliancegenome.curation_api.interfaces.base.BaseDTOCrudControllerInterface; +import org.alliancegenome.curation_api.interfaces.base.SubmittedObjectCrudInterface; import org.alliancegenome.curation_api.model.entities.Allele; import org.alliancegenome.curation_api.model.ingest.dto.AlleleDTO; import org.alliancegenome.curation_api.response.APIResponse; @@ -31,7 +31,7 @@ @Tag(name = "CRUD - Alleles") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface AlleleCrudInterface extends BaseCurieCrudInterface, BaseDTOCrudControllerInterface { +public interface AlleleCrudInterface extends SubmittedObjectCrudInterface, BaseDTOCrudControllerInterface { @POST @Path("/bulk/{dataProvider}/alleles") @@ -41,8 +41,8 @@ public interface AlleleCrudInterface extends BaseCurieCrudInterface, Bas @Override @GET @JsonView(View.AlleleDetailView.class) - @Path("/{curie}") - public ObjectResponse get(@PathParam("curie") String curie); + @Path("/{identifierString}") + public ObjectResponse get(@PathParam("identifierString") String identifierString); @Override @PUT diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/BiologicalEntityCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/BiologicalEntityCrudInterface.java index ff7da624c..2ab7a6447 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/BiologicalEntityCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/BiologicalEntityCrudInterface.java @@ -1,6 +1,6 @@ package org.alliancegenome.curation_api.interfaces.crud; -import org.alliancegenome.curation_api.interfaces.base.BaseCurieCrudInterface; +import org.alliancegenome.curation_api.interfaces.base.SubmittedObjectCrudInterface; import org.alliancegenome.curation_api.model.entities.BiologicalEntity; import org.eclipse.microprofile.openapi.annotations.tags.Tag; @@ -13,6 +13,6 @@ @Tag(name = "CRUD - Biological Entities") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface BiologicalEntityCrudInterface extends BaseCurieCrudInterface { +public interface BiologicalEntityCrudInterface extends SubmittedObjectCrudInterface { } diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ConstructCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ConstructCrudInterface.java index 61794f7a8..110c6cdb7 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ConstructCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ConstructCrudInterface.java @@ -3,7 +3,7 @@ import java.util.List; import org.alliancegenome.curation_api.interfaces.base.BaseDTOCrudControllerInterface; -import org.alliancegenome.curation_api.interfaces.base.BaseIdCrudInterface; +import org.alliancegenome.curation_api.interfaces.base.SubmittedObjectCrudInterface; import org.alliancegenome.curation_api.model.entities.Construct; import org.alliancegenome.curation_api.model.ingest.dto.ConstructDTO; import org.alliancegenome.curation_api.response.APIResponse; @@ -26,7 +26,7 @@ @Tag(name = "CRUD - Constructs") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface ConstructCrudInterface extends BaseIdCrudInterface, BaseDTOCrudControllerInterface { +public interface ConstructCrudInterface extends SubmittedObjectCrudInterface, BaseDTOCrudControllerInterface { @Override @GET @@ -35,9 +35,9 @@ public interface ConstructCrudInterface extends BaseIdCrudInterface, public ObjectResponse get(@PathParam("id") Long id); @GET - @Path("/findBy/{identifier}") + @Path("/{identifierString}") @JsonView(View.ConstructView.class) - public ObjectResponse get(@PathParam("identifier") String identifier); + public ObjectResponse get(@PathParam("identifierString") String identifierString); @PUT @Path("/") diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/CrossReferenceCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/CrossReferenceCrudInterface.java index e33389e9c..5680e1211 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/CrossReferenceCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/CrossReferenceCrudInterface.java @@ -1,6 +1,6 @@ package org.alliancegenome.curation_api.interfaces.crud; -import org.alliancegenome.curation_api.interfaces.base.BaseCurieCrudInterface; +import org.alliancegenome.curation_api.interfaces.base.BaseIdCrudInterface; import org.alliancegenome.curation_api.model.entities.CrossReference; import org.eclipse.microprofile.openapi.annotations.tags.Tag; @@ -13,5 +13,5 @@ @Tag(name = "CRUD - Cross References") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface CrossReferenceCrudInterface extends BaseCurieCrudInterface { +public interface CrossReferenceCrudInterface extends BaseIdCrudInterface { } \ No newline at end of file diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/GeneCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/GeneCrudInterface.java index d799439e1..b38b4b416 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/GeneCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/GeneCrudInterface.java @@ -3,8 +3,8 @@ import java.util.HashMap; import java.util.List; -import org.alliancegenome.curation_api.interfaces.base.BaseCurieCrudInterface; import org.alliancegenome.curation_api.interfaces.base.BaseDTOCrudControllerInterface; +import org.alliancegenome.curation_api.interfaces.base.SubmittedObjectCrudInterface; import org.alliancegenome.curation_api.model.entities.Gene; import org.alliancegenome.curation_api.model.ingest.dto.GeneDTO; import org.alliancegenome.curation_api.response.APIResponse; @@ -31,13 +31,13 @@ @Tag(name = "CRUD - Genes") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface GeneCrudInterface extends BaseCurieCrudInterface, BaseDTOCrudControllerInterface { +public interface GeneCrudInterface extends SubmittedObjectCrudInterface, BaseDTOCrudControllerInterface { @Override @GET - @Path("/{curie}") + @Path("/{identifierString}") @JsonView(View.GeneDetailView.class) - public ObjectResponse get(@PathParam("curie") String curie); + public ObjectResponse get(@PathParam("identifierString") String identifierString); @POST @Path("/bulk/{dataProvider}/genes") diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/InformationContentEntityCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/InformationContentEntityCrudInterface.java index 0c997252a..57884a950 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/InformationContentEntityCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/InformationContentEntityCrudInterface.java @@ -1,6 +1,6 @@ package org.alliancegenome.curation_api.interfaces.crud; -import org.alliancegenome.curation_api.interfaces.base.BaseCurieCrudInterface; +import org.alliancegenome.curation_api.interfaces.base.CurieObjectCrudInterface; import org.alliancegenome.curation_api.model.entities.InformationContentEntity; import org.eclipse.microprofile.openapi.annotations.tags.Tag; @@ -13,6 +13,6 @@ @Tag(name = "CRUD - Information Content Entities") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface InformationContentEntityCrudInterface extends BaseCurieCrudInterface { +public interface InformationContentEntityCrudInterface extends CurieObjectCrudInterface { } diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/MoleculeCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/MoleculeCrudInterface.java index e0a92642e..2ac6e369e 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/MoleculeCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/MoleculeCrudInterface.java @@ -1,6 +1,6 @@ package org.alliancegenome.curation_api.interfaces.crud; -import org.alliancegenome.curation_api.interfaces.base.BaseCurieCrudInterface; +import org.alliancegenome.curation_api.interfaces.base.CurieObjectCrudInterface; import org.alliancegenome.curation_api.model.entities.Molecule; import org.alliancegenome.curation_api.model.ingest.dto.fms.MoleculeIngestFmsDTO; import org.alliancegenome.curation_api.response.APIResponse; @@ -19,7 +19,7 @@ @Tag(name = "CRUD - Molecules") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface MoleculeCrudInterface extends BaseCurieCrudInterface { +public interface MoleculeCrudInterface extends CurieObjectCrudInterface { @POST @Path("/bulk/moleculefile") diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/OrganizationCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/OrganizationCrudInterface.java index 11c4e48af..57857ad66 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/OrganizationCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/OrganizationCrudInterface.java @@ -1,6 +1,6 @@ package org.alliancegenome.curation_api.interfaces.crud; -import org.alliancegenome.curation_api.interfaces.base.BaseCurieCrudInterface; +import org.alliancegenome.curation_api.interfaces.base.BaseIdCrudInterface; import org.alliancegenome.curation_api.model.entities.Organization; import org.eclipse.microprofile.openapi.annotations.tags.Tag; @@ -13,6 +13,6 @@ @Tag(name = "CRUD - Organization") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface OrganizationCrudInterface extends BaseCurieCrudInterface { +public interface OrganizationCrudInterface extends BaseIdCrudInterface { } diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ReferenceCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ReferenceCrudInterface.java index 92b9e4896..8d9ca630b 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ReferenceCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ReferenceCrudInterface.java @@ -1,6 +1,6 @@ package org.alliancegenome.curation_api.interfaces.crud; -import org.alliancegenome.curation_api.interfaces.base.BaseCurieCrudInterface; +import org.alliancegenome.curation_api.interfaces.base.CurieObjectCrudInterface; import org.alliancegenome.curation_api.model.entities.Reference; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.view.View; @@ -19,14 +19,14 @@ @Tag(name = "CRUD - Reference") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface ReferenceCrudInterface extends BaseCurieCrudInterface { +public interface ReferenceCrudInterface extends CurieObjectCrudInterface { @GET @Path("/sync") public void synchroniseReferences(); @GET - @Path("/sync/{curie}") + @Path("/sync/{id}") @JsonView(View.FieldsAndLists.class) - public ObjectResponse synchroniseReference(@PathParam("curie") String curie); + public ObjectResponse synchroniseReference(@PathParam("curie") Long id); } diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/VariantCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/VariantCrudInterface.java index 313f9e4ad..be30fdb16 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/VariantCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/VariantCrudInterface.java @@ -3,8 +3,8 @@ import java.util.HashMap; import java.util.List; -import org.alliancegenome.curation_api.interfaces.base.BaseCurieCrudInterface; import org.alliancegenome.curation_api.interfaces.base.BaseDTOCrudControllerInterface; +import org.alliancegenome.curation_api.interfaces.base.SubmittedObjectCrudInterface; import org.alliancegenome.curation_api.model.entities.Variant; import org.alliancegenome.curation_api.model.ingest.dto.VariantDTO; import org.alliancegenome.curation_api.response.APIResponse; @@ -31,7 +31,7 @@ @Tag(name = "CRUD - Variants") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface VariantCrudInterface extends BaseCurieCrudInterface, BaseDTOCrudControllerInterface { +public interface VariantCrudInterface extends SubmittedObjectCrudInterface, BaseDTOCrudControllerInterface { @POST @Path("/bulk/{dataProvider}/variants") @@ -41,8 +41,8 @@ public interface VariantCrudInterface extends BaseCurieCrudInterface, B @Override @GET @JsonView(View.VariantView.class) - @Path("/{curie}") - public ObjectResponse get(@PathParam("curie") String curie); + @Path("/{identifierString}") + public ObjectResponse get(@PathParam("identifierString") String identifierString); @Override @PUT diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmExecutor.java index 9eb6f1ff8..f4f90812a 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmExecutor.java @@ -48,18 +48,18 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { BackendBulkDataProvider dataProvider = manual.getDataProvider(); - List agmCuriesLoaded = new ArrayList<>(); - List agmCuriesBefore = affectedGenomicModelService.getCuriesByDataProvider(dataProvider.name()); - Log.debug("runLoad: Before: total " + agmCuriesBefore.size()); + List agmIdsLoaded = new ArrayList<>(); + List agmIdsBefore = affectedGenomicModelService.getIdsByDataProvider(dataProvider.name()); + Log.debug("runLoad: Before: total " + agmIdsBefore.size()); bulkLoadFile.setRecordCount(agms.size() + bulkLoadFile.getRecordCount()); bulkLoadFileDAO.merge(bulkLoadFile); BulkLoadFileHistory history = new BulkLoadFileHistory(agms.size()); - runLoad(history, agms, dataProvider, agmCuriesLoaded); + runLoad(history, agms, dataProvider, agmIdsLoaded); - if(cleanUp) runCleanup(affectedGenomicModelService, history, bulkLoadFile, agmCuriesBefore, agmCuriesLoaded); + if(cleanUp) runCleanup(affectedGenomicModelService, history, bulkLoadFile, agmIdsBefore, agmIdsLoaded); history.finishLoad(); @@ -70,16 +70,16 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { // Gets called from the API directly public APIResponse runLoad(String dataProviderName, List agms) { - List curiesLoaded = new ArrayList<>(); + List idsLoaded = new ArrayList<>(); BulkLoadFileHistory history = new BulkLoadFileHistory(agms.size()); BackendBulkDataProvider dataProvider = BackendBulkDataProvider.valueOf(dataProviderName); - runLoad(history, agms, dataProvider, curiesLoaded); + runLoad(history, agms, dataProvider, idsLoaded); history.finishLoad(); return new LoadHistoryResponce(history); } - public void runLoad(BulkLoadFileHistory history, List agms, BackendBulkDataProvider dataProvider, List curiesAdded) { + public void runLoad(BulkLoadFileHistory history, List agms, BackendBulkDataProvider dataProvider, List idsAdded) { ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); ph.addDisplayHandler(loadProcessDisplayService); @@ -88,8 +88,8 @@ public void runLoad(BulkLoadFileHistory history, List a try { AffectedGenomicModel agm = affectedGenomicModelService.upsert(agmDTO, dataProvider); history.incrementCompleted(); - if(curiesAdded != null) { - curiesAdded.add(agm.getCurie()); + if(idsAdded != null) { + idsAdded.add(agm.getId()); } } catch (ObjectUpdateException e) { history.incrementFailed(); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleExecutor.java index d52e900ae..d177d5b02 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleExecutor.java @@ -43,18 +43,18 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { BackendBulkDataProvider dataProvider = manual.getDataProvider(); - List alleleCuriesLoaded = new ArrayList<>(); - List alleleCuriesBefore = alleleService.getCuriesByDataProvider(dataProvider.name()); - Log.debug("runLoad: Before: total " + alleleCuriesBefore.size()); + List alleleIdsLoaded = new ArrayList<>(); + List alleleIdsBefore = alleleService.getIdsByDataProvider(dataProvider.name()); + Log.debug("runLoad: Before: total " + alleleIdsBefore.size()); bulkLoadFile.setRecordCount(alleles.size() + bulkLoadFile.getRecordCount()); bulkLoadFileDAO.merge(bulkLoadFile); BulkLoadFileHistory history = new BulkLoadFileHistory(alleles.size()); - runLoad(history, alleles, dataProvider, alleleCuriesLoaded); + runLoad(history, alleles, dataProvider, alleleIdsLoaded); - if(cleanUp) runCleanup(alleleService, history, bulkLoadFile, alleleCuriesBefore, alleleCuriesLoaded); + if(cleanUp) runCleanup(alleleService, history, bulkLoadFile, alleleIdsBefore, alleleIdsLoaded); history.finishLoad(); @@ -65,19 +65,19 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { // Gets called from the API directly public APIResponse runLoad(String dataProviderName, List alleles) { - List curiesLoaded = new ArrayList<>(); + List idsLoaded = new ArrayList<>(); BulkLoadFileHistory history = new BulkLoadFileHistory(alleles.size()); BackendBulkDataProvider dataProvider = BackendBulkDataProvider.valueOf(dataProviderName); - runLoad(history, alleles, dataProvider, curiesLoaded); + runLoad(history, alleles, dataProvider, idsLoaded); history.finishLoad(); return new LoadHistoryResponce(history); } - public void runLoad(BulkLoadFileHistory history, List alleles, BackendBulkDataProvider dataProvider, List curiesAdded) { + public void runLoad(BulkLoadFileHistory history, List alleles, BackendBulkDataProvider dataProvider, List idsAdded) { ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); ph.addDisplayHandler(loadProcessDisplayService); @@ -86,8 +86,8 @@ public void runLoad(BulkLoadFileHistory history, List alleles, Backen try { Allele allele = alleleService.upsert(alleleDTO, dataProvider); history.incrementCompleted(); - if (curiesAdded != null) { - curiesAdded.add(allele.getCurie()); + if (idsAdded != null) { + idsAdded.add(allele.getId()); } } catch (ObjectUpdateException e) { history.incrementFailed(); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExecutor.java index 3ea141307..b962db874 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExecutor.java @@ -48,18 +48,18 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { List genes = ingestDto.getGeneIngestSet(); if (genes == null) genes = new ArrayList<>(); - List geneCuriesLoaded = new ArrayList<>(); - List geneCuriesBefore = geneService.getCuriesByDataProvider(dataProvider); - log.debug("runLoad: Before: total " + geneCuriesBefore.size()); + List geneIdsLoaded = new ArrayList<>(); + List geneIdsBefore = geneService.getIdsByDataProvider(dataProvider); + log.debug("runLoad: Before: total " + geneIdsBefore.size()); bulkLoadFile.setRecordCount(genes.size() + bulkLoadFile.getRecordCount()); bulkLoadFileDAO.merge(bulkLoadFile); BulkLoadFileHistory history = new BulkLoadFileHistory(genes.size()); - runLoad(history, genes, dataProvider, geneCuriesLoaded); + runLoad(history, genes, dataProvider, geneIdsLoaded); - if(cleanUp) runCleanup(geneService, history, bulkLoadFile, geneCuriesBefore, geneCuriesLoaded); + if(cleanUp) runCleanup(geneService, history, bulkLoadFile, geneIdsBefore, geneIdsLoaded); history.finishLoad(); @@ -70,18 +70,18 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { // Gets called from the API directly public APIResponse runLoad(String dataProviderName, List genes) { - List curiesLoaded = new ArrayList<>(); + List idsLoaded = new ArrayList<>(); BackendBulkDataProvider dataProvider = BackendBulkDataProvider.valueOf(dataProviderName); BulkLoadFileHistory history = new BulkLoadFileHistory(genes.size()); - runLoad(history, genes, dataProvider, curiesLoaded); + runLoad(history, genes, dataProvider, idsLoaded); history.finishLoad(); return new LoadHistoryResponce(history); } - public void runLoad(BulkLoadFileHistory history, List genes, BackendBulkDataProvider dataProvider, List curiesAdded) { + public void runLoad(BulkLoadFileHistory history, List genes, BackendBulkDataProvider dataProvider, List idsAdded) { ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); ph.addDisplayHandler(loadProcessDisplayService); @@ -90,8 +90,8 @@ public void runLoad(BulkLoadFileHistory history, List genes, BackendBul try { Gene gene = geneService.upsert(geneDTO, dataProvider); history.incrementCompleted(); - if (curiesAdded != null) { - curiesAdded.add(gene.getCurie()); + if (idsAdded != null) { + idsAdded.add(gene.getId()); } } catch (ObjectUpdateException e) { history.incrementFailed(); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java index 42acc1d18..29d65efef 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java @@ -23,7 +23,7 @@ import org.alliancegenome.curation_api.services.APIVersionInfoService; import org.alliancegenome.curation_api.services.DiseaseAnnotationService; import org.alliancegenome.curation_api.services.base.BaseAssociationDTOCrudService; -import org.alliancegenome.curation_api.services.base.BaseDTOCrudService; +import org.alliancegenome.curation_api.services.base.SubmittedObjectCrudService; import org.alliancegenome.curation_api.services.processing.LoadProcessDisplayService; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; import org.apache.commons.collections4.ListUtils; @@ -186,29 +186,29 @@ public void runCleanup(DiseaseAnnotationService service, BulkLoadFileHistory his ph.finishProcess(); } - protected > void runCleanup(S service, BulkLoadFileHistory history, BulkLoadFile bulkLoadFile, List curiesBefore, List curiesAfter) { + protected > void runCleanup(S service, BulkLoadFileHistory history, BulkLoadFile bulkLoadFile, List idsBefore, List idsAfter) { BulkManualLoad manual = (BulkManualLoad) bulkLoadFile.getBulkLoad(); String dataProviderName = manual.getDataProvider().name(); - Log.debug("runLoad: After: " + dataProviderName + " " + curiesAfter.size()); + Log.debug("runLoad: After: " + dataProviderName + " " + idsAfter.size()); - List distinctAfter = curiesAfter.stream().distinct().collect(Collectors.toList()); + List distinctAfter = idsAfter.stream().distinct().collect(Collectors.toList()); Log.debug("runLoad: Distinct: " + dataProviderName + " " + distinctAfter.size()); - List curiesToRemove = ListUtils.subtract(curiesBefore, distinctAfter); - Log.debug("runLoad: Remove: " + dataProviderName + " " + curiesToRemove.size()); + List idsToRemove = ListUtils.subtract(idsBefore, distinctAfter); + Log.debug("runLoad: Remove: " + dataProviderName + " " + idsToRemove.size()); - history.setTotalDeleteRecords((long)curiesToRemove.size()); + history.setTotalDeleteRecords((long)idsToRemove.size()); ProcessDisplayHelper ph = new ProcessDisplayHelper(1000); - ph.startProcess("Deletion/deprecation of primary objects " + dataProviderName, curiesToRemove.size()); - for (String curie : curiesToRemove) { + ph.startProcess("Deletion/deprecation of primary objects " + dataProviderName, idsToRemove.size()); + for (Long id : idsToRemove) { try { String loadDescription = dataProviderName + " " + manual.getBackendBulkLoadType() + " bulk load (" + bulkLoadFile.getMd5Sum() + ")"; - service.removeOrDeprecateNonUpdated(curie, loadDescription); + service.removeOrDeprecateNonUpdated(id, loadDescription); history.incrementDeleted(); } catch (Exception e) { history.incrementDeleteFailed(); - addException(history, new ObjectUpdateExceptionData("{ \"curie\": \"" + curie + "\"}", e.getMessage(), e.getStackTrace())); + addException(history, new ObjectUpdateExceptionData("{ \"id\": \"" + id + "\"}", e.getMessage(), e.getStackTrace())); } ph.progressProcess(); } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/VariantExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/VariantExecutor.java index 7bdbb15c0..6d581d426 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/VariantExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/VariantExecutor.java @@ -43,18 +43,18 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { BackendBulkDataProvider dataProvider = manual.getDataProvider(); - List variantCuriesLoaded = new ArrayList<>(); - List variantCuriesBefore = variantService.getCuriesByDataProvider(dataProvider.name()); - Log.debug("runLoad: Before: total " + variantCuriesBefore.size()); + List variantIdsLoaded = new ArrayList<>(); + List variantIdsBefore = variantService.getIdsByDataProvider(dataProvider.name()); + Log.debug("runLoad: Before: total " + variantIdsBefore.size()); bulkLoadFile.setRecordCount(variants.size() + bulkLoadFile.getRecordCount()); bulkLoadFileDAO.merge(bulkLoadFile); BulkLoadFileHistory history = new BulkLoadFileHistory(variants.size()); - runLoad(history, variants, dataProvider, variantCuriesLoaded); + runLoad(history, variants, dataProvider, variantIdsLoaded); - if(cleanUp) runCleanup(variantService, history, bulkLoadFile, variantCuriesBefore, variantCuriesLoaded); + if(cleanUp) runCleanup(variantService, history, bulkLoadFile, variantIdsBefore, variantIdsLoaded); history.finishLoad(); @@ -65,18 +65,18 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { // Gets called from the API directly public APIResponse runLoad(String dataProviderName, List variants) { - List curiesLoaded = new ArrayList<>(); + List idsLoaded = new ArrayList<>(); BulkLoadFileHistory history = new BulkLoadFileHistory(variants.size()); BackendBulkDataProvider dataProvider = BackendBulkDataProvider.valueOf(dataProviderName); - runLoad(history, variants, dataProvider, curiesLoaded); + runLoad(history, variants, dataProvider, idsLoaded); history.finishLoad(); return new LoadHistoryResponce(history); } - public void runLoad(BulkLoadFileHistory history, List variants, BackendBulkDataProvider dataProvider, List curiesAdded) { + public void runLoad(BulkLoadFileHistory history, List variants, BackendBulkDataProvider dataProvider, List idsAdded) { ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); ph.addDisplayHandler(loadProcessDisplayService); @@ -85,8 +85,8 @@ public void runLoad(BulkLoadFileHistory history, List variants, Back try { Variant variant = variantService.upsert(variantDTO, dataProvider); history.incrementCompleted(); - if (curiesAdded != null) { - curiesAdded.add(variant.getCurie()); + if (idsAdded != null) { + idsAdded.add(variant.getId()); } } catch (ObjectUpdateException e) { history.incrementFailed(); diff --git a/src/main/java/org/alliancegenome/curation_api/model/bridges/BiologicalEntityTypeBridge.java b/src/main/java/org/alliancegenome/curation_api/model/bridges/BiologicalEntityTypeBridge.java index f99fdacc9..8ba03d561 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/bridges/BiologicalEntityTypeBridge.java +++ b/src/main/java/org/alliancegenome/curation_api/model/bridges/BiologicalEntityTypeBridge.java @@ -20,8 +20,7 @@ public class BiologicalEntityTypeBridge implements TypeBinder { @Override public void bind(TypeBindingContext context) { - context.dependencies().use("curie").use("taxon"); - + IndexSchemaElement schemaElement = context.indexSchemaElement(); IndexFieldType type = context.typeFactory().asString().analyzer("autocompleteAnalyzer").searchAnalyzer("autocompleteSearchAnalyzer").toIndexFieldType(); diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java index c3c68ddf0..53480a7d0 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java @@ -36,7 +36,7 @@ public class GenomicEntity extends BiologicalEntity { @IndexedEmbedded(includePaths = {"referencedCurie", "displayName", "referencedCurie_keyword", "displayName_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) - @ManyToMany + @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true) @JoinTable(indexes = { @Index(columnList = "genomicentity_curie, crossreferences_id", name = "genomicentity_crossreference_ge_curie_xref_id_index"), @Index(columnList = "genomicentity_curie", name = "genomicentity_crossreference_genomicentity_curie_index"), diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java index dda7c87c8..a18b4451d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java @@ -4,6 +4,7 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.DataProvider; import org.alliancegenome.curation_api.view.View; +import org.apache.commons.lang3.StringUtils; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; import org.hibernate.envers.Audited; @@ -16,6 +17,7 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; @@ -24,6 +26,7 @@ import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; +import jakarta.persistence.Transient; import jakarta.persistence.UniqueConstraint; import lombok.Data; import lombok.EqualsAndHashCode; @@ -68,4 +71,17 @@ public class SubmittedObject extends CurieObject { @JsonView({ View.FieldsOnly.class }) private DataProvider dataProvider; + + @Transient + @JsonIgnore + public String getIdentifier() { + if (StringUtils.isNotBlank(curie)) + return curie; + if (StringUtils.isNotBlank(modEntityId)) + return modEntityId; + if (StringUtils.isNotBlank(modInternalId)) + return modInternalId; + return null; + } + } diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AGMDiseaseAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AGMDiseaseAnnotationDTO.java index f48bf6ec0..7ee6a3b43 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AGMDiseaseAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AGMDiseaseAnnotationDTO.java @@ -14,27 +14,27 @@ @Setter @Getter -@AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotationDTO.class }, submitted = true) +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotationDTO.class }, submitted = true) public class AGMDiseaseAnnotationDTO extends DiseaseAnnotationDTO { @JsonView({ View.FieldsOnly.class }) - @JsonProperty("agm_curie") - private String agmCurie; + @JsonProperty("agm_identifier") + private String agmIdentifier; @JsonView({ View.FieldsOnly.class }) - @JsonProperty("inferred_gene_curie") - private String inferredGeneCurie; + @JsonProperty("inferred_gene_identifier") + private String inferredGeneIdentifier; @JsonView({ View.FieldsOnly.class }) - @JsonProperty("inferred_allele_curie") - private String inferredAlleleCurie; + @JsonProperty("inferred_allele_identifier") + private String inferredAlleleIdentifier; @JsonView({ View.FieldsAndLists.class }) - @JsonProperty("asserted_gene_curies") - private List assertedGeneCuries; + @JsonProperty("asserted_gene_identifiers") + private List assertedGeneIdentifiers; @JsonView({ View.FieldsOnly.class }) - @JsonProperty("asserted_allele_curie") - private String assertedAlleleCurie; + @JsonProperty("asserted_allele_identifier") + private String assertedAlleleIdentifier; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AlleleDiseaseAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AlleleDiseaseAnnotationDTO.java index a9d2cc409..60d5cccc1 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AlleleDiseaseAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AlleleDiseaseAnnotationDTO.java @@ -14,19 +14,19 @@ @Setter @Getter -@AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotationDTO.class }, submitted = true) +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotationDTO.class }, submitted = true) public class AlleleDiseaseAnnotationDTO extends DiseaseAnnotationDTO { @JsonView({ View.FieldsOnly.class }) - @JsonProperty("allele_curie") - private String alleleCurie; + @JsonProperty("allele_identifier") + private String alleleIdentifier; @JsonView({ View.FieldsOnly.class }) - @JsonProperty("inferred_gene_curie") - private String inferredGeneCurie; + @JsonProperty("inferred_gene_identifier") + private String inferredGeneIdentifier; @JsonView({ View.FieldsAndLists.class }) - @JsonProperty("asserted_gene_curies") - private List assertedGeneCuries; + @JsonProperty("asserted_gene_identifiers") + private List assertedGeneIdentifiers; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/DiseaseAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/DiseaseAnnotationDTO.java index 3452378e7..07212c786 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/DiseaseAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/DiseaseAnnotationDTO.java @@ -14,7 +14,7 @@ @Setter @Getter -@AGRCurationSchemaVersion(min = "1.7.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AnnotationDTO.class }) +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AnnotationDTO.class }) public class DiseaseAnnotationDTO extends AnnotationDTO { @JsonView({ View.FieldsOnly.class }) @@ -41,16 +41,16 @@ public class DiseaseAnnotationDTO extends AnnotationDTO { private List evidenceCodeCuries; @JsonView({ View.FieldsOnly.class }) - @JsonProperty("disease_genetic_modifier_curies") - private List diseaseGeneticModifierCuries; + @JsonProperty("disease_genetic_modifier_identifiers") + private List diseaseGeneticModifierIdentifiers; @JsonView({ View.FieldsOnly.class }) @JsonProperty("disease_genetic_modifier_relation_name") private String diseaseGeneticModifierRelationName; @JsonView({ View.FieldsAndLists.class }) - @JsonProperty("with_gene_curies") - private List withGeneCuries; + @JsonProperty("with_gene_identifiers") + private List withGeneIdentifiers; @JsonView({ View.FieldsOnly.class }) @JsonProperty("annotation_type_name") diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GeneDiseaseAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GeneDiseaseAnnotationDTO.java index 7bfd0862f..df5fe8d3e 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GeneDiseaseAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GeneDiseaseAnnotationDTO.java @@ -12,15 +12,15 @@ @Setter @Getter -@AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotationDTO.class }, submitted = true) +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotationDTO.class }, submitted = true) public class GeneDiseaseAnnotationDTO extends DiseaseAnnotationDTO { @JsonView({ View.FieldsOnly.class }) - @JsonProperty("gene_curie") - private String geneCurie; + @JsonProperty("gene_identifier") + private String geneIdentifier; @JsonView({ View.FieldsOnly.class }) - @JsonProperty("sgd_strain_background_curie") - private String sgdStrainBackgroundCurie; + @JsonProperty("sgd_strain_background_identifier") + private String sgdStrainBackgroundIdentifier; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGeneAssociationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGeneAssociationDTO.java index 44407a3af..d8d0f7f81 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGeneAssociationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGeneAssociationDTO.java @@ -12,11 +12,11 @@ @Setter @Getter -@AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AlleleGenomicEntityAssociationDTO.class }, submitted = true) +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AlleleGenomicEntityAssociationDTO.class }, submitted = true) public class AlleleGeneAssociationDTO extends AlleleGenomicEntityAssociationDTO { @JsonView({ View.FieldsOnly.class }) - @JsonProperty("gene_curie") - private String geneCurie; + @JsonProperty("gene_identifier") + private String geneIdentifier; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGenomicEntityAssociationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGenomicEntityAssociationDTO.java index 7778d2ff9..d7e26a44b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGenomicEntityAssociationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGenomicEntityAssociationDTO.java @@ -18,8 +18,8 @@ public class AlleleGenomicEntityAssociationDTO extends EvidenceAssociationDTO { @JsonView({ View.FieldsOnly.class }) - @JsonProperty("allele_curie") - private String alleleCurie; + @JsonProperty("allele_identifier") + private String alleleIdentifier; @JsonView({ View.FieldsOnly.class }) @JsonProperty("relation_name") diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTO.java index 53f5be866..72df3a0b8 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTO.java @@ -28,8 +28,8 @@ public class ConstructGenomicEntityAssociationDTO extends EvidenceAssociationDTO private String genomicEntityRelationName; @JsonView({ View.FieldsOnly.class }) - @JsonProperty("genomic_entity_curie") - private String genomicEntityCurie; + @JsonProperty("genomic_entity_identifier") + private String genomicEntityIdentifier; @JsonView({ View.FieldsAndLists.class }) @JsonProperty("note_dtos") diff --git a/src/main/java/org/alliancegenome/curation_api/services/AGMDiseaseAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/AGMDiseaseAnnotationService.java index 2de52be66..380b71b25 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/AGMDiseaseAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/AGMDiseaseAnnotationService.java @@ -45,7 +45,6 @@ protected void init() { setSQLDao(agmDiseaseAnnotationDAO); } - @Override public ObjectResponse get(String identifier) { SearchResponse ret = findByField("curie", identifier); if (ret != null && ret.getTotalResults() == 1) @@ -95,17 +94,13 @@ public ObjectResponse delete(Long id) { return ret; } - @Override - public void removeOrDeprecateNonUpdated(String curie, String loadDescription) { } - public List getAnnotationIdsByDataProvider(BackendBulkDataProvider dataProvider) { Map params = new HashMap<>(); params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider.sourceOrganization); if(StringUtils.equals(dataProvider.sourceOrganization, "RGD")) params.put(EntityFieldConstants.SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); - List annotationIdStrings = agmDiseaseAnnotationDAO.findFilteredIds(params); - annotationIdStrings.removeIf(Objects::isNull); - List annotationIds = annotationIdStrings.stream().map(Long::parseLong).collect(Collectors.toList()); + List annotationIds = agmDiseaseAnnotationDAO.findFilteredIds(params); + annotationIds.removeIf(Objects::isNull); return annotationIds; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/AffectedGenomicModelService.java b/src/main/java/org/alliancegenome/curation_api/services/AffectedGenomicModelService.java index 24e8a511e..d5bee41b7 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/AffectedGenomicModelService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/AffectedGenomicModelService.java @@ -17,7 +17,7 @@ import org.alliancegenome.curation_api.model.ingest.dto.AffectedGenomicModelDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.associations.constructAssociations.ConstructGenomicEntityAssociationService; -import org.alliancegenome.curation_api.services.base.BaseDTOCrudService; +import org.alliancegenome.curation_api.services.base.SubmittedObjectCrudService; import org.alliancegenome.curation_api.services.validation.AffectedGenomicModelValidator; import org.alliancegenome.curation_api.services.validation.dto.AffectedGenomicModelDTOValidator; import org.apache.commons.collections.CollectionUtils; @@ -30,7 +30,7 @@ @JBossLog @RequestScoped -public class AffectedGenomicModelService extends BaseDTOCrudService { +public class AffectedGenomicModelService extends SubmittedObjectCrudService { @Inject AffectedGenomicModelDAO agmDAO; @@ -78,10 +78,10 @@ public AffectedGenomicModel upsert(AffectedGenomicModelDTO dto, BackendBulkDataP } @Transactional - public void removeOrDeprecateNonUpdated(String curie, String loadDescription) { - AffectedGenomicModel agm = agmDAO.find(curie); + public void removeOrDeprecateNonUpdated(Long id, String loadDescription) { + AffectedGenomicModel agm = agmDAO.find(id); if (agm != null) { - List referencingDAIds = agmDAO.findReferencingDiseaseAnnotations(curie); + List referencingDAIds = agmDAO.findReferencingDiseaseAnnotations(id); Boolean anyReferencingEntities = false; for (Long daId : referencingDAIds) { DiseaseAnnotation referencingDA = diseaseAnnotationService.deprecateOrDeleteAnnotationAndNotes(daId, false, loadDescription, true); @@ -104,19 +104,19 @@ public void removeOrDeprecateNonUpdated(String curie, String loadDescription) { agmDAO.persist(agm); } } else { - agmDAO.remove(curie); + agmDAO.remove(id); } } else { - log.error("Failed getting AGM: " + curie); + log.error("Failed getting AGM: " + id); } } - public List getCuriesByDataProvider(String dataProvider) { + public List getIdsByDataProvider(String dataProvider) { Map params = new HashMap<>(); params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider); - List curies = agmDAO.findFilteredIds(params); - curies.removeIf(Objects::isNull); - return curies; + List ids = agmDAO.findFilteredIds(params); + ids.removeIf(Objects::isNull); + return ids; } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java index b5b066bdf..30099daf7 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java @@ -4,7 +4,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.stream.Collectors; import org.alliancegenome.curation_api.constants.EntityFieldConstants; import org.alliancegenome.curation_api.dao.AlleleDiseaseAnnotationDAO; @@ -92,17 +91,13 @@ public ObjectResponse delete(Long id) { return ret; } - @Override - public void removeOrDeprecateNonUpdated(String curie, String loadDescription) { } - public List getAnnotationIdsByDataProvider(BackendBulkDataProvider dataProvider) { Map params = new HashMap<>(); params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider.sourceOrganization); if(StringUtils.equals(dataProvider.sourceOrganization, "RGD")) params.put(EntityFieldConstants.SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); - List annotationIdStrings = alleleDiseaseAnnotationDAO.findFilteredIds(params); - annotationIdStrings.removeIf(Objects::isNull); - List annotationIds = annotationIdStrings.stream().map(Long::parseLong).collect(Collectors.toList()); + List annotationIds = alleleDiseaseAnnotationDAO.findFilteredIds(params); + annotationIds.removeIf(Objects::isNull); return annotationIds; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/AlleleService.java b/src/main/java/org/alliancegenome/curation_api/services/AlleleService.java index f5887409e..b872faf51 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/AlleleService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/AlleleService.java @@ -18,7 +18,7 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.associations.alleleAssociations.AlleleGeneAssociationService; import org.alliancegenome.curation_api.services.associations.constructAssociations.ConstructGenomicEntityAssociationService; -import org.alliancegenome.curation_api.services.base.BaseDTOCrudService; +import org.alliancegenome.curation_api.services.base.SubmittedObjectCrudService; import org.alliancegenome.curation_api.services.validation.AlleleValidator; import org.alliancegenome.curation_api.services.validation.dto.AlleleDTOValidator; import org.apache.commons.collections.CollectionUtils; @@ -31,7 +31,7 @@ @JBossLog @RequestScoped -public class AlleleService extends BaseDTOCrudService { +public class AlleleService extends SubmittedObjectCrudService { @Inject AlleleDAO alleleDAO; @Inject AlleleValidator alleleValidator; @@ -67,17 +67,17 @@ public Allele upsert(AlleleDTO dto, BackendBulkDataProvider dataProvider) throws @Override @Transactional - public ObjectResponse delete(String curie) { - removeOrDeprecateNonUpdated(curie, "Allele DELETE API call"); + public ObjectResponse delete(Long id) { + removeOrDeprecateNonUpdated(id, "Allele DELETE API call"); ObjectResponse ret = new ObjectResponse<>(); return ret; } @Transactional - public void removeOrDeprecateNonUpdated(String curie, String loadDescription) { - Allele allele = alleleDAO.find(curie); + public void removeOrDeprecateNonUpdated(Long id, String loadDescription) { + Allele allele = alleleDAO.find(id); if (allele != null) { - List referencingDAIds = alleleDAO.findReferencingDiseaseAnnotationIds(curie); + List referencingDAIds = alleleDAO.findReferencingDiseaseAnnotationIds(id); Boolean anyReferencingEntities = false; for (Long daId : referencingDAIds) { DiseaseAnnotation referencingDA = diseaseAnnotationService.deprecateOrDeleteAnnotationAndNotes(daId, false, loadDescription, true); @@ -106,19 +106,19 @@ public void removeOrDeprecateNonUpdated(String curie, String loadDescription) { alleleDAO.persist(allele); } } else { - alleleDAO.remove(curie); + alleleDAO.remove(id); } } else { - log.error("Failed getting allele: " + curie); + log.error("Failed getting allele: " + id); } } - public List getCuriesByDataProvider(String dataProvider) { + public List getIdsByDataProvider(String dataProvider) { Map params = new HashMap<>(); params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider); - List curies = alleleDAO.findFilteredIds(params); - curies.removeIf(Objects::isNull); - return curies; + List ids = alleleDAO.findFilteredIds(params); + ids.removeIf(Objects::isNull); + return ids; } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/BiologicalEntityService.java b/src/main/java/org/alliancegenome/curation_api/services/BiologicalEntityService.java index 192a42917..d2d34c17d 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/BiologicalEntityService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/BiologicalEntityService.java @@ -2,14 +2,14 @@ import org.alliancegenome.curation_api.dao.BiologicalEntityDAO; import org.alliancegenome.curation_api.model.entities.BiologicalEntity; -import org.alliancegenome.curation_api.services.base.BaseEntityCrudService; +import org.alliancegenome.curation_api.services.base.CurieObjectCrudService; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @RequestScoped -public class BiologicalEntityService extends BaseEntityCrudService { +public class BiologicalEntityService extends CurieObjectCrudService { @Inject BiologicalEntityDAO biologicalEntityDAO; diff --git a/src/main/java/org/alliancegenome/curation_api/services/ConditionRelationService.java b/src/main/java/org/alliancegenome/curation_api/services/ConditionRelationService.java index 8c53f0e95..40f220cc1 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ConditionRelationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ConditionRelationService.java @@ -121,11 +121,11 @@ public SearchResponse getConditionRelationSearchResponse(Hash public void deleteUnusedConditions(List inUseCrIds) { ProcessDisplayHelper pdh = new ProcessDisplayHelper(); - List crIds = conditionRelationDAO.findAllIds().getResults(); + List crIds = conditionRelationDAO.findAllIds().getResults(); pdh.startProcess("Delete unused Conditions", crIds.size()); - crIds.forEach(idString -> { - if (!inUseCrIds.contains(Long.parseLong(idString))) { - ConditionRelation cr = conditionRelationDAO.find(Long.parseLong(idString)); + crIds.forEach(crId -> { + if (!inUseCrIds.contains(crId)) { + ConditionRelation cr = conditionRelationDAO.find(crId); cr.setConditions(null); conditionRelationDAO.remove(cr.getId()); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/ConstructService.java b/src/main/java/org/alliancegenome/curation_api/services/ConstructService.java index 01ed5d81f..491ab034f 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ConstructService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ConstructService.java @@ -5,7 +5,6 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.stream.Collectors; import org.alliancegenome.curation_api.constants.EntityFieldConstants; import org.alliancegenome.curation_api.dao.ConstructDAO; @@ -14,13 +13,12 @@ import org.alliancegenome.curation_api.exceptions.ApiErrorException; import org.alliancegenome.curation_api.exceptions.ObjectUpdateException; import org.alliancegenome.curation_api.model.entities.Construct; -import org.alliancegenome.curation_api.model.entities.Note; import org.alliancegenome.curation_api.model.entities.associations.constructAssociations.ConstructGenomicEntityAssociation; import org.alliancegenome.curation_api.model.ingest.dto.ConstructDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.associations.constructAssociations.ConstructGenomicEntityAssociationService; -import org.alliancegenome.curation_api.services.base.BaseDTOCrudService; +import org.alliancegenome.curation_api.services.base.SubmittedObjectCrudService; import org.alliancegenome.curation_api.services.validation.ConstructValidator; import org.alliancegenome.curation_api.services.validation.dto.ConstructDTOValidator; import org.apache.commons.collections.CollectionUtils; @@ -33,7 +31,7 @@ @JBossLog @RequestScoped -public class ConstructService extends BaseDTOCrudService { +public class ConstructService extends SubmittedObjectCrudService { @Inject ConstructDAO constructDAO; @@ -151,14 +149,13 @@ public Construct removeOrDeprecateNonUpdated(Long id, Boolean throwApiError, Str } @Override - public void removeOrDeprecateNonUpdated(String curie, String loadDescription) { } + public void removeOrDeprecateNonUpdated(Long id, String loadDescription) { } public List getConstructIdsByDataProvider(BackendBulkDataProvider dataProvider) { Map params = new HashMap<>(); params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider.sourceOrganization); - List constructIdStrings = constructDAO.findFilteredIds(params); - constructIdStrings.removeIf(Objects::isNull); - List constructIds = constructIdStrings.stream().map(Long::parseLong).collect(Collectors.toList()); + List constructIds = constructDAO.findFilteredIds(params); + constructIds.removeIf(Objects::isNull); return constructIds; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java index 86053b2bf..c6ee68585 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java @@ -113,12 +113,12 @@ public void updateUniqueIds() { public List getAllReferencedConditionRelationIds() { ProcessDisplayHelper pdh = new ProcessDisplayHelper(); - List daIds = diseaseAnnotationDAO.findAllIds().getResults(); + List daIds = diseaseAnnotationDAO.findAllIds().getResults(); pdh.startProcess("Checking DAs for referenced Conditions ", daIds.size()); List conditionRelationIds = new ArrayList<>(); - daIds.forEach(idString -> { - DiseaseAnnotation annotation = diseaseAnnotationDAO.find(Long.parseLong(idString)); + daIds.forEach(daId -> { + DiseaseAnnotation annotation = diseaseAnnotationDAO.find(daId); if (CollectionUtils.isNotEmpty(annotation.getConditionRelations())) { List crIds = annotation.getConditionRelations().stream().map(ConditionRelation::getId).collect(Collectors.toList()); conditionRelationIds.addAll(crIds); diff --git a/src/main/java/org/alliancegenome/curation_api/services/ExperimentalConditionService.java b/src/main/java/org/alliancegenome/curation_api/services/ExperimentalConditionService.java index 635b6bfb4..60f5eb407 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ExperimentalConditionService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ExperimentalConditionService.java @@ -46,13 +46,13 @@ public ObjectResponse create(ExperimentalCondition uiEnti public void deleteUnusedExperiments() { ProcessDisplayHelper pdh = new ProcessDisplayHelper(); - List experimentIds = experimentalConditionDAO.findAllIds().getResults(); + List experimentIds = experimentalConditionDAO.findAllIds().getResults(); pdh.startProcess("Delete unused Experiments", experimentIds.size()); - experimentIds.forEach(idString -> { + experimentIds.forEach(ecId -> { try { - experimentalConditionDAO.remove(Long.parseLong(idString)); + experimentalConditionDAO.remove(ecId); } catch (ApiErrorException ex) { - Log.debug("Skipping deletion of experiment " + idString + " as still in use"); + Log.debug("Skipping deletion of experiment " + ecId + " as still in use"); } pdh.progressProcess(); }); diff --git a/src/main/java/org/alliancegenome/curation_api/services/GeneDiseaseAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/GeneDiseaseAnnotationService.java index 0d8d18c41..12ee620a2 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/GeneDiseaseAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/GeneDiseaseAnnotationService.java @@ -92,18 +92,14 @@ public ObjectResponse delete(Long id) { return ret; } - @Override - public void removeOrDeprecateNonUpdated(String curie, String loadDescription) { } - public List getAnnotationIdsByDataProvider(BackendBulkDataProvider dataProvider) { Map params = new HashMap<>(); params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider.sourceOrganization); if(StringUtils.equals(dataProvider.sourceOrganization, "RGD")) params.put(EntityFieldConstants.SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); - List annotationIdStrings = geneDiseaseAnnotationDAO.findFilteredIds(params); - annotationIdStrings.removeIf(Objects::isNull); - List annotationIds = annotationIdStrings.stream().map(Long::parseLong).collect(Collectors.toList()); - + List annotationIds = geneDiseaseAnnotationDAO.findFilteredIds(params); + annotationIds.removeIf(Objects::isNull); + return annotationIds; } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/GeneService.java b/src/main/java/org/alliancegenome/curation_api/services/GeneService.java index fccab745c..f75d11f06 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/GeneService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/GeneService.java @@ -19,7 +19,7 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.associations.alleleAssociations.AlleleGeneAssociationService; import org.alliancegenome.curation_api.services.associations.constructAssociations.ConstructGenomicEntityAssociationService; -import org.alliancegenome.curation_api.services.base.BaseDTOCrudService; +import org.alliancegenome.curation_api.services.base.SubmittedObjectCrudService; import org.alliancegenome.curation_api.services.orthology.GeneToGeneOrthologyService; import org.alliancegenome.curation_api.services.validation.GeneValidator; import org.alliancegenome.curation_api.services.validation.dto.GeneDTOValidator; @@ -34,7 +34,7 @@ @JBossLog @RequestScoped -public class GeneService extends BaseDTOCrudService { +public class GeneService extends SubmittedObjectCrudService { @Inject GeneDAO geneDAO; @@ -79,24 +79,24 @@ public Gene upsert(GeneDTO dto, BackendBulkDataProvider dataProvider) throws Obj @Override @Transactional - public ObjectResponse delete(String curie) { - removeOrDeprecateNonUpdated(curie, "Gene DELETE API call"); + public ObjectResponse delete(Long id) { + removeOrDeprecateNonUpdated(id, "Gene DELETE API call"); ObjectResponse ret = new ObjectResponse<>(); return ret; } @Transactional - public void removeOrDeprecateNonUpdated(String curie, String loadDescription) { - Gene gene = geneDAO.find(curie); + public void removeOrDeprecateNonUpdated(Long id, String loadDescription) { + Gene gene = geneDAO.find(id); if (gene != null) { - List referencingDAIds = geneDAO.findReferencingDiseaseAnnotations(curie); + List referencingDAIds = geneDAO.findReferencingDiseaseAnnotations(id); Boolean anyReferencingEntities = false; for (Long daId : referencingDAIds) { DiseaseAnnotation referencingDA = diseaseAnnotationService.deprecateOrDeleteAnnotationAndNotes(daId, false, loadDescription, true); if (referencingDA != null) anyReferencingEntities = true; } - List referencingOrthologyPairs = geneDAO.findReferencingOrthologyPairs(curie); + List referencingOrthologyPairs = geneDAO.findReferencingOrthologyPairs(id); for (Long orthId : referencingOrthologyPairs) { GeneToGeneOrthology referencingOrthoPair = orthologyService.deprecateOrthologyPair(orthId, loadDescription); if (referencingOrthoPair != null) @@ -123,22 +123,22 @@ public void removeOrDeprecateNonUpdated(String curie, String loadDescription) { gene.setObsolete(true); geneDAO.persist(gene); } else { - geneDAO.remove(curie); + geneDAO.remove(id); } } else { - log.error("Failed getting gene: " + curie); + log.error("Failed getting gene: " + id); } } - public List getCuriesByDataProvider(BackendBulkDataProvider dataProvider) { + public List getIdsByDataProvider(BackendBulkDataProvider dataProvider) { Map params = new HashMap<>(); params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider.sourceOrganization); if(StringUtils.equals(dataProvider.sourceOrganization, "RGD")) params.put(EntityFieldConstants.TAXON, dataProvider.canonicalTaxonCurie); - List curies = geneDAO.findFilteredIds(params); - curies.removeIf(Objects::isNull); + List ids = geneDAO.findFilteredIds(params); + ids.removeIf(Objects::isNull); - return curies; + return ids; } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/InformationContentEntityService.java b/src/main/java/org/alliancegenome/curation_api/services/InformationContentEntityService.java index 32ee53e98..9aab842b7 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/InformationContentEntityService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/InformationContentEntityService.java @@ -2,14 +2,14 @@ import org.alliancegenome.curation_api.dao.InformationContentEntityDAO; import org.alliancegenome.curation_api.model.entities.InformationContentEntity; -import org.alliancegenome.curation_api.services.base.BaseEntityCrudService; +import org.alliancegenome.curation_api.services.base.CurieObjectCrudService; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @RequestScoped -public class InformationContentEntityService extends BaseEntityCrudService { +public class InformationContentEntityService extends CurieObjectCrudService { @Inject InformationContentEntityDAO informationContentEntityDAO; @@ -23,7 +23,7 @@ protected void init() { } public InformationContentEntity retrieveFromDbOrLiteratureService(String curieOrXref) { - InformationContentEntity ice = informationContentEntityDAO.find(curieOrXref); + InformationContentEntity ice = informationContentEntityDAO.findByCurie(curieOrXref); if (ice == null) ice = referenceService.retrieveFromDbOrLiteratureService(curieOrXref); diff --git a/src/main/java/org/alliancegenome/curation_api/services/MoleculeService.java b/src/main/java/org/alliancegenome/curation_api/services/MoleculeService.java index a11524767..a90448729 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/MoleculeService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/MoleculeService.java @@ -16,7 +16,7 @@ import org.alliancegenome.curation_api.model.ingest.dto.fms.MoleculeFmsDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; -import org.alliancegenome.curation_api.services.base.BaseEntityCrudService; +import org.alliancegenome.curation_api.services.base.CurieObjectCrudService; import org.alliancegenome.curation_api.services.validation.MoleculeValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -29,7 +29,7 @@ @JBossLog @RequestScoped -public class MoleculeService extends BaseEntityCrudService { +public class MoleculeService extends CurieObjectCrudService { @Inject MoleculeDAO moleculeDAO; @@ -51,18 +51,25 @@ protected void init() { } @Transactional - public Molecule getByIdOrCurie(String id) { - Molecule molecule = moleculeDAO.getByIdOrCurie(id); + public Molecule getByCurie(String id) { + Molecule molecule = moleculeDAO.findByCurie(id); if (molecule != null) { molecule.getSynonyms().size(); } return molecule; } + + @Override + @Transactional + public ObjectResponse create(Molecule uiEntity) { + Molecule dbEntity = moleculeValidator.validateMoleculeCreate(uiEntity); + return new ObjectResponse(dbEntity); + } @Override @Transactional public ObjectResponse update(Molecule uiEntity) { - Molecule dbEntity = moleculeValidator.validateMolecule(uiEntity); + Molecule dbEntity = moleculeValidator.validateMoleculeUpdate(uiEntity); return new ObjectResponse<>(moleculeDAO.persist(dbEntity)); } @@ -95,7 +102,7 @@ public void processUpdate(MoleculeFmsDTO dto) throws ObjectUpdateException { } try { - Molecule molecule = moleculeDAO.find(dto.getId()); + Molecule molecule = moleculeDAO.findByCurie(dto.getId()); if (molecule == null) { molecule = new Molecule(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/OrganizationService.java b/src/main/java/org/alliancegenome/curation_api/services/OrganizationService.java index 73a5b86af..5bae94149 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/OrganizationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/OrganizationService.java @@ -38,11 +38,11 @@ public ObjectResponse get(String orgId) { org = orgCacheMap.get(orgId); } else { Log.debug("Org not cached, caching org: (" + orgId + ")"); - org = organizationDAO.find(orgId); + org = organizationDAO.find(Long.parseLong(orgId)); orgCacheMap.put(orgId, org); } } else { - org = organizationDAO.find(orgId); + org = organizationDAO.find(Long.parseLong(orgId)); orgRequest = new Date(); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/ReferenceService.java b/src/main/java/org/alliancegenome/curation_api/services/ReferenceService.java index 4b4e84d5e..489acc2f3 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ReferenceService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ReferenceService.java @@ -7,7 +7,7 @@ import org.alliancegenome.curation_api.model.entities.Reference; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; -import org.alliancegenome.curation_api.services.base.BaseEntityCrudService; +import org.alliancegenome.curation_api.services.base.CurieObjectCrudService; import org.alliancegenome.curation_api.services.helpers.references.ReferenceSynchronisationHelper; import jakarta.annotation.PostConstruct; @@ -15,7 +15,7 @@ import jakarta.inject.Inject; @RequestScoped -public class ReferenceService extends BaseEntityCrudService { +public class ReferenceService extends CurieObjectCrudService { @Inject ReferenceDAO referenceDAO; @@ -28,8 +28,8 @@ protected void init() { setSQLDao(referenceDAO); } - public ObjectResponse synchroniseReference(String curie) { - return refSyncHelper.synchroniseReference(curie); + public ObjectResponse synchroniseReference(Long id) { + return refSyncHelper.synchroniseReference(id); } public void synchroniseReferences() { @@ -40,7 +40,7 @@ public Reference retrieveFromDbOrLiteratureService(String curieOrXref) { Reference reference = null; if (curieOrXref.startsWith("AGRKB:")) { - reference = referenceDAO.find(curieOrXref); + reference = referenceDAO.findByIdentifierString(curieOrXref); } else { SearchResponse response = referenceDAO.findByField("crossReferences.referencedCurie", curieOrXref); List nonObsoleteRefs = new ArrayList<>(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/VariantService.java b/src/main/java/org/alliancegenome/curation_api/services/VariantService.java index 810a84053..f8783e39a 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/VariantService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/VariantService.java @@ -1,5 +1,6 @@ package org.alliancegenome.curation_api.services; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -9,14 +10,13 @@ import org.alliancegenome.curation_api.dao.VariantDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectUpdateException; -import org.alliancegenome.curation_api.model.entities.Note; +import org.alliancegenome.curation_api.model.entities.DiseaseAnnotation; import org.alliancegenome.curation_api.model.entities.Variant; import org.alliancegenome.curation_api.model.ingest.dto.VariantDTO; import org.alliancegenome.curation_api.response.ObjectResponse; -import org.alliancegenome.curation_api.services.base.BaseDTOCrudService; +import org.alliancegenome.curation_api.services.base.SubmittedObjectCrudService; import org.alliancegenome.curation_api.services.validation.VariantValidator; import org.alliancegenome.curation_api.services.validation.dto.VariantDTOValidator; -import org.apache.commons.collections.CollectionUtils; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.RequestScoped; @@ -26,12 +26,14 @@ @JBossLog @RequestScoped -public class VariantService extends BaseDTOCrudService { +public class VariantService extends SubmittedObjectCrudService { @Inject VariantDAO variantDAO; @Inject NoteService noteService; @Inject VariantValidator variantValidator; @Inject VariantDTOValidator variantDtoValidator; + @Inject DiseaseAnnotationService diseaseAnnotationService; + @Inject PersonService personService; @Override @PostConstruct @@ -58,24 +60,37 @@ public Variant upsert(VariantDTO dto, BackendBulkDataProvider dataProvider) thro } @Transactional - public void removeOrDeprecateNonUpdated(String curie, String loadDescription) { - Variant variant = variantDAO.find(curie); + public void removeOrDeprecateNonUpdated(Long id, String loadDescription) { + Variant variant = variantDAO.find(id); if (variant != null) { - List notesToDelete = variant.getRelatedNotes(); - variantDAO.remove(curie); - if (CollectionUtils.isNotEmpty(notesToDelete)) - notesToDelete.forEach(note -> noteService.delete(note.getId())); + List referencingDAIds = variantDAO.findReferencingDiseaseAnnotationIds(id); + Boolean anyReferencingEntities = false; + for (Long daId : referencingDAIds) { + DiseaseAnnotation referencingDA = diseaseAnnotationService.deprecateOrDeleteAnnotationAndNotes(daId, false, loadDescription, true); + if (referencingDA != null) + anyReferencingEntities = true; + } + if (anyReferencingEntities) { + if (!variant.getObsolete()) { + variant.setUpdatedBy(personService.fetchByUniqueIdOrCreate(loadDescription)); + variant.setDateUpdated(OffsetDateTime.now()); + variant.setObsolete(true); + variantDAO.persist(variant); + } + } else { + variantDAO.remove(id); + } } else { - log.error("Failed getting variant: " + curie); + log.error("Failed getting variant: " + id); } } - public List getCuriesByDataProvider(String dataProvider) { + public List getIdsByDataProvider(String dataProvider) { Map params = new HashMap<>(); params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider); - List curies = variantDAO.findFilteredIds(params); - curies.removeIf(Objects::isNull); - return curies; + List ids = variantDAO.findFilteredIds(params); + ids.removeIf(Objects::isNull); + return ids; } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java b/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java index 44fbb63c6..6a94dc6ca 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java @@ -91,9 +91,8 @@ public AlleleGeneAssociation upsert(AlleleGeneAssociationDTO dto, BackendBulkDat public List getAssociationsByDataProvider(BackendBulkDataProvider dataProvider) { Map params = new HashMap<>(); params.put(EntityFieldConstants.SUBJECT_DATA_PROVIDER, dataProvider.sourceOrganization); - List associationIdStrings = alleleGeneAssociationDAO.findFilteredIds(params); - associationIdStrings.removeIf(Objects::isNull); - List associationIds = associationIdStrings.stream().map(Long::parseLong).collect(Collectors.toList()); + List associationIds = alleleGeneAssociationDAO.findFilteredIds(params); + associationIds.removeIf(Objects::isNull); return associationIds; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java b/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java index ecc6de290..92ae81d85 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java @@ -88,9 +88,8 @@ public ConstructGenomicEntityAssociation upsert(ConstructGenomicEntityAssociatio public List getAssociationsByDataProvider(BackendBulkDataProvider dataProvider) { Map params = new HashMap<>(); params.put(EntityFieldConstants.SUBJECT_DATA_PROVIDER, dataProvider.sourceOrganization); - List associationIdStrings = constructGenomicEntityAssociationDAO.findFilteredIds(params); - associationIdStrings.removeIf(Objects::isNull); - List associationIds = associationIdStrings.stream().map(Long::parseLong).collect(Collectors.toList()); + List associationIds = constructGenomicEntityAssociationDAO.findFilteredIds(params); + associationIds.removeIf(Objects::isNull); return associationIds; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/base/BaseDTOCrudService.java b/src/main/java/org/alliancegenome/curation_api/services/base/BaseDTOCrudService.java index 4d67eafaf..e97302fb9 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/base/BaseDTOCrudService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/base/BaseDTOCrudService.java @@ -12,6 +12,4 @@ public abstract class BaseDTOCrudService get(Long id) { } public ObjectResponse get(String id) { - E object = dao.find(id); + E object = dao.findByIdentifierString(id); ObjectResponse ret = new ObjectResponse(object); return ret; } @@ -66,14 +66,6 @@ public ObjectResponse update(E entity) { return ret; } - @Transactional - public ObjectResponse delete(String id) { - // log.info("Authed Person: " + authenticatedPerson); - E object = dao.remove(id); - ObjectResponse ret = new ObjectResponse<>(object); - return ret; - } - @Transactional public ObjectResponse delete(Long id) { E object = dao.remove(id); diff --git a/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java b/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java index d78fc63ab..44d61bf9d 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java @@ -22,7 +22,7 @@ import jakarta.inject.Inject; import jakarta.transaction.Transactional; -public abstract class BaseOntologyTermService> extends BaseEntityCrudService> { +public abstract class BaseOntologyTermService> extends CurieObjectCrudService> { @Inject CrossReferenceDAO crossReferenceDAO; @@ -37,7 +37,7 @@ public abstract class BaseOntologyTermService incomingParents = new HashSet<>(); HashSet parentAdds = new HashSet<>(); @@ -225,7 +225,7 @@ public ObjectListResponse getRootNodes() { } public ObjectListResponse getChildren(String curie) { - E term = dao.find(curie); + E term = dao.findByIdentifierString(curie); if (term != null) { return (ObjectListResponse) new ObjectListResponse(term.getIsaChildren()); } else { @@ -234,7 +234,7 @@ public ObjectListResponse getChildren(String curie) { } public ObjectListResponse getDescendants(String curie) { - E term = dao.find(curie); + E term = dao.findByIdentifierString(curie); if (term != null) { return (ObjectListResponse) new ObjectListResponse(term.getIsaDescendants()); } else { @@ -243,7 +243,7 @@ public ObjectListResponse getDescendants(String curie) { } public ObjectListResponse getParents(String curie) { - E term = dao.find(curie); + E term = dao.findByIdentifierString(curie); if (term != null) { return (ObjectListResponse) new ObjectListResponse(term.getIsaParents()); } else { @@ -252,7 +252,7 @@ public ObjectListResponse getParents(String curie) { } public ObjectListResponse getAncestors(String curie) { - E term = dao.find(curie); + E term = dao.findByIdentifierString(curie); if (term != null) { return (ObjectListResponse) new ObjectListResponse(term.getIsaAncestors()); } else { diff --git a/src/main/java/org/alliancegenome/curation_api/services/base/CurieObjectCrudService.java b/src/main/java/org/alliancegenome/curation_api/services/base/CurieObjectCrudService.java new file mode 100644 index 000000000..db7f3ae5e --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/services/base/CurieObjectCrudService.java @@ -0,0 +1,26 @@ +package org.alliancegenome.curation_api.services.base; + +import org.alliancegenome.curation_api.dao.base.BaseEntityDAO; +import org.alliancegenome.curation_api.model.entities.base.CurieObject; +import org.alliancegenome.curation_api.response.ObjectResponse; + +import jakarta.transaction.Transactional; + +public abstract class CurieObjectCrudService> extends BaseEntityCrudService { + + public ObjectResponse get(String curie) { + E object = dao.findByCurie(curie); + ObjectResponse ret = new ObjectResponse(object); + return ret; + } + + @Transactional + public ObjectResponse delete(String curie) { + E object = dao.findByCurie(curie); + if (object != null) + dao.remove(object.getId()); + ObjectResponse ret = new ObjectResponse<>(object); + return ret; + } + +} diff --git a/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java b/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java new file mode 100644 index 000000000..a6cdc19a0 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java @@ -0,0 +1,35 @@ +package org.alliancegenome.curation_api.services.base; + +import org.alliancegenome.curation_api.dao.base.BaseEntityDAO; +import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; +import org.alliancegenome.curation_api.exceptions.ObjectUpdateException; +import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; +import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; +import org.alliancegenome.curation_api.response.ObjectResponse; + +import jakarta.transaction.Transactional; + +public abstract class SubmittedObjectCrudService> extends CurieObjectCrudService { + + @Override + public ObjectResponse get(String identifierString) { + E object = dao.findByIdentifierString(identifierString); + ObjectResponse ret = new ObjectResponse(object); + return ret; + } + + @Override + @Transactional + public ObjectResponse delete(String identifierString) { + E object = dao.findByIdentifierString(identifierString); + if (object != null) + dao.remove(object.getId()); + ObjectResponse ret = new ObjectResponse<>(object); + return ret; + } + + public abstract E upsert(T dto, BackendBulkDataProvider dataProvider) throws ObjectUpdateException; + + public abstract void removeOrDeprecateNonUpdated(Long id, String loadDescription); + +} diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java index 426c8178c..1b10a91c8 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java @@ -59,7 +59,7 @@ public static String getDiseaseAnnotationUniqueId(DiseaseAnnotationDTO annotatio uniqueId.add(annotationDTO.getDoTermCurie()); uniqueId.add(refCurie); uniqueId.addList(annotationDTO.getEvidenceCodeCuries()); - uniqueId.addList(annotationDTO.getWithGeneCuries()); + uniqueId.addList(annotationDTO.getWithGeneIdentifiers()); if (CollectionUtils.isNotEmpty(annotationDTO.getConditionRelationDtos())) { uniqueId.addList(annotationDTO.getConditionRelationDtos().stream().map(conditionDTO -> { UniqueIdGeneratorHelper gen = new UniqueIdGeneratorHelper(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdUpdateHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdUpdateHelper.java index cd428bddc..c3901265d 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdUpdateHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdUpdateHelper.java @@ -18,10 +18,10 @@ public class DiseaseAnnotationUniqueIdUpdateHelper { public void updateDiseaseAnnotationUniqueIds() { ProcessDisplayHelper pdh = new ProcessDisplayHelper(); - SearchResponse response = diseaseAnnotationDAO.findAllIds(); + SearchResponse response = diseaseAnnotationDAO.findAllIds(); pdh.startProcess("DiseaseAnnotation uniqueId update", response.getTotalResults()); - for (String daId : response.getResults()) { - updateDiseaseAnnotationUniqueId(Long.parseLong(daId)); + for (Long daId : response.getResults()) { + updateDiseaseAnnotationUniqueId(daId); pdh.progressProcess(); } pdh.finishProcess(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/references/ReferenceSynchronisationHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/references/ReferenceSynchronisationHelper.java index 98281d608..63ca2bd68 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/references/ReferenceSynchronisationHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/references/ReferenceSynchronisationHelper.java @@ -36,7 +36,7 @@ public Reference retrieveFromLiteratureService(String curie) { LiteratureReference litRef = fetchLiteratureServiceReference(curie); if (litRef != null) { - Reference ref = referenceDAO.find(litRef.getCurie()); + Reference ref = referenceDAO.findByIdentifierString(curie); if (ref == null) ref = new Reference(); ref = copyLiteratureReferenceFields(litRef, ref); @@ -73,10 +73,10 @@ public void synchroniseReferences() { ProcessDisplayHelper pdh = new ProcessDisplayHelper(); - SearchResponse response = referenceDAO.findAllIds(); + SearchResponse response = referenceDAO.findAllIds(); pdh.startProcess("Reference Sync", response.getTotalResults()); - for (String refCurie : response.getResults()) { - synchroniseReference(refCurie); + for (Long refId : response.getResults()) { + synchroniseReference(refId); pdh.progressProcess(); } pdh.finishProcess(); @@ -121,13 +121,13 @@ protected Reference copyLiteratureReferenceFields(LiteratureReference litRef, Re } @Transactional - public ObjectResponse synchroniseReference(String curie) { - Reference ref = referenceDAO.find(curie); + public ObjectResponse synchroniseReference(Long id) { + Reference ref = referenceDAO.find(id); ObjectResponse response = new ObjectResponse<>(); if (ref == null) return response; - LiteratureReference litRef = fetchLiteratureServiceReference(curie); + LiteratureReference litRef = fetchLiteratureServiceReference(ref.getCurie()); if (litRef == null) { ref.setObsolete(true); } else { diff --git a/src/main/java/org/alliancegenome/curation_api/services/ontology/EcoTermService.java b/src/main/java/org/alliancegenome/curation_api/services/ontology/EcoTermService.java index c50e2749e..c936afcf0 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ontology/EcoTermService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ontology/EcoTermService.java @@ -37,7 +37,7 @@ public void updateAbbreviations() { if (res != null && res.getTotalResults() == 1) { List ecoVocabularyTerms = res.getResults().get(0).getMemberTerms(); ecoVocabularyTerms.forEach((ecoVocabularyTerm) -> { - ECOTerm ecoTerm = ecoTermDAO.find(ecoVocabularyTerm.getName()); + ECOTerm ecoTerm = ecoTermDAO.findByCurie(ecoVocabularyTerm.getName()); if (ecoTerm != null) { ecoTerm.setAbbreviation(ecoVocabularyTerm.getAbbreviation()); List subsets = ecoTerm.getSubsets(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/ontology/NcbiTaxonTermService.java b/src/main/java/org/alliancegenome/curation_api/services/ontology/NcbiTaxonTermService.java index 9b15d5919..63a61f711 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ontology/NcbiTaxonTermService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ontology/NcbiTaxonTermService.java @@ -52,7 +52,7 @@ public ObjectResponse get(String taxonCurie) { private NCBITaxonTerm getTaxonFromDB(String taxonCurie) { - NCBITaxonTerm taxon = ncbiTaxonTermDAO.find(taxonCurie); + NCBITaxonTerm taxon = ncbiTaxonTermDAO.findByCurie(taxonCurie); if (taxon == null) { taxon = ncbiTaxonTermDAO.downloadAndSave(taxonCurie); if (taxon == null) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java index ba886c44c..0e268678d 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java @@ -101,18 +101,18 @@ public AGMDiseaseAnnotation validateAnnotation(AGMDiseaseAnnotation uiEntity, AG } private AffectedGenomicModel validateSubject(AGMDiseaseAnnotation uiEntity, AGMDiseaseAnnotation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getSubject()) || StringUtils.isBlank(uiEntity.getSubject().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getSubject()) || uiEntity.getSubject().getId() == null) { addMessageResponse("subject", ValidationConstants.REQUIRED_MESSAGE); return null; } - AffectedGenomicModel subjectEntity = affectedGenomicModelDAO.find(uiEntity.getSubject().getCurie()); + AffectedGenomicModel subjectEntity = affectedGenomicModelDAO.find(uiEntity.getSubject().getId()); if (subjectEntity == null) { addMessageResponse("subject", ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubject() == null || !subjectEntity.getCurie().equals(dbEntity.getSubject().getCurie()))) { + if (subjectEntity.getObsolete() && (dbEntity.getSubject() == null || !subjectEntity.getId().equals(dbEntity.getSubject().getId()))) { addMessageResponse("subject", ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -125,13 +125,13 @@ private Gene validateInferredGene(AGMDiseaseAnnotation uiEntity, AGMDiseaseAnnot if (uiEntity.getInferredGene() == null) return null; - Gene inferredGene = geneDAO.find(uiEntity.getInferredGene().getCurie()); + Gene inferredGene = geneDAO.find(uiEntity.getInferredGene().getId()); if (inferredGene == null) { addMessageResponse("inferredGene", ValidationConstants.INVALID_MESSAGE); return null; } - if (inferredGene.getObsolete() && (dbEntity.getInferredGene() == null || !inferredGene.getCurie().equals(dbEntity.getInferredGene().getCurie()))) { + if (inferredGene.getObsolete() && (dbEntity.getInferredGene() == null || !inferredGene.getId().equals(dbEntity.getInferredGene().getId()))) { addMessageResponse("inferredGene", ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -144,16 +144,16 @@ private List validateAssertedGenes(AGMDiseaseAnnotation uiEntity, AGMDisea return null; List assertedGenes = new ArrayList(); - List previousCuries = new ArrayList(); + List previousIds = new ArrayList(); if (CollectionUtils.isNotEmpty(dbEntity.getAssertedGenes())) - previousCuries = dbEntity.getAssertedGenes().stream().map(Gene::getCurie).collect(Collectors.toList()); + previousIds = dbEntity.getAssertedGenes().stream().map(Gene::getId).collect(Collectors.toList()); for (Gene gene : uiEntity.getAssertedGenes()) { - Gene assertedGene = geneDAO.find(gene.getCurie()); + Gene assertedGene = geneDAO.find(gene.getId()); if (assertedGene == null) { addMessageResponse("assertedGenes", ValidationConstants.INVALID_MESSAGE); return null; } - if (assertedGene.getObsolete() && !previousCuries.contains(assertedGene.getCurie())) { + if (assertedGene.getObsolete() && !previousIds.contains(assertedGene.getId())) { addMessageResponse("assertedGenes", ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -167,13 +167,13 @@ private Allele validateInferredAllele(AGMDiseaseAnnotation uiEntity, AGMDiseaseA if (uiEntity.getInferredAllele() == null) return null; - Allele inferredAllele = alleleDAO.find(uiEntity.getInferredAllele().getCurie()); + Allele inferredAllele = alleleDAO.find(uiEntity.getInferredAllele().getId()); if (inferredAllele == null) { addMessageResponse("inferredAllele", ValidationConstants.INVALID_MESSAGE); return null; } - if (inferredAllele.getObsolete() && (dbEntity.getInferredAllele() == null || !inferredAllele.getCurie().equals(dbEntity.getInferredAllele().getCurie()))) { + if (inferredAllele.getObsolete() && (dbEntity.getInferredAllele() == null || !inferredAllele.getId().equals(dbEntity.getInferredAllele().getId()))) { addMessageResponse("inferredAllele", ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -185,13 +185,13 @@ private Allele validateAssertedAllele(AGMDiseaseAnnotation uiEntity, AGMDiseaseA if (uiEntity.getAssertedAllele() == null) return null; - Allele assertedAllele = alleleDAO.find(uiEntity.getAssertedAllele().getCurie()); + Allele assertedAllele = alleleDAO.find(uiEntity.getAssertedAllele().getId()); if (assertedAllele == null) { addMessageResponse("assertedAllele", ValidationConstants.INVALID_MESSAGE); return null; } - if (assertedAllele.getObsolete() && (dbEntity.getAssertedAllele() == null || !assertedAllele.getCurie().equals(dbEntity.getAssertedAllele().getCurie()))) { + if (assertedAllele.getObsolete() && (dbEntity.getAssertedAllele() == null || !assertedAllele.getId().equals(dbEntity.getAssertedAllele().getId()))) { addMessageResponse("assertedAllele", ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AffectedGenomicModelValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AffectedGenomicModelValidator.java index 19153ea01..393223cc5 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AffectedGenomicModelValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AffectedGenomicModelValidator.java @@ -1,19 +1,12 @@ package org.alliancegenome.curation_api.services.validation; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.constants.VocabularyConstants; import org.alliancegenome.curation_api.dao.AffectedGenomicModelDAO; import org.alliancegenome.curation_api.dao.CrossReferenceDAO; import org.alliancegenome.curation_api.exceptions.ApiErrorException; import org.alliancegenome.curation_api.model.entities.AffectedGenomicModel; -import org.alliancegenome.curation_api.model.entities.CrossReference; -import org.alliancegenome.curation_api.model.entities.DataProvider; import org.alliancegenome.curation_api.model.entities.VocabularyTerm; -import org.alliancegenome.curation_api.model.entities.ontology.NCBITaxonTerm; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.VocabularyTermService; @@ -21,7 +14,7 @@ import jakarta.inject.Inject; @RequestScoped -public class AffectedGenomicModelValidator extends GenomicEntityValidator { +public class AffectedGenomicModelValidator extends GenomicEntityValidator { @Inject AffectedGenomicModelDAO affectedGenomicModelDAO; @@ -34,16 +27,17 @@ public class AffectedGenomicModelValidator extends GenomicEntityValidator { public AffectedGenomicModel validateAffectedGenomicModelUpdate(AffectedGenomicModel uiEntity) { response = new ObjectResponse<>(uiEntity); - errorMessage = "Could not update AGM: [" + uiEntity.getCurie() + "]"; + errorMessage = "Could not update AGM: [" + uiEntity.getIdentifier() + "]"; - String curie = validateCurie(uiEntity); - if (curie == null) { + Long id = uiEntity.getId(); + if (id == null) { + addMessageResponse("No AGM ID provided"); throw new ApiErrorException(response); } - AffectedGenomicModel dbEntity = affectedGenomicModelDAO.find(curie); + AffectedGenomicModel dbEntity = affectedGenomicModelDAO.find(id); if (dbEntity == null) { - addMessageResponse("curie", ValidationConstants.INVALID_MESSAGE); + addMessageResponse("id", ValidationConstants.INVALID_MESSAGE); throw new ApiErrorException(response); } @@ -54,11 +48,9 @@ public AffectedGenomicModel validateAffectedGenomicModelUpdate(AffectedGenomicMo public AffectedGenomicModel validateAffectedGenomicModelCreate(AffectedGenomicModel uiEntity) { response = new ObjectResponse<>(uiEntity); - errorMessage = "Could not create AGM [" + uiEntity.getCurie() + "]"; + errorMessage = "Could not create AGM"; AffectedGenomicModel dbEntity = new AffectedGenomicModel(); - String curie = validateCurie(uiEntity); - dbEntity.setCurie(curie); dbEntity = (AffectedGenomicModel) validateAuditedObjectFields(uiEntity, dbEntity, true); @@ -67,35 +59,14 @@ public AffectedGenomicModel validateAffectedGenomicModelCreate(AffectedGenomicMo private AffectedGenomicModel validateAffectedGenomicModel(AffectedGenomicModel uiEntity, AffectedGenomicModel dbEntity) { + dbEntity = (AffectedGenomicModel) validateGenomicEntityFields(uiEntity, dbEntity); + String name = handleStringField(uiEntity.getName()); dbEntity.setName(name); - NCBITaxonTerm taxon = validateTaxon(uiEntity, dbEntity); - dbEntity.setTaxon(taxon); - - DataProvider dataProvider = validateDataProvider(uiEntity, dbEntity); - dbEntity.setDataProvider(dataProvider); - VocabularyTerm subtype = validateSubtype(uiEntity, dbEntity); dbEntity.setSubtype(subtype); - List currentXrefIds; - if (dbEntity.getCrossReferences() == null) { - currentXrefIds = new ArrayList<>(); - } else { - currentXrefIds = dbEntity.getCrossReferences().stream().map(CrossReference::getId).collect(Collectors.toList()); - } - - List crossReferences = validateCrossReferences(uiEntity, dbEntity); - dbEntity.setCrossReferences(crossReferences); - List mergedIds = crossReferences == null ? new ArrayList<>() : - crossReferences.stream().map(CrossReference::getId).collect(Collectors.toList()); - for (Long currentXrefId : currentXrefIds) { - if (!mergedIds.contains(currentXrefId)) { - crossReferenceDAO.remove(currentXrefId); - } - } - if (response.hasErrors()) { response.setErrorMessage(errorMessage); throw new ApiErrorException(response); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java index 150fa82ec..1500236c4 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java @@ -90,18 +90,18 @@ public AlleleDiseaseAnnotation validateAnnotation(AlleleDiseaseAnnotation uiEnti } private Allele validateSubject(AlleleDiseaseAnnotation uiEntity, AlleleDiseaseAnnotation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getSubject()) || StringUtils.isBlank(uiEntity.getSubject().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getSubject()) || uiEntity.getSubject().getId() == null) { addMessageResponse("subject", ValidationConstants.REQUIRED_MESSAGE); return null; } - Allele subjectEntity = alleleDAO.find(uiEntity.getSubject().getCurie()); + Allele subjectEntity = alleleDAO.find(uiEntity.getSubject().getId()); if (subjectEntity == null) { addMessageResponse("subject", ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubject() == null || !subjectEntity.getCurie().equals(dbEntity.getSubject().getCurie()))) { + if (subjectEntity.getObsolete() && (dbEntity.getSubject() == null || !subjectEntity.getId().equals(dbEntity.getSubject().getId()))) { addMessageResponse("subject", ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -113,13 +113,13 @@ private Gene validateInferredGene(AlleleDiseaseAnnotation uiEntity, AlleleDiseas if (uiEntity.getInferredGene() == null) return null; - Gene inferredGene = geneDAO.find(uiEntity.getInferredGene().getCurie()); + Gene inferredGene = geneDAO.find(uiEntity.getInferredGene().getId()); if (inferredGene == null) { addMessageResponse("inferredGene", ValidationConstants.INVALID_MESSAGE); return null; } - if (inferredGene.getObsolete() && (dbEntity.getInferredGene() == null || !inferredGene.getCurie().equals(dbEntity.getInferredGene().getCurie()))) { + if (inferredGene.getObsolete() && (dbEntity.getInferredGene() == null || !inferredGene.getId().equals(dbEntity.getInferredGene().getId()))) { addMessageResponse("inferredGene", ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -132,16 +132,16 @@ private List validateAssertedGenes(AlleleDiseaseAnnotation uiEntity, Allel return null; List assertedGenes = new ArrayList(); - List previousCuries = new ArrayList(); + List previousIds = new ArrayList(); if (CollectionUtils.isNotEmpty(dbEntity.getAssertedGenes())) - previousCuries = dbEntity.getAssertedGenes().stream().map(Gene::getCurie).collect(Collectors.toList()); + previousIds = dbEntity.getAssertedGenes().stream().map(Gene::getId).collect(Collectors.toList()); for (Gene gene : uiEntity.getAssertedGenes()) { - Gene assertedGene = geneDAO.find(gene.getCurie()); + Gene assertedGene = geneDAO.find(gene.getId()); if (assertedGene == null) { addMessageResponse("assertedGenes", ValidationConstants.INVALID_MESSAGE); return null; } - if (assertedGene.getObsolete() && !previousCuries.contains(assertedGene.getCurie())) { + if (assertedGene.getObsolete() && !previousIds.contains(assertedGene.getId())) { addMessageResponse("assertedGenes", ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java index f4523cb1d..ede083352 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java @@ -49,7 +49,7 @@ import jakarta.inject.Inject; @RequestScoped -public class AlleleValidator extends GenomicEntityValidator { +public class AlleleValidator extends GenomicEntityValidator { @Inject AlleleDAO alleleDAO; @@ -86,16 +86,17 @@ public class AlleleValidator extends GenomicEntityValidator { public Allele validateAlleleUpdate(Allele uiEntity) { response = new ObjectResponse<>(uiEntity); - errorMessage = "Could not update Allele: [" + uiEntity.getCurie() + "]"; + errorMessage = "Could not update Allele: [" + uiEntity.getIdentifier() + "]"; - String curie = validateCurie(uiEntity); - if (curie == null) { + Long id = uiEntity.getId(); + if (id == null) { + addMessageResponse("No Allele ID provided"); throw new ApiErrorException(response); } - Allele dbEntity = alleleDAO.find(curie); + Allele dbEntity = alleleDAO.find(id); if (dbEntity == null) { - addMessageResponse("curie", ValidationConstants.INVALID_MESSAGE); + addMessageResponse("id", ValidationConstants.INVALID_MESSAGE); throw new ApiErrorException(response); } @@ -106,7 +107,7 @@ public Allele validateAlleleUpdate(Allele uiEntity) { public Allele validateAlleleCreate(Allele uiEntity) { response = new ObjectResponse<>(); - errorMessage = "Could not create Allele: [" + uiEntity.getCurie() + "]"; + errorMessage = "Could not create Allele"; Allele dbEntity = new Allele(); String curie = validateCurie(uiEntity); @@ -119,11 +120,7 @@ public Allele validateAlleleCreate(Allele uiEntity) { public Allele validateAllele(Allele uiEntity, Allele dbEntity) { - NCBITaxonTerm taxon = validateTaxon(uiEntity, dbEntity); - dbEntity.setTaxon(taxon); - - DataProvider dataProvider = validateDataProvider(uiEntity, dbEntity); - dbEntity.setDataProvider(dataProvider); + dbEntity = (Allele) validateGenomicEntityFields(uiEntity, dbEntity); List references = validateReferences(uiEntity, dbEntity); dbEntity.setReferences(references); @@ -146,23 +143,6 @@ public Allele validateAllele(Allele uiEntity, Allele dbEntity) { dbEntity.getRelatedNotes().addAll(relatedNotes); } - List currentXrefIds; - if (dbEntity.getCrossReferences() == null) { - currentXrefIds = new ArrayList<>(); - } else { - currentXrefIds = dbEntity.getCrossReferences().stream().map(CrossReference::getId).collect(Collectors.toList()); - } - - List crossReferences = validateCrossReferences(uiEntity, dbEntity); - dbEntity.setCrossReferences(crossReferences); - List mergedIds = crossReferences == null ? new ArrayList<>() : - crossReferences.stream().map(CrossReference::getId).collect(Collectors.toList()); - for (Long currentXrefId : currentXrefIds) { - if (!mergedIds.contains(currentXrefId)) { - crossReferenceDAO.remove(currentXrefId); - } - } - AlleleSymbolSlotAnnotation symbol = validateAlleleSymbol(uiEntity, dbEntity); AlleleFullNameSlotAnnotation fullName = validateAlleleFullName(uiEntity, dbEntity); AlleleGermlineTransmissionStatusSlotAnnotation germlineTransmissionStatus = validateAlleleGermlineTransmissionStatus(uiEntity, dbEntity); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AnnotationValidator.java index 855222490..284d1c5c3 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AnnotationValidator.java @@ -22,6 +22,7 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.DataProviderService; import org.alliancegenome.curation_api.services.helpers.notes.NoteIdentityHelper; +import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.ListUtils; import org.apache.commons.lang3.ObjectUtils; @@ -126,11 +127,6 @@ public List validateRelatedNotes(Annotation uiEntity, Annotation dbEntity, convertMapToErrorMessages(field); return null; } - - for (Note validatedNote : validatedNotes) { - if (validatedNote.getId() == null) - noteDAO.persist(validatedNote); - } if (CollectionUtils.isEmpty(validatedNotes)) return null; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/BiologicalEntityValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/BiologicalEntityValidator.java index d95a8c94b..fff926af5 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/BiologicalEntityValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/BiologicalEntityValidator.java @@ -2,25 +2,29 @@ import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.model.entities.BiologicalEntity; -import org.alliancegenome.curation_api.model.entities.DataProvider; import org.alliancegenome.curation_api.model.entities.ontology.NCBITaxonTerm; -import org.alliancegenome.curation_api.response.ObjectResponse; -import org.alliancegenome.curation_api.services.DataProviderService; import org.alliancegenome.curation_api.services.ontology.NcbiTaxonTermService; +import org.alliancegenome.curation_api.services.validation.base.SubmittedObjectValidator; import org.apache.commons.lang3.StringUtils; import jakarta.inject.Inject; -public class BiologicalEntityValidator extends CurieAuditedObjectValidator { +public class BiologicalEntityValidator extends SubmittedObjectValidator { @Inject NcbiTaxonTermService ncbiTaxonTermService; - @Inject - DataProviderService dataProviderService; - @Inject - DataProviderValidator dataProviderValidator; + + public E validateBiologicalEntityFields(E uiEntity, E dbEntity) { + + dbEntity = validateSubmittedObjectFields(uiEntity, dbEntity); + + NCBITaxonTerm taxon = validateTaxon(uiEntity, dbEntity); + dbEntity.setTaxon(taxon); + + return dbEntity; + } - public NCBITaxonTerm validateTaxon(BiologicalEntity uiEntity, BiologicalEntity dbEntity) { + public NCBITaxonTerm validateTaxon(E uiEntity, E dbEntity) { String field = "taxon"; if (uiEntity.getTaxon() == null || StringUtils.isBlank(uiEntity.getTaxon().getCurie())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); @@ -40,33 +44,4 @@ public NCBITaxonTerm validateTaxon(BiologicalEntity uiEntity, BiologicalEntity d return taxon; } - - public DataProvider validateDataProvider(BiologicalEntity uiEntity, BiologicalEntity dbEntity) { - String field = "dataProvider"; - if (uiEntity.getDataProvider() == null) { - if (dbEntity.getDataProvider() == null) - uiEntity.setDataProvider(dataProviderService.createAffiliatedModDataProvider()); - if (uiEntity.getDataProvider() == null) { - addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); - return null; - } - } - - DataProvider uiDataProvider = uiEntity.getDataProvider(); - DataProvider dbDataProvider = dbEntity.getDataProvider(); - - ObjectResponse dpResponse = dataProviderValidator.validateDataProvider(uiDataProvider, dbDataProvider, false); - if (dpResponse.hasErrors()) { - addMessageResponse(field, dpResponse.errorMessagesString()); - return null; - } - - DataProvider validatedDataProvider = dpResponse.getEntity(); - if (validatedDataProvider.getObsolete() && (dbDataProvider == null || !validatedDataProvider.getId().equals(dbDataProvider.getId()))) { - addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); - return null; - } - - return validatedDataProvider; - } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java index 7856d0c06..222cb6688 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java @@ -20,6 +20,7 @@ import org.alliancegenome.curation_api.services.ReferenceService; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/CrossReferenceValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/CrossReferenceValidator.java index ecfa440f9..a76130431 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/CrossReferenceValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/CrossReferenceValidator.java @@ -5,6 +5,7 @@ import org.alliancegenome.curation_api.exceptions.ApiErrorException; import org.alliancegenome.curation_api.model.entities.CrossReference; import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.RequestScoped; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/DataProviderValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/DataProviderValidator.java index 8a722034e..95de252d0 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/DataProviderValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/DataProviderValidator.java @@ -10,6 +10,7 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.CrossReferenceService; import org.alliancegenome.curation_api.services.OrganizationService; +import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java index f61b52b1f..27dcb2043 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java @@ -51,15 +51,15 @@ public class DiseaseAnnotationValidator extends AnnotationValidator { public DOTerm validateObject(DiseaseAnnotation uiEntity, DiseaseAnnotation dbEntity) { String field = "object"; - if (ObjectUtils.isEmpty(uiEntity.getObject()) || StringUtils.isEmpty(uiEntity.getObject().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getObject()) || uiEntity.getObject().getId() == null) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } - DOTerm diseaseTerm = doTermDAO.find(uiEntity.getObject().getCurie()); + DOTerm diseaseTerm = doTermDAO.find(uiEntity.getObject().getId()); if (diseaseTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; - } else if (diseaseTerm.getObsolete() && (dbEntity.getObject() == null || !diseaseTerm.getCurie().equals(dbEntity.getObject().getCurie()))) { + } else if (diseaseTerm.getObsolete() && (dbEntity.getObject() == null || !diseaseTerm.getId().equals(dbEntity.getObject().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -95,13 +95,16 @@ public List validateEvidenceCodes(DiseaseAnnotation uiEntity, DiseaseAn return null; } List validEvidenceCodes = new ArrayList<>(); + List previousIds = new ArrayList(); + if (CollectionUtils.isNotEmpty(dbEntity.getEvidenceCodes())) + previousIds = dbEntity.getEvidenceCodes().stream().map(ECOTerm::getId).collect(Collectors.toList()); for (ECOTerm ec : uiEntity.getEvidenceCodes()) { - ECOTerm evidenceCode = ecoTermDAO.find(ec.getCurie()); + ECOTerm evidenceCode = ecoTermDAO.find(ec.getId()); if (evidenceCode == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (evidenceCode.getObsolete() && (CollectionUtils.isEmpty(dbEntity.getEvidenceCodes()) || !dbEntity.getEvidenceCodes().contains(evidenceCode))) { + if (evidenceCode.getObsolete() && (CollectionUtils.isEmpty(dbEntity.getEvidenceCodes()) || !previousIds.contains(evidenceCode.getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -119,15 +122,15 @@ public List validateWith(DiseaseAnnotation uiEntity, DiseaseAnnotation dbE return null; List validWithGenes = new ArrayList(); - List previousCuries = new ArrayList(); + List previousIds = new ArrayList(); if (CollectionUtils.isNotEmpty(dbEntity.getWith())) - previousCuries = dbEntity.getWith().stream().map(Gene::getCurie).collect(Collectors.toList()); + previousIds = dbEntity.getWith().stream().map(Gene::getId).collect(Collectors.toList()); for (Gene wg : uiEntity.getWith()) { - Gene withGene = geneDAO.find(wg.getCurie()); - if (withGene == null || !withGene.getCurie().startsWith("HGNC:")) { + Gene withGene = geneDAO.find(wg.getId()); + if (withGene == null || withGene.getModEntityId() == null || !withGene.getModEntityId().startsWith("HGNC:")) { addMessageResponse("with", ValidationConstants.INVALID_MESSAGE); return null; - } else if (withGene.getObsolete() && !previousCuries.contains(withGene.getCurie())) { + } else if (withGene.getObsolete() && !previousIds.contains(withGene.getId())) { addMessageResponse("with", ValidationConstants.OBSOLETE_MESSAGE); } else { validWithGenes.add(withGene); @@ -180,18 +183,18 @@ public List validateDiseaseGeneticModifiers(DiseaseAnnotation } List validModifiers = new ArrayList<>(); - List previousCuries = new ArrayList<>(); + List previousIds = new ArrayList<>(); if (CollectionUtils.isNotEmpty(dbEntity.getDiseaseGeneticModifiers())) - previousCuries = dbEntity.getDiseaseGeneticModifiers().stream().map(BiologicalEntity::getCurie).collect(Collectors.toList()); + previousIds = dbEntity.getDiseaseGeneticModifiers().stream().map(BiologicalEntity::getId).collect(Collectors.toList()); for (BiologicalEntity modifier : uiEntity.getDiseaseGeneticModifiers()) { - BiologicalEntity diseaseGeneticModifier = biologicalEntityDAO.find(modifier.getCurie()); + BiologicalEntity diseaseGeneticModifier = biologicalEntityDAO.find(modifier.getId()); if (diseaseGeneticModifier == null) { addMessageResponse("diseaseGeneticModifiers", ValidationConstants.INVALID_MESSAGE); return null; } - if (diseaseGeneticModifier.getObsolete() && !previousCuries.contains(diseaseGeneticModifier.getCurie())) { + if (diseaseGeneticModifier.getObsolete() && !previousIds.contains(diseaseGeneticModifier.getId())) { addMessageResponse("diseaseGeneticModifiers", ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java index e65cbae61..5e7f58f3f 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java @@ -21,6 +21,7 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.ExperimentalConditionSummary; +import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; @@ -122,15 +123,15 @@ public ExperimentalCondition validateExperimentalCondition(ExperimentalCondition public ZECOTerm validateConditionClass(ExperimentalCondition uiEntity, ExperimentalCondition dbEntity) { String field = "conditionClass"; - if (ObjectUtils.isEmpty(uiEntity.getConditionClass()) || StringUtils.isBlank(uiEntity.getConditionClass().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getConditionClass()) || uiEntity.getConditionClass().getId() == null) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } - ZECOTerm zecoTerm = zecoTermDAO.find(uiEntity.getConditionClass().getCurie()); + ZECOTerm zecoTerm = zecoTermDAO.find(uiEntity.getConditionClass().getId()); if (zecoTerm == null || zecoTerm.getSubsets().isEmpty() || !zecoTerm.getSubsets().contains(OntologyConstants.ZECO_AGR_SLIM_SUBSET)) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; - } else if (zecoTerm.getObsolete() && (dbEntity.getConditionClass() == null || !zecoTerm.getCurie().equals(dbEntity.getConditionClass().getCurie()))) { + } else if (zecoTerm.getObsolete() && (dbEntity.getConditionClass() == null || !zecoTerm.getId().equals(dbEntity.getConditionClass().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -139,14 +140,14 @@ public ZECOTerm validateConditionClass(ExperimentalCondition uiEntity, Experimen public ExperimentalConditionOntologyTerm validateConditionId(ExperimentalCondition uiEntity, ExperimentalCondition dbEntity) { String field = "conditionId"; - if (ObjectUtils.isEmpty(uiEntity.getConditionId()) || StringUtils.isBlank(uiEntity.getConditionId().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getConditionId()) || uiEntity.getConditionId().getId() == null) { return null; } - ExperimentalConditionOntologyTerm ecOntologyTerm = ecOntologyTermDAO.find(uiEntity.getConditionId().getCurie()); + ExperimentalConditionOntologyTerm ecOntologyTerm = ecOntologyTermDAO.find(uiEntity.getConditionId().getId()); if (ecOntologyTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; - } else if (ecOntologyTerm.getObsolete() && (dbEntity.getConditionId() == null || !ecOntologyTerm.getCurie().equals(dbEntity.getConditionId().getCurie()))) { + } else if (ecOntologyTerm.getObsolete() && (dbEntity.getConditionId() == null || !ecOntologyTerm.getId().equals(dbEntity.getConditionId().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -155,14 +156,14 @@ public ExperimentalConditionOntologyTerm validateConditionId(ExperimentalConditi public GOTerm validateConditionGeneOntology(ExperimentalCondition uiEntity, ExperimentalCondition dbEntity) { String field = "conditionGeneOntology"; - if (ObjectUtils.isEmpty(uiEntity.getConditionGeneOntology()) || StringUtils.isBlank(uiEntity.getConditionGeneOntology().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getConditionGeneOntology()) || uiEntity.getConditionGeneOntology().getId() == null) { return null; } - GOTerm goTerm = goTermDAO.find(uiEntity.getConditionGeneOntology().getCurie()); + GOTerm goTerm = goTermDAO.find(uiEntity.getConditionGeneOntology().getId()); if (goTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; - } else if (goTerm.getObsolete() && (dbEntity.getConditionGeneOntology() == null || !goTerm.getCurie().equals(dbEntity.getConditionGeneOntology().getCurie()))) { + } else if (goTerm.getObsolete() && (dbEntity.getConditionGeneOntology() == null || !goTerm.getId().equals(dbEntity.getConditionGeneOntology().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -171,14 +172,14 @@ public GOTerm validateConditionGeneOntology(ExperimentalCondition uiEntity, Expe public AnatomicalTerm validateConditionAnatomy(ExperimentalCondition uiEntity, ExperimentalCondition dbEntity) { String field = "conditionAnatomy"; - if (ObjectUtils.isEmpty(uiEntity.getConditionAnatomy()) || StringUtils.isBlank(uiEntity.getConditionAnatomy().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getConditionAnatomy()) || uiEntity.getConditionAnatomy().getId() == null) { return null; } - AnatomicalTerm anatomicalTerm = anatomicalTermDAO.find(uiEntity.getConditionAnatomy().getCurie()); + AnatomicalTerm anatomicalTerm = anatomicalTermDAO.find(uiEntity.getConditionAnatomy().getId()); if (anatomicalTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; - } else if (anatomicalTerm.getObsolete() && (dbEntity.getConditionAnatomy() == null || !anatomicalTerm.getCurie().equals(dbEntity.getConditionAnatomy().getCurie()))) { + } else if (anatomicalTerm.getObsolete() && (dbEntity.getConditionAnatomy() == null || !anatomicalTerm.getId().equals(dbEntity.getConditionAnatomy().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -187,14 +188,14 @@ public AnatomicalTerm validateConditionAnatomy(ExperimentalCondition uiEntity, E public ChemicalTerm validateConditionChemical(ExperimentalCondition uiEntity, ExperimentalCondition dbEntity) { String field = "conditionChemical"; - if (ObjectUtils.isEmpty(uiEntity.getConditionChemical()) || StringUtils.isBlank(uiEntity.getConditionChemical().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getConditionChemical()) || uiEntity.getConditionChemical().getId() == null) { return null; } - ChemicalTerm chemicalTerm = chemicalTermDAO.find(uiEntity.getConditionChemical().getCurie()); + ChemicalTerm chemicalTerm = chemicalTermDAO.find(uiEntity.getConditionChemical().getId()); if (chemicalTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; - } else if (chemicalTerm.getObsolete() && (dbEntity.getConditionChemical() == null || !chemicalTerm.getCurie().equals(dbEntity.getConditionChemical().getCurie()))) { + } else if (chemicalTerm.getObsolete() && (dbEntity.getConditionChemical() == null || !chemicalTerm.getId().equals(dbEntity.getConditionChemical().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -203,17 +204,17 @@ public ChemicalTerm validateConditionChemical(ExperimentalCondition uiEntity, Ex public NCBITaxonTerm validateConditionTaxon(ExperimentalCondition uiEntity, ExperimentalCondition dbEntity) { String field = "conditionTaxon"; - if (ObjectUtils.isEmpty(uiEntity.getConditionTaxon()) || StringUtils.isBlank(uiEntity.getConditionTaxon().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getConditionTaxon()) || uiEntity.getConditionTaxon().getId() == null) { return null; } - NCBITaxonTerm taxonTerm = ncbiTaxonTermDAO.find(uiEntity.getConditionTaxon().getCurie()); + NCBITaxonTerm taxonTerm = ncbiTaxonTermDAO.find(uiEntity.getConditionTaxon().getId()); if (taxonTerm == null) { taxonTerm = ncbiTaxonTermDAO.downloadAndSave(uiEntity.getConditionTaxon().getCurie()); } if (taxonTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; - } else if (taxonTerm.getObsolete() && (dbEntity.getConditionTaxon() == null || !taxonTerm.getCurie().equals(dbEntity.getConditionTaxon().getCurie()))) { + } else if (taxonTerm.getObsolete() && (dbEntity.getConditionTaxon() == null || !taxonTerm.getId().equals(dbEntity.getConditionTaxon().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java index bded7625e..e632f862a 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java @@ -83,18 +83,18 @@ public GeneDiseaseAnnotation validateAnnotation(GeneDiseaseAnnotation uiEntity, } private Gene validateSubject(GeneDiseaseAnnotation uiEntity, GeneDiseaseAnnotation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getSubject()) || StringUtils.isBlank(uiEntity.getSubject().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getSubject()) || uiEntity.getSubject().getId() == null) { addMessageResponse("subject", ValidationConstants.REQUIRED_MESSAGE); return null; } - Gene subjectEntity = geneDAO.find(uiEntity.getSubject().getCurie()); + Gene subjectEntity = geneDAO.find(uiEntity.getSubject().getId()); if (subjectEntity == null) { addMessageResponse("subject", ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubject() == null || !subjectEntity.getCurie().equals(dbEntity.getSubject().getCurie()))) { + if (subjectEntity.getObsolete() && (dbEntity.getSubject() == null || !subjectEntity.getId().equals(dbEntity.getSubject().getId()))) { addMessageResponse("subject", ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -126,16 +126,16 @@ private VocabularyTerm validateDiseaseRelation(GeneDiseaseAnnotation uiEntity, G } private AffectedGenomicModel validateSgdStrainBackground(GeneDiseaseAnnotation uiEntity, GeneDiseaseAnnotation dbEntity) { - if (uiEntity.getSgdStrainBackground() == null) + if (uiEntity.getSgdStrainBackground() == null || uiEntity.getSgdStrainBackground().getId() == null) return null; - AffectedGenomicModel sgdStrainBackground = agmDAO.find(uiEntity.getSgdStrainBackground().getCurie()); + AffectedGenomicModel sgdStrainBackground = agmDAO.find(uiEntity.getSgdStrainBackground().getId()); if (sgdStrainBackground == null || !sgdStrainBackground.getTaxon().getName().startsWith("Saccharomyces cerevisiae")) { addMessageResponse("sgdStrainBackground", ValidationConstants.INVALID_MESSAGE); return null; } - if (sgdStrainBackground.getObsolete() && (dbEntity.getSgdStrainBackground() == null || !sgdStrainBackground.getCurie().equals(dbEntity.getSgdStrainBackground().getCurie()))) { + if (sgdStrainBackground.getObsolete() && (dbEntity.getSgdStrainBackground() == null || !sgdStrainBackground.getId().equals(dbEntity.getSgdStrainBackground().getId()))) { addMessageResponse("sgdStrainBackground", ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneValidator.java index 2441d6b70..ed479d0b6 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneValidator.java @@ -31,7 +31,7 @@ import jakarta.inject.Inject; @RequestScoped -public class GeneValidator extends GenomicEntityValidator { +public class GeneValidator extends GenomicEntityValidator { @Inject GeneDAO geneDAO; @@ -54,16 +54,17 @@ public class GeneValidator extends GenomicEntityValidator { public Gene validateGeneUpdate(Gene uiEntity) { response = new ObjectResponse<>(uiEntity); - errorMessage = "Could not update Gene: [" + uiEntity.getCurie() + "]"; + errorMessage = "Could not update Gene: [" + uiEntity.getIdentifier() + "]"; - String curie = validateCurie(uiEntity); - if (curie == null) { + Long id = uiEntity.getId(); + if (id == null) { + addMessageResponse("No Gene ID provided"); throw new ApiErrorException(response); } - Gene dbEntity = geneDAO.find(curie); + Gene dbEntity = geneDAO.find(id); if (dbEntity == null) { - addMessageResponse("curie", ValidationConstants.INVALID_MESSAGE); + addMessageResponse("id", ValidationConstants.INVALID_MESSAGE); throw new ApiErrorException(response); } @@ -74,11 +75,9 @@ public Gene validateGeneUpdate(Gene uiEntity) { public Gene validateGeneCreate(Gene uiEntity) { response = new ObjectResponse<>(uiEntity); - errorMessage = "Could not create Gene: [" + uiEntity.getCurie() + "]"; + errorMessage = "Could not create Gene"; Gene dbEntity = new Gene(); - String curie = validateCurie(uiEntity); - dbEntity.setCurie(curie); dbEntity = (Gene) validateAuditedObjectFields(uiEntity, dbEntity, true); @@ -87,28 +86,7 @@ public Gene validateGeneCreate(Gene uiEntity) { private Gene validateGene(Gene uiEntity, Gene dbEntity) { - NCBITaxonTerm taxon = validateTaxon(uiEntity, dbEntity); - dbEntity.setTaxon(taxon); - - DataProvider dataProvider = validateDataProvider(uiEntity, dbEntity); - dbEntity.setDataProvider(dataProvider); - - List currentXrefIds; - if (dbEntity.getCrossReferences() == null) { - currentXrefIds = new ArrayList<>(); - } else { - currentXrefIds = dbEntity.getCrossReferences().stream().map(CrossReference::getId).collect(Collectors.toList()); - } - - List crossReferences = validateCrossReferences(uiEntity, dbEntity); - dbEntity.setCrossReferences(crossReferences); - List mergedIds = crossReferences == null ? new ArrayList<>() : - crossReferences.stream().map(CrossReference::getId).collect(Collectors.toList()); - for (Long currentXrefId : currentXrefIds) { - if (!mergedIds.contains(currentXrefId)) { - crossReferenceDAO.remove(currentXrefId); - } - } + dbEntity = (Gene) validateGenomicEntityFields(uiEntity, dbEntity); SOTerm geneType = validateGeneType(uiEntity, dbEntity); dbEntity.setGeneType(geneType); @@ -163,11 +141,11 @@ private SOTerm validateGeneType(Gene uiEntity, Gene dbEntity) { if (uiEntity.getGeneType() == null) return null; - SOTerm soTerm = soTermDAO.find(uiEntity.getGeneType().getCurie()); + SOTerm soTerm = soTermDAO.find(uiEntity.getGeneType().getId()); if (soTerm == null) { addMessageResponse("geneType", ValidationConstants.INVALID_MESSAGE); return null; - } else if (soTerm.getObsolete() && (dbEntity.getGeneType() == null || !soTerm.getCurie().equals(dbEntity.getGeneType().getCurie()))) { + } else if (soTerm.getObsolete() && (dbEntity.getGeneType() == null || !soTerm.getId().equals(dbEntity.getGeneType().getId()))) { addMessageResponse("geneType", ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/GenomicEntityValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/GenomicEntityValidator.java index 56daca4f5..5d8ab7bf8 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/GenomicEntityValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/GenomicEntityValidator.java @@ -11,29 +11,51 @@ import jakarta.inject.Inject; -public class GenomicEntityValidator extends BiologicalEntityValidator { +public class GenomicEntityValidator extends BiologicalEntityValidator { @Inject CrossReferenceValidator crossReferenceValidator; @Inject CrossReferenceService crossReferenceService; + + public E validateGenomicEntityFields(E uiEntity, E dbEntity) { - public List validateCrossReferences(GenomicEntity uiEntity, GenomicEntity dbEntity) { + dbEntity = validateBiologicalEntityFields(uiEntity, dbEntity); + + List xrefs = validateCrossReferences(uiEntity, dbEntity); + if (dbEntity.getCrossReferences() != null) + dbEntity.getCrossReferences().clear(); + if (xrefs != null) { + if (dbEntity.getCrossReferences() == null) + dbEntity.setCrossReferences(new ArrayList<>()); + dbEntity.getCrossReferences().addAll(xrefs); + } + + return dbEntity; + } + + public List validateCrossReferences(E uiEntity, E dbEntity) { String field = "crossReferences"; List validatedXrefs = new ArrayList(); + Boolean allValid = true; if (CollectionUtils.isNotEmpty(uiEntity.getCrossReferences())) { - for (CrossReference newXref : uiEntity.getCrossReferences()) { - ObjectResponse xrefResponse = crossReferenceValidator.validateCrossReference(newXref, false); + for (int ix = 0; ix < uiEntity.getCrossReferences().size(); ix++) { + CrossReference xref = uiEntity.getCrossReferences().get(ix); + ObjectResponse xrefResponse = crossReferenceValidator.validateCrossReference(xref, false); if (xrefResponse.getEntity() == null) { - addMessageResponse(field, xrefResponse.errorMessagesString()); - return null; + allValid = false; + response.addErrorMessages(field, ix, xrefResponse.getErrorMessages()); + } else { + validatedXrefs.add(xref); } - validatedXrefs.add(xrefResponse.getEntity()); } } - validatedXrefs = crossReferenceService.getMergedXrefList(validatedXrefs, dbEntity.getCrossReferences()); + if (!allValid) { + convertMapToErrorMessages(field); + return null; + } if (CollectionUtils.isEmpty(validatedXrefs)) return null; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/MoleculeValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/MoleculeValidator.java index a044bfce6..534476a41 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/MoleculeValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/MoleculeValidator.java @@ -1,37 +1,61 @@ package org.alliancegenome.curation_api.services.validation; +import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.dao.MoleculeDAO; import org.alliancegenome.curation_api.exceptions.ApiErrorException; import org.alliancegenome.curation_api.model.entities.Molecule; import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.services.validation.base.CurieObjectValidator; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @RequestScoped -public class MoleculeValidator extends CurieAuditedObjectValidator { +public class MoleculeValidator extends CurieObjectValidator { @Inject MoleculeDAO moleculeDAO; - public Molecule validateMolecule(Molecule uiEntity) { + private String errorMessage; + + public Molecule validateMoleculeUpdate(Molecule uiEntity) { response = new ObjectResponse<>(uiEntity); - - String curie = validateCurie(uiEntity); - if (curie == null) { + errorMessage = "Could not update Molecule: [" + uiEntity.getCurie() + "]"; + + Long id = uiEntity.getId(); + if (id == null) { + addMessageResponse("No Molecule ID provided"); throw new ApiErrorException(response); } - - Molecule dbEntity = moleculeDAO.find(curie); + + Molecule dbEntity = moleculeDAO.find(id); if (dbEntity == null) { - addMessageResponse("Could not find Molecule with curie: [" + curie + "]"); + addMessageResponse("id", ValidationConstants.INVALID_MESSAGE); throw new ApiErrorException(response); } - - String errorTitle = "Could not update Molecule: [" + curie + "]"; - + dbEntity = (Molecule) validateAuditedObjectFields(uiEntity, dbEntity, false); + + return validateMolecule(uiEntity, dbEntity); + } + + public Molecule validateMoleculeCreate(Molecule uiEntity) { + response = new ObjectResponse<>(uiEntity); + errorMessage = "Could not create Molecule"; + + Molecule dbEntity = new Molecule(); + + dbEntity = (Molecule) validateAuditedObjectFields(uiEntity, dbEntity, true); + return validateMolecule(uiEntity, dbEntity); + } + + public Molecule validateMolecule(Molecule uiEntity, Molecule dbEntity) { + response = new ObjectResponse<>(uiEntity); + + String curie = validateCurie(uiEntity); + dbEntity.setCurie(curie); + dbEntity.setInchi(handleStringField(uiEntity.getInchi())); dbEntity.setInchiKey(handleStringField(uiEntity.getInchiKey())); dbEntity.setIupac(handleStringField(uiEntity.getIupac())); @@ -39,7 +63,7 @@ public Molecule validateMolecule(Molecule uiEntity) { dbEntity.setSmiles(handleStringField(uiEntity.getSmiles())); if (response.hasErrors()) { - response.setErrorMessage(errorTitle); + response.setErrorMessage(errorMessage); throw new ApiErrorException(response); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/NoteValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/NoteValidator.java index d67d1616f..56afad20c 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/NoteValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/NoteValidator.java @@ -14,6 +14,7 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.ReferenceService; import org.alliancegenome.curation_api.services.VocabularyTermService; +import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/PersonValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/PersonValidator.java index f051e5e4a..d47823093 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/PersonValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/PersonValidator.java @@ -5,6 +5,7 @@ import org.alliancegenome.curation_api.exceptions.ApiErrorException; import org.alliancegenome.curation_api.model.entities.Person; import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ReagentValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ReagentValidator.java index 8e3392ea2..841aa3e54 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ReagentValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ReagentValidator.java @@ -8,12 +8,13 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.DataProviderService; import org.alliancegenome.curation_api.services.ontology.NcbiTaxonTermService; +import org.alliancegenome.curation_api.services.validation.base.SubmittedObjectValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import jakarta.inject.Inject; -public class ReagentValidator extends AuditedObjectValidator { +public class ReagentValidator extends SubmittedObjectValidator { @Inject NcbiTaxonTermService ncbiTaxonTermService; @@ -27,12 +28,12 @@ public Reagent validateCommonReagentFields(Reagent uiEntity, Reagent dbEntity) { Boolean newEntity = false; if (dbEntity.getId() == null) newEntity = true; - dbEntity = validateAuditedObjectFields(uiEntity, dbEntity, newEntity); + dbEntity = (Reagent) validateAuditedObjectFields(uiEntity, dbEntity, newEntity); String modEntityId = StringUtils.isNotBlank(uiEntity.getModEntityId()) ? uiEntity.getModEntityId() : null; dbEntity.setModEntityId(modEntityId); - String modInternalId = StringUtils.isNotBlank(uiEntity.getModInternalId()) ? uiEntity.getModInternalId() : null; + String modInternalId = validateModInternalId(uiEntity); dbEntity.setModInternalId(modInternalId); List secondaryIds = CollectionUtils.isNotEmpty(uiEntity.getSecondaryIdentifiers()) ? uiEntity.getSecondaryIdentifiers() : null; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ReferenceValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ReferenceValidator.java index 7b2da66f5..442fb81d9 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ReferenceValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ReferenceValidator.java @@ -7,6 +7,7 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.PersonService; import org.alliancegenome.curation_api.services.ReferenceService; +import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/VariantValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/VariantValidator.java index afc58164a..3c653003c 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/VariantValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/VariantValidator.java @@ -32,7 +32,7 @@ import jakarta.inject.Inject; @RequestScoped -public class VariantValidator extends GenomicEntityValidator { +public class VariantValidator extends GenomicEntityValidator { @Inject VariantDAO variantDAO; @@ -49,16 +49,17 @@ public class VariantValidator extends GenomicEntityValidator { public Variant validateVariantUpdate(Variant uiEntity) { response = new ObjectResponse<>(uiEntity); - errorMessage = "Could not update Variant: [" + uiEntity.getCurie() + "]"; + errorMessage = "Could not update Variant: [" + uiEntity.getIdentifier() + "]"; - String curie = validateCurie(uiEntity); - if (curie == null) { + Long id = uiEntity.getId(); + if (id == null) { + addMessageResponse("No Variant ID provided"); throw new ApiErrorException(response); } - Variant dbEntity = variantDAO.find(curie); + Variant dbEntity = variantDAO.find(id); if (dbEntity == null) { - addMessageResponse("curie", ValidationConstants.INVALID_MESSAGE); + addMessageResponse("id", ValidationConstants.INVALID_MESSAGE); throw new ApiErrorException(response); } @@ -69,11 +70,9 @@ public Variant validateVariantUpdate(Variant uiEntity) { public Variant validateVariantCreate(Variant uiEntity) { response = new ObjectResponse<>(); - errorMessage = "Could not create Variant: [" + uiEntity.getCurie() + "]"; - + errorMessage = "Could not create Variant"; + Variant dbEntity = new Variant(); - String curie = validateCurie(uiEntity); - dbEntity.setCurie(curie); dbEntity = (Variant) validateAuditedObjectFields(uiEntity, dbEntity, true); @@ -82,28 +81,7 @@ public Variant validateVariantCreate(Variant uiEntity) { public Variant validateVariant(Variant uiEntity, Variant dbEntity) { - NCBITaxonTerm taxon = validateTaxon(uiEntity, dbEntity); - dbEntity.setTaxon(taxon); - - DataProvider dataProvider = validateDataProvider(uiEntity, dbEntity); - dbEntity.setDataProvider(dataProvider); - - List currentXrefIds; - if (dbEntity.getCrossReferences() == null) { - currentXrefIds = new ArrayList<>(); - } else { - currentXrefIds = dbEntity.getCrossReferences().stream().map(CrossReference::getId).collect(Collectors.toList()); - } - - List crossReferences = validateCrossReferences(uiEntity, dbEntity); - dbEntity.setCrossReferences(crossReferences); - List mergedIds = crossReferences == null ? new ArrayList<>() : - crossReferences.stream().map(CrossReference::getId).collect(Collectors.toList()); - for (Long currentXrefId : currentXrefIds) { - if (!mergedIds.contains(currentXrefId)) { - crossReferenceDAO.remove(currentXrefId); - } - } + dbEntity = (Variant) validateGenomicEntityFields(uiEntity, dbEntity); SOTerm variantType = validateVariantType(uiEntity, dbEntity); dbEntity.setVariantType(variantType); @@ -135,15 +113,15 @@ public Variant validateVariant(Variant uiEntity, Variant dbEntity) { public SOTerm validateVariantType(Variant uiEntity, Variant dbEntity) { String field = "variantType"; - if (ObjectUtils.isEmpty(uiEntity.getVariantType()) || StringUtils.isEmpty(uiEntity.getVariantType().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getVariantType()) || uiEntity.getVariantType().getId() == null) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } - SOTerm variantType = soTermDAO.find(uiEntity.getVariantType().getCurie()); + SOTerm variantType = soTermDAO.find(uiEntity.getVariantType().getId()); if (variantType == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; - } else if (variantType.getObsolete() && (dbEntity.getVariantType() == null || !variantType.getCurie().equals(dbEntity.getVariantType().getCurie()))) { + } else if (variantType.getObsolete() && (dbEntity.getVariantType() == null || !variantType.getId().equals(dbEntity.getVariantType().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -171,14 +149,14 @@ private VocabularyTerm validateVariantStatus(Variant uiEntity, Variant dbEntity) public SOTerm validateSourceGeneralConsequence(Variant uiEntity, Variant dbEntity) { String field = "sourceGeneralConsequence"; - if (ObjectUtils.isEmpty(uiEntity.getSourceGeneralConsequence()) || StringUtils.isEmpty(uiEntity.getSourceGeneralConsequence().getCurie())) + if (ObjectUtils.isEmpty(uiEntity.getSourceGeneralConsequence()) || uiEntity.getSourceGeneralConsequence().getId() == null) return null; - SOTerm sourceGeneralConsequence = soTermDAO.find(uiEntity.getSourceGeneralConsequence().getCurie()); + SOTerm sourceGeneralConsequence = soTermDAO.find(uiEntity.getSourceGeneralConsequence().getId()); if (sourceGeneralConsequence == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; - } else if (sourceGeneralConsequence.getObsolete() && (dbEntity.getSourceGeneralConsequence() == null || !sourceGeneralConsequence.getCurie().equals(dbEntity.getSourceGeneralConsequence().getCurie()))) { + } else if (sourceGeneralConsequence.getObsolete() && (dbEntity.getSourceGeneralConsequence() == null || !sourceGeneralConsequence.getId().equals(dbEntity.getSourceGeneralConsequence().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/VocabularyTermSetValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/VocabularyTermSetValidator.java index 1f3669079..8498ec579 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/VocabularyTermSetValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/VocabularyTermSetValidator.java @@ -13,6 +13,7 @@ import org.alliancegenome.curation_api.model.entities.VocabularyTermSet; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/VocabularyTermValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/VocabularyTermValidator.java index f667f45bf..a712fe63e 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/VocabularyTermValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/VocabularyTermValidator.java @@ -8,6 +8,7 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.VocabularyTermService; +import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/VocabularyValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/VocabularyValidator.java index 2c6d44945..e6b12a934 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/VocabularyValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/VocabularyValidator.java @@ -6,6 +6,7 @@ import org.alliancegenome.curation_api.model.entities.Vocabulary; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/EvidenceAssociationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/EvidenceAssociationValidator.java index 96325daaf..a55f98828 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/EvidenceAssociationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/EvidenceAssociationValidator.java @@ -7,7 +7,7 @@ import org.alliancegenome.curation_api.model.entities.EvidenceAssociation; import org.alliancegenome.curation_api.model.entities.InformationContentEntity; import org.alliancegenome.curation_api.services.InformationContentEntityService; -import org.alliancegenome.curation_api.services.validation.AuditedObjectValidator; +import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.collections.CollectionUtils; import jakarta.inject.Inject; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java index 5bf67fc5c..e57f448ea 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java @@ -68,18 +68,18 @@ public AlleleGeneAssociation validateAlleleGeneAssociation(AlleleGeneAssociation private Allele validateSubject(AlleleGeneAssociation uiEntity, AlleleGeneAssociation dbEntity) { String field = "subject"; - if (ObjectUtils.isEmpty(uiEntity.getSubject()) || StringUtils.isBlank(uiEntity.getSubject().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getSubject()) || uiEntity.getSubject().getId() == null) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } - Allele subjectEntity = alleleDAO.find(uiEntity.getSubject().getCurie()); + Allele subjectEntity = alleleDAO.find(uiEntity.getSubject().getId()); if (subjectEntity == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubject() == null || !subjectEntity.getCurie().equals(dbEntity.getSubject().getCurie()))) { + if (subjectEntity.getObsolete() && (dbEntity.getSubject() == null || !subjectEntity.getId().equals(dbEntity.getSubject().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -89,18 +89,18 @@ private Allele validateSubject(AlleleGeneAssociation uiEntity, AlleleGeneAssocia } private Gene validateObject(AlleleGeneAssociation uiEntity, AlleleGeneAssociation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getObject()) || StringUtils.isBlank(uiEntity.getObject().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getObject()) || uiEntity.getObject().getId() == null) { addMessageResponse("object", ValidationConstants.REQUIRED_MESSAGE); return null; } - Gene objectEntity = geneDAO.find(uiEntity.getObject().getCurie()); + Gene objectEntity = geneDAO.find(uiEntity.getObject().getId()); if (objectEntity == null) { addMessageResponse("object", ValidationConstants.INVALID_MESSAGE); return null; } - if (objectEntity.getObsolete() && (dbEntity.getObject() == null || !objectEntity.getCurie().equals(dbEntity.getObject().getCurie()))) { + if (objectEntity.getObsolete() && (dbEntity.getObject() == null || !objectEntity.getId().equals(dbEntity.getObject().getId()))) { addMessageResponse("object", ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGenomicEntityAssociationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGenomicEntityAssociationValidator.java index e65bb528d..b77b1d634 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGenomicEntityAssociationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGenomicEntityAssociationValidator.java @@ -33,12 +33,12 @@ public ECOTerm validateEvidenceCode(AlleleGenomicEntityAssociation uiEntity, All if (uiEntity.getEvidenceCode() == null) return null; - ECOTerm evidenceCode = ecoTermDAO.find(uiEntity.getEvidenceCode().getCurie()); + ECOTerm evidenceCode = ecoTermDAO.find(uiEntity.getEvidenceCode().getId()); if (evidenceCode == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (evidenceCode.getObsolete() && (dbEntity.getEvidenceCode() == null || !dbEntity.getEvidenceCode().getCurie().equals(evidenceCode.getCurie()))) { + if (evidenceCode.getObsolete() && (dbEntity.getEvidenceCode() == null || !dbEntity.getEvidenceCode().getId().equals(evidenceCode.getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java index 1031b500a..49e8cda69 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java @@ -115,18 +115,18 @@ private Construct validateSubject(ConstructGenomicEntityAssociation uiEntity, Co } private GenomicEntity validateObject(ConstructGenomicEntityAssociation uiEntity, ConstructGenomicEntityAssociation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getObject()) || StringUtils.isBlank(uiEntity.getObject().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getObject()) || uiEntity.getObject().getId() == null) { addMessageResponse("object", ValidationConstants.REQUIRED_MESSAGE); return null; } - GenomicEntity objectEntity = genomicEntityDAO.find(uiEntity.getObject().getCurie()); + GenomicEntity objectEntity = genomicEntityDAO.find(uiEntity.getObject().getId()); if (objectEntity == null) { addMessageResponse("object", ValidationConstants.INVALID_MESSAGE); return null; } - if (objectEntity.getObsolete() && (dbEntity.getObject() == null || !objectEntity.getCurie().equals(dbEntity.getObject().getCurie()))) { + if (objectEntity.getObsolete() && (dbEntity.getObject() == null || !objectEntity.getId().equals(dbEntity.getObject().getId()))) { addMessageResponse("object", ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AuditedObjectValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/base/AuditedObjectValidator.java similarity index 97% rename from src/main/java/org/alliancegenome/curation_api/services/validation/AuditedObjectValidator.java rename to src/main/java/org/alliancegenome/curation_api/services/validation/base/AuditedObjectValidator.java index 5f406b42d..1b05b3302 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AuditedObjectValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/base/AuditedObjectValidator.java @@ -1,4 +1,4 @@ -package org.alliancegenome.curation_api.services.validation; +package org.alliancegenome.curation_api.services.validation.base; import java.time.OffsetDateTime; import java.util.List; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/CurieAuditedObjectValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/base/CurieObjectValidator.java similarity index 74% rename from src/main/java/org/alliancegenome/curation_api/services/validation/CurieAuditedObjectValidator.java rename to src/main/java/org/alliancegenome/curation_api/services/validation/base/CurieObjectValidator.java index 5d15b2844..e7cb75f0d 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/CurieAuditedObjectValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/base/CurieObjectValidator.java @@ -1,10 +1,10 @@ -package org.alliancegenome.curation_api.services.validation; +package org.alliancegenome.curation_api.services.validation.base; import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.model.entities.base.CurieObject; import org.apache.commons.lang3.StringUtils; -public class CurieAuditedObjectValidator extends AuditedObjectValidator { +public class CurieObjectValidator extends AuditedObjectValidator { public String validateCurie(CurieObject uiEntity) { String curie = uiEntity.getCurie(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/base/SubmittedObjectValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/base/SubmittedObjectValidator.java new file mode 100644 index 000000000..f86736a96 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/base/SubmittedObjectValidator.java @@ -0,0 +1,72 @@ +package org.alliancegenome.curation_api.services.validation.base; + +import org.alliancegenome.curation_api.constants.ValidationConstants; +import org.alliancegenome.curation_api.model.entities.DataProvider; +import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.services.DataProviderService; +import org.alliancegenome.curation_api.services.validation.DataProviderValidator; +import org.apache.commons.lang3.StringUtils; + +import jakarta.inject.Inject; + +public class SubmittedObjectValidator extends CurieObjectValidator { + + @Inject DataProviderService dataProviderService; + @Inject DataProviderValidator dataProviderValidator; + + public E validateSubmittedObjectFields(E uiEntity, E dbEntity) { + String curie = handleStringField(uiEntity.getCurie()); + dbEntity.setCurie(curie); + + String modEntityId = handleStringField(uiEntity.getModEntityId()); + dbEntity.setModEntityId(modEntityId); + + String modInternalId = validateModInternalId(uiEntity); + dbEntity.setModInternalId(modInternalId); + + DataProvider dataProvider = validateDataProvider(uiEntity, dbEntity); + dbEntity.setDataProvider(dataProvider); + + return dbEntity; + } + + public String validateModInternalId(E uiEntity) { + String modInternalId = uiEntity.getModInternalId(); + if (StringUtils.isBlank(modInternalId)) { + if (StringUtils.isBlank(uiEntity.getModEntityId())) + addMessageResponse("modInternalId", ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId"); + return null; + } + return modInternalId; + } + + public DataProvider validateDataProvider(E uiEntity, E dbEntity) { + String field = "dataProvider"; + if (uiEntity.getDataProvider() == null) { + if (dbEntity.getDataProvider() == null) + uiEntity.setDataProvider(dataProviderService.createAffiliatedModDataProvider()); + if (uiEntity.getDataProvider() == null) { + addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); + return null; + } + } + + DataProvider uiDataProvider = uiEntity.getDataProvider(); + DataProvider dbDataProvider = dbEntity.getDataProvider(); + + ObjectResponse dpResponse = dataProviderValidator.validateDataProvider(uiDataProvider, dbDataProvider, false); + if (dpResponse.hasErrors()) { + addMessageResponse(field, dpResponse.errorMessagesString()); + return null; + } + + DataProvider validatedDataProvider = dpResponse.getEntity(); + if (validatedDataProvider.getObsolete() && (dbDataProvider == null || !validatedDataProvider.getId().equals(dbDataProvider.getId()))) { + addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); + return null; + } + + return validatedDataProvider; + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java index 96b64962c..e4d8b7d3f 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java @@ -55,16 +55,16 @@ public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotation Reference validatedReference = refResponse.getEntity().getSingleReference(); String refCurie = validatedReference == null ? null : validatedReference.getCurie(); - if (StringUtils.isBlank(dto.getAgmCurie())) { - adaResponse.addErrorMessage("agm_curie", ValidationConstants.REQUIRED_MESSAGE); + if (StringUtils.isBlank(dto.getAgmIdentifier())) { + adaResponse.addErrorMessage("agm_identifier", ValidationConstants.REQUIRED_MESSAGE); } else { - agm = agmDAO.find(dto.getAgmCurie()); + agm = agmDAO.findByIdentifierString(dto.getAgmIdentifier()); if (agm == null) { - adaResponse.addErrorMessage("agm_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAgmCurie() + ")"); + adaResponse.addErrorMessage("agm_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAgmIdentifier() + ")"); } else { String annotationId; String identifyingField; - String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getAgmCurie(), refCurie); + String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getAgmIdentifier(), refCurie); if (StringUtils.isNotBlank(dto.getModEntityId())) { annotationId = dto.getModEntityId(); @@ -88,7 +88,7 @@ public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotation if (dataProvider != null && (dataProvider.name().equals("RGD") || dataProvider.name().equals("HUMAN")) && !agm.getTaxon().getCurie().equals(dataProvider.canonicalTaxonCurie) || !dataProvider.sourceOrganization.equals(agm.getDataProvider().getSourceOrganization().getAbbreviation())) { - adaResponse.addErrorMessage("agm_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAgmCurie() + ") for " + dataProvider.name() + " load"); + adaResponse.addErrorMessage("agm_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAgmIdentifier() + ") for " + dataProvider.name() + " load"); } } } @@ -107,21 +107,21 @@ public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotation adaResponse.addErrorMessage("disease_relation_name", ValidationConstants.REQUIRED_MESSAGE); } - if (StringUtils.isNotBlank(dto.getInferredGeneCurie())) { - Gene inferredGene = geneDAO.find(dto.getInferredGeneCurie()); + if (StringUtils.isNotBlank(dto.getInferredGeneIdentifier())) { + Gene inferredGene = geneDAO.findByIdentifierString(dto.getInferredGeneIdentifier()); if (inferredGene == null) - adaResponse.addErrorMessage("inferred_gene_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getInferredGeneCurie() + ")"); + adaResponse.addErrorMessage("inferred_gene_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getInferredGeneIdentifier() + ")"); annotation.setInferredGene(inferredGene); } else { annotation.setInferredGene(null); } - if (CollectionUtils.isNotEmpty(dto.getAssertedGeneCuries())) { + if (CollectionUtils.isNotEmpty(dto.getAssertedGeneIdentifiers())) { List assertedGenes = new ArrayList<>(); - for (String assertedGeneCurie : dto.getAssertedGeneCuries()) { - Gene assertedGene = geneDAO.find(assertedGeneCurie); + for (String assertedGeneIdentifier : dto.getAssertedGeneIdentifiers()) { + Gene assertedGene = geneDAO.findByIdentifierString(assertedGeneIdentifier); if (assertedGene == null) { - adaResponse.addErrorMessage("asserted_gene_curies", ValidationConstants.INVALID_MESSAGE + " (" + assertedGeneCurie + ")"); + adaResponse.addErrorMessage("asserted_gene_identifiers", ValidationConstants.INVALID_MESSAGE + " (" + assertedGeneIdentifier + ")"); } else { assertedGenes.add(assertedGene); } @@ -131,19 +131,19 @@ public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotation annotation.setAssertedGenes(null); } - if (StringUtils.isNotBlank(dto.getInferredAlleleCurie())) { - Allele inferredAllele = alleleDAO.find(dto.getInferredAlleleCurie()); + if (StringUtils.isNotBlank(dto.getInferredAlleleIdentifier())) { + Allele inferredAllele = alleleDAO.findByIdentifierString(dto.getInferredAlleleIdentifier()); if (inferredAllele == null) - adaResponse.addErrorMessage("inferred_allele_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getInferredAlleleCurie() + ")"); + adaResponse.addErrorMessage("inferred_allele_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getInferredAlleleIdentifier() + ")"); annotation.setInferredAllele(inferredAllele); } else { annotation.setInferredAllele(null); } - if (StringUtils.isNotBlank(dto.getAssertedAlleleCurie())) { - Allele assertedAllele = alleleDAO.find(dto.getAssertedAlleleCurie()); + if (StringUtils.isNotBlank(dto.getAssertedAlleleIdentifier())) { + Allele assertedAllele = alleleDAO.findByIdentifierString(dto.getAssertedAlleleIdentifier()); if (assertedAllele == null) - adaResponse.addErrorMessage("asserted_allele_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAssertedAlleleCurie() + ")"); + adaResponse.addErrorMessage("asserted_allele_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAssertedAlleleIdentifier() + ")"); annotation.setAssertedAllele(assertedAllele); } else { annotation.setAssertedAllele(null); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AffectedGenomicModelDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AffectedGenomicModelDTOValidator.java index dac90ccda..1b245b6a2 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AffectedGenomicModelDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AffectedGenomicModelDTOValidator.java @@ -6,9 +6,11 @@ import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; import org.alliancegenome.curation_api.model.entities.AffectedGenomicModel; +import org.alliancegenome.curation_api.model.entities.Allele; import org.alliancegenome.curation_api.model.entities.VocabularyTerm; import org.alliancegenome.curation_api.model.ingest.dto.AffectedGenomicModelDTO; import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.validation.dto.base.BaseDTOValidator; import org.apache.commons.lang3.StringUtils; @@ -24,27 +26,26 @@ public class AffectedGenomicModelDTOValidator extends BaseDTOValidator { @Inject VocabularyTermService vocabularyTermService; - public AffectedGenomicModel validateAffectedGenomicModelDTO(AffectedGenomicModelDTO dto, BackendBulkDataProvider dataProvider) throws ObjectValidationException { - ObjectResponse agmResponse = new ObjectResponse(); + private ObjectResponse agmResponse = new ObjectResponse(); + public AffectedGenomicModel validateAffectedGenomicModelDTO(AffectedGenomicModelDTO dto, BackendBulkDataProvider dataProvider) throws ObjectValidationException { + AffectedGenomicModel agm = null; - if (StringUtils.isBlank(dto.getCurie())) { - agmResponse.addErrorMessage("curie", ValidationConstants.REQUIRED_MESSAGE); + if (StringUtils.isNotBlank(dto.getModEntityId())) { + SearchResponse response = affectedGenomicModelDAO.findByField("modEntityId", dto.getModEntityId()); + if (response != null && response.getSingleResult() != null) + agm = response.getSingleResult(); } else { - agm = affectedGenomicModelDAO.find(dto.getCurie()); + agmResponse.addErrorMessage("modEntityId", ValidationConstants.REQUIRED_MESSAGE); } if (agm == null) agm = new AffectedGenomicModel(); - agm.setCurie(dto.getCurie()); - - if (StringUtils.isNotBlank(dto.getName())) { - agm.setName(dto.getName()); - } else { - agm.setName(null); - } - + agm.setModEntityId(dto.getModEntityId()); + agm.setModInternalId(handleStringField(dto.getModInternalId())); + agm.setName(handleStringField(dto.getName())); + ObjectResponse geResponse = validateGenomicEntityDTO(agm, dto, dataProvider); agmResponse.addErrorMessages(geResponse.getErrorMessages()); @@ -60,6 +61,8 @@ public AffectedGenomicModel validateAffectedGenomicModelDTO(AffectedGenomicModel agmResponse.addErrorMessage("subtype_name", ValidationConstants.INVALID_MESSAGE + " (" + dto.getSubtypeName() + ")"); } agm.setSubtype(subtype); + + agmResponse.convertErrorMessagesToMap(); if (agmResponse.hasErrors()) { throw new ObjectValidationException(dto, agmResponse.errorMessagesString()); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDTOValidator.java index 6bbc8ef20..f3f505799 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDTOValidator.java @@ -33,6 +33,7 @@ import org.alliancegenome.curation_api.model.ingest.dto.slotAnnotions.alleleSlotAnnotations.AlleleMutationTypeSlotAnnotationDTO; import org.alliancegenome.curation_api.model.ingest.dto.slotAnnotions.alleleSlotAnnotations.AlleleNomenclatureEventSlotAnnotationDTO; import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.ReferenceService; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.helpers.notes.NoteIdentityHelper; @@ -97,16 +98,19 @@ public class AlleleDTOValidator extends BaseDTOValidator { public Allele validateAlleleDTO(AlleleDTO dto, BackendBulkDataProvider dataProvider) throws ObjectValidationException { Allele allele = null; - if (StringUtils.isBlank(dto.getCurie())) { - alleleResponse.addErrorMessage("curie", ValidationConstants.REQUIRED_MESSAGE); + if (StringUtils.isNotBlank(dto.getModEntityId())) { + SearchResponse response = alleleDAO.findByField("modEntityId", dto.getModEntityId()); + if (response != null && response.getSingleResult() != null) + allele = response.getSingleResult(); } else { - allele = alleleDAO.find(dto.getCurie()); + alleleResponse.addErrorMessage("modEntityId", ValidationConstants.REQUIRED_MESSAGE); } if (allele == null) allele = new Allele(); - allele.setCurie(dto.getCurie()); + allele.setModEntityId(dto.getModEntityId()); + allele.setModInternalId(handleStringField(dto.getModInternalId())); ObjectResponse geResponse = validateGenomicEntityDTO(allele, dto, dataProvider); alleleResponse.addErrorMessages(geResponse.getErrorMessages()); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java index 15f239e79..b48f48521 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java @@ -49,16 +49,16 @@ public AlleleDiseaseAnnotation validateAlleleDiseaseAnnotationDTO(AlleleDiseaseA Reference validatedReference = refResponse.getEntity().getSingleReference(); String refCurie = validatedReference == null ? null : validatedReference.getCurie(); - if (StringUtils.isBlank(dto.getAlleleCurie())) { - adaResponse.addErrorMessage("allele_curie", ValidationConstants.REQUIRED_MESSAGE); + if (StringUtils.isBlank(dto.getAlleleIdentifier())) { + adaResponse.addErrorMessage("allele_identifier", ValidationConstants.REQUIRED_MESSAGE); } else { - allele = alleleDAO.find(dto.getAlleleCurie()); + allele = alleleDAO.findByIdentifierString(dto.getAlleleIdentifier()); if (allele == null) { - adaResponse.addErrorMessage("allele_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAlleleCurie() + ")"); + adaResponse.addErrorMessage("allele_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAlleleIdentifier() + ")"); } else { String annotationId; String identifyingField; - String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getAlleleCurie(), refCurie); + String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getAlleleIdentifier(), refCurie); if (StringUtils.isNotBlank(dto.getModEntityId())) { annotationId = dto.getModEntityId(); @@ -82,7 +82,7 @@ public AlleleDiseaseAnnotation validateAlleleDiseaseAnnotationDTO(AlleleDiseaseA if (dataProvider != null && (dataProvider.name().equals("RGD") || dataProvider.name().equals("HUMAN")) && !allele.getTaxon().getCurie().equals(dataProvider.canonicalTaxonCurie) || !dataProvider.sourceOrganization.equals(allele.getDataProvider().getSourceOrganization().getAbbreviation())) { - adaResponse.addErrorMessage("allele_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAlleleCurie() + ") for " + dataProvider.name() + " load"); + adaResponse.addErrorMessage("allele_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAlleleIdentifier() + ") for " + dataProvider.name() + " load"); } } } @@ -101,21 +101,21 @@ public AlleleDiseaseAnnotation validateAlleleDiseaseAnnotationDTO(AlleleDiseaseA adaResponse.addErrorMessage("disease_relation_name", ValidationConstants.REQUIRED_MESSAGE); } - if (StringUtils.isNotBlank(dto.getInferredGeneCurie())) { - Gene inferredGene = geneDAO.find(dto.getInferredGeneCurie()); + if (StringUtils.isNotBlank(dto.getInferredGeneIdentifier())) { + Gene inferredGene = geneDAO.findByIdentifierString(dto.getInferredGeneIdentifier()); if (inferredGene == null) - adaResponse.addErrorMessage("inferred_gene_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getInferredGeneCurie() + ")"); + adaResponse.addErrorMessage("inferred_gene_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getInferredGeneIdentifier() + ")"); annotation.setInferredGene(inferredGene); } else { annotation.setInferredGene(null); } - if (CollectionUtils.isNotEmpty(dto.getAssertedGeneCuries())) { + if (CollectionUtils.isNotEmpty(dto.getAssertedGeneIdentifiers())) { List assertedGenes = new ArrayList<>(); - for (String assertedGeneCurie : dto.getAssertedGeneCuries()) { - Gene assertedGene = geneDAO.find(assertedGeneCurie); + for (String assertedGeneIdentifier : dto.getAssertedGeneIdentifiers()) { + Gene assertedGene = geneDAO.findByIdentifierString(assertedGeneIdentifier); if (assertedGene == null) { - adaResponse.addErrorMessage("asserted_gene_curies", ValidationConstants.INVALID_MESSAGE + " (" + assertedGeneCurie + ")"); + adaResponse.addErrorMessage("asserted_gene_identifiers", ValidationConstants.INVALID_MESSAGE + " (" + assertedGeneIdentifier + ")"); } else { assertedGenes.add(assertedGene); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AnnotationDTOValidator.java index a2fe0d2c9..eb2429177 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AnnotationDTOValidator.java @@ -51,17 +51,8 @@ public ObjectResponse validat ObjectResponse annotResponse = validateAuditedObjectDTO(annotation, dto); annotation = annotResponse.getEntity(); - if (StringUtils.isNotBlank(dto.getModEntityId())) { - annotation.setModEntityId(dto.getModEntityId()); - } else { - annotation.setModEntityId(null); - } - - if (StringUtils.isNotBlank(dto.getModInternalId())) { - annotation.setModInternalId(dto.getModInternalId()); - } else { - annotation.setModInternalId(null); - } + annotation.setModEntityId(handleStringField(dto.getModEntityId())); + annotation.setModInternalId(handleStringField(dto.getModInternalId())); if (dto.getDataProviderDto() == null) { annotResponse.addErrorMessage("data_provider_dto", ValidationConstants.REQUIRED_MESSAGE); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java index ce0daf9ca..fafe08894 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java @@ -84,15 +84,15 @@ public ObjectRespo annotation.setNegated(false); } - if (CollectionUtils.isNotEmpty(dto.getWithGeneCuries())) { + if (CollectionUtils.isNotEmpty(dto.getWithGeneIdentifiers())) { List withGenes = new ArrayList<>(); - for (String withCurie : dto.getWithGeneCuries()) { - if (!withCurie.startsWith("HGNC:")) { - daResponse.addErrorMessage("with_gene_curies", ValidationConstants.INVALID_MESSAGE + " (" + withCurie + ")"); + for (String withIdentifier : dto.getWithGeneIdentifiers()) { + if (!withIdentifier.startsWith("HGNC:")) { + daResponse.addErrorMessage("with_gene_identifiers", ValidationConstants.INVALID_MESSAGE + " (" + withIdentifier + ")"); } else { - Gene withGene = geneDAO.getByIdOrCurie(withCurie); + Gene withGene = geneDAO.findByIdentifierString(withIdentifier); if (withGene == null) { - daResponse.addErrorMessage("with_gene_curies", ValidationConstants.INVALID_MESSAGE + " (" + withCurie + ")"); + daResponse.addErrorMessage("with_gene_identifiers", ValidationConstants.INVALID_MESSAGE + " (" + withIdentifier + ")"); } else { withGenes.add(withGene); } @@ -129,21 +129,21 @@ public ObjectRespo annotation.setDiseaseQualifiers(null); } - if (CollectionUtils.isNotEmpty(dto.getDiseaseGeneticModifierCuries()) || StringUtils.isNotBlank(dto.getDiseaseGeneticModifierRelationName())) { - if (CollectionUtils.isEmpty(dto.getDiseaseGeneticModifierCuries())) { - daResponse.addErrorMessage("disease_genetic_modifier_relation_name", ValidationConstants.DEPENDENCY_MESSAGE_PREFIX + "disease_genetic_modifier_curies"); + if (CollectionUtils.isNotEmpty(dto.getDiseaseGeneticModifierIdentifiers()) || StringUtils.isNotBlank(dto.getDiseaseGeneticModifierRelationName())) { + if (CollectionUtils.isEmpty(dto.getDiseaseGeneticModifierIdentifiers())) { + daResponse.addErrorMessage("disease_genetic_modifier_relation_name", ValidationConstants.DEPENDENCY_MESSAGE_PREFIX + "disease_genetic_modifier_identifiers"); } else if (StringUtils.isBlank(dto.getDiseaseGeneticModifierRelationName())) { - daResponse.addErrorMessage("disease_genetic_modifier_curies", ValidationConstants.DEPENDENCY_MESSAGE_PREFIX + "disease_genetic_modifier_relation_name"); + daResponse.addErrorMessage("disease_genetic_modifier_identifiers", ValidationConstants.DEPENDENCY_MESSAGE_PREFIX + "disease_genetic_modifier_relation_name"); } else { VocabularyTerm diseaseGeneticModifierRelation = vocabularyTermService.getTermInVocabulary(VocabularyConstants.DISEASE_GENETIC_MODIFIER_RELATION_VOCABULARY, dto.getDiseaseGeneticModifierRelationName()).getEntity(); if (diseaseGeneticModifierRelation == null) daResponse.addErrorMessage("disease_genetic_modifier_relation_name", ValidationConstants.INVALID_MESSAGE + " (" + dto.getDiseaseGeneticModifierRelationName() + ")"); List diseaseGeneticModifiers = new ArrayList<>(); - for (String modifierCurie : dto.getDiseaseGeneticModifierCuries()) { - BiologicalEntity diseaseGeneticModifier = biologicalEntityDAO.find(modifierCurie); + for (String modifierIdentifier : dto.getDiseaseGeneticModifierIdentifiers()) { + BiologicalEntity diseaseGeneticModifier = biologicalEntityDAO.findByIdentifierString(modifierIdentifier); if (diseaseGeneticModifier == null) { - daResponse.addErrorMessage("disease_genetic_modifier_curies", ValidationConstants.INVALID_MESSAGE + " (" + modifierCurie + ")"); + daResponse.addErrorMessage("disease_genetic_modifier_identifiers", ValidationConstants.INVALID_MESSAGE + " (" + modifierIdentifier + ")"); } else { diseaseGeneticModifiers.add(diseaseGeneticModifier); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java index c31eb4c22..acab94ca1 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java @@ -103,7 +103,7 @@ public ObjectResponse validateExperimentalConditionDTO(Ex NCBITaxonTerm conditionTaxon = null; if (StringUtils.isNotBlank(dto.getConditionTaxonCurie())) { - conditionTaxon = ncbiTaxonTermDAO.find(dto.getConditionTaxonCurie()); + conditionTaxon = ncbiTaxonTermDAO.findByCurie(dto.getConditionTaxonCurie()); if (conditionTaxon == null) { conditionTaxon = ncbiTaxonTermDAO.downloadAndSave(dto.getConditionTaxonCurie()); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDTOValidator.java index df0d2e4b3..28c11354d 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDTOValidator.java @@ -9,6 +9,7 @@ import org.alliancegenome.curation_api.dao.GeneDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; +import org.alliancegenome.curation_api.model.entities.Allele; import org.alliancegenome.curation_api.model.entities.Gene; import org.alliancegenome.curation_api.model.entities.slotAnnotations.geneSlotAnnotations.GeneFullNameSlotAnnotation; import org.alliancegenome.curation_api.model.entities.slotAnnotations.geneSlotAnnotations.GeneSecondaryIdSlotAnnotation; @@ -19,6 +20,7 @@ import org.alliancegenome.curation_api.model.ingest.dto.slotAnnotions.NameSlotAnnotationDTO; import org.alliancegenome.curation_api.model.ingest.dto.slotAnnotions.SecondaryIdSlotAnnotationDTO; import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.helpers.slotAnnotations.SlotAnnotationIdentityHelper; import org.alliancegenome.curation_api.services.validation.dto.base.BaseDTOValidator; import org.alliancegenome.curation_api.services.validation.dto.slotAnnotations.geneSlotAnnotations.GeneFullNameSlotAnnotationDTOValidator; @@ -57,16 +59,19 @@ public class GeneDTOValidator extends BaseDTOValidator { public Gene validateGeneDTO(GeneDTO dto, BackendBulkDataProvider dataProvider) throws ObjectValidationException { Gene gene = null; - if (StringUtils.isBlank(dto.getCurie())) { - geneResponse.addErrorMessage("curie", ValidationConstants.REQUIRED_MESSAGE); + if (StringUtils.isNotBlank(dto.getModEntityId())) { + SearchResponse response = geneDAO.findByField("modEntityId", dto.getModEntityId()); + if (response != null && response.getSingleResult() != null) + gene = response.getSingleResult(); } else { - gene = geneDAO.find(dto.getCurie()); + geneResponse.addErrorMessage("modEntityId", ValidationConstants.REQUIRED_MESSAGE); } if (gene == null) gene = new Gene(); - gene.setCurie(dto.getCurie()); + gene.setModEntityId(dto.getModEntityId()); + gene.setModInternalId(handleStringField(dto.getModInternalId())); ObjectResponse geResponse = validateGenomicEntityDTO(gene, dto, dataProvider); geneResponse.addErrorMessages(geResponse.getErrorMessages()); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java index d69d843f0..3e10c721f 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java @@ -51,16 +51,16 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat Reference validatedReference = refResponse.getEntity().getSingleReference(); String refCurie = validatedReference == null ? null : validatedReference.getCurie(); - if (StringUtils.isBlank(dto.getGeneCurie())) { - gdaResponse.addErrorMessage("gene_curie", ValidationConstants.REQUIRED_MESSAGE); + if (StringUtils.isBlank(dto.getGeneIdentifier())) { + gdaResponse.addErrorMessage("gene_identifier", ValidationConstants.REQUIRED_MESSAGE); } else { - gene = geneDAO.find(dto.getGeneCurie()); + gene = geneDAO.findByIdentifierString(dto.getGeneIdentifier()); if (gene == null) { - gdaResponse.addErrorMessage("gene_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGeneCurie() + ")"); + gdaResponse.addErrorMessage("gene_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGeneIdentifier() + ")"); } else { String annotationId; String identifyingField; - String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getGeneCurie(), refCurie); + String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getGeneIdentifier(), refCurie); if (StringUtils.isNotBlank(dto.getModEntityId())) { annotationId = dto.getModEntityId(); @@ -84,7 +84,7 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat if (dataProvider != null && (dataProvider.name().equals("RGD") || dataProvider.name().equals("HUMAN")) && !gene.getTaxon().getCurie().equals(dataProvider.canonicalTaxonCurie) || !dataProvider.sourceOrganization.equals(gene.getDataProvider().getSourceOrganization().getAbbreviation())) { - gdaResponse.addErrorMessage("gene_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGeneCurie() + ") for " + dataProvider.name() + " load"); + gdaResponse.addErrorMessage("gene_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGeneIdentifier() + ") for " + dataProvider.name() + " load"); } } } @@ -92,10 +92,10 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat annotation.setSingleReference(validatedReference); AffectedGenomicModel sgdStrainBackground = null; - if (StringUtils.isNotBlank(dto.getSgdStrainBackgroundCurie())) { - sgdStrainBackground = affectedGenomicModelDAO.find(dto.getSgdStrainBackgroundCurie()); + if (StringUtils.isNotBlank(dto.getSgdStrainBackgroundIdentifier())) { + sgdStrainBackground = affectedGenomicModelDAO.findByIdentifierString(dto.getSgdStrainBackgroundIdentifier()); if (sgdStrainBackground == null || !sgdStrainBackground.getTaxon().getName().startsWith("Saccharomyces cerevisiae")) { - gdaResponse.addErrorMessage("sgd_strain_background_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getSgdStrainBackgroundCurie() + ")"); + gdaResponse.addErrorMessage("sgd_strain_background_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getSgdStrainBackgroundIdentifier() + ")"); } } annotation.setSgdStrainBackground(sgdStrainBackground); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ReagentDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ReagentDTOValidator.java index 4b9d7c3d7..316883601 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ReagentDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ReagentDTOValidator.java @@ -24,23 +24,10 @@ public ObjectResponse validateReage ObjectResponse reagentResponse = validateAuditedObjectDTO(reagent, dto); reagent = reagentResponse.getEntity(); - if (StringUtils.isNotBlank(dto.getModEntityId())) { - reagent.setModEntityId(dto.getModEntityId()); - } else { - reagent.setModEntityId(null); - } + reagent.setModEntityId(handleStringField(dto.getModEntityId())); + reagent.setModInternalId(handleStringField(dto.getModInternalId())); - if (StringUtils.isNotBlank(dto.getModInternalId())) { - reagent.setModInternalId(dto.getModInternalId()); - } else { - reagent.setModInternalId(null); - } - - if (CollectionUtils.isNotEmpty(dto.getSecondaryIdentifiers())) { - reagent.setSecondaryIdentifiers(dto.getSecondaryIdentifiers()); - } else { - reagent.setSecondaryIdentifiers(null); - } + reagent.setSecondaryIdentifiers(handleStringListField(dto.getSecondaryIdentifiers())); if (dto.getDataProviderDto() == null) { reagentResponse.addErrorMessage("data_provider_dto", ValidationConstants.REQUIRED_MESSAGE); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java index 2ba1ae492..42cf8ac68 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java @@ -9,12 +9,14 @@ import org.alliancegenome.curation_api.dao.VariantDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; +import org.alliancegenome.curation_api.model.entities.Allele; import org.alliancegenome.curation_api.model.entities.Note; import org.alliancegenome.curation_api.model.entities.Variant; import org.alliancegenome.curation_api.model.entities.VocabularyTerm; import org.alliancegenome.curation_api.model.entities.ontology.SOTerm; import org.alliancegenome.curation_api.model.ingest.dto.VariantDTO; import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.helpers.notes.NoteIdentityHelper; import org.alliancegenome.curation_api.services.ontology.SoTermService; @@ -46,16 +48,25 @@ public class VariantDTOValidator extends BaseDTOValidator { public Variant validateVariantDTO(VariantDTO dto, BackendBulkDataProvider dataProvider) throws ObjectValidationException { Variant variant = null; - if (StringUtils.isBlank(dto.getCurie())) { - variantResponse.addErrorMessage("curie", ValidationConstants.REQUIRED_MESSAGE); + if (StringUtils.isNotBlank(dto.getModEntityId())) { + SearchResponse response = variantDAO.findByField("modEntityId", dto.getModEntityId()); + if (response != null && response.getSingleResult() != null) + variant = response.getSingleResult(); } else { - variant = variantDAO.find(dto.getCurie()); + if (StringUtils.isBlank(dto.getModInternalId())) { + variantResponse.addErrorMessage("modInternalId", ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId"); + } else { + SearchResponse response = variantDAO.findByField("modInternalId", dto.getModInternalId()); + if (response != null && response.getSingleResult() != null) + variant = response.getSingleResult(); + } } if (variant == null) variant = new Variant(); - variant.setCurie(dto.getCurie()); + variant.setModEntityId(dto.getModEntityId()); + variant.setModInternalId(dto.getModInternalId()); ObjectResponse geResponse = validateGenomicEntityDTO(variant, dto, dataProvider); variantResponse.addErrorMessages(geResponse.getErrorMessages()); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java index f3e4254b2..1e1ad4719 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java @@ -34,13 +34,37 @@ public class AlleleGeneAssociationDTOValidator extends AlleleGenomicEntityAssoci public AlleleGeneAssociation validateAlleleGeneAssociationDTO(AlleleGeneAssociationDTO dto, BackendBulkDataProvider beDataProvider) throws ObjectValidationException { ObjectResponse agaResponse = new ObjectResponse(); - + + Allele subject = null; + if (StringUtils.isBlank(dto.getAlleleIdentifier())) { + agaResponse.addErrorMessage("allele_identifier", ValidationConstants.REQUIRED_MESSAGE); + } else { + subject = alleleDAO.findByIdentifierString(dto.getAlleleIdentifier()); + if (subject == null) { + agaResponse.addErrorMessage("allele_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAlleleIdentifier() + ")"); + } else if (beDataProvider != null && !subject.getDataProvider().getSourceOrganization().getAbbreviation().equals(beDataProvider.sourceOrganization)) { + agaResponse.addErrorMessage("allele_identifier", ValidationConstants.INVALID_MESSAGE + " for " + beDataProvider.name() + " load (" + dto.getAlleleIdentifier() + ")"); + } + } + + Gene object = null; + if (StringUtils.isBlank(dto.getGeneIdentifier())) { + agaResponse.addErrorMessage("gene_identifier", ValidationConstants.REQUIRED_MESSAGE); + } else { + object = geneDAO.findByIdentifierString(dto.getGeneIdentifier()); + if (object == null) { + agaResponse.addErrorMessage("gene_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGeneIdentifier() + ")"); + } else if (beDataProvider != null && !subject.getDataProvider().getSourceOrganization().getAbbreviation().equals(beDataProvider.sourceOrganization)) { + agaResponse.addErrorMessage("gene_identifier", ValidationConstants.INVALID_MESSAGE + " for " + beDataProvider.name() + " load (" + dto.getGeneIdentifier() + ")"); + } + } + AlleleGeneAssociation association = null; - if (StringUtils.isNotBlank(dto.getAlleleCurie()) && StringUtils.isNotBlank(dto.getGeneCurie()) && StringUtils.isNotBlank(dto.getRelationName())) { + if (subject != null && object != null && StringUtils.isNotBlank(dto.getRelationName())) { HashMap params = new HashMap<>(); - params.put("subject.curie", dto.getAlleleCurie()); + params.put("subject.id", subject.getId()); params.put("relation.name", dto.getRelationName()); - params.put("object.curie", dto.getGeneCurie()); + params.put("object.id", object.getId()); SearchResponse searchResponse = alleleGeneAssociationDAO.findByParams(params); if (searchResponse != null && searchResponse.getResults().size() == 1) { @@ -50,31 +74,13 @@ public AlleleGeneAssociation validateAlleleGeneAssociationDTO(AlleleGeneAssociat if (association == null) association = new AlleleGeneAssociation(); + association.setSubject(subject); + association.setObject(object); + ObjectResponse ageaResponse = validateAlleleGenomicEntityAssociationDTO(association, dto); agaResponse.addErrorMessages(ageaResponse.getErrorMessages()); association = (AlleleGeneAssociation) ageaResponse.getEntity(); - if (StringUtils.isBlank(dto.getAlleleCurie())) { - agaResponse.addErrorMessage("allele_curie", ValidationConstants.REQUIRED_MESSAGE); - } else { - Allele allele = alleleDAO.find(dto.getAlleleCurie()); - if (allele == null) { - agaResponse.addErrorMessage("allele_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAlleleCurie() + ")"); - } else if (beDataProvider != null && !allele.getDataProvider().getSourceOrganization().getAbbreviation().equals(beDataProvider.sourceOrganization)) { - agaResponse.addErrorMessage("allele_curie", ValidationConstants.INVALID_MESSAGE + " for " + beDataProvider.name() + " load"); - } - association.setSubject(allele); - } - - if (StringUtils.isBlank(dto.getGeneCurie())) { - agaResponse.addErrorMessage("gene_curie", ValidationConstants.REQUIRED_MESSAGE); - } else { - Gene gene = geneDAO.find(dto.getGeneCurie()); - if (gene == null) - agaResponse.addErrorMessage("gene_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGeneCurie() + ")"); - association.setObject(gene); - } - if (StringUtils.isNotEmpty(dto.getRelationName())) { VocabularyTerm relation = vocabularyTermService.getTermInVocabularyTermSet(VocabularyConstants.ALLELE_GENE_RELATION_VOCABULARY_TERM_SET, dto.getRelationName()).getEntity(); if (relation == null) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java index ecd38d04e..d8da968fc 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java @@ -63,20 +63,28 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati assocResponse.addErrorMessage("construct_identifier", ValidationConstants.INVALID_MESSAGE); } else { construct = res.getSingleResult(); - if (beDataProvider != null && !construct.getDataProvider().getSourceOrganization().getAbbreviation().equals(beDataProvider.sourceOrganization)) { + if (beDataProvider != null && !construct.getDataProvider().getSourceOrganization().getAbbreviation().equals(beDataProvider.sourceOrganization)) assocResponse.addErrorMessage("construct_identifier", ValidationConstants.INVALID_MESSAGE + " for " + beDataProvider.name() + " load"); - } } } else { assocResponse.addErrorMessage("construct_identifier", ValidationConstants.REQUIRED_MESSAGE); } + GenomicEntity genomicEntity = null; + if (StringUtils.isBlank(dto.getGenomicEntityIdentifier())) { + assocResponse.addErrorMessage("genomic_entity_identifier", ValidationConstants.REQUIRED_MESSAGE); + } else { + genomicEntity = genomicEntityDAO.findByIdentifierString(dto.getGenomicEntityIdentifier()); + if (genomicEntity == null) + assocResponse.addErrorMessage("genomic_entity_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGenomicEntityIdentifier() + ")"); + } + ConstructGenomicEntityAssociation association = null; - if (construct != null && StringUtils.isNotBlank(dto.getGenomicEntityRelationName()) && StringUtils.isNotBlank(dto.getGenomicEntityCurie())) { + if (construct != null && StringUtils.isNotBlank(dto.getGenomicEntityRelationName()) && genomicEntity != null) { HashMap params = new HashMap<>(); params.put("subject.id", construct.getId()); params.put("relation.name", dto.getGenomicEntityRelationName()); - params.put("object.curie", dto.getGenomicEntityCurie()); + params.put("object.id", genomicEntity.getId()); SearchResponse searchResponse = constructGenomicEntityAssociationDAO.findByParams(params); if (searchResponse != null && searchResponse.getResults().size() == 1) { @@ -87,20 +95,12 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati association = new ConstructGenomicEntityAssociation(); association.setSubject(construct); + association.setObject(genomicEntity); ObjectResponse eviResponse = validateEvidenceAssociationDTO(association, dto); assocResponse.addErrorMessages(eviResponse.getErrorMessages()); association = eviResponse.getEntity(); - if (StringUtils.isBlank(dto.getGenomicEntityCurie())) { - assocResponse.addErrorMessage("genomic_entity_curie", ValidationConstants.REQUIRED_MESSAGE); - } else { - GenomicEntity genomicEntity = genomicEntityDAO.find(dto.getGenomicEntityCurie()); - if (genomicEntity == null) - assocResponse.addErrorMessage("genomic_entity_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGenomicEntityCurie() + ")"); - association.setObject(genomicEntity); - } - if (StringUtils.isNotEmpty(dto.getGenomicEntityRelationName())) { VocabularyTerm relation = vocabularyTermService.getTermInVocabularyTermSet(VocabularyConstants.CONSTRUCT_GENOMIC_ENTITY_RELATION_VOCABULARY_TERM_SET, dto.getGenomicEntityRelationName()).getEntity(); if (relation == null) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseDTOValidator.java index 80f01b601..50e42bb88 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseDTOValidator.java @@ -2,6 +2,7 @@ import java.time.OffsetDateTime; import java.time.format.DateTimeParseException; +import java.util.List; import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.dao.DataProviderDAO; @@ -20,6 +21,7 @@ import org.alliancegenome.curation_api.services.PersonService; import org.alliancegenome.curation_api.services.ontology.NcbiTaxonTermService; import org.alliancegenome.curation_api.services.validation.dto.DataProviderDTOValidator; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.RequestScoped; @@ -142,4 +144,18 @@ public ObjectResponse v return geResponse; } + + public String handleStringField(String string) { + if (StringUtils.isNotBlank(string)) + return string; + + return null; + } + + public List handleStringListField(List list) { + if (CollectionUtils.isEmpty(list)) + return null; + + return list; + } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java index 1b861a939..f77495815 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java @@ -45,39 +45,27 @@ public GeneToGeneOrthologyGenerated validateOrthologyFmsDTO(OrthologyFmsDTO dto) ObjectResponse orthologyResponse = new ObjectResponse(); - String subjectGeneCurie = null; - String objectGeneCurie = null; + String subjectGeneIdentifier = null; + String objectGeneIdentifier = null; GeneToGeneOrthologyGenerated orthoPair = null; if (StringUtils.isBlank(dto.getGene1())) { orthologyResponse.addErrorMessage("gene1", ValidationConstants.REQUIRED_MESSAGE); } else { - subjectGeneCurie = convertToAgrCurie(dto.getGene1(), dto.getGene1Species()); + subjectGeneIdentifier = convertToModCurie(dto.getGene1(), dto.getGene1Species()); } if (StringUtils.isBlank(dto.getGene2())) { orthologyResponse.addErrorMessage("gene2", ValidationConstants.REQUIRED_MESSAGE); } else { - objectGeneCurie = convertToAgrCurie(dto.getGene2(), dto.getGene2Species()); + objectGeneIdentifier = convertToModCurie(dto.getGene2(), dto.getGene2Species()); } - if (subjectGeneCurie != null && objectGeneCurie != null) { - Map params = new HashMap<>(); - params.put("subjectGene.curie", subjectGeneCurie); - params.put("objectGene.curie", objectGeneCurie); - SearchResponse searchResponse = generatedOrthologyDAO.findByParams(params); - if (searchResponse != null && searchResponse.getSingleResult() != null) - orthoPair = searchResponse.getSingleResult(); - } - - if (orthoPair == null) - orthoPair = new GeneToGeneOrthologyGenerated(); - Gene subjectGene = null; if (StringUtils.isNotBlank(dto.getGene1())) { - subjectGene = geneDAO.find(subjectGeneCurie); + subjectGene = geneDAO.findByIdentifierString(subjectGeneIdentifier); if (subjectGene == null) { - orthologyResponse.addErrorMessage("gene1", ValidationConstants.INVALID_MESSAGE + " (" + subjectGeneCurie + ")"); + orthologyResponse.addErrorMessage("gene1", ValidationConstants.INVALID_MESSAGE + " (" + subjectGeneIdentifier + ")"); } else { if (dto.getGene1Species() == null) { orthologyResponse.addErrorMessage("gene1Species", ValidationConstants.REQUIRED_MESSAGE); @@ -92,13 +80,12 @@ public GeneToGeneOrthologyGenerated validateOrthologyFmsDTO(OrthologyFmsDTO dto) } } } - orthoPair.setSubjectGene(subjectGene); Gene objectGene = null; if (StringUtils.isNotBlank(dto.getGene2())) { - objectGene = geneDAO.find(objectGeneCurie); + objectGene = geneDAO.findByIdentifierString(objectGeneIdentifier); if (objectGene == null) { - orthologyResponse.addErrorMessage("gene2", ValidationConstants.INVALID_MESSAGE + " (" + objectGeneCurie + ")"); + orthologyResponse.addErrorMessage("gene2", ValidationConstants.INVALID_MESSAGE + " (" + objectGeneIdentifier + ")"); } else { if (dto.getGene2Species() == null) { orthologyResponse.addErrorMessage("gene2Species", ValidationConstants.REQUIRED_MESSAGE); @@ -113,6 +100,20 @@ public GeneToGeneOrthologyGenerated validateOrthologyFmsDTO(OrthologyFmsDTO dto) } } } + + if (subjectGene != null && objectGene != null) { + Map params = new HashMap<>(); + params.put("subjectGene.id", subjectGene.getId()); + params.put("objectGene.id", objectGene.getId()); + SearchResponse searchResponse = generatedOrthologyDAO.findByParams(params); + if (searchResponse != null && searchResponse.getSingleResult() != null) + orthoPair = searchResponse.getSingleResult(); + } + + if (orthoPair == null) + orthoPair = new GeneToGeneOrthologyGenerated(); + + orthoPair.setSubjectGene(subjectGene); orthoPair.setObjectGene(objectGene); VocabularyTerm isBestScore = null; @@ -212,7 +213,7 @@ private boolean sameGenus(NCBITaxonTerm taxon, NCBITaxonTerm geneTaxon) { return false; } - private String convertToAgrCurie(String curie, Integer taxonId) { + private String convertToModCurie(String curie, Integer taxonId) { curie = curie.replaceFirst("^DRSC:", ""); if (curie.indexOf(":") == -1) { String prefix = BackendBulkDataProvider.getCuriePrefixFromTaxonId(taxonId); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/SlotAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/SlotAnnotationValidator.java index 3bf225d3b..00d1cf88c 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/SlotAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/SlotAnnotationValidator.java @@ -15,7 +15,7 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.InformationContentEntityService; import org.alliancegenome.curation_api.services.helpers.constructs.ConstructUniqueIdHelper; -import org.alliancegenome.curation_api.services.validation.AuditedObjectValidator; +import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -66,8 +66,12 @@ public List validateEvidence(E uiEntity, E dbEntity) { public Allele validateSingleAllele(Allele uiAllele, Allele dbAllele) { String field = "singleAllele"; - - Allele allele = alleleDAO.find(uiAllele.getCurie()); + if (uiAllele == null || uiAllele.getId() == null) { + addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); + return null; + } + + Allele allele = alleleDAO.find(uiAllele.getId()); if (allele == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; @@ -82,26 +86,11 @@ public Allele validateSingleAllele(Allele uiAllele, Allele dbAllele) { public Construct validateSingleConstruct(Construct uiConstruct, Construct dbConstruct) { String field = "singleConstruct"; - - String constructId; - String identifyingField; - if (StringUtils.isNotBlank(uiConstruct.getModEntityId())) { - constructId = uiConstruct.getModEntityId(); - identifyingField = "modEntityId"; - } else if (StringUtils.isNotBlank(uiConstruct.getModInternalId())) { - constructId = uiConstruct.getModInternalId(); - identifyingField = "modInternalId"; - } else { - constructId = ConstructUniqueIdHelper.getConstructUniqueId(uiConstruct); - identifyingField = "uniqueId"; - } - - Construct construct = null; - SearchResponse constructList = constructDAO.findByField(identifyingField, constructId); - if (constructList != null && constructList.getResults().size() > 0) { - construct = constructList.getResults().get(0); + if (uiConstruct == null || uiConstruct.getId() == null) { + addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); } + Construct construct = constructDAO.find(uiConstruct.getId()); if (construct == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; @@ -116,8 +105,12 @@ public Construct validateSingleConstruct(Construct uiConstruct, Construct dbCons public Gene validateSingleGene(Gene uiGene, Gene dbGene) { String field = "singleGene"; - - Gene gene = geneDAO.find(uiGene.getCurie()); + if (uiGene == null || uiGene.getId() == null) { + addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); + return null; + } + + Gene gene = geneDAO.find(uiGene.getId()); if (gene == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationValidator.java index 703ae9867..28c0a619b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationValidator.java @@ -113,11 +113,11 @@ public PhenotypeTerm validatePhenotypeTerm(AlleleFunctionalImpactSlotAnnotation if (uiEntity.getPhenotypeTerm() == null) return null; - PhenotypeTerm phenotypeTerm = phenotypeTermDAO.find(uiEntity.getPhenotypeTerm().getCurie()); + PhenotypeTerm phenotypeTerm = phenotypeTermDAO.find(uiEntity.getPhenotypeTerm().getId()); if (phenotypeTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; - } else if (phenotypeTerm.getObsolete() && (dbEntity.getPhenotypeTerm() == null || !phenotypeTerm.getCurie().equals(dbEntity.getPhenotypeTerm().getCurie()))) { + } else if (phenotypeTerm.getObsolete() && (dbEntity.getPhenotypeTerm() == null || !phenotypeTerm.getId().equals(dbEntity.getPhenotypeTerm().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationValidator.java index e9b979c3c..51790886b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationValidator.java @@ -106,11 +106,11 @@ public PhenotypeTerm validatePhenotypeTerm(AlleleInheritanceModeSlotAnnotation u if (uiEntity.getPhenotypeTerm() == null) return null; - PhenotypeTerm phenotypeTerm = phenotypeTermDAO.find(uiEntity.getPhenotypeTerm().getCurie()); + PhenotypeTerm phenotypeTerm = phenotypeTermDAO.find(uiEntity.getPhenotypeTerm().getId()); if (phenotypeTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; - } else if (phenotypeTerm.getObsolete() && (dbEntity.getPhenotypeTerm() == null || !phenotypeTerm.getCurie().equals(dbEntity.getPhenotypeTerm().getCurie()))) { + } else if (phenotypeTerm.getObsolete() && (dbEntity.getPhenotypeTerm() == null || !phenotypeTerm.getId().equals(dbEntity.getPhenotypeTerm().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotationValidator.java index f053e9b9b..dbfde8702 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotationValidator.java @@ -2,6 +2,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.dao.ontology.SoTermDAO; @@ -80,13 +81,16 @@ private List validateMutationTypes(AlleleMutationTypeSlotAnnotation uiEn return null; } List validMutationTypes = new ArrayList<>(); + List previousIds = new ArrayList(); + if (CollectionUtils.isNotEmpty(dbEntity.getMutationTypes())) + previousIds = dbEntity.getMutationTypes().stream().map(SOTerm::getId).collect(Collectors.toList()); for (SOTerm mt : uiEntity.getMutationTypes()) { - SOTerm mutationType = soTermDAO.find(mt.getCurie()); + SOTerm mutationType = soTermDAO.find(mt.getId()); if (mutationType == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (mutationType.getObsolete() && (CollectionUtils.isEmpty(dbEntity.getMutationTypes()) || !dbEntity.getMutationTypes().contains(mutationType))) { + if (mutationType.getObsolete() && (CollectionUtils.isEmpty(dbEntity.getMutationTypes()) || !previousIds.contains(mutationType.getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/test/resources/bulk/01_gene/AF_01_all_fields.json b/src/test/resources/bulk/01_gene/AF_01_all_fields.json index fb2edc3b7..8de8dae37 100644 --- a/src/test/resources/bulk/01_gene/AF_01_all_fields.json +++ b/src/test/resources/bulk/01_gene/AF_01_all_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:Gene0001", + "mod_entity_id": "GENETEST:Gene0001", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/EN_01_empty_non_required_fields.json b/src/test/resources/bulk/01_gene/EN_01_empty_non_required_fields.json index 6a7eb3a32..9e4b3d71f 100644 --- a/src/test/resources/bulk/01_gene/EN_01_empty_non_required_fields.json +++ b/src/test/resources/bulk/01_gene/EN_01_empty_non_required_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:EN01", + "mod_entity_id": "GENETEST:EN01", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/ER_01_empty_curie.json b/src/test/resources/bulk/01_gene/ER_01_empty_curie.json index 89607037d..8046374f7 100644 --- a/src/test/resources/bulk/01_gene/ER_01_empty_curie.json +++ b/src/test/resources/bulk/01_gene/ER_01_empty_curie.json @@ -1,6 +1,6 @@ [ { - "curie": "", + "mod_entity_id": "", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/ER_02_empty_taxon.json b/src/test/resources/bulk/01_gene/ER_02_empty_taxon.json index 7e0ffdd63..322d2117c 100644 --- a/src/test/resources/bulk/01_gene/ER_02_empty_taxon.json +++ b/src/test/resources/bulk/01_gene/ER_02_empty_taxon.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER02", + "mod_entity_id": "GENETEST:ER02", "taxon_curie": "", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/ER_03_empty_gene_symbol_display_text.json b/src/test/resources/bulk/01_gene/ER_03_empty_gene_symbol_display_text.json index 0e3e52998..bce150f7f 100644 --- a/src/test/resources/bulk/01_gene/ER_03_empty_gene_symbol_display_text.json +++ b/src/test/resources/bulk/01_gene/ER_03_empty_gene_symbol_display_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER03", + "mod_entity_id": "GENETEST:ER03", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/ER_04_empty_gene_full_name_display_text.json b/src/test/resources/bulk/01_gene/ER_04_empty_gene_full_name_display_text.json index 27bbfb32c..a677f1bfe 100644 --- a/src/test/resources/bulk/01_gene/ER_04_empty_gene_full_name_display_text.json +++ b/src/test/resources/bulk/01_gene/ER_04_empty_gene_full_name_display_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER04", + "mod_entity_id": "GENETEST:ER04", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/ER_05_empty_gene_systematic_name_display_text.json b/src/test/resources/bulk/01_gene/ER_05_empty_gene_systematic_name_display_text.json index d7871e0f9..b61665665 100644 --- a/src/test/resources/bulk/01_gene/ER_05_empty_gene_systematic_name_display_text.json +++ b/src/test/resources/bulk/01_gene/ER_05_empty_gene_systematic_name_display_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER05", + "mod_entity_id": "GENETEST:ER05", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/ER_06_empty_gene_synonym_display_text.json b/src/test/resources/bulk/01_gene/ER_06_empty_gene_synonym_display_text.json index 888e0d0fc..d73378769 100644 --- a/src/test/resources/bulk/01_gene/ER_06_empty_gene_synonym_display_text.json +++ b/src/test/resources/bulk/01_gene/ER_06_empty_gene_synonym_display_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER06", + "mod_entity_id": "GENETEST:ER06", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/ER_07_empty_gene_symbol_format_text.json b/src/test/resources/bulk/01_gene/ER_07_empty_gene_symbol_format_text.json index 0efc56c83..b6b969d1a 100644 --- a/src/test/resources/bulk/01_gene/ER_07_empty_gene_symbol_format_text.json +++ b/src/test/resources/bulk/01_gene/ER_07_empty_gene_symbol_format_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER07", + "mod_entity_id": "GENETEST:ER07", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/ER_08_empty_gene_full_name_format_text.json b/src/test/resources/bulk/01_gene/ER_08_empty_gene_full_name_format_text.json index e4a1e326d..b13598137 100644 --- a/src/test/resources/bulk/01_gene/ER_08_empty_gene_full_name_format_text.json +++ b/src/test/resources/bulk/01_gene/ER_08_empty_gene_full_name_format_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER08", + "mod_entity_id": "GENETEST:ER08", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/ER_09_empty_gene_systematic_name_format_text.json b/src/test/resources/bulk/01_gene/ER_09_empty_gene_systematic_name_format_text.json index 73bfe3ee7..245ddc047 100644 --- a/src/test/resources/bulk/01_gene/ER_09_empty_gene_systematic_name_format_text.json +++ b/src/test/resources/bulk/01_gene/ER_09_empty_gene_systematic_name_format_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER09", + "mod_entity_id": "GENETEST:ER09", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/ER_10_empty_gene_synonym_format_text.json b/src/test/resources/bulk/01_gene/ER_10_empty_gene_synonym_format_text.json index d604e71c8..8adf992ed 100644 --- a/src/test/resources/bulk/01_gene/ER_10_empty_gene_synonym_format_text.json +++ b/src/test/resources/bulk/01_gene/ER_10_empty_gene_synonym_format_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER10", + "mod_entity_id": "GENETEST:ER10", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/ER_11_empty_gene_symbol_name_type.json b/src/test/resources/bulk/01_gene/ER_11_empty_gene_symbol_name_type.json index a05bdf486..ed74c0725 100644 --- a/src/test/resources/bulk/01_gene/ER_11_empty_gene_symbol_name_type.json +++ b/src/test/resources/bulk/01_gene/ER_11_empty_gene_symbol_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER11", + "mod_entity_id": "GENETEST:ER11", "taxon_curie": "", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/ER_12_empty_gene_full_name_name_type.json b/src/test/resources/bulk/01_gene/ER_12_empty_gene_full_name_name_type.json index b0a1862d3..dc9d88a34 100644 --- a/src/test/resources/bulk/01_gene/ER_12_empty_gene_full_name_name_type.json +++ b/src/test/resources/bulk/01_gene/ER_12_empty_gene_full_name_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER12", + "mod_entity_id": "GENETEST:ER12", "taxon_curie": "", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/ER_13_empty_gene_systematic_name_name_type.json b/src/test/resources/bulk/01_gene/ER_13_empty_gene_systematic_name_name_type.json index a54f26705..3bba1ce01 100644 --- a/src/test/resources/bulk/01_gene/ER_13_empty_gene_systematic_name_name_type.json +++ b/src/test/resources/bulk/01_gene/ER_13_empty_gene_systematic_name_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER13", + "mod_entity_id": "GENETEST:ER13", "taxon_curie": "", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/ER_14_empty_gene_synonym_name_type.json b/src/test/resources/bulk/01_gene/ER_14_empty_gene_synonym_name_type.json index d6328c1ae..bc3f864d5 100644 --- a/src/test/resources/bulk/01_gene/ER_14_empty_gene_synonym_name_type.json +++ b/src/test/resources/bulk/01_gene/ER_14_empty_gene_synonym_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER14", + "mod_entity_id": "GENETEST:ER14", "taxon_curie": "", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/ER_15_empty_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/01_gene/ER_15_empty_data_provider_source_organization_abbreviation.json index e6ebfa520..1ef038787 100644 --- a/src/test/resources/bulk/01_gene/ER_15_empty_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/01_gene/ER_15_empty_data_provider_source_organization_abbreviation.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER15", + "mod_entity_id": "GENETEST:ER15", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/ER_16_empty_data_provider_cross_reference_referenced_curie.json b/src/test/resources/bulk/01_gene/ER_16_empty_data_provider_cross_reference_referenced_curie.json index ed59bdf73..81b5ef619 100644 --- a/src/test/resources/bulk/01_gene/ER_16_empty_data_provider_cross_reference_referenced_curie.json +++ b/src/test/resources/bulk/01_gene/ER_16_empty_data_provider_cross_reference_referenced_curie.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER16", + "mod_entity_id": "GENETEST:ER16", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/ER_17_empty_data_provider_cross_reference_display_name.json b/src/test/resources/bulk/01_gene/ER_17_empty_data_provider_cross_reference_display_name.json index e9ac5923d..d9b5da22c 100644 --- a/src/test/resources/bulk/01_gene/ER_17_empty_data_provider_cross_reference_display_name.json +++ b/src/test/resources/bulk/01_gene/ER_17_empty_data_provider_cross_reference_display_name.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER17", + "mod_entity_id": "GENETEST:ER17", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/ER_18_empty_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/01_gene/ER_18_empty_data_provider_cross_reference_prefix.json index f42c09a2b..7f99cc953 100644 --- a/src/test/resources/bulk/01_gene/ER_18_empty_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/01_gene/ER_18_empty_data_provider_cross_reference_prefix.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER18", + "mod_entity_id": "GENETEST:ER18", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/ER_19_empty_data_provider_cross_reference_page_area.json b/src/test/resources/bulk/01_gene/ER_19_empty_data_provider_cross_reference_page_area.json index e7fd981c1..b18cfde30 100644 --- a/src/test/resources/bulk/01_gene/ER_19_empty_data_provider_cross_reference_page_area.json +++ b/src/test/resources/bulk/01_gene/ER_19_empty_data_provider_cross_reference_page_area.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER19", + "mod_entity_id": "GENETEST:ER19", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/ER_20_empty_gene_secondary_id_secondary_id.json b/src/test/resources/bulk/01_gene/ER_20_empty_gene_secondary_id_secondary_id.json index 1691f5a1e..c0b971f31 100644 --- a/src/test/resources/bulk/01_gene/ER_20_empty_gene_secondary_id_secondary_id.json +++ b/src/test/resources/bulk/01_gene/ER_20_empty_gene_secondary_id_secondary_id.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:ER20", + "mod_entity_id": "GENETEST:ER20", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/IV_01_invalid_date_created.json b/src/test/resources/bulk/01_gene/IV_01_invalid_date_created.json index 58fc95202..6790bdcfa 100644 --- a/src/test/resources/bulk/01_gene/IV_01_invalid_date_created.json +++ b/src/test/resources/bulk/01_gene/IV_01_invalid_date_created.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV01", + "mod_entity_id": "GENETEST:IV01", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_02_invalid_date_updated.json b/src/test/resources/bulk/01_gene/IV_02_invalid_date_updated.json index 5d7129d16..a98c2819c 100644 --- a/src/test/resources/bulk/01_gene/IV_02_invalid_date_updated.json +++ b/src/test/resources/bulk/01_gene/IV_02_invalid_date_updated.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV02", + "mod_entity_id": "GENETEST:IV02", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_03_invalid_taxon.json b/src/test/resources/bulk/01_gene/IV_03_invalid_taxon.json index 1087831df..5e5b55f0b 100644 --- a/src/test/resources/bulk/01_gene/IV_03_invalid_taxon.json +++ b/src/test/resources/bulk/01_gene/IV_03_invalid_taxon.json @@ -1,6 +1,6 @@ [ { - "curie": "IV03", + "mod_entity_id": "IV03", "taxon_curie": "NCBITaxon:1009", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_04_invalid_gene_symbol_name_type.json b/src/test/resources/bulk/01_gene/IV_04_invalid_gene_symbol_name_type.json index 424ddbb12..9def50c3d 100644 --- a/src/test/resources/bulk/01_gene/IV_04_invalid_gene_symbol_name_type.json +++ b/src/test/resources/bulk/01_gene/IV_04_invalid_gene_symbol_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV04", + "mod_entity_id": "GENETEST:IV04", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_05_invalid_gene_full_name_name_type.json b/src/test/resources/bulk/01_gene/IV_05_invalid_gene_full_name_name_type.json index dd65e9aa9..d1c6b37a4 100644 --- a/src/test/resources/bulk/01_gene/IV_05_invalid_gene_full_name_name_type.json +++ b/src/test/resources/bulk/01_gene/IV_05_invalid_gene_full_name_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV05", + "mod_entity_id": "GENETEST:IV05", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_06_invalid_gene_systematic_name_name_type.json b/src/test/resources/bulk/01_gene/IV_06_invalid_gene_systematic_name_name_type.json index bb9c09812..f8a85a8b2 100644 --- a/src/test/resources/bulk/01_gene/IV_06_invalid_gene_systematic_name_name_type.json +++ b/src/test/resources/bulk/01_gene/IV_06_invalid_gene_systematic_name_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV06", + "mod_entity_id": "GENETEST:IV06", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_07_invalid_gene_synonym_name_type.json b/src/test/resources/bulk/01_gene/IV_07_invalid_gene_synonym_name_type.json index 0e847b360..8c61f47ab 100644 --- a/src/test/resources/bulk/01_gene/IV_07_invalid_gene_synonym_name_type.json +++ b/src/test/resources/bulk/01_gene/IV_07_invalid_gene_synonym_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV07", + "mod_entity_id": "GENETEST:IV07", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_08_invalid_gene_symbol_synonym_scope.json b/src/test/resources/bulk/01_gene/IV_08_invalid_gene_symbol_synonym_scope.json index 5b903be12..b696e0b3a 100644 --- a/src/test/resources/bulk/01_gene/IV_08_invalid_gene_symbol_synonym_scope.json +++ b/src/test/resources/bulk/01_gene/IV_08_invalid_gene_symbol_synonym_scope.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV08", + "mod_entity_id": "GENETEST:IV08", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_09_invalid_gene_full_name_synonym_scope.json b/src/test/resources/bulk/01_gene/IV_09_invalid_gene_full_name_synonym_scope.json index cd98d5da4..fbf328751 100644 --- a/src/test/resources/bulk/01_gene/IV_09_invalid_gene_full_name_synonym_scope.json +++ b/src/test/resources/bulk/01_gene/IV_09_invalid_gene_full_name_synonym_scope.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV09", + "mod_entity_id": "GENETEST:IV09", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_10_invalid_gene_systematic_name_synonym_scope.json b/src/test/resources/bulk/01_gene/IV_10_invalid_gene_systematic_name_synonym_scope.json index 59e829650..1f7b5a658 100644 --- a/src/test/resources/bulk/01_gene/IV_10_invalid_gene_systematic_name_synonym_scope.json +++ b/src/test/resources/bulk/01_gene/IV_10_invalid_gene_systematic_name_synonym_scope.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV10", + "mod_entity_id": "GENETEST:IV10", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_11_invalid_gene_synonym_synonym_scope.json b/src/test/resources/bulk/01_gene/IV_11_invalid_gene_synonym_synonym_scope.json index 919a015bb..cacf4f6d6 100644 --- a/src/test/resources/bulk/01_gene/IV_11_invalid_gene_synonym_synonym_scope.json +++ b/src/test/resources/bulk/01_gene/IV_11_invalid_gene_synonym_synonym_scope.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV11", + "mod_entity_id": "GENETEST:IV11", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_12_invalid_gene_symbol_evidence.json b/src/test/resources/bulk/01_gene/IV_12_invalid_gene_symbol_evidence.json index ad861512c..d368562b6 100644 --- a/src/test/resources/bulk/01_gene/IV_12_invalid_gene_symbol_evidence.json +++ b/src/test/resources/bulk/01_gene/IV_12_invalid_gene_symbol_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV12", + "mod_entity_id": "GENETEST:IV12", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_13_invalid_gene_full_name_evidence.json b/src/test/resources/bulk/01_gene/IV_13_invalid_gene_full_name_evidence.json index b20525f5d..c08bcab4f 100644 --- a/src/test/resources/bulk/01_gene/IV_13_invalid_gene_full_name_evidence.json +++ b/src/test/resources/bulk/01_gene/IV_13_invalid_gene_full_name_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV13", + "mod_entity_id": "GENETEST:IV13", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_14_invalid_gene_systematic_name_evidence.json b/src/test/resources/bulk/01_gene/IV_14_invalid_gene_systematic_name_evidence.json index 5ef0c9a09..d1bea9873 100644 --- a/src/test/resources/bulk/01_gene/IV_14_invalid_gene_systematic_name_evidence.json +++ b/src/test/resources/bulk/01_gene/IV_14_invalid_gene_systematic_name_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV14", + "mod_entity_id": "GENETEST:IV14", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_15_invalid_gene_synonym_evidence.json b/src/test/resources/bulk/01_gene/IV_15_invalid_gene_synonym_evidence.json index 36ec0edf5..0b93b444b 100644 --- a/src/test/resources/bulk/01_gene/IV_15_invalid_gene_synonym_evidence.json +++ b/src/test/resources/bulk/01_gene/IV_15_invalid_gene_synonym_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV15", + "mod_entity_id": "GENETEST:IV15", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_16_invalid_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/01_gene/IV_16_invalid_data_provider_source_organization_abbreviation.json index f94c91679..025906d64 100644 --- a/src/test/resources/bulk/01_gene/IV_16_invalid_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/01_gene/IV_16_invalid_data_provider_source_organization_abbreviation.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV16", + "mod_entity_id": "GENETEST:IV16", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_17_invalid_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/01_gene/IV_17_invalid_data_provider_cross_reference_prefix.json index 82690061d..63e7fab44 100644 --- a/src/test/resources/bulk/01_gene/IV_17_invalid_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/01_gene/IV_17_invalid_data_provider_cross_reference_prefix.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV17", + "mod_entity_id": "GENETEST:IV17", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_18_invalid_data_provider_cross_reference_page_area.json b/src/test/resources/bulk/01_gene/IV_18_invalid_data_provider_cross_reference_page_area.json index 410031bf6..b5b60c080 100644 --- a/src/test/resources/bulk/01_gene/IV_18_invalid_data_provider_cross_reference_page_area.json +++ b/src/test/resources/bulk/01_gene/IV_18_invalid_data_provider_cross_reference_page_area.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV18", + "mod_entity_id": "GENETEST:IV18", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/IV_19_invalid_gene_secondary_id_evidence.json b/src/test/resources/bulk/01_gene/IV_19_invalid_gene_secondary_id_evidence.json index 91b318e84..68469c5ea 100644 --- a/src/test/resources/bulk/01_gene/IV_19_invalid_gene_secondary_id_evidence.json +++ b/src/test/resources/bulk/01_gene/IV_19_invalid_gene_secondary_id_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IV19", + "mod_entity_id": "GENETEST:IV19", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/MN_01_no_non_required_fields_level_1.json b/src/test/resources/bulk/01_gene/MN_01_no_non_required_fields_level_1.json index 857e40001..26fa33dd6 100644 --- a/src/test/resources/bulk/01_gene/MN_01_no_non_required_fields_level_1.json +++ b/src/test/resources/bulk/01_gene/MN_01_no_non_required_fields_level_1.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MN01", + "mod_entity_id": "GENETEST:MN01", "taxon_curie": "NCBITaxon:6239", "gene_symbol_dto": { "display_text": "Tg1", diff --git a/src/test/resources/bulk/01_gene/MN_02_no_non_required_fields_level_2.json b/src/test/resources/bulk/01_gene/MN_02_no_non_required_fields_level_2.json index 93a54e155..03c4cc582 100644 --- a/src/test/resources/bulk/01_gene/MN_02_no_non_required_fields_level_2.json +++ b/src/test/resources/bulk/01_gene/MN_02_no_non_required_fields_level_2.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MN02", + "mod_entity_id": "GENETEST:MN02", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/MR_02_no_taxon.json b/src/test/resources/bulk/01_gene/MR_02_no_taxon.json index 71c4af57b..1ddf2c697 100644 --- a/src/test/resources/bulk/01_gene/MR_02_no_taxon.json +++ b/src/test/resources/bulk/01_gene/MR_02_no_taxon.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR02", + "mod_entity_id": "GENETEST:MR02", "internal": true, "obsolete": false, "created_by_curie": "GENETEST:Person0001", diff --git a/src/test/resources/bulk/01_gene/MR_03_no_gene_symbol.json b/src/test/resources/bulk/01_gene/MR_03_no_gene_symbol.json index 5703a29e6..ef2ac4272 100644 --- a/src/test/resources/bulk/01_gene/MR_03_no_gene_symbol.json +++ b/src/test/resources/bulk/01_gene/MR_03_no_gene_symbol.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR03", + "mod_entity_id": "GENETEST:MR03", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/MR_04_no_gene_symbol_display_text.json b/src/test/resources/bulk/01_gene/MR_04_no_gene_symbol_display_text.json index dd46ec652..cb3c917b0 100644 --- a/src/test/resources/bulk/01_gene/MR_04_no_gene_symbol_display_text.json +++ b/src/test/resources/bulk/01_gene/MR_04_no_gene_symbol_display_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR04", + "mod_entity_id": "GENETEST:MR04", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/MR_05_no_gene_full_name_display_text.json b/src/test/resources/bulk/01_gene/MR_05_no_gene_full_name_display_text.json index af6055192..4439345a8 100644 --- a/src/test/resources/bulk/01_gene/MR_05_no_gene_full_name_display_text.json +++ b/src/test/resources/bulk/01_gene/MR_05_no_gene_full_name_display_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR05", + "mod_entity_id": "GENETEST:MR05", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/MR_06_no_gene_systematic_name_display_text.json b/src/test/resources/bulk/01_gene/MR_06_no_gene_systematic_name_display_text.json index 8d86e83ce..f926be018 100644 --- a/src/test/resources/bulk/01_gene/MR_06_no_gene_systematic_name_display_text.json +++ b/src/test/resources/bulk/01_gene/MR_06_no_gene_systematic_name_display_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR06", + "mod_entity_id": "GENETEST:MR06", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/MR_07_no_gene_synonym_display_text.json b/src/test/resources/bulk/01_gene/MR_07_no_gene_synonym_display_text.json index b4b3421e9..8be375cf7 100644 --- a/src/test/resources/bulk/01_gene/MR_07_no_gene_synonym_display_text.json +++ b/src/test/resources/bulk/01_gene/MR_07_no_gene_synonym_display_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR07", + "mod_entity_id": "GENETEST:MR07", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/MR_08_no_gene_symbol_format_text.json b/src/test/resources/bulk/01_gene/MR_08_no_gene_symbol_format_text.json index 83634b8d0..7a1bbac7e 100644 --- a/src/test/resources/bulk/01_gene/MR_08_no_gene_symbol_format_text.json +++ b/src/test/resources/bulk/01_gene/MR_08_no_gene_symbol_format_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR08", + "mod_entity_id": "GENETEST:MR08", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/MR_09_no_gene_full_name_format_text.json b/src/test/resources/bulk/01_gene/MR_09_no_gene_full_name_format_text.json index 70aecd07d..82981897c 100644 --- a/src/test/resources/bulk/01_gene/MR_09_no_gene_full_name_format_text.json +++ b/src/test/resources/bulk/01_gene/MR_09_no_gene_full_name_format_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR09", + "mod_entity_id": "GENETEST:MR09", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/MR_10_no_gene_systematic_name_format_text.json b/src/test/resources/bulk/01_gene/MR_10_no_gene_systematic_name_format_text.json index c676ab7dd..e0ebfe171 100644 --- a/src/test/resources/bulk/01_gene/MR_10_no_gene_systematic_name_format_text.json +++ b/src/test/resources/bulk/01_gene/MR_10_no_gene_systematic_name_format_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR10", + "mod_entity_id": "GENETEST:MR10", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/MR_11_no_gene_synonym_format_text.json b/src/test/resources/bulk/01_gene/MR_11_no_gene_synonym_format_text.json index b8c664e6c..39fda4f39 100644 --- a/src/test/resources/bulk/01_gene/MR_11_no_gene_synonym_format_text.json +++ b/src/test/resources/bulk/01_gene/MR_11_no_gene_synonym_format_text.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR11", + "mod_entity_id": "GENETEST:MR11", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/MR_12_no_gene_symbol_name_type.json b/src/test/resources/bulk/01_gene/MR_12_no_gene_symbol_name_type.json index aa73cd305..de01c6279 100644 --- a/src/test/resources/bulk/01_gene/MR_12_no_gene_symbol_name_type.json +++ b/src/test/resources/bulk/01_gene/MR_12_no_gene_symbol_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR12", + "mod_entity_id": "GENETEST:MR12", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/MR_13_no_gene_full_name_name_type.json b/src/test/resources/bulk/01_gene/MR_13_no_gene_full_name_name_type.json index 77aae2f4c..42ab3d545 100644 --- a/src/test/resources/bulk/01_gene/MR_13_no_gene_full_name_name_type.json +++ b/src/test/resources/bulk/01_gene/MR_13_no_gene_full_name_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR13", + "mod_entity_id": "GENETEST:MR13", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/MR_14_no_gene_systematic_name_name_type.json b/src/test/resources/bulk/01_gene/MR_14_no_gene_systematic_name_name_type.json index c9d14f0fb..4da1983b0 100644 --- a/src/test/resources/bulk/01_gene/MR_14_no_gene_systematic_name_name_type.json +++ b/src/test/resources/bulk/01_gene/MR_14_no_gene_systematic_name_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR14", + "mod_entity_id": "GENETEST:MR14", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/MR_15_no_gene_synonym_name_type.json b/src/test/resources/bulk/01_gene/MR_15_no_gene_synonym_name_type.json index 67c36dd73..5a43833dc 100644 --- a/src/test/resources/bulk/01_gene/MR_15_no_gene_synonym_name_type.json +++ b/src/test/resources/bulk/01_gene/MR_15_no_gene_synonym_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR15", + "mod_entity_id": "GENETEST:MR15", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/01_gene/MR_16_no_data_provider.json b/src/test/resources/bulk/01_gene/MR_16_no_data_provider.json index 5545bcc86..e11ca8af1 100644 --- a/src/test/resources/bulk/01_gene/MR_16_no_data_provider.json +++ b/src/test/resources/bulk/01_gene/MR_16_no_data_provider.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR16", + "mod_entity_id": "GENETEST:MR16", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/MR_17_no_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/01_gene/MR_17_no_data_provider_source_organization_abbreviation.json index 4233ae2af..e9fb337b2 100644 --- a/src/test/resources/bulk/01_gene/MR_17_no_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/01_gene/MR_17_no_data_provider_source_organization_abbreviation.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR17", + "mod_entity_id": "GENETEST:MR17", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/MR_18_no_data_provider_cross_reference_referenced_curie.json b/src/test/resources/bulk/01_gene/MR_18_no_data_provider_cross_reference_referenced_curie.json index 91c00c2c7..a10b9fd6c 100644 --- a/src/test/resources/bulk/01_gene/MR_18_no_data_provider_cross_reference_referenced_curie.json +++ b/src/test/resources/bulk/01_gene/MR_18_no_data_provider_cross_reference_referenced_curie.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR18", + "mod_entity_id": "GENETEST:MR18", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/MR_19_no_data_provider_cross_reference_display_name.json b/src/test/resources/bulk/01_gene/MR_19_no_data_provider_cross_reference_display_name.json index 3a1243e49..9668dfab0 100644 --- a/src/test/resources/bulk/01_gene/MR_19_no_data_provider_cross_reference_display_name.json +++ b/src/test/resources/bulk/01_gene/MR_19_no_data_provider_cross_reference_display_name.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR19", + "mod_entity_id": "GENETEST:MR19", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/MR_20_no_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/01_gene/MR_20_no_data_provider_cross_reference_prefix.json index 0f55dacd8..34c91a9a3 100644 --- a/src/test/resources/bulk/01_gene/MR_20_no_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/01_gene/MR_20_no_data_provider_cross_reference_prefix.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR20", + "mod_entity_id": "GENETEST:MR20", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/MR_21_no_data_provider_cross_reference_page_area.json b/src/test/resources/bulk/01_gene/MR_21_no_data_provider_cross_reference_page_area.json index 64fc17475..79ec357c4 100644 --- a/src/test/resources/bulk/01_gene/MR_21_no_data_provider_cross_reference_page_area.json +++ b/src/test/resources/bulk/01_gene/MR_21_no_data_provider_cross_reference_page_area.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR21", + "mod_entity_id": "GENETEST:MR21", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/MR_22_no_gene_secondary_id_secondary_id.json b/src/test/resources/bulk/01_gene/MR_22_no_gene_secondary_id_secondary_id.json index 3165cb1cb..7574129c8 100644 --- a/src/test/resources/bulk/01_gene/MR_22_no_gene_secondary_id_secondary_id.json +++ b/src/test/resources/bulk/01_gene/MR_22_no_gene_secondary_id_secondary_id.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:MR22", + "mod_entity_id": "GENETEST:MR22", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/UD_01_update_all_except_default_fields.json b/src/test/resources/bulk/01_gene/UD_01_update_all_except_default_fields.json index 0a9e61fa0..baa392601 100644 --- a/src/test/resources/bulk/01_gene/UD_01_update_all_except_default_fields.json +++ b/src/test/resources/bulk/01_gene/UD_01_update_all_except_default_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:Gene0001", + "mod_entity_id": "GENETEST:Gene0001", "taxon_curie": "NCBITaxon:10116", "created_by_curie": "GENETEST:Person0002", "updated_by_curie": "GENETEST:Person0001", diff --git a/src/test/resources/bulk/01_gene/UE_01_update_empty_non_required_fields.json b/src/test/resources/bulk/01_gene/UE_01_update_empty_non_required_fields.json index 83124a0d9..014acf58d 100644 --- a/src/test/resources/bulk/01_gene/UE_01_update_empty_non_required_fields.json +++ b/src/test/resources/bulk/01_gene/UE_01_update_empty_non_required_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:Gene0001", + "mod_entity_id": "GENETEST:Gene0001", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/UM_01_update_no_non_required_fields_level_1.json b/src/test/resources/bulk/01_gene/UM_01_update_no_non_required_fields_level_1.json index ecb5b5eb6..c22bf5575 100644 --- a/src/test/resources/bulk/01_gene/UM_01_update_no_non_required_fields_level_1.json +++ b/src/test/resources/bulk/01_gene/UM_01_update_no_non_required_fields_level_1.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:Gene0001", + "mod_entity_id": "GENETEST:Gene0001", "taxon_curie": "NCBITaxon:6239", "gene_symbol_dto": { "display_text": "Tg1", diff --git a/src/test/resources/bulk/01_gene/UM_02_update_no_non_required_fields_level_2.json b/src/test/resources/bulk/01_gene/UM_02_update_no_non_required_fields_level_2.json index c330bc546..e4df9b57c 100644 --- a/src/test/resources/bulk/01_gene/UM_02_update_no_non_required_fields_level_2.json +++ b/src/test/resources/bulk/01_gene/UM_02_update_no_non_required_fields_level_2.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:Gene0001", + "mod_entity_id": "GENETEST:Gene0001", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/VT_01_valid_taxon_for_HUMAN.json b/src/test/resources/bulk/01_gene/VT_01_valid_taxon_for_HUMAN.json index 15a99266a..6e1f2ac08 100644 --- a/src/test/resources/bulk/01_gene/VT_01_valid_taxon_for_HUMAN.json +++ b/src/test/resources/bulk/01_gene/VT_01_valid_taxon_for_HUMAN.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IT01", + "mod_entity_id": "GENETEST:IT01", "taxon_curie": "NCBITaxon:9606", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/01_gene/VT_02_valid_taxon_for_RGD.json b/src/test/resources/bulk/01_gene/VT_02_valid_taxon_for_RGD.json index 7688645d2..3bd4816ad 100644 --- a/src/test/resources/bulk/01_gene/VT_02_valid_taxon_for_RGD.json +++ b/src/test/resources/bulk/01_gene/VT_02_valid_taxon_for_RGD.json @@ -1,6 +1,6 @@ [ { - "curie": "GENETEST:IT01", + "mod_entity_id": "GENETEST:IT01", "taxon_curie": "NCBITaxon:10116", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/AF_01_all_fields.json b/src/test/resources/bulk/02_allele/AF_01_all_fields.json index 49f33317e..a4f7c4193 100644 --- a/src/test/resources/bulk/02_allele/AF_01_all_fields.json +++ b/src/test/resources/bulk/02_allele/AF_01_all_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:Allele0001", + "mod_entity_id": "ALLELETEST:Allele0001", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/DN_01_duplicate_notes.json b/src/test/resources/bulk/02_allele/DN_01_duplicate_notes.json index d7e274fca..496893518 100644 --- a/src/test/resources/bulk/02_allele/DN_01_duplicate_notes.json +++ b/src/test/resources/bulk/02_allele/DN_01_duplicate_notes.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:DN01", + "mod_entity_id": "ALLELETEST:DN01", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/EN_01_empty_non_required_fields.json b/src/test/resources/bulk/02_allele/EN_01_empty_non_required_fields.json index 7ade28637..b0834157f 100644 --- a/src/test/resources/bulk/02_allele/EN_01_empty_non_required_fields.json +++ b/src/test/resources/bulk/02_allele/EN_01_empty_non_required_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:EN01", + "mod_entity_id": "ALLELETEST:EN01", "taxon_curie": "NCBITaxon:6239", "created_by_curie": "", "updated_by_curie": "", diff --git a/src/test/resources/bulk/02_allele/ER_01_empty_curie.json b/src/test/resources/bulk/02_allele/ER_01_empty_curie.json index aefb1c522..3d31b2c99 100644 --- a/src/test/resources/bulk/02_allele/ER_01_empty_curie.json +++ b/src/test/resources/bulk/02_allele/ER_01_empty_curie.json @@ -1,6 +1,6 @@ [ { - "curie": "", + "mod_entity_id": "", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/ER_02_empty_taxon.json b/src/test/resources/bulk/02_allele/ER_02_empty_taxon.json index bb5dcd78a..514eb2af5 100644 --- a/src/test/resources/bulk/02_allele/ER_02_empty_taxon.json +++ b/src/test/resources/bulk/02_allele/ER_02_empty_taxon.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER02", + "mod_entity_id": "ALLELETEST:ER02", "taxon_curie": "", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/ER_03_empty_allele_mutation_type_mutation_types.json b/src/test/resources/bulk/02_allele/ER_03_empty_allele_mutation_type_mutation_types.json index 63c501d43..917563a83 100644 --- a/src/test/resources/bulk/02_allele/ER_03_empty_allele_mutation_type_mutation_types.json +++ b/src/test/resources/bulk/02_allele/ER_03_empty_allele_mutation_type_mutation_types.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER03", + "mod_entity_id": "ALLELETEST:ER03", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/ER_04_empty_allele_symbol_display_text.json b/src/test/resources/bulk/02_allele/ER_04_empty_allele_symbol_display_text.json index be0edea70..88f32f52b 100644 --- a/src/test/resources/bulk/02_allele/ER_04_empty_allele_symbol_display_text.json +++ b/src/test/resources/bulk/02_allele/ER_04_empty_allele_symbol_display_text.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER04", + "mod_entity_id": "ALLELETEST:ER04", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/ER_05_empty_allele_full_name_display_text.json b/src/test/resources/bulk/02_allele/ER_05_empty_allele_full_name_display_text.json index c259952d4..5b2d0bfcb 100644 --- a/src/test/resources/bulk/02_allele/ER_05_empty_allele_full_name_display_text.json +++ b/src/test/resources/bulk/02_allele/ER_05_empty_allele_full_name_display_text.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER05", + "mod_entity_id": "ALLELETEST:ER05", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/ER_06_empty_allele_synonym_display_text.json b/src/test/resources/bulk/02_allele/ER_06_empty_allele_synonym_display_text.json index 22c3ce80c..6c8821511 100644 --- a/src/test/resources/bulk/02_allele/ER_06_empty_allele_synonym_display_text.json +++ b/src/test/resources/bulk/02_allele/ER_06_empty_allele_synonym_display_text.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER06", + "mod_entity_id": "ALLELETEST:ER06", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/ER_07_empty_allele_symbol_format_text.json b/src/test/resources/bulk/02_allele/ER_07_empty_allele_symbol_format_text.json index 65d89b89f..f4e50a54e 100644 --- a/src/test/resources/bulk/02_allele/ER_07_empty_allele_symbol_format_text.json +++ b/src/test/resources/bulk/02_allele/ER_07_empty_allele_symbol_format_text.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER07", + "mod_entity_id": "ALLELETEST:ER07", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/ER_08_empty_allele_full_name_format_text.json b/src/test/resources/bulk/02_allele/ER_08_empty_allele_full_name_format_text.json index d57b4632e..e7d5ddd54 100644 --- a/src/test/resources/bulk/02_allele/ER_08_empty_allele_full_name_format_text.json +++ b/src/test/resources/bulk/02_allele/ER_08_empty_allele_full_name_format_text.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER08", + "mod_entity_id": "ALLELETEST:ER08", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/ER_09_empty_allele_synonym_format_text.json b/src/test/resources/bulk/02_allele/ER_09_empty_allele_synonym_format_text.json index 1632f1aca..bd804be6f 100644 --- a/src/test/resources/bulk/02_allele/ER_09_empty_allele_synonym_format_text.json +++ b/src/test/resources/bulk/02_allele/ER_09_empty_allele_synonym_format_text.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER09", + "mod_entity_id": "ALLELETEST:ER09", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/ER_10_empty_allele_symbol_name_type.json b/src/test/resources/bulk/02_allele/ER_10_empty_allele_symbol_name_type.json index fb8635121..652ea1fe8 100644 --- a/src/test/resources/bulk/02_allele/ER_10_empty_allele_symbol_name_type.json +++ b/src/test/resources/bulk/02_allele/ER_10_empty_allele_symbol_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER10", + "mod_entity_id": "ALLELETEST:ER10", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/ER_11_empty_allele_full_name_name_type.json b/src/test/resources/bulk/02_allele/ER_11_empty_allele_full_name_name_type.json index 7988e85f7..5780aaac2 100644 --- a/src/test/resources/bulk/02_allele/ER_11_empty_allele_full_name_name_type.json +++ b/src/test/resources/bulk/02_allele/ER_11_empty_allele_full_name_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER11", + "mod_entity_id": "ALLELETEST:ER11", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/ER_12_empty_allele_synonym_name_type.json b/src/test/resources/bulk/02_allele/ER_12_empty_allele_synonym_name_type.json index fe07fb747..2f5434ce5 100644 --- a/src/test/resources/bulk/02_allele/ER_12_empty_allele_synonym_name_type.json +++ b/src/test/resources/bulk/02_allele/ER_12_empty_allele_synonym_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER12", + "mod_entity_id": "ALLELETEST:ER12", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/ER_13_empty_allele_secondary_id_secondary_id.json b/src/test/resources/bulk/02_allele/ER_13_empty_allele_secondary_id_secondary_id.json index 8b7870d2f..50ff9ca51 100644 --- a/src/test/resources/bulk/02_allele/ER_13_empty_allele_secondary_id_secondary_id.json +++ b/src/test/resources/bulk/02_allele/ER_13_empty_allele_secondary_id_secondary_id.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER13", + "mod_entity_id": "ALLELETEST:ER13", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/ER_14_empty_allele_inheritance_mode_inheritance_mode.json b/src/test/resources/bulk/02_allele/ER_14_empty_allele_inheritance_mode_inheritance_mode.json index d1bd01e10..004ced268 100644 --- a/src/test/resources/bulk/02_allele/ER_14_empty_allele_inheritance_mode_inheritance_mode.json +++ b/src/test/resources/bulk/02_allele/ER_14_empty_allele_inheritance_mode_inheritance_mode.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER14", + "mod_entity_id": "ALLELETEST:ER14", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/ER_15_empty_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/02_allele/ER_15_empty_data_provider_source_organization_abbreviation.json index 8fcf7cd20..c5ff5b346 100644 --- a/src/test/resources/bulk/02_allele/ER_15_empty_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/02_allele/ER_15_empty_data_provider_source_organization_abbreviation.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER15", + "mod_entity_id": "ALLELETEST:ER15", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/ER_16_empty_data_provider_cross_reference_referenced_curie.json b/src/test/resources/bulk/02_allele/ER_16_empty_data_provider_cross_reference_referenced_curie.json index 60dad6a74..e596cd787 100644 --- a/src/test/resources/bulk/02_allele/ER_16_empty_data_provider_cross_reference_referenced_curie.json +++ b/src/test/resources/bulk/02_allele/ER_16_empty_data_provider_cross_reference_referenced_curie.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER16", + "mod_entity_id": "ALLELETEST:ER16", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/ER_17_empty_data_provider_cross_reference_display_name.json b/src/test/resources/bulk/02_allele/ER_17_empty_data_provider_cross_reference_display_name.json index a63677eb9..9a2d7384a 100644 --- a/src/test/resources/bulk/02_allele/ER_17_empty_data_provider_cross_reference_display_name.json +++ b/src/test/resources/bulk/02_allele/ER_17_empty_data_provider_cross_reference_display_name.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER17", + "mod_entity_id": "ALLELETEST:ER17", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/ER_18_empty_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/02_allele/ER_18_empty_data_provider_cross_reference_prefix.json index 5781cfd35..435cef0d7 100644 --- a/src/test/resources/bulk/02_allele/ER_18_empty_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/02_allele/ER_18_empty_data_provider_cross_reference_prefix.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER18", + "mod_entity_id": "ALLELETEST:ER18", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/ER_19_empty_data_provider_cross_reference_page_area.json b/src/test/resources/bulk/02_allele/ER_19_empty_data_provider_cross_reference_page_area.json index dc4a69f68..617eff68c 100644 --- a/src/test/resources/bulk/02_allele/ER_19_empty_data_provider_cross_reference_page_area.json +++ b/src/test/resources/bulk/02_allele/ER_19_empty_data_provider_cross_reference_page_area.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER19", + "mod_entity_id": "ALLELETEST:ER19", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/ER_20_empty_allele_functional_impacts_functional_impacts.json b/src/test/resources/bulk/02_allele/ER_20_empty_allele_functional_impacts_functional_impacts.json index 8eedd775a..9582e5cad 100644 --- a/src/test/resources/bulk/02_allele/ER_20_empty_allele_functional_impacts_functional_impacts.json +++ b/src/test/resources/bulk/02_allele/ER_20_empty_allele_functional_impacts_functional_impacts.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER20", + "mod_entity_id": "ALLELETEST:ER20", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/ER_21_empty_allele_germline_transmission_status_germline_transmission_status.json b/src/test/resources/bulk/02_allele/ER_21_empty_allele_germline_transmission_status_germline_transmission_status.json index 61c6e344f..c80568cc9 100644 --- a/src/test/resources/bulk/02_allele/ER_21_empty_allele_germline_transmission_status_germline_transmission_status.json +++ b/src/test/resources/bulk/02_allele/ER_21_empty_allele_germline_transmission_status_germline_transmission_status.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER21", + "mod_entity_id": "ALLELETEST:ER21", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/ER_22_empty_related_notes_note_type_name.json b/src/test/resources/bulk/02_allele/ER_22_empty_related_notes_note_type_name.json index e7cf66364..aa64b6281 100644 --- a/src/test/resources/bulk/02_allele/ER_22_empty_related_notes_note_type_name.json +++ b/src/test/resources/bulk/02_allele/ER_22_empty_related_notes_note_type_name.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER22", + "mod_entity_id": "ALLELETEST:ER22", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/ER_23_empty_related_notes_free_text.json b/src/test/resources/bulk/02_allele/ER_23_empty_related_notes_free_text.json index eca386c8d..7a79efd24 100644 --- a/src/test/resources/bulk/02_allele/ER_23_empty_related_notes_free_text.json +++ b/src/test/resources/bulk/02_allele/ER_23_empty_related_notes_free_text.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER23", + "mod_entity_id": "ALLELETEST:ER23", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/ER_24_empty_allele_database_status_database_status.json b/src/test/resources/bulk/02_allele/ER_24_empty_allele_database_status_database_status.json index 8145a914a..33287cfac 100644 --- a/src/test/resources/bulk/02_allele/ER_24_empty_allele_database_status_database_status.json +++ b/src/test/resources/bulk/02_allele/ER_24_empty_allele_database_status_database_status.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER24", + "mod_entity_id": "ALLELETEST:ER24", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/ER_25_empty_allele_nomenclature_events_nomenclature_event.json b/src/test/resources/bulk/02_allele/ER_25_empty_allele_nomenclature_events_nomenclature_event.json index 3c6a9430c..d2093f622 100644 --- a/src/test/resources/bulk/02_allele/ER_25_empty_allele_nomenclature_events_nomenclature_event.json +++ b/src/test/resources/bulk/02_allele/ER_25_empty_allele_nomenclature_events_nomenclature_event.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:ER25", + "mod_entity_id": "ALLELETEST:ER25", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_01_invalid_date_created.json b/src/test/resources/bulk/02_allele/IV_01_invalid_date_created.json index 092fb311b..130f6daa6 100644 --- a/src/test/resources/bulk/02_allele/IV_01_invalid_date_created.json +++ b/src/test/resources/bulk/02_allele/IV_01_invalid_date_created.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV01", + "mod_entity_id": "ALLELETEST:IV01", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_02_invalid_date_updated.json b/src/test/resources/bulk/02_allele/IV_02_invalid_date_updated.json index 5ee730576..ad03cc631 100644 --- a/src/test/resources/bulk/02_allele/IV_02_invalid_date_updated.json +++ b/src/test/resources/bulk/02_allele/IV_02_invalid_date_updated.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV02", + "mod_entity_id": "ALLELETEST:IV02", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_03_invalid_taxon.json b/src/test/resources/bulk/02_allele/IV_03_invalid_taxon.json index f82c386fc..73347460f 100644 --- a/src/test/resources/bulk/02_allele/IV_03_invalid_taxon.json +++ b/src/test/resources/bulk/02_allele/IV_03_invalid_taxon.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV03", + "mod_entity_id": "ALLELETEST:IV03", "taxon_curie": "NCBITaxon:1009", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_04_invalid_in_collection.json b/src/test/resources/bulk/02_allele/IV_04_invalid_in_collection.json index f8bd5379f..01b5bd0cd 100644 --- a/src/test/resources/bulk/02_allele/IV_04_invalid_in_collection.json +++ b/src/test/resources/bulk/02_allele/IV_04_invalid_in_collection.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV04", + "mod_entity_id": "ALLELETEST:IV04", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_05_invalid_reference.json b/src/test/resources/bulk/02_allele/IV_05_invalid_reference.json index 25ff2254a..7fbc2c998 100644 --- a/src/test/resources/bulk/02_allele/IV_05_invalid_reference.json +++ b/src/test/resources/bulk/02_allele/IV_05_invalid_reference.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV05", + "mod_entity_id": "ALLELETEST:IV05", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_06_invalid_allele_mutation_type_mutation_type.json b/src/test/resources/bulk/02_allele/IV_06_invalid_allele_mutation_type_mutation_type.json index 108c84d2f..83329def5 100644 --- a/src/test/resources/bulk/02_allele/IV_06_invalid_allele_mutation_type_mutation_type.json +++ b/src/test/resources/bulk/02_allele/IV_06_invalid_allele_mutation_type_mutation_type.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV06", + "mod_entity_id": "ALLELETEST:IV06", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_07_invalid_allele_mutation_type_evidence.json b/src/test/resources/bulk/02_allele/IV_07_invalid_allele_mutation_type_evidence.json index d2bbd1688..318340412 100644 --- a/src/test/resources/bulk/02_allele/IV_07_invalid_allele_mutation_type_evidence.json +++ b/src/test/resources/bulk/02_allele/IV_07_invalid_allele_mutation_type_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV07", + "mod_entity_id": "ALLELETEST:IV07", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_08_invalid_allele_symbol_name_type.json b/src/test/resources/bulk/02_allele/IV_08_invalid_allele_symbol_name_type.json index 02f031e85..e643a6265 100644 --- a/src/test/resources/bulk/02_allele/IV_08_invalid_allele_symbol_name_type.json +++ b/src/test/resources/bulk/02_allele/IV_08_invalid_allele_symbol_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV08", + "mod_entity_id": "ALLELETEST:IV08", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_09_invalid_allele_full_name_name_type.json b/src/test/resources/bulk/02_allele/IV_09_invalid_allele_full_name_name_type.json index 5e58698bd..641443c17 100644 --- a/src/test/resources/bulk/02_allele/IV_09_invalid_allele_full_name_name_type.json +++ b/src/test/resources/bulk/02_allele/IV_09_invalid_allele_full_name_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV09", + "mod_entity_id": "ALLELETEST:IV09", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_10_invalid_allele_synonym_name_type.json b/src/test/resources/bulk/02_allele/IV_10_invalid_allele_synonym_name_type.json index 76c7ed4fa..466161db8 100644 --- a/src/test/resources/bulk/02_allele/IV_10_invalid_allele_synonym_name_type.json +++ b/src/test/resources/bulk/02_allele/IV_10_invalid_allele_synonym_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV10", + "mod_entity_id": "ALLELETEST:IV10", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_11_invalid_allele_symbol_synonym_scope.json b/src/test/resources/bulk/02_allele/IV_11_invalid_allele_symbol_synonym_scope.json index 1d3247648..a8af3fdda 100644 --- a/src/test/resources/bulk/02_allele/IV_11_invalid_allele_symbol_synonym_scope.json +++ b/src/test/resources/bulk/02_allele/IV_11_invalid_allele_symbol_synonym_scope.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV11", + "mod_entity_id": "ALLELETEST:IV11", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_12_invalid_allele_full_name_synonym_scope.json b/src/test/resources/bulk/02_allele/IV_12_invalid_allele_full_name_synonym_scope.json index ca057fc7d..9407e5992 100644 --- a/src/test/resources/bulk/02_allele/IV_12_invalid_allele_full_name_synonym_scope.json +++ b/src/test/resources/bulk/02_allele/IV_12_invalid_allele_full_name_synonym_scope.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV12", + "mod_entity_id": "ALLELETEST:IV12", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_13_invalid_allele_synonym_synonym_scope.json b/src/test/resources/bulk/02_allele/IV_13_invalid_allele_synonym_synonym_scope.json index a3425d653..1c74f5dae 100644 --- a/src/test/resources/bulk/02_allele/IV_13_invalid_allele_synonym_synonym_scope.json +++ b/src/test/resources/bulk/02_allele/IV_13_invalid_allele_synonym_synonym_scope.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV13", + "mod_entity_id": "ALLELETEST:IV13", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_14_invalid_allele_symbol_evidence.json b/src/test/resources/bulk/02_allele/IV_14_invalid_allele_symbol_evidence.json index 1ba054f28..658a42b69 100644 --- a/src/test/resources/bulk/02_allele/IV_14_invalid_allele_symbol_evidence.json +++ b/src/test/resources/bulk/02_allele/IV_14_invalid_allele_symbol_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV14", + "mod_entity_id": "ALLELETEST:IV14", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_15_invalid_allele_full_name_evidence.json b/src/test/resources/bulk/02_allele/IV_15_invalid_allele_full_name_evidence.json index 91d9be0e1..bdf271dad 100644 --- a/src/test/resources/bulk/02_allele/IV_15_invalid_allele_full_name_evidence.json +++ b/src/test/resources/bulk/02_allele/IV_15_invalid_allele_full_name_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV15", + "mod_entity_id": "ALLELETEST:IV15", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_16_invalid_allele_synonym_evidence.json b/src/test/resources/bulk/02_allele/IV_16_invalid_allele_synonym_evidence.json index ffda8432d..a04928df1 100644 --- a/src/test/resources/bulk/02_allele/IV_16_invalid_allele_synonym_evidence.json +++ b/src/test/resources/bulk/02_allele/IV_16_invalid_allele_synonym_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV16", + "mod_entity_id": "ALLELETEST:IV16", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_17_invalid_allele_secondary_id_evidence.json b/src/test/resources/bulk/02_allele/IV_17_invalid_allele_secondary_id_evidence.json index 3233be8aa..b940d8b66 100644 --- a/src/test/resources/bulk/02_allele/IV_17_invalid_allele_secondary_id_evidence.json +++ b/src/test/resources/bulk/02_allele/IV_17_invalid_allele_secondary_id_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV17", + "mod_entity_id": "ALLELETEST:IV17", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/IV_18_invalid_allele_inheritance_mode_inheritance_mode.json b/src/test/resources/bulk/02_allele/IV_18_invalid_allele_inheritance_mode_inheritance_mode.json index 72134627e..f4768e75a 100644 --- a/src/test/resources/bulk/02_allele/IV_18_invalid_allele_inheritance_mode_inheritance_mode.json +++ b/src/test/resources/bulk/02_allele/IV_18_invalid_allele_inheritance_mode_inheritance_mode.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV18", + "mod_entity_id": "ALLELETEST:IV18", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_19_invalid_allele_inheritance_mode_phenotype_term.json b/src/test/resources/bulk/02_allele/IV_19_invalid_allele_inheritance_mode_phenotype_term.json index db9db1671..61c9e3f61 100644 --- a/src/test/resources/bulk/02_allele/IV_19_invalid_allele_inheritance_mode_phenotype_term.json +++ b/src/test/resources/bulk/02_allele/IV_19_invalid_allele_inheritance_mode_phenotype_term.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV19", + "mod_entity_id": "ALLELETEST:IV19", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_20_invalid_allele_inheritance_mode_evidence.json b/src/test/resources/bulk/02_allele/IV_20_invalid_allele_inheritance_mode_evidence.json index aff54334d..85a44a114 100644 --- a/src/test/resources/bulk/02_allele/IV_20_invalid_allele_inheritance_mode_evidence.json +++ b/src/test/resources/bulk/02_allele/IV_20_invalid_allele_inheritance_mode_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV20", + "mod_entity_id": "ALLELETEST:IV20", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_21_invalid_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/02_allele/IV_21_invalid_data_provider_source_organization_abbreviation.json index 02e77840a..f3b4d1a28 100644 --- a/src/test/resources/bulk/02_allele/IV_21_invalid_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/02_allele/IV_21_invalid_data_provider_source_organization_abbreviation.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV21", + "mod_entity_id": "ALLELETEST:IV21", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_22_invalid_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/02_allele/IV_22_invalid_data_provider_cross_reference_prefix.json index 4fe52fd9a..0541f6b7d 100644 --- a/src/test/resources/bulk/02_allele/IV_22_invalid_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/02_allele/IV_22_invalid_data_provider_cross_reference_prefix.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV22", + "mod_entity_id": "ALLELETEST:IV22", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_23_invalid_data_provider_cross_reference_page_area.json b/src/test/resources/bulk/02_allele/IV_23_invalid_data_provider_cross_reference_page_area.json index 70bb0f0e3..18804d3df 100644 --- a/src/test/resources/bulk/02_allele/IV_23_invalid_data_provider_cross_reference_page_area.json +++ b/src/test/resources/bulk/02_allele/IV_23_invalid_data_provider_cross_reference_page_area.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV23", + "mod_entity_id": "ALLELETEST:IV23", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_24_invalid_allele_functional_impacts_functional_impacts.json b/src/test/resources/bulk/02_allele/IV_24_invalid_allele_functional_impacts_functional_impacts.json index 35785d146..a52b0efc5 100644 --- a/src/test/resources/bulk/02_allele/IV_24_invalid_allele_functional_impacts_functional_impacts.json +++ b/src/test/resources/bulk/02_allele/IV_24_invalid_allele_functional_impacts_functional_impacts.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV24", + "mod_entity_id": "ALLELETEST:IV24", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_25_invalid_allele_functional_impacts_phenotype_term.json b/src/test/resources/bulk/02_allele/IV_25_invalid_allele_functional_impacts_phenotype_term.json index a61a6f343..925039bac 100644 --- a/src/test/resources/bulk/02_allele/IV_25_invalid_allele_functional_impacts_phenotype_term.json +++ b/src/test/resources/bulk/02_allele/IV_25_invalid_allele_functional_impacts_phenotype_term.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV25", + "mod_entity_id": "ALLELETEST:IV25", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_26_invalid_allele_functional_impacts_evidence.json b/src/test/resources/bulk/02_allele/IV_26_invalid_allele_functional_impacts_evidence.json index 288f9133b..936849682 100644 --- a/src/test/resources/bulk/02_allele/IV_26_invalid_allele_functional_impacts_evidence.json +++ b/src/test/resources/bulk/02_allele/IV_26_invalid_allele_functional_impacts_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV26", + "mod_entity_id": "ALLELETEST:IV26", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_27_invalid_allele_germline_transmission_status_germline_transmission_status.json b/src/test/resources/bulk/02_allele/IV_27_invalid_allele_germline_transmission_status_germline_transmission_status.json index eb8aaa0f0..614abc4e9 100644 --- a/src/test/resources/bulk/02_allele/IV_27_invalid_allele_germline_transmission_status_germline_transmission_status.json +++ b/src/test/resources/bulk/02_allele/IV_27_invalid_allele_germline_transmission_status_germline_transmission_status.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV27", + "mod_entity_id": "ALLELETEST:IV27", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_28_invalid_allele_germline_transmission_status_evidence.json b/src/test/resources/bulk/02_allele/IV_28_invalid_allele_germline_transmission_status_evidence.json index cc3152637..55089e852 100644 --- a/src/test/resources/bulk/02_allele/IV_28_invalid_allele_germline_transmission_status_evidence.json +++ b/src/test/resources/bulk/02_allele/IV_28_invalid_allele_germline_transmission_status_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV28", + "mod_entity_id": "ALLELETEST:IV28", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_29_invalid_related_notes_note_type_name.json b/src/test/resources/bulk/02_allele/IV_29_invalid_related_notes_note_type_name.json index 1affba5c7..5657f692e 100644 --- a/src/test/resources/bulk/02_allele/IV_29_invalid_related_notes_note_type_name.json +++ b/src/test/resources/bulk/02_allele/IV_29_invalid_related_notes_note_type_name.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV29", + "mod_entity_id": "ALLELETEST:IV29", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_30_invalid_related_notes_evidence.json b/src/test/resources/bulk/02_allele/IV_30_invalid_related_notes_evidence.json index 2fe55aa3a..b010b0744 100644 --- a/src/test/resources/bulk/02_allele/IV_30_invalid_related_notes_evidence.json +++ b/src/test/resources/bulk/02_allele/IV_30_invalid_related_notes_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV30", + "mod_entity_id": "ALLELETEST:IV30", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_31_invalid_allele_database_status_database_status.json b/src/test/resources/bulk/02_allele/IV_31_invalid_allele_database_status_database_status.json index 4563e8e49..e18c93caa 100644 --- a/src/test/resources/bulk/02_allele/IV_31_invalid_allele_database_status_database_status.json +++ b/src/test/resources/bulk/02_allele/IV_31_invalid_allele_database_status_database_status.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV31", + "mod_entity_id": "ALLELETEST:IV31", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_32_invalid_allele_database_status_evidence.json b/src/test/resources/bulk/02_allele/IV_32_invalid_allele_database_status_evidence.json index 50b0283cb..7b44791ca 100644 --- a/src/test/resources/bulk/02_allele/IV_32_invalid_allele_database_status_evidence.json +++ b/src/test/resources/bulk/02_allele/IV_32_invalid_allele_database_status_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV32", + "mod_entity_id": "ALLELETEST:IV32", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_33_invalid_allele_nomenclature_events_nomenclature_event.json b/src/test/resources/bulk/02_allele/IV_33_invalid_allele_nomenclature_events_nomenclature_event.json index 32b0b6472..08bfd4d53 100644 --- a/src/test/resources/bulk/02_allele/IV_33_invalid_allele_nomenclature_events_nomenclature_event.json +++ b/src/test/resources/bulk/02_allele/IV_33_invalid_allele_nomenclature_events_nomenclature_event.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV33", + "mod_entity_id": "ALLELETEST:IV33", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/IV_34_invalid_allele_nomenclature_events_evidence.json b/src/test/resources/bulk/02_allele/IV_34_invalid_allele_nomenclature_events_evidence.json index 5820bc376..6b06478db 100644 --- a/src/test/resources/bulk/02_allele/IV_34_invalid_allele_nomenclature_events_evidence.json +++ b/src/test/resources/bulk/02_allele/IV_34_invalid_allele_nomenclature_events_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IV34", + "mod_entity_id": "ALLELETEST:IV34", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/MN_01_no_non_required_fields_level_1.json b/src/test/resources/bulk/02_allele/MN_01_no_non_required_fields_level_1.json index ee85cf31a..271caea0e 100644 --- a/src/test/resources/bulk/02_allele/MN_01_no_non_required_fields_level_1.json +++ b/src/test/resources/bulk/02_allele/MN_01_no_non_required_fields_level_1.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MN01", + "mod_entity_id": "ALLELETEST:MN01", "taxon_curie": "NCBITaxon:6239", "allele_symbol_dto": { "display_text": "Ta1", diff --git a/src/test/resources/bulk/02_allele/MN_02_no_non_required_fields_level_2.json b/src/test/resources/bulk/02_allele/MN_02_no_non_required_fields_level_2.json index c5656363c..e144878c8 100644 --- a/src/test/resources/bulk/02_allele/MN_02_no_non_required_fields_level_2.json +++ b/src/test/resources/bulk/02_allele/MN_02_no_non_required_fields_level_2.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MN01", + "mod_entity_id": "ALLELETEST:MN01", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/MR_02_no_taxon.json b/src/test/resources/bulk/02_allele/MR_02_no_taxon.json index 5e2f4d4a8..6366a6476 100644 --- a/src/test/resources/bulk/02_allele/MR_02_no_taxon.json +++ b/src/test/resources/bulk/02_allele/MR_02_no_taxon.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR02", + "mod_entity_id": "ALLELETEST:MR02", "internal": true, "obsolete": false, "created_by_curie": "ALLELETEST:Person0001", diff --git a/src/test/resources/bulk/02_allele/MR_03_no_allele_mutation_type_mutation_types.json b/src/test/resources/bulk/02_allele/MR_03_no_allele_mutation_type_mutation_types.json index a28c2a88b..c66983a3f 100644 --- a/src/test/resources/bulk/02_allele/MR_03_no_allele_mutation_type_mutation_types.json +++ b/src/test/resources/bulk/02_allele/MR_03_no_allele_mutation_type_mutation_types.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR03", + "mod_entity_id": "ALLELETEST:MR03", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/MR_04_no_allele_symbol.json b/src/test/resources/bulk/02_allele/MR_04_no_allele_symbol.json index 88ff58534..1acfb7599 100644 --- a/src/test/resources/bulk/02_allele/MR_04_no_allele_symbol.json +++ b/src/test/resources/bulk/02_allele/MR_04_no_allele_symbol.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR04", + "mod_entity_id": "ALLELETEST:MR04", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/MR_05_no_allele_symbol_display_text.json b/src/test/resources/bulk/02_allele/MR_05_no_allele_symbol_display_text.json index d0f19defc..f1710cac0 100644 --- a/src/test/resources/bulk/02_allele/MR_05_no_allele_symbol_display_text.json +++ b/src/test/resources/bulk/02_allele/MR_05_no_allele_symbol_display_text.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR05", + "mod_entity_id": "ALLELETEST:MR05", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/MR_06_no_allele_full_name_display_text.json b/src/test/resources/bulk/02_allele/MR_06_no_allele_full_name_display_text.json index 7e556fb40..52865cf50 100644 --- a/src/test/resources/bulk/02_allele/MR_06_no_allele_full_name_display_text.json +++ b/src/test/resources/bulk/02_allele/MR_06_no_allele_full_name_display_text.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR06", + "mod_entity_id": "ALLELETEST:MR06", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/MR_07_no_allele_synonym_display_text.json b/src/test/resources/bulk/02_allele/MR_07_no_allele_synonym_display_text.json index ba0d3baeb..35fe21401 100644 --- a/src/test/resources/bulk/02_allele/MR_07_no_allele_synonym_display_text.json +++ b/src/test/resources/bulk/02_allele/MR_07_no_allele_synonym_display_text.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR07", + "mod_entity_id": "ALLELETEST:MR07", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/MR_08_no_allele_symbol_format_text.json b/src/test/resources/bulk/02_allele/MR_08_no_allele_symbol_format_text.json index 4cf577311..865dff4bd 100644 --- a/src/test/resources/bulk/02_allele/MR_08_no_allele_symbol_format_text.json +++ b/src/test/resources/bulk/02_allele/MR_08_no_allele_symbol_format_text.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR08", + "mod_entity_id": "ALLELETEST:MR08", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/MR_09_no_allele_full_name_format_text.json b/src/test/resources/bulk/02_allele/MR_09_no_allele_full_name_format_text.json index 66bee1c04..b5115d164 100644 --- a/src/test/resources/bulk/02_allele/MR_09_no_allele_full_name_format_text.json +++ b/src/test/resources/bulk/02_allele/MR_09_no_allele_full_name_format_text.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR09", + "mod_entity_id": "ALLELETEST:MR09", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/MR_10_no_allele_synonym_format_text.json b/src/test/resources/bulk/02_allele/MR_10_no_allele_synonym_format_text.json index ef893696b..584f07363 100644 --- a/src/test/resources/bulk/02_allele/MR_10_no_allele_synonym_format_text.json +++ b/src/test/resources/bulk/02_allele/MR_10_no_allele_synonym_format_text.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETESTMR10", + "mod_entity_id": "ALLELETESTMR10", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/MR_11_no_allele_symbol_name_type.json b/src/test/resources/bulk/02_allele/MR_11_no_allele_symbol_name_type.json index 1e5cade87..81cabfd27 100644 --- a/src/test/resources/bulk/02_allele/MR_11_no_allele_symbol_name_type.json +++ b/src/test/resources/bulk/02_allele/MR_11_no_allele_symbol_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR11", + "mod_entity_id": "ALLELETEST:MR11", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/MR_12_no_allele_full_name_name_type.json b/src/test/resources/bulk/02_allele/MR_12_no_allele_full_name_name_type.json index 62cc84b39..d69ecb9b7 100644 --- a/src/test/resources/bulk/02_allele/MR_12_no_allele_full_name_name_type.json +++ b/src/test/resources/bulk/02_allele/MR_12_no_allele_full_name_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR12", + "mod_entity_id": "ALLELETEST:MR12", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/MR_13_no_allele_synonym_name_type.json b/src/test/resources/bulk/02_allele/MR_13_no_allele_synonym_name_type.json index b2fb3286a..6bd85e71f 100644 --- a/src/test/resources/bulk/02_allele/MR_13_no_allele_synonym_name_type.json +++ b/src/test/resources/bulk/02_allele/MR_13_no_allele_synonym_name_type.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR13", + "mod_entity_id": "ALLELETEST:MR13", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/MR_14_no_allele_secondary_id_secondary_id.json b/src/test/resources/bulk/02_allele/MR_14_no_allele_secondary_id_secondary_id.json index d4096e2c4..2b735857c 100644 --- a/src/test/resources/bulk/02_allele/MR_14_no_allele_secondary_id_secondary_id.json +++ b/src/test/resources/bulk/02_allele/MR_14_no_allele_secondary_id_secondary_id.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR14", + "mod_entity_id": "ALLELETEST:MR14", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/02_allele/MR_15_no_allele_inheritance_mode_inheritance_mode.json b/src/test/resources/bulk/02_allele/MR_15_no_allele_inheritance_mode_inheritance_mode.json index c0ebdcb03..2b71f0867 100644 --- a/src/test/resources/bulk/02_allele/MR_15_no_allele_inheritance_mode_inheritance_mode.json +++ b/src/test/resources/bulk/02_allele/MR_15_no_allele_inheritance_mode_inheritance_mode.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR15", + "mod_entity_id": "ALLELETEST:MR15", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/MR_16_no_data_provider.json b/src/test/resources/bulk/02_allele/MR_16_no_data_provider.json index 3d56b4b2f..27ad94d25 100644 --- a/src/test/resources/bulk/02_allele/MR_16_no_data_provider.json +++ b/src/test/resources/bulk/02_allele/MR_16_no_data_provider.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR16", + "mod_entity_id": "ALLELETEST:MR16", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/MR_17_no_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/02_allele/MR_17_no_data_provider_source_organization_abbreviation.json index 577132f80..498abe347 100644 --- a/src/test/resources/bulk/02_allele/MR_17_no_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/02_allele/MR_17_no_data_provider_source_organization_abbreviation.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR17", + "mod_entity_id": "ALLELETEST:MR17", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/MR_18_no_data_provider_cross_reference_referenced_curie.json b/src/test/resources/bulk/02_allele/MR_18_no_data_provider_cross_reference_referenced_curie.json index 6b1f94167..9ebec95fc 100644 --- a/src/test/resources/bulk/02_allele/MR_18_no_data_provider_cross_reference_referenced_curie.json +++ b/src/test/resources/bulk/02_allele/MR_18_no_data_provider_cross_reference_referenced_curie.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR18", + "mod_entity_id": "ALLELETEST:MR18", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/MR_19_no_data_provider_cross_reference_display_name.json b/src/test/resources/bulk/02_allele/MR_19_no_data_provider_cross_reference_display_name.json index 0b01cdc9b..60ee80f25 100644 --- a/src/test/resources/bulk/02_allele/MR_19_no_data_provider_cross_reference_display_name.json +++ b/src/test/resources/bulk/02_allele/MR_19_no_data_provider_cross_reference_display_name.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR19", + "mod_entity_id": "ALLELETEST:MR19", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/MR_20_no_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/02_allele/MR_20_no_data_provider_cross_reference_prefix.json index 33cdc3d96..2c12645d5 100644 --- a/src/test/resources/bulk/02_allele/MR_20_no_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/02_allele/MR_20_no_data_provider_cross_reference_prefix.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR20", + "mod_entity_id": "ALLELETEST:MR20", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/MR_21_no_data_provider_cross_reference_page_area.json b/src/test/resources/bulk/02_allele/MR_21_no_data_provider_cross_reference_page_area.json index ca3fc9d6f..219fd13f3 100644 --- a/src/test/resources/bulk/02_allele/MR_21_no_data_provider_cross_reference_page_area.json +++ b/src/test/resources/bulk/02_allele/MR_21_no_data_provider_cross_reference_page_area.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR21", + "mod_entity_id": "ALLELETEST:MR21", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/MR_22_no_allele_functional_impacts_functional_impacts.json b/src/test/resources/bulk/02_allele/MR_22_no_allele_functional_impacts_functional_impacts.json index f4b7d7adf..17420c422 100644 --- a/src/test/resources/bulk/02_allele/MR_22_no_allele_functional_impacts_functional_impacts.json +++ b/src/test/resources/bulk/02_allele/MR_22_no_allele_functional_impacts_functional_impacts.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR22", + "mod_entity_id": "ALLELETEST:MR22", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/MR_23_no_allele_germline_transmission_status_germline_transmission_status.json b/src/test/resources/bulk/02_allele/MR_23_no_allele_germline_transmission_status_germline_transmission_status.json index f4fd129f3..3ed5e9e61 100644 --- a/src/test/resources/bulk/02_allele/MR_23_no_allele_germline_transmission_status_germline_transmission_status.json +++ b/src/test/resources/bulk/02_allele/MR_23_no_allele_germline_transmission_status_germline_transmission_status.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR23", + "mod_entity_id": "ALLELETEST:MR23", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/MR_24_no_related_notes_note_type_name.json b/src/test/resources/bulk/02_allele/MR_24_no_related_notes_note_type_name.json index f122fa973..682df5280 100644 --- a/src/test/resources/bulk/02_allele/MR_24_no_related_notes_note_type_name.json +++ b/src/test/resources/bulk/02_allele/MR_24_no_related_notes_note_type_name.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR24", + "mod_entity_id": "ALLELETEST:MR24", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/MR_25_no_related_notes_free_text.json b/src/test/resources/bulk/02_allele/MR_25_no_related_notes_free_text.json index c5d7411c8..b94712a8c 100644 --- a/src/test/resources/bulk/02_allele/MR_25_no_related_notes_free_text.json +++ b/src/test/resources/bulk/02_allele/MR_25_no_related_notes_free_text.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR25", + "mod_entity_id": "ALLELETEST:MR25", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/MR_26_no_allele_database_status_database_status.json b/src/test/resources/bulk/02_allele/MR_26_no_allele_database_status_database_status.json index b2a9ad97a..c63ad0d0e 100644 --- a/src/test/resources/bulk/02_allele/MR_26_no_allele_database_status_database_status.json +++ b/src/test/resources/bulk/02_allele/MR_26_no_allele_database_status_database_status.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR26", + "mod_entity_id": "ALLELETEST:MR26", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/MR_27_no_allele_nomenclature_events_nomenclature_event.json b/src/test/resources/bulk/02_allele/MR_27_no_allele_nomenclature_events_nomenclature_event.json index cfa4acffb..724ec1827 100644 --- a/src/test/resources/bulk/02_allele/MR_27_no_allele_nomenclature_events_nomenclature_event.json +++ b/src/test/resources/bulk/02_allele/MR_27_no_allele_nomenclature_events_nomenclature_event.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:MR27", + "mod_entity_id": "ALLELETEST:MR27", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/SI_01_secondary_ids.json b/src/test/resources/bulk/02_allele/SI_01_secondary_ids.json index 88ff73675..960094826 100644 --- a/src/test/resources/bulk/02_allele/SI_01_secondary_ids.json +++ b/src/test/resources/bulk/02_allele/SI_01_secondary_ids.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:SI01", + "mod_entity_id": "ALLELETEST:SI01", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/UD_01_update_all_except_default_fields.json b/src/test/resources/bulk/02_allele/UD_01_update_all_except_default_fields.json index 2c5185be0..d5397ea28 100644 --- a/src/test/resources/bulk/02_allele/UD_01_update_all_except_default_fields.json +++ b/src/test/resources/bulk/02_allele/UD_01_update_all_except_default_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:Allele0001", + "mod_entity_id": "ALLELETEST:Allele0001", "taxon_curie": "NCBITaxon:10116", "created_by_curie": "ALLELETEST:Person0002", "updated_by_curie": "ALLELETEST:Person0001", diff --git a/src/test/resources/bulk/02_allele/UE_01_update_empty_non_required_fields.json b/src/test/resources/bulk/02_allele/UE_01_update_empty_non_required_fields.json index 3b00a4fef..7d0e93baa 100644 --- a/src/test/resources/bulk/02_allele/UE_01_update_empty_non_required_fields.json +++ b/src/test/resources/bulk/02_allele/UE_01_update_empty_non_required_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:Allele0001", + "mod_entity_id": "ALLELETEST:Allele0001", "taxon_curie": "NCBITaxon:6239", "created_by_curie": "", "updated_by_curie": "", diff --git a/src/test/resources/bulk/02_allele/UM_01_update_no_non_required_fields_level_1.json b/src/test/resources/bulk/02_allele/UM_01_update_no_non_required_fields_level_1.json index 00136c87a..13b876712 100644 --- a/src/test/resources/bulk/02_allele/UM_01_update_no_non_required_fields_level_1.json +++ b/src/test/resources/bulk/02_allele/UM_01_update_no_non_required_fields_level_1.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:Allele0001", + "mod_entity_id": "ALLELETEST:Allele0001", "taxon_curie": "NCBITaxon:6239", "allele_symbol_dto": { "display_text": "Ta1", diff --git a/src/test/resources/bulk/02_allele/UM_02_update_no_non_required_fields_level_2.json b/src/test/resources/bulk/02_allele/UM_02_update_no_non_required_fields_level_2.json index dbbb551dc..8ae38d14c 100644 --- a/src/test/resources/bulk/02_allele/UM_02_update_no_non_required_fields_level_2.json +++ b/src/test/resources/bulk/02_allele/UM_02_update_no_non_required_fields_level_2.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:Allele0001", + "mod_entity_id": "ALLELETEST:Allele0001", "taxon_curie": "NCBITaxon:6239", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/VT_01_valid_taxon_for_HUMAN.json b/src/test/resources/bulk/02_allele/VT_01_valid_taxon_for_HUMAN.json index 1b04365a7..a42ed57b2 100644 --- a/src/test/resources/bulk/02_allele/VT_01_valid_taxon_for_HUMAN.json +++ b/src/test/resources/bulk/02_allele/VT_01_valid_taxon_for_HUMAN.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IT01", + "mod_entity_id": "ALLELETEST:IT01", "taxon_curie": "NCBITaxon:9606", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/02_allele/VT_02_valid_taxon_for_RGD.json b/src/test/resources/bulk/02_allele/VT_02_valid_taxon_for_RGD.json index bb4672b70..c214ebc1d 100644 --- a/src/test/resources/bulk/02_allele/VT_02_valid_taxon_for_RGD.json +++ b/src/test/resources/bulk/02_allele/VT_02_valid_taxon_for_RGD.json @@ -1,6 +1,6 @@ [ { - "curie": "ALLELETEST:IT01", + "mod_entity_id": "ALLELETEST:IT01", "taxon_curie": "NCBITaxon:10116", "internal": true, "obsolete": true, diff --git a/src/test/resources/bulk/03_agm/AF_01_all_fields.json b/src/test/resources/bulk/03_agm/AF_01_all_fields.json index 95a7f55e0..3874e021e 100644 --- a/src/test/resources/bulk/03_agm/AF_01_all_fields.json +++ b/src/test/resources/bulk/03_agm/AF_01_all_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:Agm0001", + "mod_entity_id": "AGMTEST:Agm0001", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/EN_01_empty_non_required_fields.json b/src/test/resources/bulk/03_agm/EN_01_empty_non_required_fields.json index 539e00b70..ac64425c6 100644 --- a/src/test/resources/bulk/03_agm/EN_01_empty_non_required_fields.json +++ b/src/test/resources/bulk/03_agm/EN_01_empty_non_required_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:EN01", + "mod_entity_id": "AGMTEST:EN01", "subtype_name": "fish", "name": "", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/ER_01_empty_curie.json b/src/test/resources/bulk/03_agm/ER_01_empty_curie.json index a3ba78c22..c4799f5fc 100644 --- a/src/test/resources/bulk/03_agm/ER_01_empty_curie.json +++ b/src/test/resources/bulk/03_agm/ER_01_empty_curie.json @@ -1,6 +1,6 @@ [ { - "curie": "", + "mod_entity_id": "", "name": "TestAgm18", "taxon_curie": "NCBITaxon:6239", "internal": true, diff --git a/src/test/resources/bulk/03_agm/ER_02_empty_taxon.json b/src/test/resources/bulk/03_agm/ER_02_empty_taxon.json index e44b21179..099874704 100644 --- a/src/test/resources/bulk/03_agm/ER_02_empty_taxon.json +++ b/src/test/resources/bulk/03_agm/ER_02_empty_taxon.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:ER02", + "mod_entity_id": "AGMTEST:ER02", "name": "TestAgm19", "taxon_curie": "", "internal": true, diff --git a/src/test/resources/bulk/03_agm/ER_03_empty_subtype.json b/src/test/resources/bulk/03_agm/ER_03_empty_subtype.json index 92c024af5..fc22280bc 100644 --- a/src/test/resources/bulk/03_agm/ER_03_empty_subtype.json +++ b/src/test/resources/bulk/03_agm/ER_03_empty_subtype.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:Agm0001", + "mod_entity_id": "AGMTEST:Agm0001", "subtype_name": "", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/ER_04_empty_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/03_agm/ER_04_empty_data_provider_source_organization_abbreviation.json index 0ce56704c..48aa18c7e 100644 --- a/src/test/resources/bulk/03_agm/ER_04_empty_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/03_agm/ER_04_empty_data_provider_source_organization_abbreviation.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:ER04", + "mod_entity_id": "AGMTEST:ER04", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/ER_05_empty_data_provider_cross_reference_referenced_curie.json b/src/test/resources/bulk/03_agm/ER_05_empty_data_provider_cross_reference_referenced_curie.json index d083f656a..9d9b26c8a 100644 --- a/src/test/resources/bulk/03_agm/ER_05_empty_data_provider_cross_reference_referenced_curie.json +++ b/src/test/resources/bulk/03_agm/ER_05_empty_data_provider_cross_reference_referenced_curie.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:ER05", + "mod_entity_id": "AGMTEST:ER05", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/ER_06_empty_data_provider_cross_reference_display_name.json b/src/test/resources/bulk/03_agm/ER_06_empty_data_provider_cross_reference_display_name.json index 897146b65..59cced227 100644 --- a/src/test/resources/bulk/03_agm/ER_06_empty_data_provider_cross_reference_display_name.json +++ b/src/test/resources/bulk/03_agm/ER_06_empty_data_provider_cross_reference_display_name.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:ER06", + "mod_entity_id": "AGMTEST:ER06", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/ER_07_empty_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/03_agm/ER_07_empty_data_provider_cross_reference_prefix.json index 22db08cb9..c0a58b856 100644 --- a/src/test/resources/bulk/03_agm/ER_07_empty_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/03_agm/ER_07_empty_data_provider_cross_reference_prefix.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:ER07", + "mod_entity_id": "AGMTEST:ER07", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/ER_08_empty_data_provider_cross_reference_page_area.json b/src/test/resources/bulk/03_agm/ER_08_empty_data_provider_cross_reference_page_area.json index 8119c66cd..e329b3169 100644 --- a/src/test/resources/bulk/03_agm/ER_08_empty_data_provider_cross_reference_page_area.json +++ b/src/test/resources/bulk/03_agm/ER_08_empty_data_provider_cross_reference_page_area.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:ER08", + "mod_entity_id": "AGMTEST:ER08", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/IV_01_invalid_date_created.json b/src/test/resources/bulk/03_agm/IV_01_invalid_date_created.json index b59a07fd0..800c974a7 100644 --- a/src/test/resources/bulk/03_agm/IV_01_invalid_date_created.json +++ b/src/test/resources/bulk/03_agm/IV_01_invalid_date_created.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:Agm0011", + "mod_entity_id": "AGMTEST:Agm0011", "name": "TestAgm11", "taxon_curie": "NCBITaxon:6239", "internal": true, diff --git a/src/test/resources/bulk/03_agm/IV_02_invalid_date_updated.json b/src/test/resources/bulk/03_agm/IV_02_invalid_date_updated.json index a11549b79..64cc2970d 100644 --- a/src/test/resources/bulk/03_agm/IV_02_invalid_date_updated.json +++ b/src/test/resources/bulk/03_agm/IV_02_invalid_date_updated.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:Agm0012", + "mod_entity_id": "AGMTEST:Agm0012", "name": "TestAgm12", "taxon_curie": "NCBITaxon:6239", "internal": true, diff --git a/src/test/resources/bulk/03_agm/IV_03_invalid_taxon.json b/src/test/resources/bulk/03_agm/IV_03_invalid_taxon.json index 2bdf17348..bbf465096 100644 --- a/src/test/resources/bulk/03_agm/IV_03_invalid_taxon.json +++ b/src/test/resources/bulk/03_agm/IV_03_invalid_taxon.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:Agm0010", + "mod_entity_id": "AGMTEST:Agm0010", "name": "TestAgm10", "taxon_curie": "NCBITaxon:1009", "internal": true, diff --git a/src/test/resources/bulk/03_agm/IV_04_invalid_subtype.json b/src/test/resources/bulk/03_agm/IV_04_invalid_subtype.json index be268fe5c..a56226ae3 100644 --- a/src/test/resources/bulk/03_agm/IV_04_invalid_subtype.json +++ b/src/test/resources/bulk/03_agm/IV_04_invalid_subtype.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:Agm0001", + "mod_entity_id": "AGMTEST:Agm0001", "subtype_name": "invalid", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/IV_05_invalid_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/03_agm/IV_05_invalid_data_provider_source_organization_abbreviation.json index 5ed0bc448..03e8282c0 100644 --- a/src/test/resources/bulk/03_agm/IV_05_invalid_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/03_agm/IV_05_invalid_data_provider_source_organization_abbreviation.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:IV05", + "mod_entity_id": "AGMTEST:IV05", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/IV_06_invalid_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/03_agm/IV_06_invalid_data_provider_cross_reference_prefix.json index 6aadf83d8..f376937db 100644 --- a/src/test/resources/bulk/03_agm/IV_06_invalid_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/03_agm/IV_06_invalid_data_provider_cross_reference_prefix.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:IV06", + "mod_entity_id": "AGMTEST:IV06", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/IV_07_invalid_data_provider_cross_reference_page_area.json b/src/test/resources/bulk/03_agm/IV_07_invalid_data_provider_cross_reference_page_area.json index ff2441eac..e73fa9f01 100644 --- a/src/test/resources/bulk/03_agm/IV_07_invalid_data_provider_cross_reference_page_area.json +++ b/src/test/resources/bulk/03_agm/IV_07_invalid_data_provider_cross_reference_page_area.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:IV07", + "mod_entity_id": "AGMTEST:IV07", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/MN_01_no_non_required_fields.json b/src/test/resources/bulk/03_agm/MN_01_no_non_required_fields.json index a806a0a1b..5061e0b51 100644 --- a/src/test/resources/bulk/03_agm/MN_01_no_non_required_fields.json +++ b/src/test/resources/bulk/03_agm/MN_01_no_non_required_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:MN01", + "mod_entity_id": "AGMTEST:MN01", "taxon_curie": "NCBITaxon:6239", "subtype_name": "fish", "data_provider_dto": { diff --git a/src/test/resources/bulk/03_agm/MR_02_no_taxon.json b/src/test/resources/bulk/03_agm/MR_02_no_taxon.json index 1d4d983e0..8616782c6 100644 --- a/src/test/resources/bulk/03_agm/MR_02_no_taxon.json +++ b/src/test/resources/bulk/03_agm/MR_02_no_taxon.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:MR02", + "mod_entity_id": "AGMTEST:MR02", "name": "TestAgm4", "internal": true, "obsolete": false, diff --git a/src/test/resources/bulk/03_agm/MR_03_no_subtype.json b/src/test/resources/bulk/03_agm/MR_03_no_subtype.json index b562346e1..e1f31a60f 100644 --- a/src/test/resources/bulk/03_agm/MR_03_no_subtype.json +++ b/src/test/resources/bulk/03_agm/MR_03_no_subtype.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:Agm0001", + "mod_entity_id": "AGMTEST:Agm0001", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", "internal": true, diff --git a/src/test/resources/bulk/03_agm/MR_04_no_data_provider.json b/src/test/resources/bulk/03_agm/MR_04_no_data_provider.json index 370e040bf..c2741cfab 100644 --- a/src/test/resources/bulk/03_agm/MR_04_no_data_provider.json +++ b/src/test/resources/bulk/03_agm/MR_04_no_data_provider.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:MR04", + "mod_entity_id": "AGMTEST:MR04", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/MR_05_no_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/03_agm/MR_05_no_data_provider_source_organization_abbreviation.json index bd483c174..7fa4a4e6e 100644 --- a/src/test/resources/bulk/03_agm/MR_05_no_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/03_agm/MR_05_no_data_provider_source_organization_abbreviation.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:MR05", + "mod_entity_id": "AGMTEST:MR05", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/MR_06_no_data_provider_cross_reference_referenced_curie.json b/src/test/resources/bulk/03_agm/MR_06_no_data_provider_cross_reference_referenced_curie.json index 2b953dcc9..5a9d6937e 100644 --- a/src/test/resources/bulk/03_agm/MR_06_no_data_provider_cross_reference_referenced_curie.json +++ b/src/test/resources/bulk/03_agm/MR_06_no_data_provider_cross_reference_referenced_curie.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:MR06", + "mod_entity_id": "AGMTEST:MR06", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/MR_07_no_data_provider_cross_reference_display_name.json b/src/test/resources/bulk/03_agm/MR_07_no_data_provider_cross_reference_display_name.json index 8110b574b..fe7158dcd 100644 --- a/src/test/resources/bulk/03_agm/MR_07_no_data_provider_cross_reference_display_name.json +++ b/src/test/resources/bulk/03_agm/MR_07_no_data_provider_cross_reference_display_name.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:MR07", + "mod_entity_id": "AGMTEST:MR07", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/MR_08_no_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/03_agm/MR_08_no_data_provider_cross_reference_prefix.json index 0d90fdd57..ea788b531 100644 --- a/src/test/resources/bulk/03_agm/MR_08_no_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/03_agm/MR_08_no_data_provider_cross_reference_prefix.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:MR08", + "mod_entity_id": "AGMTEST:MR08", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/MR_09_no_data_provider_cross_reference_page_area.json b/src/test/resources/bulk/03_agm/MR_09_no_data_provider_cross_reference_page_area.json index de365c707..87590968b 100644 --- a/src/test/resources/bulk/03_agm/MR_09_no_data_provider_cross_reference_page_area.json +++ b/src/test/resources/bulk/03_agm/MR_09_no_data_provider_cross_reference_page_area.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:MR09", + "mod_entity_id": "AGMTEST:MR09", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/UD_01_update_all_except_default_fields.json b/src/test/resources/bulk/03_agm/UD_01_update_all_except_default_fields.json index 308e88bed..d8f9c7a94 100644 --- a/src/test/resources/bulk/03_agm/UD_01_update_all_except_default_fields.json +++ b/src/test/resources/bulk/03_agm/UD_01_update_all_except_default_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:Agm0001", + "mod_entity_id": "AGMTEST:Agm0001", "subtype_name": "genotype", "name": "TestAgm1a", "taxon_curie": "NCBITaxon:10116", diff --git a/src/test/resources/bulk/03_agm/UE_01_update_empty_non_required_fields.json b/src/test/resources/bulk/03_agm/UE_01_update_empty_non_required_fields.json index 55bac2d78..2c6544fc4 100644 --- a/src/test/resources/bulk/03_agm/UE_01_update_empty_non_required_fields.json +++ b/src/test/resources/bulk/03_agm/UE_01_update_empty_non_required_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:Agm0001", + "mod_entity_id": "AGMTEST:Agm0001", "subtype_name": "fish", "name": "", "taxon_curie": "NCBITaxon:6239", diff --git a/src/test/resources/bulk/03_agm/UM_01_update_no_non_required_fields.json b/src/test/resources/bulk/03_agm/UM_01_update_no_non_required_fields.json index e24ba6c9f..fe33d7cbf 100644 --- a/src/test/resources/bulk/03_agm/UM_01_update_no_non_required_fields.json +++ b/src/test/resources/bulk/03_agm/UM_01_update_no_non_required_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:Agm0001", + "mod_entity_id": "AGMTEST:Agm0001", "taxon_curie": "NCBITaxon:6239", "subtype_name": "fish", "data_provider_dto": { diff --git a/src/test/resources/bulk/03_agm/VT_01_valid_taxon_for_HUMAN.json b/src/test/resources/bulk/03_agm/VT_01_valid_taxon_for_HUMAN.json index b3127063a..d98045198 100644 --- a/src/test/resources/bulk/03_agm/VT_01_valid_taxon_for_HUMAN.json +++ b/src/test/resources/bulk/03_agm/VT_01_valid_taxon_for_HUMAN.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:Agm0001", + "mod_entity_id": "AGMTEST:Agm0001", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:9606", diff --git a/src/test/resources/bulk/03_agm/VT_02_valid_taxon_for_RGD.json b/src/test/resources/bulk/03_agm/VT_02_valid_taxon_for_RGD.json index f5c13586a..456503a6e 100644 --- a/src/test/resources/bulk/03_agm/VT_02_valid_taxon_for_RGD.json +++ b/src/test/resources/bulk/03_agm/VT_02_valid_taxon_for_RGD.json @@ -1,6 +1,6 @@ [ { - "curie": "AGMTEST:Agm0001", + "mod_entity_id": "AGMTEST:Agm0001", "subtype_name": "fish", "name": "TestAgm1", "taxon_curie": "NCBITaxon:10116", diff --git a/src/test/resources/bulk/04_disease_annotation/AF_01_all_fields_gene_annotation.json b/src/test/resources/bulk/04_disease_annotation/AF_01_all_fields_gene_annotation.json index 1b980b6ec..34b0a2b0e 100644 --- a/src/test/resources/bulk/04_disease_annotation/AF_01_all_fields_gene_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/AF_01_all_fields_gene_annotation.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -95,7 +95,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/AF_02_all_fields_allele_annotation.json b/src/test/resources/bulk/04_disease_annotation/AF_02_all_fields_allele_annotation.json index d7bd798d4..e9eb039a5 100644 --- a/src/test/resources/bulk/04_disease_annotation/AF_02_all_fields_allele_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/AF_02_all_fields_allele_annotation.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "allele_curie": "DATEST:Allele0001", + "allele_identifier": "DATEST:Allele0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -99,8 +99,8 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "DATEST:Gene0001", - "asserted_gene_curies": [ + "inferred_gene_identifier": "DATEST:Gene0001", + "asserted_gene_identifiers": [ "DATEST:Gene0002" ] } diff --git a/src/test/resources/bulk/04_disease_annotation/AF_03_all_fields_agm_annotation.json b/src/test/resources/bulk/04_disease_annotation/AF_03_all_fields_agm_annotation.json index 93d0eeb2f..abcb54cc5 100644 --- a/src/test/resources/bulk/04_disease_annotation/AF_03_all_fields_agm_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/AF_03_all_fields_agm_annotation.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "agm_curie": "DATEST:AGM0001", + "agm_identifier": "DATEST:AGM0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -99,11 +99,11 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "DATEST:Gene0001", - "asserted_gene_curies": [ + "inferred_gene_identifier": "DATEST:Gene0001", + "asserted_gene_identifiers": [ "DATEST:Gene0002" ], - "inferred_allele_curie": "DATEST:Allele0001", - "asserted_allele_curie": "DATEST:Allele0002" + "inferred_allele_identifier": "DATEST:Allele0001", + "asserted_allele_identifier": "DATEST:Allele0002" } ] diff --git a/src/test/resources/bulk/04_disease_annotation/DN_01_duplicate_notes.json b/src/test/resources/bulk/04_disease_annotation/DN_01_duplicate_notes.json index 1a5254e67..ab79cf2cd 100644 --- a/src/test/resources/bulk/04_disease_annotation/DN_01_duplicate_notes.json +++ b/src/test/resources/bulk/04_disease_annotation/DN_01_duplicate_notes.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -108,7 +108,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ED_01_empty_disease_genetic_modifier.json b/src/test/resources/bulk/04_disease_annotation/ED_01_empty_disease_genetic_modifier.json index 484943823..d2106c1c3 100644 --- a/src/test/resources/bulk/04_disease_annotation/ED_01_empty_disease_genetic_modifier.json +++ b/src/test/resources/bulk/04_disease_annotation/ED_01_empty_disease_genetic_modifier.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ED01", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,9 +61,9 @@ ] } ], - "disease_genetic_modifier_curies": [], + "disease_genetic_modifier_identifiers": [], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -81,7 +81,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ED_02_empty_disease_genetic_modifier_relation.json b/src/test/resources/bulk/04_disease_annotation/ED_02_empty_disease_genetic_modifier_relation.json index 0753539cf..507799dd4 100644 --- a/src/test/resources/bulk/04_disease_annotation/ED_02_empty_disease_genetic_modifier_relation.json +++ b/src/test/resources/bulk/04_disease_annotation/ED_02_empty_disease_genetic_modifier_relation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ED02", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ED_03_empty_disease_genetic_modifier_and_relation.json b/src/test/resources/bulk/04_disease_annotation/ED_03_empty_disease_genetic_modifier_and_relation.json index de203041d..2f0f47ef1 100644 --- a/src/test/resources/bulk/04_disease_annotation/ED_03_empty_disease_genetic_modifier_and_relation.json +++ b/src/test/resources/bulk/04_disease_annotation/ED_03_empty_disease_genetic_modifier_and_relation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ED03", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,9 +61,9 @@ ] } ], - "disease_genetic_modifier_curies": [], + "disease_genetic_modifier_identifiers": [], "disease_genetic_modifier_relation_name": "", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -81,7 +81,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ED_04_empty_condition_relation_reference.json b/src/test/resources/bulk/04_disease_annotation/ED_04_empty_condition_relation_reference.json index f6ec9f85e..fb83e05ec 100644 --- a/src/test/resources/bulk/04_disease_annotation/ED_04_empty_condition_relation_reference.json +++ b/src/test/resources/bulk/04_disease_annotation/ED_04_empty_condition_relation_reference.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ED04", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ED_05_empty_condition_relation_handle_and_reference.json b/src/test/resources/bulk/04_disease_annotation/ED_05_empty_condition_relation_handle_and_reference.json index 69b37bfa1..bb5892a4d 100644 --- a/src/test/resources/bulk/04_disease_annotation/ED_05_empty_condition_relation_handle_and_reference.json +++ b/src/test/resources/bulk/04_disease_annotation/ED_05_empty_condition_relation_handle_and_reference.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ED05", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -59,11 +59,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -81,7 +81,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/EN_01_empty_non_required_fields_level_1_gene_annotation.json b/src/test/resources/bulk/04_disease_annotation/EN_01_empty_non_required_fields_level_1_gene_annotation.json index 731b1e1a8..53b23e8bb 100644 --- a/src/test/resources/bulk/04_disease_annotation/EN_01_empty_non_required_fields_level_1_gene_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/EN_01_empty_non_required_fields_level_1_gene_annotation.json @@ -5,7 +5,7 @@ "updated_by_curie": "", "date_created": "", "date_updated": "", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -24,12 +24,12 @@ "DATEST:Evidence0001" ], "condition_relation_dtos": [], - "disease_genetic_modifier_curies": [], + "disease_genetic_modifier_identifiers": [], "disease_genetic_modifier_relation_name": "", - "with_gene_curies": [], + "with_gene_identifiers": [], "reference_curie": "PMID:25920554", "note_dtos": [], - "sgd_strain_background_curie": "", + "sgd_strain_background_identifier": "", "annotation_type_name": "", "disease_qualifier_names": [] } diff --git a/src/test/resources/bulk/04_disease_annotation/EN_02_empty_non_required_fields_level_1_allele_annotation.json b/src/test/resources/bulk/04_disease_annotation/EN_02_empty_non_required_fields_level_1_allele_annotation.json index 691dfb9a2..c6ef86139 100644 --- a/src/test/resources/bulk/04_disease_annotation/EN_02_empty_non_required_fields_level_1_allele_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/EN_02_empty_non_required_fields_level_1_allele_annotation.json @@ -5,7 +5,7 @@ "updated_by_curie": "", "date_created": "", "date_updated": "", - "allele_curie": "DATEST:Allele0001", + "allele_identifier": "DATEST:Allele0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -24,14 +24,14 @@ "DATEST:Evidence0001" ], "condition_relation_dtos": [], - "disease_genetic_modifier_curies": [], + "disease_genetic_modifier_identifiers": [], "disease_genetic_modifier_relation_name": "", - "with_gene_curies": [], + "with_gene_identifiers": [], "reference_curie": "PMID:25920554", "note_dtos": [], "annotation_type_name": "", "disease_qualifier_names": [], - "inferred_gene_curie": "", - "asserted_gene_curies": [] + "inferred_gene_identifier": "", + "asserted_gene_identifiers": [] } ] diff --git a/src/test/resources/bulk/04_disease_annotation/EN_03_empty_non_required_fields_level_1_agm_annotation.json b/src/test/resources/bulk/04_disease_annotation/EN_03_empty_non_required_fields_level_1_agm_annotation.json index 53d5690f7..0443f17e8 100644 --- a/src/test/resources/bulk/04_disease_annotation/EN_03_empty_non_required_fields_level_1_agm_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/EN_03_empty_non_required_fields_level_1_agm_annotation.json @@ -5,7 +5,7 @@ "updated_by_curie": "", "date_created": "", "date_updated": "", - "agm_curie": "DATEST:AGM0001", + "agm_identifier": "DATEST:AGM0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -24,16 +24,16 @@ "DATEST:Evidence0001" ], "condition_relation_dtos": [], - "disease_genetic_modifier_curies": [], + "disease_genetic_modifier_identifiers": [], "disease_genetic_modifier_relation_name": "", - "with_gene_curies": [], + "with_gene_identifiers": [], "reference_curie": "PMID:25920554", "note_dtos": [], "annotation_type_name": "", "disease_qualifier_names": [], - "inferred_gene_curie": "", - "asserted_gene_curies": [], - "inferred_allele_curie": "", - "asserted_allele_curie": "" + "inferred_gene_identifier": "", + "asserted_gene_identifiers": [], + "inferred_allele_identifier": "", + "asserted_allele_identifier": "" } ] diff --git a/src/test/resources/bulk/04_disease_annotation/EN_04_empty_non_required_fields_level_2.json b/src/test/resources/bulk/04_disease_annotation/EN_04_empty_non_required_fields_level_2.json index ae7babe1c..d213f2cad 100644 --- a/src/test/resources/bulk/04_disease_annotation/EN_04_empty_non_required_fields_level_2.json +++ b/src/test/resources/bulk/04_disease_annotation/EN_04_empty_non_required_fields_level_2.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "source_organization_abbreviation": "WB", @@ -60,11 +60,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -79,7 +79,7 @@ "evidence_curies": [] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_01_empty_subject.json b/src/test/resources/bulk/04_disease_annotation/ER_01_empty_subject.json index e0072e53d..e72dadedf 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_01_empty_subject.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_01_empty_subject.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ER01", "internal": false, "obsolete": false, - "gene_curie": "", + "gene_identifier": "", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_02_empty_object.json b/src/test/resources/bulk/04_disease_annotation/ER_02_empty_object.json index 4adf41a25..1b4a500ea 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_02_empty_object.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_02_empty_object.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ER02", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_03_empty_disease_relation_gene_annotation.json b/src/test/resources/bulk/04_disease_annotation/ER_03_empty_disease_relation_gene_annotation.json index 0ca22fde7..3363db01b 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_03_empty_disease_relation_gene_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_03_empty_disease_relation_gene_annotation.json @@ -3,7 +3,7 @@ "mod_entity_id": "ER03", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_04_empty_disease_relation_allele_annotation.json b/src/test/resources/bulk/04_disease_annotation/ER_04_empty_disease_relation_allele_annotation.json index 829873fec..6d97c6814 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_04_empty_disease_relation_allele_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_04_empty_disease_relation_allele_annotation.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "allele_curie": "DATEST:Allele0001", + "allele_identifier": "DATEST:Allele0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -99,8 +99,8 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "DATEST:Gene0001", - "asserted_gene_curies": [ + "inferred_gene_identifier": "DATEST:Gene0001", + "asserted_gene_identifiers": [ "DATEST:Gene0002" ] } diff --git a/src/test/resources/bulk/04_disease_annotation/ER_05_empty_disease_relation_agm_annotation.json b/src/test/resources/bulk/04_disease_annotation/ER_05_empty_disease_relation_agm_annotation.json index bbf656f12..91acb1332 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_05_empty_disease_relation_agm_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_05_empty_disease_relation_agm_annotation.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "agm_curie": "DATEST:AGM0001", + "agm_identifier": "DATEST:AGM0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -99,11 +99,11 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "DATEST:Gene0001", - "asserted_gene_curies": [ + "inferred_gene_identifier": "DATEST:Gene0001", + "asserted_gene_identifiers": [ "DATEST:Gene0002" ], - "inferred_allele_curie": "DATEST:Allele0001", - "asserted_allele_curie": "DATEST:Allele0002" + "inferred_allele_identifier": "DATEST:Allele0001", + "asserted_allele_identifier": "DATEST:Allele0002" } ] diff --git a/src/test/resources/bulk/04_disease_annotation/ER_06_empty_evidence_codes.json b/src/test/resources/bulk/04_disease_annotation/ER_06_empty_evidence_codes.json index 7ee470dca..5a071168d 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_06_empty_evidence_codes.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_06_empty_evidence_codes.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ER06", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -59,11 +59,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -81,7 +81,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_07_empty_single_reference.json b/src/test/resources/bulk/04_disease_annotation/ER_07_empty_single_reference.json index 0d1e59d93..c7ae6151f 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_07_empty_single_reference.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_07_empty_single_reference.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ER07", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_08_empty_data_provider.json b/src/test/resources/bulk/04_disease_annotation/ER_08_empty_data_provider.json index 237841581..3e40df603 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_08_empty_data_provider.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_08_empty_data_provider.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ER08", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_name": "", "secondary_data_provider_dto": { @@ -49,11 +49,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -71,7 +71,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_09_empty_condition_relations_type.json b/src/test/resources/bulk/04_disease_annotation/ER_09_empty_condition_relations_type.json index d93fda07e..a92501566 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_09_empty_condition_relations_type.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_09_empty_condition_relations_type.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ER09", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_10_empty_condition_relation_experimental_conditions.json b/src/test/resources/bulk/04_disease_annotation/ER_10_empty_condition_relation_experimental_conditions.json index 0eea01e0b..e6d989dda 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_10_empty_condition_relation_experimental_conditions.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_10_empty_condition_relation_experimental_conditions.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ER10", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -48,11 +48,11 @@ "condition_dtos": [] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -70,7 +70,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_11_empty_condition_class.json b/src/test/resources/bulk/04_disease_annotation/ER_11_empty_condition_class.json index 1bbc89c7b..855a58385 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_11_empty_condition_class.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_11_empty_condition_class.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ER11", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_12_empty_related_note_type.json b/src/test/resources/bulk/04_disease_annotation/ER_12_empty_related_note_type.json index b3a84096e..40b33eec0 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_12_empty_related_note_type.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_12_empty_related_note_type.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ER12", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_13_empty_related_note_free_text.json b/src/test/resources/bulk/04_disease_annotation/ER_13_empty_related_note_free_text.json index da3f00883..3e8b46c87 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_13_empty_related_note_free_text.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_13_empty_related_note_free_text.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:ER13", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_14_empty_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/04_disease_annotation/ER_14_empty_data_provider_source_organization_abbreviation.json index 6eecc1abe..68926d1b0 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_14_empty_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_14_empty_data_provider_source_organization_abbreviation.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -95,7 +95,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_15_empty_secondary_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/04_disease_annotation/ER_15_empty_secondary_data_provider_source_organization_abbreviation.json index b6e6818da..e65b8c91b 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_15_empty_secondary_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_15_empty_secondary_data_provider_source_organization_abbreviation.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -95,7 +95,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_16_empty_data_provider_cross_reference_referenced_curie.json b/src/test/resources/bulk/04_disease_annotation/ER_16_empty_data_provider_cross_reference_referenced_curie.json index 1301d0723..e90d04cfd 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_16_empty_data_provider_cross_reference_referenced_curie.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_16_empty_data_provider_cross_reference_referenced_curie.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -95,7 +95,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_17_empty_data_provider_cross_reference_display_name.json b/src/test/resources/bulk/04_disease_annotation/ER_17_empty_data_provider_cross_reference_display_name.json index c250df460..22b07c74b 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_17_empty_data_provider_cross_reference_display_name.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_17_empty_data_provider_cross_reference_display_name.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -95,7 +95,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/ER_18_empty_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/04_disease_annotation/ER_18_empty_data_provider_cross_reference_prefix.json index 90b856fc6..031f5e431 100644 --- a/src/test/resources/bulk/04_disease_annotation/ER_18_empty_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/04_disease_annotation/ER_18_empty_data_provider_cross_reference_prefix.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -95,7 +95,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_01_invalid_date_created.json b/src/test/resources/bulk/04_disease_annotation/IV_01_invalid_date_created.json index 8d2e7e2bf..61d0b63ff 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_01_invalid_date_created.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_01_invalid_date_created.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV01", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_02_invalid_date_updated.json b/src/test/resources/bulk/04_disease_annotation/IV_02_invalid_date_updated.json index 4d03ad39f..81c2d6f83 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_02_invalid_date_updated.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_02_invalid_date_updated.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV02", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "09/03/2022", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_03_invalid_subject.json b/src/test/resources/bulk/04_disease_annotation/IV_03_invalid_subject.json index f4d66eb8d..0a1187512 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_03_invalid_subject.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_03_invalid_subject.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV03", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0003", + "gene_identifier": "DATEST:Gene0003", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_04_invalid_object.json b/src/test/resources/bulk/04_disease_annotation/IV_04_invalid_object.json index 50635d1b2..566925bf1 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_04_invalid_object.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_04_invalid_object.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV04", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Invalid", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_05_invalid_disease_relation_gene_annotation.json b/src/test/resources/bulk/04_disease_annotation/IV_05_invalid_disease_relation_gene_annotation.json index 7fc8ec08a..3e37d7706 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_05_invalid_disease_relation_gene_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_05_invalid_disease_relation_gene_annotation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV05", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_06_invalid_disease_relation_allele_annotation.json b/src/test/resources/bulk/04_disease_annotation/IV_06_invalid_disease_relation_allele_annotation.json index 68dc58644..96bebd1c9 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_06_invalid_disease_relation_allele_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_06_invalid_disease_relation_allele_annotation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV06", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Allele0001", + "gene_identifier": "DATEST:Allele0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_07_invalid_disease_relation_agm_annotation.json b/src/test/resources/bulk/04_disease_annotation/IV_07_invalid_disease_relation_agm_annotation.json index 385d36524..2a67f3108 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_07_invalid_disease_relation_agm_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_07_invalid_disease_relation_agm_annotation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV07", "internal": false, "obsolete": false, - "gene_curie": "DATEST:AGM0001", + "gene_identifier": "DATEST:AGM0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_08_invalid_evidence_code.json b/src/test/resources/bulk/04_disease_annotation/IV_08_invalid_evidence_code.json index 11af5abc4..2a6c69e4c 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_08_invalid_evidence_code.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_08_invalid_evidence_code.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV08", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_09_invalid_single_reference.json b/src/test/resources/bulk/04_disease_annotation/IV_09_invalid_single_reference.json index 779e72b60..0edc8173a 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_09_invalid_single_reference.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_09_invalid_single_reference.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV09", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:0", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_10_invalid_genetic_sex.json b/src/test/resources/bulk/04_disease_annotation/IV_10_invalid_genetic_sex.json index 7fd8a08b4..f84f38d6e 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_10_invalid_genetic_sex.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_10_invalid_genetic_sex.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV10", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_11_invalid_sgd_strain_background.json b/src/test/resources/bulk/04_disease_annotation/IV_11_invalid_sgd_strain_background.json index d590debc2..987fb9729 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_11_invalid_sgd_strain_background.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_11_invalid_sgd_strain_background.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV11", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:Invalid", + "sgd_strain_background_identifier": "SGD:Invalid", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_12_invalid_with.json b/src/test/resources/bulk/04_disease_annotation/IV_12_invalid_with.json index d43f0a619..28a087ac7 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_12_invalid_with.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_12_invalid_with.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:Invalid" ], "reference_curie": "PMID:25920554", @@ -95,7 +95,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_13_invalid_disease_qualifier.json b/src/test/resources/bulk/04_disease_annotation/IV_13_invalid_disease_qualifier.json index 506dbed6b..0ed69995b 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_13_invalid_disease_qualifier.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_13_invalid_disease_qualifier.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV13", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "invalid_qualifier" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_14_invalid_genetic_modifier.json b/src/test/resources/bulk/04_disease_annotation/IV_14_invalid_genetic_modifier.json index 572542b4c..ee9617ece 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_14_invalid_genetic_modifier.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_14_invalid_genetic_modifier.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV14", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Invalid" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_15_invalid_genetic_modifier_relation.json b/src/test/resources/bulk/04_disease_annotation/IV_15_invalid_genetic_modifier_relation.json index 53cbe2dbd..dbafc3552 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_15_invalid_genetic_modifier_relation.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_15_invalid_genetic_modifier_relation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV15", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "invalid_modifier", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_16_invalid_annotation_type.json b/src/test/resources/bulk/04_disease_annotation/IV_16_invalid_annotation_type.json index 269072156..ce849d33d 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_16_invalid_annotation_type.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_16_invalid_annotation_type.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV16", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "non_valid_type", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_17_invalid_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/04_disease_annotation/IV_17_invalid_data_provider_source_organization_abbreviation.json index 8352f8c40..2ac196282 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_17_invalid_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_17_invalid_data_provider_source_organization_abbreviation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV17", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_18_invalid_secondary_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/04_disease_annotation/IV_18_invalid_secondary_data_provider_source_organization_abbreviation.json index b2359d589..dc955b6d7 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_18_invalid_secondary_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_18_invalid_secondary_data_provider_source_organization_abbreviation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV18", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_19_invalid_inferred_gene_allele_annotation.json b/src/test/resources/bulk/04_disease_annotation/IV_19_invalid_inferred_gene_allele_annotation.json index e1e8d4e5e..73229dc4d 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_19_invalid_inferred_gene_allele_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_19_invalid_inferred_gene_allele_annotation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV19", "internal": false, "obsolete": false, - "allele_curie": "DATEST:Allele0001", + "allele_identifier": "DATEST:Allele0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -87,7 +87,7 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "INVALID:Gene0001", + "inferred_gene_identifier": "INVALID:Gene0001", "asserted_gene": "DATEST:Gene0001" } ] diff --git a/src/test/resources/bulk/04_disease_annotation/IV_20_invalid_asserted_gene_allele_annotation.json b/src/test/resources/bulk/04_disease_annotation/IV_20_invalid_asserted_gene_allele_annotation.json index 5a30b84ad..d5c4e7a46 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_20_invalid_asserted_gene_allele_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_20_invalid_asserted_gene_allele_annotation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV20", "internal": false, "obsolete": false, - "allele_curie": "DATEST:Allele0001", + "allele_identifier": "DATEST:Allele0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -87,8 +87,8 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "DATEST:Gene0001", - "asserted_gene_curies": [ + "inferred_gene_identifier": "DATEST:Gene0001", + "asserted_gene_identifiers": [ "INVALID:Gene0001" ] } diff --git a/src/test/resources/bulk/04_disease_annotation/IV_21_invalid_inferred_gene_agm_annotation.json b/src/test/resources/bulk/04_disease_annotation/IV_21_invalid_inferred_gene_agm_annotation.json index 5ce503c65..e1b8806d1 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_21_invalid_inferred_gene_agm_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_21_invalid_inferred_gene_agm_annotation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV21", "internal": false, "obsolete": false, - "agm_curie": "DATEST:AGM0001", + "agm_identifier": "DATEST:AGM0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -87,9 +87,9 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "INVALID:Gene0001", + "inferred_gene_identifier": "INVALID:Gene0001", "asserted_gene": "DATEST:Gene0001", - "inferred_allele_curie": "DATEST:Allele0001", - "asserted_allele_curie": "DATEST:Allele0001" + "inferred_allele_identifier": "DATEST:Allele0001", + "asserted_allele_identifier": "DATEST:Allele0001" } ] diff --git a/src/test/resources/bulk/04_disease_annotation/IV_22_invalid_asserted_gene_agm_annotation.json b/src/test/resources/bulk/04_disease_annotation/IV_22_invalid_asserted_gene_agm_annotation.json index 5b9598ec8..68328566c 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_22_invalid_asserted_gene_agm_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_22_invalid_asserted_gene_agm_annotation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV22", "internal": false, "obsolete": false, - "agm_curie": "DATEST:AGM0001", + "agm_identifier": "DATEST:AGM0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -87,11 +87,11 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "DATEST:Gene0001", - "asserted_gene_curies": [ + "inferred_gene_identifier": "DATEST:Gene0001", + "asserted_gene_identifiers": [ "INVALID:Gene0001" ], - "inferred_allele_curie": "DATEST:Allele0001", - "asserted_allele_curie": "DATEST:Allele0001" + "inferred_allele_identifier": "DATEST:Allele0001", + "asserted_allele_identifier": "DATEST:Allele0001" } ] diff --git a/src/test/resources/bulk/04_disease_annotation/IV_23_invalid_inferred_allele_agm_annotation.json b/src/test/resources/bulk/04_disease_annotation/IV_23_invalid_inferred_allele_agm_annotation.json index 3cbc8dda4..a93d7110c 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_23_invalid_inferred_allele_agm_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_23_invalid_inferred_allele_agm_annotation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV23", "internal": false, "obsolete": false, - "agm_curie": "DATEST:AGM0001", + "agm_identifier": "DATEST:AGM0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -87,9 +87,9 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "DATEST:Gene0001", + "inferred_gene_identifier": "DATEST:Gene0001", "asserted_gene": "DATEST:Gene0001", - "inferred_allele_curie": "INVALID:Allele0001", - "asserted_allele_curie": "DATEST:Allele0001" + "inferred_allele_identifier": "INVALID:Allele0001", + "asserted_allele_identifier": "DATEST:Allele0001" } ] diff --git a/src/test/resources/bulk/04_disease_annotation/IV_24_invalid_asserted_allele_agm_annotation.json b/src/test/resources/bulk/04_disease_annotation/IV_24_invalid_asserted_allele_agm_annotation.json index d9f7863b6..c8e8c492c 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_24_invalid_asserted_allele_agm_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_24_invalid_asserted_allele_agm_annotation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV24", "internal": false, "obsolete": false, - "agm_curie": "DATEST:AGM0001", + "agm_identifier": "DATEST:AGM0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -87,9 +87,9 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "DATEST:Gene0001", + "inferred_gene_identifier": "DATEST:Gene0001", "asserted_gene": "DATEST:Gene0001", - "inferred_allele_curie": "DATEST:Allele0001", - "asserted_allele_curie": "INVALID:Allele0001" + "inferred_allele_identifier": "DATEST:Allele0001", + "asserted_allele_identifier": "INVALID:Allele0001" } ] diff --git a/src/test/resources/bulk/04_disease_annotation/IV_25_invalid_condition_relation_type.json b/src/test/resources/bulk/04_disease_annotation/IV_25_invalid_condition_relation_type.json index 67573c7ce..b1682c56f 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_25_invalid_condition_relation_type.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_25_invalid_condition_relation_type.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -95,7 +95,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_26_invalid_condition_relation_single_reference.json b/src/test/resources/bulk/04_disease_annotation/IV_26_invalid_condition_relation_single_reference.json index b6cd3907b..44962ae3a 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_26_invalid_condition_relation_single_reference.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_26_invalid_condition_relation_single_reference.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -95,7 +95,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_27_invalid_condition_class.json b/src/test/resources/bulk/04_disease_annotation/IV_27_invalid_condition_class.json index 1734b3dfc..e6eb4512b 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_27_invalid_condition_class.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_27_invalid_condition_class.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV27", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_28_non_slim_condition_class.json b/src/test/resources/bulk/04_disease_annotation/IV_28_non_slim_condition_class.json index c65faa848..ef674bfc4 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_28_non_slim_condition_class.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_28_non_slim_condition_class.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV28", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -57,11 +57,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -79,7 +79,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_29_invalid_condition_id.json b/src/test/resources/bulk/04_disease_annotation/IV_29_invalid_condition_id.json index 62b95defe..685733067 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_29_invalid_condition_id.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_29_invalid_condition_id.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV29", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_30_invalid_condition_gene_ontology.json b/src/test/resources/bulk/04_disease_annotation/IV_30_invalid_condition_gene_ontology.json index 357dfff0c..a9081fd96 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_30_invalid_condition_gene_ontology.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_30_invalid_condition_gene_ontology.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV30", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_31_invalid_condition_anatomy.json b/src/test/resources/bulk/04_disease_annotation/IV_31_invalid_condition_anatomy.json index eaefeae65..3059f9ac2 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_31_invalid_condition_anatomy.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_31_invalid_condition_anatomy.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV31", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_32_invalid_condition_taxon.json b/src/test/resources/bulk/04_disease_annotation/IV_32_invalid_condition_taxon.json index 9229fb23c..cebd0eb7f 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_32_invalid_condition_taxon.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_32_invalid_condition_taxon.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV32", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_33_invalid_condition_chemical.json b/src/test/resources/bulk/04_disease_annotation/IV_33_invalid_condition_chemical.json index d61515ded..9be1af7fa 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_33_invalid_condition_chemical.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_33_invalid_condition_chemical.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV33", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_34_invalid_related_note_type.json b/src/test/resources/bulk/04_disease_annotation/IV_34_invalid_related_note_type.json index 7b099e73e..ef1346c6e 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_34_invalid_related_note_type.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_34_invalid_related_note_type.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV34", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_35_invalid_related_note_reference.json b/src/test/resources/bulk/04_disease_annotation/IV_35_invalid_related_note_reference.json index 300242e22..24f4043ac 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_35_invalid_related_note_reference.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_35_invalid_related_note_reference.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV35", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_36_invalid_data_provider_cross_reference_page_area.json b/src/test/resources/bulk/04_disease_annotation/IV_36_invalid_data_provider_cross_reference_page_area.json index 8223da782..fba4b798b 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_36_invalid_data_provider_cross_reference_page_area.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_36_invalid_data_provider_cross_reference_page_area.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV36", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_37_invalid_secondary_data_provider_cross_reference_page_area.json b/src/test/resources/bulk/04_disease_annotation/IV_37_invalid_secondary_data_provider_cross_reference_page_area.json index e3f57b334..5ac81e553 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_37_invalid_secondary_data_provider_cross_reference_page_area.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_37_invalid_secondary_data_provider_cross_reference_page_area.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV37", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_38_invalid_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/04_disease_annotation/IV_38_invalid_data_provider_cross_reference_prefix.json index 9d96d7235..cefb073fd 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_38_invalid_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_38_invalid_data_provider_cross_reference_prefix.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV38", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/IV_39_invalid_secondary_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/04_disease_annotation/IV_39_invalid_secondary_data_provider_cross_reference_prefix.json index 16ca4f341..3e1138943 100644 --- a/src/test/resources/bulk/04_disease_annotation/IV_39_invalid_secondary_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/04_disease_annotation/IV_39_invalid_secondary_data_provider_cross_reference_prefix.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:IV39", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MD_01_no_disease_genetic_modifier.json b/src/test/resources/bulk/04_disease_annotation/MD_01_no_disease_genetic_modifier.json index 2aec2e75e..0fbe19ff9 100644 --- a/src/test/resources/bulk/04_disease_annotation/MD_01_no_disease_genetic_modifier.json +++ b/src/test/resources/bulk/04_disease_annotation/MD_01_no_disease_genetic_modifier.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MD01", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -62,7 +62,7 @@ } ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -80,7 +80,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MD_02_no_disease_genetic_modifier_relation.json b/src/test/resources/bulk/04_disease_annotation/MD_02_no_disease_genetic_modifier_relation.json index 31637aaa5..019a5c52f 100644 --- a/src/test/resources/bulk/04_disease_annotation/MD_02_no_disease_genetic_modifier_relation.json +++ b/src/test/resources/bulk/04_disease_annotation/MD_02_no_disease_genetic_modifier_relation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MD02", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,10 +61,10 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -82,7 +82,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MD_03_no_disease_genetic_modifier_or_relation.json b/src/test/resources/bulk/04_disease_annotation/MD_03_no_disease_genetic_modifier_or_relation.json index e892afb7a..5ab4bfb32 100644 --- a/src/test/resources/bulk/04_disease_annotation/MD_03_no_disease_genetic_modifier_or_relation.json +++ b/src/test/resources/bulk/04_disease_annotation/MD_03_no_disease_genetic_modifier_or_relation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MD03", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,7 +61,7 @@ ] } ], - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -79,7 +79,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MD_04_no_condition_relation_reference.json b/src/test/resources/bulk/04_disease_annotation/MD_04_no_condition_relation_reference.json index 984fcb934..ba82fbf15 100644 --- a/src/test/resources/bulk/04_disease_annotation/MD_04_no_condition_relation_reference.json +++ b/src/test/resources/bulk/04_disease_annotation/MD_04_no_condition_relation_reference.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MD04", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -60,11 +60,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -82,7 +82,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MD_05_no_condition_relation_handle_or_reference.json b/src/test/resources/bulk/04_disease_annotation/MD_05_no_condition_relation_handle_or_reference.json index db5d8bebd..b9ca13042 100644 --- a/src/test/resources/bulk/04_disease_annotation/MD_05_no_condition_relation_handle_or_reference.json +++ b/src/test/resources/bulk/04_disease_annotation/MD_05_no_condition_relation_handle_or_reference.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MD05", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -59,11 +59,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -81,7 +81,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MM_01_mismatched_note_reference.json b/src/test/resources/bulk/04_disease_annotation/MM_01_mismatched_note_reference.json index 8ab4f836a..58311e177 100644 --- a/src/test/resources/bulk/04_disease_annotation/MM_01_mismatched_note_reference.json +++ b/src/test/resources/bulk/04_disease_annotation/MM_01_mismatched_note_reference.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MM01", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -83,7 +83,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MM_02_mismatched_condition_relation_reference.json b/src/test/resources/bulk/04_disease_annotation/MM_02_mismatched_condition_relation_reference.json index 0ed65176c..da0798297 100644 --- a/src/test/resources/bulk/04_disease_annotation/MM_02_mismatched_condition_relation_reference.json +++ b/src/test/resources/bulk/04_disease_annotation/MM_02_mismatched_condition_relation_reference.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MM02", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": {"internal":false,"obsolete":false,"source_organization_abbreviation":"WB","cross_reference_dto": {"internal":false,"obsolete":false,"referenced_curie":"TEST:0001","page_area":"homepage","display_name":"TEST:0001","prefix":"TEST"}}, "secondary_data_provider_dto": {"internal":false,"obsolete":false,"source_organization_abbreviation":"RGD","cross_reference_dto": {"internal":false,"obsolete":false,"referenced_curie":"TEST:0002","page_area":"homepage","display_name":"TEST:0002","prefix":"TEST"}}, @@ -37,11 +37,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -59,7 +59,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MN_01_no_non_required_fields_level_1_gene_annotation.json b/src/test/resources/bulk/04_disease_annotation/MN_01_no_non_required_fields_level_1_gene_annotation.json index 012627913..f8630698e 100644 --- a/src/test/resources/bulk/04_disease_annotation/MN_01_no_non_required_fields_level_1_gene_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/MN_01_no_non_required_fields_level_1_gene_annotation.json @@ -1,7 +1,7 @@ [ { "mod_entity_id": "DATEST:MN01", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, diff --git a/src/test/resources/bulk/04_disease_annotation/MN_02_no_non_required_fields_level_1_allele_annotation.json b/src/test/resources/bulk/04_disease_annotation/MN_02_no_non_required_fields_level_1_allele_annotation.json index fe85ef587..a2d107a79 100644 --- a/src/test/resources/bulk/04_disease_annotation/MN_02_no_non_required_fields_level_1_allele_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/MN_02_no_non_required_fields_level_1_allele_annotation.json @@ -1,7 +1,7 @@ [ { "mod_entity_id": "DATEST:MN02", - "allele_curie": "DATEST:Allele0001", + "allele_identifier": "DATEST:Allele0001", "do_term_curie": "DATEST:Disease0001", "disease_relation_name": "is_implicated_in", "data_provider_dto": { diff --git a/src/test/resources/bulk/04_disease_annotation/MN_03_no_non_required_fields_level_1_agm_annotation.json b/src/test/resources/bulk/04_disease_annotation/MN_03_no_non_required_fields_level_1_agm_annotation.json index 2b95f2014..012b36538 100644 --- a/src/test/resources/bulk/04_disease_annotation/MN_03_no_non_required_fields_level_1_agm_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/MN_03_no_non_required_fields_level_1_agm_annotation.json @@ -1,7 +1,7 @@ [ { "mod_entity_id": "DATEST:MN03", - "agm_curie": "DATEST:AGM0001", + "agm_identifier": "DATEST:AGM0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, diff --git a/src/test/resources/bulk/04_disease_annotation/MN_04_no_non_required_fields_level_2.json b/src/test/resources/bulk/04_disease_annotation/MN_04_no_non_required_fields_level_2.json index 630bbcc24..1c74dee87 100644 --- a/src/test/resources/bulk/04_disease_annotation/MN_04_no_non_required_fields_level_2.json +++ b/src/test/resources/bulk/04_disease_annotation/MN_04_no_non_required_fields_level_2.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -35,11 +35,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -49,7 +49,7 @@ "note_type_name": "disease_summary" } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_01_no_subject.json b/src/test/resources/bulk/04_disease_annotation/MR_01_no_subject.json index 60bb5c309..8f3b150be 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_01_no_subject.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_01_no_subject.json @@ -60,11 +60,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -82,7 +82,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_02_no_object.json b/src/test/resources/bulk/04_disease_annotation/MR_02_no_object.json index 40dd10e1a..eab319c19 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_02_no_object.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_02_no_object.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MR02", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "data_provider_dto": { "internal": false, "obsolete": false, @@ -60,11 +60,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -82,7 +82,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_03_no_disease_relation_gene_annotation.json b/src/test/resources/bulk/04_disease_annotation/MR_03_no_disease_relation_gene_annotation.json index 22d5029d8..a5e52acb1 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_03_no_disease_relation_gene_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_03_no_disease_relation_gene_annotation.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MR03", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -60,11 +60,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -82,7 +82,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_04_no_disease_relation_allele_annotation.json b/src/test/resources/bulk/04_disease_annotation/MR_04_no_disease_relation_allele_annotation.json index 6b6189fbd..5d9bbd294 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_04_no_disease_relation_allele_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_04_no_disease_relation_allele_annotation.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "allele_curie": "DATEST:Allele0001", + "allele_identifier": "DATEST:Allele0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -71,11 +71,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -98,8 +98,8 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "DATEST:Gene0001", - "asserted_gene_curies": [ + "inferred_gene_identifier": "DATEST:Gene0001", + "asserted_gene_identifiers": [ "DATEST:Gene0002" ] } diff --git a/src/test/resources/bulk/04_disease_annotation/MR_05_no_disease_relation_agm_annotation.json b/src/test/resources/bulk/04_disease_annotation/MR_05_no_disease_relation_agm_annotation.json index 8811759c8..7db03eb58 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_05_no_disease_relation_agm_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_05_no_disease_relation_agm_annotation.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "agm_curie": "DATEST:AGM0001", + "agm_identifier": "DATEST:AGM0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -71,11 +71,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -98,11 +98,11 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "DATEST:Gene0001", - "asserted_gene_curies": [ + "inferred_gene_identifier": "DATEST:Gene0001", + "asserted_gene_identifiers": [ "DATEST:Gene0002" ], - "inferred_allele_curie": "DATEST:Allele0001", - "asserted_allele_curie": "DATEST:Allele0002" + "inferred_allele_identifier": "DATEST:Allele0001", + "asserted_allele_identifier": "DATEST:Allele0002" } ] diff --git a/src/test/resources/bulk/04_disease_annotation/MR_06_no_evidence_codes.json b/src/test/resources/bulk/04_disease_annotation/MR_06_no_evidence_codes.json index a0ba3feef..67f6a3ed9 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_06_no_evidence_codes.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_06_no_evidence_codes.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MR06", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -58,11 +58,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -80,7 +80,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_07_no_single_reference.json b/src/test/resources/bulk/04_disease_annotation/MR_07_no_single_reference.json index b6e4b6d0f..110160e17 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_07_no_single_reference.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_07_no_single_reference.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MR07", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "note_dtos": [ @@ -82,7 +82,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_08_no_data_provider.json b/src/test/resources/bulk/04_disease_annotation/MR_08_no_data_provider.json index 275cc6f39..a897f21da 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_08_no_data_provider.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_08_no_data_provider.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MR08", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "secondary_data_provider_dto": { "internal": false, @@ -59,7 +59,7 @@ ] } ], - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -68,7 +68,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_09_no_condition_relations_type.json b/src/test/resources/bulk/04_disease_annotation/MR_09_no_condition_relations_type.json index 32c167ae9..530463544 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_09_no_condition_relations_type.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_09_no_condition_relations_type.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MR09", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -60,11 +60,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -82,7 +82,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_10_no_condition_relation_experimental_conditions.json b/src/test/resources/bulk/04_disease_annotation/MR_10_no_condition_relation_experimental_conditions.json index 67ec361f1..0e730d5e3 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_10_no_condition_relation_experimental_conditions.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_10_no_condition_relation_experimental_conditions.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MR10", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -47,11 +47,11 @@ "obsolete": false } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -69,7 +69,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_11_no_condition_class.json b/src/test/resources/bulk/04_disease_annotation/MR_11_no_condition_class.json index dbf0fe00d..f88f2418c 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_11_no_condition_class.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_11_no_condition_class.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MR11", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -60,11 +60,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -82,7 +82,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_12_no_related_note_type.json b/src/test/resources/bulk/04_disease_annotation/MR_12_no_related_note_type.json index 09f46a047..f2b1faf3c 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_12_no_related_note_type.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_12_no_related_note_type.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MR12", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": {"internal":false,"obsolete":false,"source_organization_abbreviation":"WB","cross_reference_dto": {"internal":false,"obsolete":false,"referenced_curie":"TEST:0001","page_area":"homepage","display_name":"TEST:0001","prefix":"TEST"}}, "secondary_data_provider_dto": {"internal":false,"obsolete":false,"source_organization_abbreviation":"RGD","cross_reference_dto": {"internal":false,"obsolete":false,"referenced_curie":"TEST:0002","page_area":"homepage","display_name":"TEST:0002","prefix":"TEST"}}, @@ -37,11 +37,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -58,7 +58,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_13_no_related_note_free_text.json b/src/test/resources/bulk/04_disease_annotation/MR_13_no_related_note_free_text.json index 7eedebbcb..5d50c455a 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_13_no_related_note_free_text.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_13_no_related_note_free_text.json @@ -3,7 +3,7 @@ "mod_entity_id": "DATEST:MR13", "internal": false, "obsolete": false, - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -61,11 +61,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -82,7 +82,7 @@ "created_by_curie": "DATEST:Person0001", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-09T22:10:12+00:00", - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_14_no_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/04_disease_annotation/MR_14_no_data_provider_source_organization_abbreviation.json index 2e2deb3c6..434dcb3dc 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_14_no_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_14_no_data_provider_source_organization_abbreviation.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -71,11 +71,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -94,7 +94,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_15_no_secondary_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/04_disease_annotation/MR_15_no_secondary_data_provider_source_organization_abbreviation.json index 53ed7888f..f30d86be4 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_15_no_secondary_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_15_no_secondary_data_provider_source_organization_abbreviation.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -71,11 +71,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -94,7 +94,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_16_no_data_provider_cross_reference_referenced_curie.json b/src/test/resources/bulk/04_disease_annotation/MR_16_no_data_provider_cross_reference_referenced_curie.json index 440705f93..6a6c8a002 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_16_no_data_provider_cross_reference_referenced_curie.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_16_no_data_provider_cross_reference_referenced_curie.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -71,11 +71,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -94,7 +94,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_17_no_data_provider_cross_reference_display_name.json b/src/test/resources/bulk/04_disease_annotation/MR_17_no_data_provider_cross_reference_display_name.json index a713ef1c4..0fa51b166 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_17_no_data_provider_cross_reference_display_name.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_17_no_data_provider_cross_reference_display_name.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -71,11 +71,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -94,7 +94,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/MR_18_no_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/04_disease_annotation/MR_18_no_data_provider_cross_reference_prefix.json index 1eaaed20b..e9cf3988a 100644 --- a/src/test/resources/bulk/04_disease_annotation/MR_18_no_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/04_disease_annotation/MR_18_no_data_provider_cross_reference_prefix.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -71,11 +71,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -94,7 +94,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/SI_01_secondary_ids.json b/src/test/resources/bulk/04_disease_annotation/SI_01_secondary_ids.json index 1ac519759..7d7135c7a 100644 --- a/src/test/resources/bulk/04_disease_annotation/SI_01_secondary_ids.json +++ b/src/test/resources/bulk/04_disease_annotation/SI_01_secondary_ids.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001secondary", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -95,7 +95,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/UD_01_update_all_except_default_fields_gene_annotation.json b/src/test/resources/bulk/04_disease_annotation/UD_01_update_all_except_default_fields_gene_annotation.json index b2306e997..9c54c14e4 100644 --- a/src/test/resources/bulk/04_disease_annotation/UD_01_update_all_except_default_fields_gene_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/UD_01_update_all_except_default_fields_gene_annotation.json @@ -5,7 +5,7 @@ "updated_by_curie": "DATEST:Person0001", "date_created": "2022-03-19T22:10:12+00:00", "date_updated": "2022-03-20T22:10:12+00:00", - "gene_curie": "DATEST:Gene0002", + "gene_identifier": "DATEST:Gene0002", "do_term_curie": "DATEST:Disease0002", "secondary_data_provider_dto": { "internal": false, @@ -65,11 +65,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0001" ], "disease_genetic_modifier_relation_name": "exacerbated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0002" ], "reference_curie": "PMID:25920551", @@ -86,7 +86,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0002", + "sgd_strain_background_identifier": "SGD:AGM0002", "annotation_type_name": "computational", "disease_qualifier_names": [ "severity" diff --git a/src/test/resources/bulk/04_disease_annotation/UD_02_update_all_except_default_fields_allele_annotation.json b/src/test/resources/bulk/04_disease_annotation/UD_02_update_all_except_default_fields_allele_annotation.json index b34c70afd..ffd5920ad 100644 --- a/src/test/resources/bulk/04_disease_annotation/UD_02_update_all_except_default_fields_allele_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/UD_02_update_all_except_default_fields_allele_annotation.json @@ -5,7 +5,7 @@ "updated_by_curie": "DATEST:Person0001", "date_created": "2022-03-19T22:10:12+00:00", "date_updated": "2022-03-20T22:10:12+00:00", - "allele_curie": "DATEST:Allele0002", + "allele_identifier": "DATEST:Allele0002", "do_term_curie": "DATEST:Disease0002", "secondary_data_provider_dto": { "internal": false, @@ -65,11 +65,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0001" ], "disease_genetic_modifier_relation_name": "exacerbated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0002" ], "reference_curie": "PMID:25920551", @@ -90,8 +90,8 @@ "disease_qualifier_names": [ "severity" ], - "inferred_gene_curie": "DATEST:Gene0002", - "asserted_gene_curies": [ + "inferred_gene_identifier": "DATEST:Gene0002", + "asserted_gene_identifiers": [ "DATEST:Gene0001" ] } diff --git a/src/test/resources/bulk/04_disease_annotation/UD_03_update_all_except_default_fields_agm_annotation.json b/src/test/resources/bulk/04_disease_annotation/UD_03_update_all_except_default_fields_agm_annotation.json index 4b75b1650..f0cc1fe3f 100644 --- a/src/test/resources/bulk/04_disease_annotation/UD_03_update_all_except_default_fields_agm_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/UD_03_update_all_except_default_fields_agm_annotation.json @@ -5,7 +5,7 @@ "updated_by_curie": "DATEST:Person0001", "date_created": "2022-03-19T22:10:12+00:00", "date_updated": "2022-03-20T22:10:12+00:00", - "agm_curie": "DATEST:AGM0002", + "agm_identifier": "DATEST:AGM0002", "do_term_curie": "DATEST:Disease0002", "secondary_data_provider_dto": { "internal": false, @@ -65,11 +65,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0001" ], "disease_genetic_modifier_relation_name": "exacerbated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0002" ], "reference_curie": "PMID:25920551", @@ -90,11 +90,11 @@ "disease_qualifier_names": [ "severity" ], - "inferred_gene_curie": "DATEST:Gene0002", - "asserted_gene_curies": [ + "inferred_gene_identifier": "DATEST:Gene0002", + "asserted_gene_identifiers": [ "DATEST:Gene0001" ], - "inferred_allele_curie": "DATEST:Allele0002", - "asserted_allele_curie": "DATEST:Allele0001" + "inferred_allele_identifier": "DATEST:Allele0002", + "asserted_allele_identifier": "DATEST:Allele0001" } ] diff --git a/src/test/resources/bulk/04_disease_annotation/UE_01_update_empty_non_required_fields_level_1_gene_annotation.json b/src/test/resources/bulk/04_disease_annotation/UE_01_update_empty_non_required_fields_level_1_gene_annotation.json index 556849296..aef14bdb8 100644 --- a/src/test/resources/bulk/04_disease_annotation/UE_01_update_empty_non_required_fields_level_1_gene_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/UE_01_update_empty_non_required_fields_level_1_gene_annotation.json @@ -5,7 +5,7 @@ "updated_by_curie": "", "date_created": "", "date_updated": "", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -24,12 +24,12 @@ "DATEST:Evidence0001" ], "condition_relation_dtos": [], - "disease_genetic_modifier_curies": [], + "disease_genetic_modifier_identifiers": [], "disease_genetic_modifier_relation_name": "", - "with_gene_curies": [], + "with_gene_identifiers": [], "reference_curie": "PMID:25920554", "note_dtos": [], - "sgd_strain_background_curie": "", + "sgd_strain_background_identifier": "", "annotation_type_name": "", "disease_qualifier_names": [] } diff --git a/src/test/resources/bulk/04_disease_annotation/UE_02_update_empty_non_required_fields_level_1_allele_annotation.json b/src/test/resources/bulk/04_disease_annotation/UE_02_update_empty_non_required_fields_level_1_allele_annotation.json index 0044e36d7..4158ad708 100644 --- a/src/test/resources/bulk/04_disease_annotation/UE_02_update_empty_non_required_fields_level_1_allele_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/UE_02_update_empty_non_required_fields_level_1_allele_annotation.json @@ -5,7 +5,7 @@ "updated_by_curie": "", "date_created": "", "date_updated": "", - "allele_curie": "DATEST:Allele0001", + "allele_identifier": "DATEST:Allele0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -24,14 +24,14 @@ "DATEST:Evidence0001" ], "condition_relation_dtos": [], - "disease_genetic_modifier_curies": [], + "disease_genetic_modifier_identifiers": [], "disease_genetic_modifier_relation_name": "", - "with_gene_curies": [], + "with_gene_identifiers": [], "reference_curie": "PMID:25920554", "note_dtos": [], "annotation_type_name": "", "disease_qualifier_names": [], - "inferred_gene_curie": "", - "asserted_gene_curies": [] + "inferred_gene_identifier": "", + "asserted_gene_identifiers": [] } ] diff --git a/src/test/resources/bulk/04_disease_annotation/UE_03_update_empty_non_required_fields_level_1_agm_annotation.json b/src/test/resources/bulk/04_disease_annotation/UE_03_update_empty_non_required_fields_level_1_agm_annotation.json index c53f30e21..9edfeb8ae 100644 --- a/src/test/resources/bulk/04_disease_annotation/UE_03_update_empty_non_required_fields_level_1_agm_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/UE_03_update_empty_non_required_fields_level_1_agm_annotation.json @@ -5,7 +5,7 @@ "updated_by_curie": "", "date_created": "", "date_updated": "", - "agm_curie": "DATEST:AGM0001", + "agm_identifier": "DATEST:AGM0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -24,16 +24,16 @@ "DATEST:Evidence0001" ], "condition_relation_dtos": [], - "disease_genetic_modifier_curies": [], + "disease_genetic_modifier_identifiers": [], "disease_genetic_modifier_relation_name": "", - "with_gene_curies": [], + "with_gene_identifiers": [], "reference_curie": "PMID:25920554", "note_dtos": [], "annotation_type_name": "", "disease_qualifier_names": [], - "inferred_gene_curie": "", - "asserted_gene_curies": [], - "inferred_allele_curie": "", - "asserted_allele_curie": "" + "inferred_gene_identifier": "", + "asserted_gene_identifiers": [], + "inferred_allele_identifier": "", + "asserted_allele_identifier": "" } ] diff --git a/src/test/resources/bulk/04_disease_annotation/UE_04_update_empty_non_required_fields_level_2.json b/src/test/resources/bulk/04_disease_annotation/UE_04_update_empty_non_required_fields_level_2.json index 088bd69e9..9e2ce550b 100644 --- a/src/test/resources/bulk/04_disease_annotation/UE_04_update_empty_non_required_fields_level_2.json +++ b/src/test/resources/bulk/04_disease_annotation/UE_04_update_empty_non_required_fields_level_2.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "source_organization_abbreviation": "WB", @@ -60,11 +60,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -79,7 +79,7 @@ "evidence_curies": [] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/UM_01_update_no_non_required_fields_level_1_gene_annotation.json b/src/test/resources/bulk/04_disease_annotation/UM_01_update_no_non_required_fields_level_1_gene_annotation.json index fb708a657..e8c6d5433 100644 --- a/src/test/resources/bulk/04_disease_annotation/UM_01_update_no_non_required_fields_level_1_gene_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/UM_01_update_no_non_required_fields_level_1_gene_annotation.json @@ -1,7 +1,7 @@ [ { "mod_entity_id": "DATEST:Annot0001", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, diff --git a/src/test/resources/bulk/04_disease_annotation/UM_02_update_no_non_required_fields_level_1_allele_annotation.json b/src/test/resources/bulk/04_disease_annotation/UM_02_update_no_non_required_fields_level_1_allele_annotation.json index 264c957c7..d2354cac9 100644 --- a/src/test/resources/bulk/04_disease_annotation/UM_02_update_no_non_required_fields_level_1_allele_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/UM_02_update_no_non_required_fields_level_1_allele_annotation.json @@ -1,7 +1,7 @@ [ { "mod_entity_id": "DATEST:Annot0002", - "allele_curie": "DATEST:Allele0001", + "allele_identifier": "DATEST:Allele0001", "do_term_curie": "DATEST:Disease0001", "disease_relation_name": "is_implicated_in", "data_provider_dto": { diff --git a/src/test/resources/bulk/04_disease_annotation/UM_03_update_no_non_required_fields_level_1_agm_annotation.json b/src/test/resources/bulk/04_disease_annotation/UM_03_update_no_non_required_fields_level_1_agm_annotation.json index 3ade314cb..f0a743e7d 100644 --- a/src/test/resources/bulk/04_disease_annotation/UM_03_update_no_non_required_fields_level_1_agm_annotation.json +++ b/src/test/resources/bulk/04_disease_annotation/UM_03_update_no_non_required_fields_level_1_agm_annotation.json @@ -1,7 +1,7 @@ [ { "mod_entity_id": "DATEST:Annot0003", - "agm_curie": "DATEST:AGM0001", + "agm_identifier": "DATEST:AGM0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, diff --git a/src/test/resources/bulk/04_disease_annotation/UM_04_update_no_non_required_fields_level_2.json b/src/test/resources/bulk/04_disease_annotation/UM_04_update_no_non_required_fields_level_2.json index 36e808edd..f8bbe4626 100644 --- a/src/test/resources/bulk/04_disease_annotation/UM_04_update_no_non_required_fields_level_2.json +++ b/src/test/resources/bulk/04_disease_annotation/UM_04_update_no_non_required_fields_level_2.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -35,11 +35,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -49,7 +49,7 @@ "note_type_name": "disease_summary" } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/US_01_unsupported_evidence_code.json b/src/test/resources/bulk/04_disease_annotation/US_01_unsupported_evidence_code.json index 1ce84795d..d3293e0cd 100644 --- a/src/test/resources/bulk/04_disease_annotation/US_01_unsupported_evidence_code.json +++ b/src/test/resources/bulk/04_disease_annotation/US_01_unsupported_evidence_code.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0001", + "gene_identifier": "DATEST:Gene0001", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -95,7 +95,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/VS_01_valid_subject_gene_for_HUMAN.json b/src/test/resources/bulk/04_disease_annotation/VS_01_valid_subject_gene_for_HUMAN.json index 16fbc4e93..80ba24f9f 100644 --- a/src/test/resources/bulk/04_disease_annotation/VS_01_valid_subject_gene_for_HUMAN.json +++ b/src/test/resources/bulk/04_disease_annotation/VS_01_valid_subject_gene_for_HUMAN.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0004", + "gene_identifier": "DATEST:Gene0004", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -95,7 +95,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/VS_02_valid_subject_gene_for_RGD.json b/src/test/resources/bulk/04_disease_annotation/VS_02_valid_subject_gene_for_RGD.json index db6b24909..7292cee18 100644 --- a/src/test/resources/bulk/04_disease_annotation/VS_02_valid_subject_gene_for_RGD.json +++ b/src/test/resources/bulk/04_disease_annotation/VS_02_valid_subject_gene_for_RGD.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "gene_curie": "DATEST:Gene0003", + "gene_identifier": "DATEST:Gene0003", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -95,7 +95,7 @@ ] } ], - "sgd_strain_background_curie": "SGD:AGM0001", + "sgd_strain_background_identifier": "SGD:AGM0001", "annotation_type_name": "manually_curated", "disease_qualifier_names": [ "susceptibility" diff --git a/src/test/resources/bulk/04_disease_annotation/VS_03_valid_subject_allele_for_HUMAN.json b/src/test/resources/bulk/04_disease_annotation/VS_03_valid_subject_allele_for_HUMAN.json index a7395143b..40edc7f5f 100644 --- a/src/test/resources/bulk/04_disease_annotation/VS_03_valid_subject_allele_for_HUMAN.json +++ b/src/test/resources/bulk/04_disease_annotation/VS_03_valid_subject_allele_for_HUMAN.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "allele_curie": "DATEST:Allele0004", + "allele_identifier": "DATEST:Allele0004", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -99,8 +99,8 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "DATEST:Gene0001", - "asserted_gene_curies": [ + "inferred_gene_identifier": "DATEST:Gene0001", + "asserted_gene_identifiers": [ "DATEST:Gene0002" ] } diff --git a/src/test/resources/bulk/04_disease_annotation/VS_04_valid_subject_allele_for_RGD.json b/src/test/resources/bulk/04_disease_annotation/VS_04_valid_subject_allele_for_RGD.json index 5cd36b661..30cac5b25 100644 --- a/src/test/resources/bulk/04_disease_annotation/VS_04_valid_subject_allele_for_RGD.json +++ b/src/test/resources/bulk/04_disease_annotation/VS_04_valid_subject_allele_for_RGD.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "allele_curie": "DATEST:Allele0003", + "allele_identifier": "DATEST:Allele0003", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -99,8 +99,8 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "DATEST:Gene0001", - "asserted_gene_curies": [ + "inferred_gene_identifier": "DATEST:Gene0001", + "asserted_gene_identifiers": [ "DATEST:Gene0002" ] } diff --git a/src/test/resources/bulk/04_disease_annotation/VS_05_valid_subject_agm_for_HUMAN.json b/src/test/resources/bulk/04_disease_annotation/VS_05_valid_subject_agm_for_HUMAN.json index 8d806a554..ee24515cb 100644 --- a/src/test/resources/bulk/04_disease_annotation/VS_05_valid_subject_agm_for_HUMAN.json +++ b/src/test/resources/bulk/04_disease_annotation/VS_05_valid_subject_agm_for_HUMAN.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "agm_curie": "DATEST:AGM0004", + "agm_identifier": "DATEST:AGM0004", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -99,11 +99,11 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "DATEST:Gene0001", - "asserted_gene_curies": [ + "inferred_gene_identifier": "DATEST:Gene0001", + "asserted_gene_identifiers": [ "DATEST:Gene0002" ], - "inferred_allele_curie": "DATEST:Allele0001", - "asserted_allele_curie": "DATEST:Allele0002" + "inferred_allele_identifier": "DATEST:Allele0001", + "asserted_allele_identifier": "DATEST:Allele0002" } ] diff --git a/src/test/resources/bulk/04_disease_annotation/VS_06_valid_subject_agm_for_RGD.json b/src/test/resources/bulk/04_disease_annotation/VS_06_valid_subject_agm_for_RGD.json index 31ddc1a5b..446220f36 100644 --- a/src/test/resources/bulk/04_disease_annotation/VS_06_valid_subject_agm_for_RGD.json +++ b/src/test/resources/bulk/04_disease_annotation/VS_06_valid_subject_agm_for_RGD.json @@ -7,7 +7,7 @@ "updated_by_curie": "DATEST:Person0002", "date_created": "2022-03-09T22:10:12+00:00", "date_updated": "2022-03-10T22:10:12+00:00", - "agm_curie": "DATEST:AGM0003", + "agm_identifier": "DATEST:AGM0003", "do_term_curie": "DATEST:Disease0001", "data_provider_dto": { "internal": false, @@ -72,11 +72,11 @@ ] } ], - "disease_genetic_modifier_curies": [ + "disease_genetic_modifier_identifiers": [ "DATEST:Gene0002" ], "disease_genetic_modifier_relation_name": "ameliorated_by", - "with_gene_curies": [ + "with_gene_identifiers": [ "HGNC:0001" ], "reference_curie": "PMID:25920554", @@ -99,11 +99,11 @@ "disease_qualifier_names": [ "susceptibility" ], - "inferred_gene_curie": "DATEST:Gene0001", - "asserted_gene_curies": [ + "inferred_gene_identifier": "DATEST:Gene0001", + "asserted_gene_identifiers": [ "DATEST:Gene0002" ], - "inferred_allele_curie": "DATEST:Allele0001", - "asserted_allele_curie": "DATEST:Allele0002" + "inferred_allele_identifier": "DATEST:Allele0001", + "asserted_allele_identifier": "DATEST:Allele0002" } ] diff --git a/src/test/resources/bulk/06_variant/AF_01_all_fields.json b/src/test/resources/bulk/06_variant/AF_01_all_fields.json index 2489b9963..94dedc737 100644 --- a/src/test/resources/bulk/06_variant/AF_01_all_fields.json +++ b/src/test/resources/bulk/06_variant/AF_01_all_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:Variant0001", + "mod_entity_id": "VARIANTTEST:Variant0001", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/DN_01_duplicate_notes.json b/src/test/resources/bulk/06_variant/DN_01_duplicate_notes.json index 5b56030a9..545c95531 100644 --- a/src/test/resources/bulk/06_variant/DN_01_duplicate_notes.json +++ b/src/test/resources/bulk/06_variant/DN_01_duplicate_notes.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:DN01", + "mod_entity_id": "VARIANTTEST:DN01", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/EN_01_empty_non_required_fields.json b/src/test/resources/bulk/06_variant/EN_01_empty_non_required_fields.json index 474ebb400..edb8594aa 100644 --- a/src/test/resources/bulk/06_variant/EN_01_empty_non_required_fields.json +++ b/src/test/resources/bulk/06_variant/EN_01_empty_non_required_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:EN01", + "mod_entity_id": "VARIANTTEST:EN01", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "", diff --git a/src/test/resources/bulk/06_variant/ER_01_empty_curie.json b/src/test/resources/bulk/06_variant/ER_01_empty_curie.json index 582ea5772..da79c9d57 100644 --- a/src/test/resources/bulk/06_variant/ER_01_empty_curie.json +++ b/src/test/resources/bulk/06_variant/ER_01_empty_curie.json @@ -1,6 +1,6 @@ [ { - "curie": "", + "mod_entity_id": "", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/ER_02_empty_taxon.json b/src/test/resources/bulk/06_variant/ER_02_empty_taxon.json index e9e44e1e3..3f08b8741 100644 --- a/src/test/resources/bulk/06_variant/ER_02_empty_taxon.json +++ b/src/test/resources/bulk/06_variant/ER_02_empty_taxon.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:ER02", + "mod_entity_id": "VARIANTTEST:ER02", "taxon_curie": "", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/ER_03_empty_variant_type.json b/src/test/resources/bulk/06_variant/ER_03_empty_variant_type.json index fd89b72f7..79944ffcc 100644 --- a/src/test/resources/bulk/06_variant/ER_03_empty_variant_type.json +++ b/src/test/resources/bulk/06_variant/ER_03_empty_variant_type.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:ER03", + "mod_entity_id": "VARIANTTEST:ER03", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/ER_04_empty_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/06_variant/ER_04_empty_data_provider_source_organization_abbreviation.json index ab3bf0606..3f65e0e42 100644 --- a/src/test/resources/bulk/06_variant/ER_04_empty_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/06_variant/ER_04_empty_data_provider_source_organization_abbreviation.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:ER04", + "mod_entity_id": "VARIANTTEST:ER04", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/ER_05_empty_data_provider_cross_reference_referenced_curie.json b/src/test/resources/bulk/06_variant/ER_05_empty_data_provider_cross_reference_referenced_curie.json index eb9b154af..7083d310c 100644 --- a/src/test/resources/bulk/06_variant/ER_05_empty_data_provider_cross_reference_referenced_curie.json +++ b/src/test/resources/bulk/06_variant/ER_05_empty_data_provider_cross_reference_referenced_curie.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:ER05", + "mod_entity_id": "VARIANTTEST:ER05", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/ER_06_empty_data_provider_cross_reference_display_name.json b/src/test/resources/bulk/06_variant/ER_06_empty_data_provider_cross_reference_display_name.json index f21ccd411..220dee3c2 100644 --- a/src/test/resources/bulk/06_variant/ER_06_empty_data_provider_cross_reference_display_name.json +++ b/src/test/resources/bulk/06_variant/ER_06_empty_data_provider_cross_reference_display_name.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:ER06", + "mod_entity_id": "VARIANTTEST:ER06", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/ER_07_empty_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/06_variant/ER_07_empty_data_provider_cross_reference_prefix.json index 639a82740..3de6dbeb5 100644 --- a/src/test/resources/bulk/06_variant/ER_07_empty_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/06_variant/ER_07_empty_data_provider_cross_reference_prefix.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:ER07", + "mod_entity_id": "VARIANTTEST:ER07", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/ER_08_empty_data_provider_cross_reference_page_area.json b/src/test/resources/bulk/06_variant/ER_08_empty_data_provider_cross_reference_page_area.json index 30ce97971..74da99dd3 100644 --- a/src/test/resources/bulk/06_variant/ER_08_empty_data_provider_cross_reference_page_area.json +++ b/src/test/resources/bulk/06_variant/ER_08_empty_data_provider_cross_reference_page_area.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:ER08", + "mod_entity_id": "VARIANTTEST:ER08", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/ER_09_empty_related_notes_note_type.json b/src/test/resources/bulk/06_variant/ER_09_empty_related_notes_note_type.json index e9f1f5552..7a248cd84 100644 --- a/src/test/resources/bulk/06_variant/ER_09_empty_related_notes_note_type.json +++ b/src/test/resources/bulk/06_variant/ER_09_empty_related_notes_note_type.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:ER09", + "mod_entity_id": "VARIANTTEST:ER09", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/ER_10_empty_related_notes_free_text.json b/src/test/resources/bulk/06_variant/ER_10_empty_related_notes_free_text.json index ebb66b4e8..544e2b086 100644 --- a/src/test/resources/bulk/06_variant/ER_10_empty_related_notes_free_text.json +++ b/src/test/resources/bulk/06_variant/ER_10_empty_related_notes_free_text.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:ER10", + "mod_entity_id": "VARIANTTEST:ER10", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/IV_01_invalid_date_created.json b/src/test/resources/bulk/06_variant/IV_01_invalid_date_created.json index 32651c5dc..ed0c6e255 100644 --- a/src/test/resources/bulk/06_variant/IV_01_invalid_date_created.json +++ b/src/test/resources/bulk/06_variant/IV_01_invalid_date_created.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:IV01", + "mod_entity_id": "VARIANTTEST:IV01", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/IV_02_invalid_date_updated.json b/src/test/resources/bulk/06_variant/IV_02_invalid_date_updated.json index b34ba3d07..cd6cce1e1 100644 --- a/src/test/resources/bulk/06_variant/IV_02_invalid_date_updated.json +++ b/src/test/resources/bulk/06_variant/IV_02_invalid_date_updated.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:IV02", + "mod_entity_id": "VARIANTTEST:IV02", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/IV_03_invalid_taxon.json b/src/test/resources/bulk/06_variant/IV_03_invalid_taxon.json index 9417cb149..8ae3ba548 100644 --- a/src/test/resources/bulk/06_variant/IV_03_invalid_taxon.json +++ b/src/test/resources/bulk/06_variant/IV_03_invalid_taxon.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:IV03", + "mod_entity_id": "VARIANTTEST:IV03", "taxon_curie": "NCBITaxon:Invalid", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/IV_04_invalid_variant_type.json b/src/test/resources/bulk/06_variant/IV_04_invalid_variant_type.json index 1111cf372..fe4206efd 100644 --- a/src/test/resources/bulk/06_variant/IV_04_invalid_variant_type.json +++ b/src/test/resources/bulk/06_variant/IV_04_invalid_variant_type.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:IV04", + "mod_entity_id": "VARIANTTEST:IV04", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:Invalid", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/IV_05_invalid_variant_status.json b/src/test/resources/bulk/06_variant/IV_05_invalid_variant_status.json index 047713fb8..8584fba88 100644 --- a/src/test/resources/bulk/06_variant/IV_05_invalid_variant_status.json +++ b/src/test/resources/bulk/06_variant/IV_05_invalid_variant_status.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:IV05", + "mod_entity_id": "VARIANTTEST:IV05", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "invalid", diff --git a/src/test/resources/bulk/06_variant/IV_06_invalid_source_general_consequence.json b/src/test/resources/bulk/06_variant/IV_06_invalid_source_general_consequence.json index 0dd019061..b392487af 100644 --- a/src/test/resources/bulk/06_variant/IV_06_invalid_source_general_consequence.json +++ b/src/test/resources/bulk/06_variant/IV_06_invalid_source_general_consequence.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:IV06", + "mod_entity_id": "VARIANTTEST:IV06", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/IV_07_invalid_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/06_variant/IV_07_invalid_data_provider_source_organization_abbreviation.json index 305347897..cb9355a73 100644 --- a/src/test/resources/bulk/06_variant/IV_07_invalid_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/06_variant/IV_07_invalid_data_provider_source_organization_abbreviation.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:IV07", + "mod_entity_id": "VARIANTTEST:IV07", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/IV_08_invalid_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/06_variant/IV_08_invalid_data_provider_cross_reference_prefix.json index 75ebb5aff..3f1ee271f 100644 --- a/src/test/resources/bulk/06_variant/IV_08_invalid_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/06_variant/IV_08_invalid_data_provider_cross_reference_prefix.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:IV08", + "mod_entity_id": "VARIANTTEST:IV08", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/IV_09_invalid_data_provider_cross_reference_page_area.json b/src/test/resources/bulk/06_variant/IV_09_invalid_data_provider_cross_reference_page_area.json index a4b3eee46..ce60fe8ab 100644 --- a/src/test/resources/bulk/06_variant/IV_09_invalid_data_provider_cross_reference_page_area.json +++ b/src/test/resources/bulk/06_variant/IV_09_invalid_data_provider_cross_reference_page_area.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:IV09", + "mod_entity_id": "VARIANTTEST:IV09", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/IV_10_invalid_related_notes_note_type.json b/src/test/resources/bulk/06_variant/IV_10_invalid_related_notes_note_type.json index 26e02f3ff..40b3e161a 100644 --- a/src/test/resources/bulk/06_variant/IV_10_invalid_related_notes_note_type.json +++ b/src/test/resources/bulk/06_variant/IV_10_invalid_related_notes_note_type.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:IV10", + "mod_entity_id": "VARIANTTEST:IV10", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/IV_11_invalid_related_notes_evidence.json b/src/test/resources/bulk/06_variant/IV_11_invalid_related_notes_evidence.json index df9304d22..ae9e57be0 100644 --- a/src/test/resources/bulk/06_variant/IV_11_invalid_related_notes_evidence.json +++ b/src/test/resources/bulk/06_variant/IV_11_invalid_related_notes_evidence.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:IV11", + "mod_entity_id": "VARIANTTEST:IV11", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/MN_01_no_non_required_fields_level_1.json b/src/test/resources/bulk/06_variant/MN_01_no_non_required_fields_level_1.json index 3b9866404..d390c610c 100644 --- a/src/test/resources/bulk/06_variant/MN_01_no_non_required_fields_level_1.json +++ b/src/test/resources/bulk/06_variant/MN_01_no_non_required_fields_level_1.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:MN01", + "mod_entity_id": "VARIANTTEST:MN01", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "data_provider_dto": { diff --git a/src/test/resources/bulk/06_variant/MN_02_no_non_required_fields_level_2.json b/src/test/resources/bulk/06_variant/MN_02_no_non_required_fields_level_2.json index a10508c83..b8f241419 100644 --- a/src/test/resources/bulk/06_variant/MN_02_no_non_required_fields_level_2.json +++ b/src/test/resources/bulk/06_variant/MN_02_no_non_required_fields_level_2.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:MN02", + "mod_entity_id": "VARIANTTEST:MN02", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/MR_02_no_taxon.json b/src/test/resources/bulk/06_variant/MR_02_no_taxon.json index 5d702f181..beaaa4579 100644 --- a/src/test/resources/bulk/06_variant/MR_02_no_taxon.json +++ b/src/test/resources/bulk/06_variant/MR_02_no_taxon.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:MR02", + "mod_entity_id": "VARIANTTEST:MR02", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", "source_general_consequence_curie": "SO:SGC001", diff --git a/src/test/resources/bulk/06_variant/MR_03_no_variant_type.json b/src/test/resources/bulk/06_variant/MR_03_no_variant_type.json index cd0059324..26d39ff38 100644 --- a/src/test/resources/bulk/06_variant/MR_03_no_variant_type.json +++ b/src/test/resources/bulk/06_variant/MR_03_no_variant_type.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:MR03", + "mod_entity_id": "VARIANTTEST:MR03", "taxon_curie": "NCBITaxon:6239", "variant_status_name": "status_test", "source_general_consequence_curie": "SO:SGC001", diff --git a/src/test/resources/bulk/06_variant/MR_04_no_data_provider.json b/src/test/resources/bulk/06_variant/MR_04_no_data_provider.json index 74c409550..0ca4bff2f 100644 --- a/src/test/resources/bulk/06_variant/MR_04_no_data_provider.json +++ b/src/test/resources/bulk/06_variant/MR_04_no_data_provider.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:MR04", + "mod_entity_id": "VARIANTTEST:MR04", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/MR_05_no_data_provider_source_organization_abbreviation.json b/src/test/resources/bulk/06_variant/MR_05_no_data_provider_source_organization_abbreviation.json index aa8227112..4fa4b59e9 100644 --- a/src/test/resources/bulk/06_variant/MR_05_no_data_provider_source_organization_abbreviation.json +++ b/src/test/resources/bulk/06_variant/MR_05_no_data_provider_source_organization_abbreviation.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:MR05", + "mod_entity_id": "VARIANTTEST:MR05", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/MR_06_no_data_provider_cross_reference_referenced_curie.json b/src/test/resources/bulk/06_variant/MR_06_no_data_provider_cross_reference_referenced_curie.json index 86f78ad31..b17396f08 100644 --- a/src/test/resources/bulk/06_variant/MR_06_no_data_provider_cross_reference_referenced_curie.json +++ b/src/test/resources/bulk/06_variant/MR_06_no_data_provider_cross_reference_referenced_curie.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:MR06", + "mod_entity_id": "VARIANTTEST:MR06", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/MR_07_no_data_provider_cross_reference_display_name.json b/src/test/resources/bulk/06_variant/MR_07_no_data_provider_cross_reference_display_name.json index f4e5b54db..ab878dcc8 100644 --- a/src/test/resources/bulk/06_variant/MR_07_no_data_provider_cross_reference_display_name.json +++ b/src/test/resources/bulk/06_variant/MR_07_no_data_provider_cross_reference_display_name.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:MR07", + "mod_entity_id": "VARIANTTEST:MR07", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/MR_08_no_data_provider_cross_reference_prefix.json b/src/test/resources/bulk/06_variant/MR_08_no_data_provider_cross_reference_prefix.json index 4bfeebf79..d6eb1c761 100644 --- a/src/test/resources/bulk/06_variant/MR_08_no_data_provider_cross_reference_prefix.json +++ b/src/test/resources/bulk/06_variant/MR_08_no_data_provider_cross_reference_prefix.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:MR08", + "mod_entity_id": "VARIANTTEST:MR08", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/MR_09_no_data_provider_cross_reference_page_area.json b/src/test/resources/bulk/06_variant/MR_09_no_data_provider_cross_reference_page_area.json index 04071d33d..8752dcbdd 100644 --- a/src/test/resources/bulk/06_variant/MR_09_no_data_provider_cross_reference_page_area.json +++ b/src/test/resources/bulk/06_variant/MR_09_no_data_provider_cross_reference_page_area.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:MR09", + "mod_entity_id": "VARIANTTEST:MR09", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/MR_10_no_related_notes_note_type.json b/src/test/resources/bulk/06_variant/MR_10_no_related_notes_note_type.json index 04207ad98..8332dc32e 100644 --- a/src/test/resources/bulk/06_variant/MR_10_no_related_notes_note_type.json +++ b/src/test/resources/bulk/06_variant/MR_10_no_related_notes_note_type.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:MR10", + "mod_entity_id": "VARIANTTEST:MR10", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/MR_11_no_related_notes_free_text.json b/src/test/resources/bulk/06_variant/MR_11_no_related_notes_free_text.json index f128a4ca6..3e983ef00 100644 --- a/src/test/resources/bulk/06_variant/MR_11_no_related_notes_free_text.json +++ b/src/test/resources/bulk/06_variant/MR_11_no_related_notes_free_text.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:MR11", + "mod_entity_id": "VARIANTTEST:MR11", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/06_variant/UD_01_update_all_except_default_fields.json b/src/test/resources/bulk/06_variant/UD_01_update_all_except_default_fields.json index f61e9c24c..9b1a918d9 100644 --- a/src/test/resources/bulk/06_variant/UD_01_update_all_except_default_fields.json +++ b/src/test/resources/bulk/06_variant/UD_01_update_all_except_default_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:Variant0001", + "mod_entity_id": "VARIANTTEST:Variant0001", "taxon_curie": "NCBITaxon:10116", "variant_type_curie": "SO:VT002", "variant_status_name": "status_test_2", diff --git a/src/test/resources/bulk/06_variant/UE_01_update_empty_non_required_fields.json b/src/test/resources/bulk/06_variant/UE_01_update_empty_non_required_fields.json index 133f50107..14cb13cab 100644 --- a/src/test/resources/bulk/06_variant/UE_01_update_empty_non_required_fields.json +++ b/src/test/resources/bulk/06_variant/UE_01_update_empty_non_required_fields.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:Variant0001", + "mod_entity_id": "VARIANTTEST:Variant0001", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "", diff --git a/src/test/resources/bulk/06_variant/UM_01_update_no_non_required_fields_level_1.json b/src/test/resources/bulk/06_variant/UM_01_update_no_non_required_fields_level_1.json index c9161743c..726bd44f2 100644 --- a/src/test/resources/bulk/06_variant/UM_01_update_no_non_required_fields_level_1.json +++ b/src/test/resources/bulk/06_variant/UM_01_update_no_non_required_fields_level_1.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:Variant0001", + "mod_entity_id": "VARIANTTEST:Variant0001", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "data_provider_dto": { diff --git a/src/test/resources/bulk/06_variant/UM_02_update_no_non_required_fields_level_2.json b/src/test/resources/bulk/06_variant/UM_02_update_no_non_required_fields_level_2.json index ae6de77d5..abc00f85e 100644 --- a/src/test/resources/bulk/06_variant/UM_02_update_no_non_required_fields_level_2.json +++ b/src/test/resources/bulk/06_variant/UM_02_update_no_non_required_fields_level_2.json @@ -1,6 +1,6 @@ [ { - "curie": "VARIANTTEST:Variant0001", + "mod_entity_id": "VARIANTTEST:Variant0001", "taxon_curie": "NCBITaxon:6239", "variant_type_curie": "SO:VT001", "variant_status_name": "status_test", diff --git a/src/test/resources/bulk/AA01_allele_gene_association/AF_01_all_fields.json b/src/test/resources/bulk/AA01_allele_gene_association/AF_01_all_fields.json index bf9b2df5f..6954626b8 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/AF_01_all_fields.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/AF_01_all_fields.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/ER_01_empty_subject.json b/src/test/resources/bulk/AA01_allele_gene_association/ER_01_empty_subject.json index 00356bdf7..89297ef85 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/ER_01_empty_subject.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/ER_01_empty_subject.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "", + "allele_identifier": "", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/ER_02_empty_relation.json b/src/test/resources/bulk/AA01_allele_gene_association/ER_02_empty_relation.json index d58a769ac..254ff3352 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/ER_02_empty_relation.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/ER_02_empty_relation.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/ER_03_empty_object.json b/src/test/resources/bulk/AA01_allele_gene_association/ER_03_empty_object.json index ea509936e..9d11a3961 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/ER_03_empty_object.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/ER_03_empty_object.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "", + "gene_identifier": "", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/ER_04_empty_related_note_note_type.json b/src/test/resources/bulk/AA01_allele_gene_association/ER_04_empty_related_note_note_type.json index 0a9d58ef2..3c45a53fe 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/ER_04_empty_related_note_note_type.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/ER_04_empty_related_note_note_type.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/ER_05_empty_related_note_free_text.json b/src/test/resources/bulk/AA01_allele_gene_association/ER_05_empty_related_note_free_text.json index a3fe4e62a..e9a639220 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/ER_05_empty_related_note_free_text.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/ER_05_empty_related_note_free_text.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/IV_01_invalid_subject.json b/src/test/resources/bulk/AA01_allele_gene_association/IV_01_invalid_subject.json index 28fd91511..86c693972 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/IV_01_invalid_subject.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/IV_01_invalid_subject.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "Invalid", + "allele_identifier": "Invalid", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/IV_02_invalid_relation.json b/src/test/resources/bulk/AA01_allele_gene_association/IV_02_invalid_relation.json index 274d3724b..f463abce5 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/IV_02_invalid_relation.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/IV_02_invalid_relation.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "invalid", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/IV_03_invalid_object.json b/src/test/resources/bulk/AA01_allele_gene_association/IV_03_invalid_object.json index ebb09c2d6..ed8cb191c 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/IV_03_invalid_object.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/IV_03_invalid_object.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "Invalid", + "gene_identifier": "Invalid", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/IV_04_invalid_date_created.json b/src/test/resources/bulk/AA01_allele_gene_association/IV_04_invalid_date_created.json index bad261e19..d6664b89e 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/IV_04_invalid_date_created.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/IV_04_invalid_date_created.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/IV_05_invalid_date_updated.json b/src/test/resources/bulk/AA01_allele_gene_association/IV_05_invalid_date_updated.json index 3c06dc1a5..6d3ec052a 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/IV_05_invalid_date_updated.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/IV_05_invalid_date_updated.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/IV_06_invalid_evidence_code.json b/src/test/resources/bulk/AA01_allele_gene_association/IV_06_invalid_evidence_code.json index 977bcd171..503467fd8 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/IV_06_invalid_evidence_code.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/IV_06_invalid_evidence_code.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "Invalid", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/IV_07_invalid_evidence.json b/src/test/resources/bulk/AA01_allele_gene_association/IV_07_invalid_evidence.json index a4b560d73..5b1ddc539 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/IV_07_invalid_evidence.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/IV_07_invalid_evidence.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:Invalid" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/IV_08_invalid_related_note_note_type.json b/src/test/resources/bulk/AA01_allele_gene_association/IV_08_invalid_related_note_note_type.json index 686f087cb..0512bce1f 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/IV_08_invalid_related_note_note_type.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/IV_08_invalid_related_note_note_type.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/MR_01_no_subject.json b/src/test/resources/bulk/AA01_allele_gene_association/MR_01_no_subject.json index 410d4c6b5..6539b4132 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/MR_01_no_subject.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/MR_01_no_subject.json @@ -1,7 +1,7 @@ [ { "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/MR_02_no_relation.json b/src/test/resources/bulk/AA01_allele_gene_association/MR_02_no_relation.json index dc2c2de95..e5646bfe7 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/MR_02_no_relation.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/MR_02_no_relation.json @@ -1,7 +1,7 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", - "gene_curie": "GENETEST:Gene0001", + "allele_identifier": "ALLELETEST:Allele0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/MR_03_no_object.json b/src/test/resources/bulk/AA01_allele_gene_association/MR_03_no_object.json index fc75bf96e..ece82884a 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/MR_03_no_object.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/MR_03_no_object.json @@ -1,6 +1,6 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ diff --git a/src/test/resources/bulk/AA01_allele_gene_association/MR_04_no_related_note_note_type.json b/src/test/resources/bulk/AA01_allele_gene_association/MR_04_no_related_note_note_type.json index a5338d0f6..2b46e5c6e 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/MR_04_no_related_note_note_type.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/MR_04_no_related_note_note_type.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/MR_05_no_related_note_free_text.json b/src/test/resources/bulk/AA01_allele_gene_association/MR_05_no_related_note_free_text.json index e7d4012b8..f4cc4f170 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/MR_05_no_related_note_free_text.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/MR_05_no_related_note_free_text.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/UD_01_update_all_except_default_fields.json b/src/test/resources/bulk/AA01_allele_gene_association/UD_01_update_all_except_default_fields.json index d8d8166a4..dbbfa4a01 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/UD_01_update_all_except_default_fields.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/UD_01_update_all_except_default_fields.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0002", "evidence_curies": [ "PMID:25920551" diff --git a/src/test/resources/bulk/AA01_allele_gene_association/UE_01_update_empty_non_required_fields.json b/src/test/resources/bulk/AA01_allele_gene_association/UE_01_update_empty_non_required_fields.json index 0d69d57ba..7c22da74a 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/UE_01_update_empty_non_required_fields.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/UE_01_update_empty_non_required_fields.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "", "evidence_curies": [], "internal": true, diff --git a/src/test/resources/bulk/AA01_allele_gene_association/UM_01_update_no_non_required_fields_level_1.json b/src/test/resources/bulk/AA01_allele_gene_association/UM_01_update_no_non_required_fields_level_1.json index 0de90a1f5..d3f5c6415 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/UM_01_update_no_non_required_fields_level_1.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/UM_01_update_no_non_required_fields_level_1.json @@ -1,7 +1,7 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001" + "gene_identifier": "GENETEST:Gene0001" } ] diff --git a/src/test/resources/bulk/AA01_allele_gene_association/UM_02_update_no_non_required_fields_level_2.json b/src/test/resources/bulk/AA01_allele_gene_association/UM_02_update_no_non_required_fields_level_2.json index cb4914eae..0ffd6ce31 100644 --- a/src/test/resources/bulk/AA01_allele_gene_association/UM_02_update_no_non_required_fields_level_2.json +++ b/src/test/resources/bulk/AA01_allele_gene_association/UM_02_update_no_non_required_fields_level_2.json @@ -1,8 +1,8 @@ [ { - "allele_curie": "ALLELETEST:Allele0001", + "allele_identifier": "ALLELETEST:Allele0001", "relation_name": "is_allele_of", - "gene_curie": "GENETEST:Gene0001", + "gene_identifier": "GENETEST:Gene0001", "evidence_code_curie": "DATEST:Evidence0001", "evidence_curies": [ "PMID:25920550" diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/AF_01_all_fields.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/AF_01_all_fields.json index 1c91834ba..e0758963c 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/AF_01_all_fields.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/AF_01_all_fields.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_01_empty_subject.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_01_empty_subject.json index 8c91a02b4..4eb6d76f2 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_01_empty_subject.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_01_empty_subject.json @@ -2,7 +2,7 @@ { "construct_identifier": "", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_02_empty_relation.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_02_empty_relation.json index e549a6cf7..6ceb62ed8 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_02_empty_relation.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_02_empty_relation.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_03_empty_object.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_03_empty_object.json index cd3dd44b3..bc9f6fbee 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_03_empty_object.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_03_empty_object.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "", + "genomic_entity_identifier": "", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_04_empty_related_note_note_type.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_04_empty_related_note_note_type.json index 0f232a029..8f2e79f04 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_04_empty_related_note_note_type.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_04_empty_related_note_note_type.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_05_empty_related_note_free_text.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_05_empty_related_note_free_text.json index 672d887ba..658ef5ed7 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_05_empty_related_note_free_text.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/ER_05_empty_related_note_free_text.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_01_invalid_subject.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_01_invalid_subject.json index 6bb4258e2..3c2388ac8 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_01_invalid_subject.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_01_invalid_subject.json @@ -2,7 +2,7 @@ { "construct_identifier": "CONSTRUCTTEST:IV01", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_02_invalid_relation.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_02_invalid_relation.json index c3d4538ce..91012447b 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_02_invalid_relation.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_02_invalid_relation.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "invalid", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_03_invalid_object.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_03_invalid_object.json index c11665347..74588bbf3 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_03_invalid_object.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_03_invalid_object.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Invalid", + "genomic_entity_identifier": "GENETEST:Invalid", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_04_invalid_date_created.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_04_invalid_date_created.json index fcd084e17..acaeb6e2f 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_04_invalid_date_created.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_04_invalid_date_created.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_05_invalid_date_updated.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_05_invalid_date_updated.json index d78ada9cc..1bf98e3a5 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_05_invalid_date_updated.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_05_invalid_date_updated.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_06_invalid_evidence.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_06_invalid_evidence.json index d06e19536..5070027e2 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_06_invalid_evidence.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_06_invalid_evidence.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:Invalid" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_07_invalid_related_note_note_type.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_07_invalid_related_note_note_type.json index d6cd16660..8261293d8 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_07_invalid_related_note_note_type.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/IV_07_invalid_related_note_note_type.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_01_no_subject.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_01_no_subject.json index 897a287df..6fc4a0340 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_01_no_subject.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_01_no_subject.json @@ -1,7 +1,7 @@ [ { "relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_02_no_relation.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_02_no_relation.json index 9936895f5..43386d907 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_02_no_relation.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_02_no_relation.json @@ -1,7 +1,7 @@ [ { "construct_identifier": "WB:Construct0001", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_04_no_related_note_note_type.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_04_no_related_note_note_type.json index 90fdb1997..9e28c7784 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_04_no_related_note_note_type.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_04_no_related_note_note_type.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_05_no_related_note_free_text.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_05_no_related_note_free_text.json index 4dbda39a0..f2a9e3493 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_05_no_related_note_free_text.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/MR_05_no_related_note_free_text.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/UD_01_update_all_except_default_fields.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/UD_01_update_all_except_default_fields.json index e7e87a7cb..a0e50efd5 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/UD_01_update_all_except_default_fields.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/UD_01_update_all_except_default_fields.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920551" ], diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/UE_01_update_empty_non_required_fields.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/UE_01_update_empty_non_required_fields.json index 1dbd4b9bd..e86822828 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/UE_01_update_empty_non_required_fields.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/UE_01_update_empty_non_required_fields.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [], "created_by_curie": "", "updated_by_curie": "", diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/UM_01_update_no_non_required_fields_level_1.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/UM_01_update_no_non_required_fields_level_1.json index 68daa2945..cd12428f8 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/UM_01_update_no_non_required_fields_level_1.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/UM_01_update_no_non_required_fields_level_1.json @@ -2,6 +2,6 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001" + "genomic_entity_identifier": "GENETEST:Gene0001" } ] \ No newline at end of file diff --git a/src/test/resources/bulk/CA01_construct_genomic_entity_association/UM_02_update_no_non_required_fields_level_2.json b/src/test/resources/bulk/CA01_construct_genomic_entity_association/UM_02_update_no_non_required_fields_level_2.json index 38d575384..0b73f81c0 100644 --- a/src/test/resources/bulk/CA01_construct_genomic_entity_association/UM_02_update_no_non_required_fields_level_2.json +++ b/src/test/resources/bulk/CA01_construct_genomic_entity_association/UM_02_update_no_non_required_fields_level_2.json @@ -2,7 +2,7 @@ { "construct_identifier": "WB:Construct0001", "genomic_entity_relation_name": "is_regulated_by", - "genomic_entity_curie": "GENETEST:Gene0001", + "genomic_entity_identifier": "GENETEST:Gene0001", "evidence_curies": [ "PMID:25920550" ], From f557ae8f7b1807aa9f47d75e8f66f1fd460d4316 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 8 Dec 2023 09:55:27 +0000 Subject: [PATCH 005/159] Test updates --- .../bulkupload/AgmBulkUploadITCase.java | 12 ++-- .../bulkupload/AlleleBulkUploadITCase.java | 16 ++--- .../DiseaseAnnotationBulkUploadITCase.java | 64 +++++++++---------- .../bulkupload/GeneBulkUploadITCase.java | 14 ++-- .../bulkupload/VariantBulkUploadITCase.java | 16 ++--- ...AlleleGeneAssociationBulkUploadITCase.java | 10 +-- ...omicEntityAssociationBulkUploadITCase.java | 8 +-- .../fms/OrthologyBulkUploadFmsITCase.java | 4 +- ...ty_curie.json => ER_01_empty_mod_ids.json} | 0 ...01_no_curie.json => MR_01_no_mod_ids.json} | 0 ...ty_curie.json => ER_01_empty_mod_ids.json} | 0 ...01_no_curie.json => MR_01_no_mod_ids.json} | 0 ...ty_curie.json => ER_01_empty_mod_ids.json} | 0 ...01_no_curie.json => MR_01_no_mod_ids.json} | 0 ...ty_curie.json => ER_01_empty_mod_ids.json} | 0 ...01_no_curie.json => MR_01_no_mod_ids.json} | 0 16 files changed, 72 insertions(+), 72 deletions(-) rename src/test/resources/bulk/01_gene/{ER_01_empty_curie.json => ER_01_empty_mod_ids.json} (100%) rename src/test/resources/bulk/01_gene/{MR_01_no_curie.json => MR_01_no_mod_ids.json} (100%) rename src/test/resources/bulk/02_allele/{ER_01_empty_curie.json => ER_01_empty_mod_ids.json} (100%) rename src/test/resources/bulk/02_allele/{MR_01_no_curie.json => MR_01_no_mod_ids.json} (100%) rename src/test/resources/bulk/03_agm/{ER_01_empty_curie.json => ER_01_empty_mod_ids.json} (100%) rename src/test/resources/bulk/03_agm/{MR_01_no_curie.json => MR_01_no_mod_ids.json} (100%) rename src/test/resources/bulk/06_variant/{ER_01_empty_curie.json => ER_01_empty_mod_ids.json} (100%) rename src/test/resources/bulk/06_variant/{MR_01_no_curie.json => MR_01_no_mod_ids.json} (100%) diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/AgmBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/AgmBulkUploadITCase.java index b556c0140..8b526c58e 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/AgmBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/AgmBulkUploadITCase.java @@ -58,7 +58,7 @@ public void agmBulkUploadCheckFields() throws Exception { get(agmGetEndpoint + "AGMTEST:Agm0001"). then(). statusCode(200). - body("entity.curie", is("AGMTEST:Agm0001")). + body("entity.modEntityId", is("AGMTEST:Agm0001")). body("entity.name", is("TestAgm1")). body("entity.taxon.curie", is("NCBITaxon:6239")). body("entity.subtype.name", is("fish")). @@ -84,7 +84,7 @@ public void agmBulkUploadUpdateCheckFields() throws Exception { get(agmGetEndpoint + "AGMTEST:Agm0001"). then(). statusCode(200). - body("entity.curie", is("AGMTEST:Agm0001")). + body("entity.modEntityId", is("AGMTEST:Agm0001")). body("entity.name", is("TestAgm1a")). body("entity.taxon.curie", is("NCBITaxon:10116")). body("entity.subtype.name", is("genotype")). @@ -103,7 +103,7 @@ public void agmBulkUploadUpdateCheckFields() throws Exception { @Test @Order(3) public void agmBulkUploadMissingRequiredFields() throws Exception { - checkFailedBulkLoad(agmBulkPostEndpoint, agmTestFilePath + "MR_01_no_curie.json"); + checkFailedBulkLoad(agmBulkPostEndpoint, agmTestFilePath + "MR_01_no_mod_ids.json"); checkFailedBulkLoad(agmBulkPostEndpoint, agmTestFilePath + "MR_02_no_taxon.json"); checkFailedBulkLoad(agmBulkPostEndpoint, agmTestFilePath + "MR_03_no_subtype.json"); checkFailedBulkLoad(agmBulkPostEndpoint, agmTestFilePath + "MR_04_no_data_provider.json"); @@ -117,7 +117,7 @@ public void agmBulkUploadMissingRequiredFields() throws Exception { @Test @Order(4) public void agmBulkUploadEmptyRequiredFields() throws Exception { - checkFailedBulkLoad(agmBulkPostEndpoint, agmTestFilePath + "ER_01_empty_curie.json"); + checkFailedBulkLoad(agmBulkPostEndpoint, agmTestFilePath + "ER_01_empty_mod_ids.json"); checkFailedBulkLoad(agmBulkPostEndpoint, agmTestFilePath + "ER_02_empty_taxon.json"); checkFailedBulkLoad(agmBulkPostEndpoint, agmTestFilePath + "ER_03_empty_subtype.json"); checkFailedBulkLoad(agmBulkPostEndpoint, agmTestFilePath + "ER_04_empty_data_provider_source_organization_abbreviation.json"); @@ -150,7 +150,7 @@ public void agmBulkUploadUpdateMissingNonRequiredFields() throws Exception { get(agmGetEndpoint + "AGMTEST:Agm0001"). then(). statusCode(200). - body("entity.curie", is("AGMTEST:Agm0001")). + body("entity.modEntityId", is("AGMTEST:Agm0001")). body("entity", not(hasKey("name"))). body("entity", not(hasKey("createdBy"))). body("entity", not(hasKey("updatedBy"))). @@ -169,7 +169,7 @@ public void agmBulkUploadUpdateEmptyNonRequiredFields() throws Exception { get(agmGetEndpoint + "AGMTEST:Agm0001"). then(). statusCode(200). - body("entity.curie", is("AGMTEST:Agm0001")). + body("entity.modEntityId", is("AGMTEST:Agm0001")). body("entity", not(hasKey("name"))). body("entity", not(hasKey("createdBy"))). body("entity", not(hasKey("updatedBy"))). diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/AlleleBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/AlleleBulkUploadITCase.java index ecd454240..00ba0acaf 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/AlleleBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/AlleleBulkUploadITCase.java @@ -74,7 +74,7 @@ public void alleleBulkUploadCheckFields() throws Exception { get(alleleGetEndpoint + "ALLELETEST:Allele0001"). then(). statusCode(200). - body("entity.curie", is("ALLELETEST:Allele0001")). + body("entity.modEntityId", is("ALLELETEST:Allele0001")). body("entity.taxon.curie", is("NCBITaxon:6239")). body("entity.internal", is(true)). body("entity.obsolete", is(true)). @@ -210,7 +210,7 @@ public void alleleBulkUploadUpdateCheckFields() throws Exception { get(alleleGetEndpoint + "ALLELETEST:Allele0001"). then(). statusCode(200). - body("entity.curie", is("ALLELETEST:Allele0001")). + body("entity.modEntityId", is("ALLELETEST:Allele0001")). body("entity.taxon.curie", is("NCBITaxon:10116")). body("entity.internal", is(false)). body("entity.obsolete", is(false)). @@ -341,7 +341,7 @@ public void alleleBulkUploadUpdateCheckFields() throws Exception { @Test @Order(3) public void alleleBulkUploadMissingRequiredFields() throws Exception { - checkFailedBulkLoad(alleleBulkPostEndpoint, alleleTestFilePath + "MR_01_no_curie.json"); + checkFailedBulkLoad(alleleBulkPostEndpoint, alleleTestFilePath + "MR_01_no_mod_ids.json"); checkFailedBulkLoad(alleleBulkPostEndpoint, alleleTestFilePath + "MR_02_no_taxon.json"); checkFailedBulkLoad(alleleBulkPostEndpoint, alleleTestFilePath + "MR_03_no_allele_mutation_type_mutation_types.json"); checkFailedBulkLoad(alleleBulkPostEndpoint, alleleTestFilePath + "MR_04_no_allele_symbol.json"); @@ -373,7 +373,7 @@ public void alleleBulkUploadMissingRequiredFields() throws Exception { @Test @Order(4) public void alleleBulkUploadEmptyRequiredFields() throws Exception { - checkFailedBulkLoad(alleleBulkPostEndpoint, alleleTestFilePath + "ER_01_empty_curie.json"); + checkFailedBulkLoad(alleleBulkPostEndpoint, alleleTestFilePath + "ER_01_empty_mod_ids.json"); checkFailedBulkLoad(alleleBulkPostEndpoint, alleleTestFilePath + "ER_02_empty_taxon.json"); checkFailedBulkLoad(alleleBulkPostEndpoint, alleleTestFilePath + "ER_03_empty_allele_mutation_type_mutation_types.json"); checkFailedBulkLoad(alleleBulkPostEndpoint, alleleTestFilePath + "ER_04_empty_allele_symbol_display_text.json"); @@ -450,7 +450,7 @@ public void alleleBulkUploadUpdateMissingNonRequiredFields() throws Exception { get(alleleGetEndpoint + "ALLELETEST:Allele0001"). then(). statusCode(200). - body("entity.curie", is("ALLELETEST:Allele0001")). + body("entity.modEntityId", is("ALLELETEST:Allele0001")). body("entity", not(hasKey("createdBy"))). body("entity", not(hasKey("updatedBy"))). body("entity", not(hasKey("dateCreated"))). @@ -479,7 +479,7 @@ public void alleleBulkUploadUpdateMissingNonRequiredFieldsLevel2() throws Except when(). get(alleleGetEndpoint + "ALLELETEST:Allele0001").then(). statusCode(200). - body("entity.curie", is("ALLELETEST:Allele0001")). + body("entity.modEntityId", is("ALLELETEST:Allele0001")). body("entity.relatedNotes[0]", not(hasKey("evidence"))). body("entity.relatedNotes[0]", not(hasKey("createdBy"))). body("entity.relatedNotes[0]", not(hasKey("updatedBy"))). @@ -557,7 +557,7 @@ public void alleleBulkUploadUpdateEmptyNonRequiredFieldsLevel() throws Exception when(). get(alleleGetEndpoint + "ALLELETEST:Allele0001").then(). statusCode(200). - body("entity.curie", is("ALLELETEST:Allele0001")). + body("entity.modEntityId", is("ALLELETEST:Allele0001")). body("entity", not(hasKey("createdBy"))). body("entity", not(hasKey("updatedBy"))). body("entity", not(hasKey("dateCreated"))). @@ -661,7 +661,7 @@ public void alleleBulkUploadDuplicateNotes() throws Exception { get(alleleGetEndpoint + "ALLELETEST:DN01"). then(). statusCode(200). - body("entity.curie", is("ALLELETEST:DN01")). + body("entity.modEntityId", is("ALLELETEST:DN01")). body("entity.relatedNotes", hasSize(1)); } diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java index 9b9014b42..cc7fabf44 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java @@ -203,7 +203,7 @@ public void geneDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-10T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-09T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:Gene0001|is_implicated_in|true|DATEST:Disease0001|AGRKB:000000002|DATEST:Evidence0001|HGNC:0001|exacerbated_by|DATEST:ExpCondTerm0001|DATEST:ExpCondTerm0002|DATEST:AnatomyTerm0001|DATEST:ChemicalTerm0001|DATEST:GOTerm0001|NCBITaxon:6239|Some amount|Free text|susceptibility|ameliorated_by|DATEST:Gene0002")). - body("entity.subject.curie", is(gene)). + body("entity.subject.modEntityId", is(gene)). body("entity.object.curie", is(doTerm)). body("entity.relation.name", is(alleleAndGeneRelation)). body("entity.geneticSex.name", is(geneticSex)). @@ -234,10 +234,10 @@ public void geneDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.conditionRelations[0].conditions[0].conditionChemical.curie", is(chemicalTerm)). body("entity.conditionRelations[0].conditions[0].conditionFreeText", is("Free text")). body("entity.conditionRelations[0].conditions[0].conditionSummary", is("Test ExperimentalConditionOntologyTerm:Test ExperimentalConditionOntologyTerm:Test AnatomicalTerm:Test GOTerm:Test ChemicalTerm:Caenorhabditis elegans:Some amount:Free text")). - body("entity.diseaseGeneticModifiers[0].curie", is(gene2)). + body("entity.diseaseGeneticModifiers[0].modEntityId", is(gene2)). body("entity.diseaseGeneticModifierRelation.name", is(diseaseGeneticModifierRelation)). body("entity.with", hasSize(1)). - body("entity.with[0].curie", is(withGene)). + body("entity.with[0].modEntityId", is(withGene)). body("entity.singleReference.curie", is(reference)). body("entity.relatedNotes", hasSize(1)). body("entity.relatedNotes[0].internal", is(false)). @@ -251,7 +251,7 @@ public void geneDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.relatedNotes[0].references[0].curie", is(reference)). body("entity.annotationType.name", is(annotationType)). body("entity.diseaseQualifiers[0].name", is(diseaseQualifier)). - body("entity.sgdStrainBackground.curie", is(sgdBackgroundStrain)). + body("entity.sgdStrainBackground.modEntityId", is(sgdBackgroundStrain)). body("entity.evidenceCodes", hasSize(1)). body("entity.evidenceCodes[0].curie", is(ecoTerm)). body("entity.dataProvider.sourceOrganization.abbreviation", is(dataProvider)). @@ -283,7 +283,7 @@ public void alleleDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-10T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-09T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:Allele0001|is_implicated_in|true|DATEST:Disease0001|AGRKB:000000002|DATEST:Evidence0001|HGNC:0001|exacerbated_by|DATEST:ExpCondTerm0001|DATEST:ExpCondTerm0002|DATEST:AnatomyTerm0001|DATEST:ChemicalTerm0001|DATEST:GOTerm0001|NCBITaxon:6239|Some amount|Free text|susceptibility|ameliorated_by|DATEST:Gene0002")). - body("entity.subject.curie", is(allele)). + body("entity.subject.modEntityId", is(allele)). body("entity.object.curie", is(doTerm)). body("entity.relation.name", is(alleleAndGeneRelation)). body("entity.geneticSex.name", is(geneticSex)). @@ -314,10 +314,10 @@ public void alleleDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.conditionRelations[0].conditions[0].conditionChemical.curie", is(chemicalTerm)). body("entity.conditionRelations[0].conditions[0].conditionFreeText", is("Free text")). body("entity.conditionRelations[0].conditions[0].conditionSummary", is("Test ExperimentalConditionOntologyTerm:Test ExperimentalConditionOntologyTerm:Test AnatomicalTerm:Test GOTerm:Test ChemicalTerm:Caenorhabditis elegans:Some amount:Free text")). - body("entity.diseaseGeneticModifiers[0].curie", is(gene2)). + body("entity.diseaseGeneticModifiers[0].modEntityId", is(gene2)). body("entity.diseaseGeneticModifierRelation.name", is(diseaseGeneticModifierRelation)). body("entity.with", hasSize(1)). - body("entity.with[0].curie", is(withGene)). + body("entity.with[0].modEntityId", is(withGene)). body("entity.singleReference.curie", is(reference)). body("entity.relatedNotes", hasSize(1)). body("entity.relatedNotes[0].internal", is(false)). @@ -335,8 +335,8 @@ public void alleleDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.evidenceCodes[0].curie", is(ecoTerm)). body("entity.dataProvider.sourceOrganization.abbreviation", is(dataProvider)). body("entity.secondaryDataProvider.sourceOrganization.abbreviation", is(dataProvider2)). - body("entity.inferredGene.curie", is(gene)). - body("entity.assertedGenes[0].curie", is(gene2)). + body("entity.inferredGene.modEntityId", is(gene)). + body("entity.assertedGenes[0].modEntityId", is(gene2)). body("entity.dataProvider.crossReference.referencedCurie", is("TEST:0001")). body("entity.dataProvider.crossReference.displayName", is("TEST:0001")). body("entity.dataProvider.crossReference.resourceDescriptorPage.name", is("homepage")). @@ -364,7 +364,7 @@ public void agmDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-10T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-09T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:AGM0001|is_model_of|true|DATEST:Disease0001|AGRKB:000000002|DATEST:Evidence0001|HGNC:0001|exacerbated_by|DATEST:ExpCondTerm0001|DATEST:ExpCondTerm0002|DATEST:AnatomyTerm0001|DATEST:ChemicalTerm0001|DATEST:GOTerm0001|NCBITaxon:6239|Some amount|Free text|susceptibility|ameliorated_by|DATEST:Gene0002")). - body("entity.subject.curie", is(agm)). + body("entity.subject.modEntityId", is(agm)). body("entity.object.curie", is(doTerm)). body("entity.relation.name", is(agmRelation)). body("entity.geneticSex.name", is(geneticSex)). @@ -395,10 +395,10 @@ public void agmDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.conditionRelations[0].conditions[0].conditionChemical.curie", is(chemicalTerm)). body("entity.conditionRelations[0].conditions[0].conditionFreeText", is("Free text")). body("entity.conditionRelations[0].conditions[0].conditionSummary", is("Test ExperimentalConditionOntologyTerm:Test ExperimentalConditionOntologyTerm:Test AnatomicalTerm:Test GOTerm:Test ChemicalTerm:Caenorhabditis elegans:Some amount:Free text")). - body("entity.diseaseGeneticModifiers[0].curie", is(gene2)). + body("entity.diseaseGeneticModifiers[0].modEntityId", is(gene2)). body("entity.diseaseGeneticModifierRelation.name", is(diseaseGeneticModifierRelation)). body("entity.with", hasSize(1)). - body("entity.with[0].curie", is(withGene)). + body("entity.with[0].modEntityId", is(withGene)). body("entity.singleReference.curie", is(reference)). body("entity.relatedNotes", hasSize(1)). body("entity.relatedNotes[0].internal", is(false)). @@ -416,10 +416,10 @@ public void agmDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.evidenceCodes[0].curie", is(ecoTerm)). body("entity.dataProvider.sourceOrganization.abbreviation", is(dataProvider)). body("entity.secondaryDataProvider.sourceOrganization.abbreviation", is(dataProvider2)). - body("entity.inferredGene.curie", is(gene)). - body("entity.assertedGenes[0].curie", is(gene2)). - body("entity.inferredAllele.curie", is(allele)). - body("entity.assertedAllele.curie", is(allele2)). + body("entity.inferredGene.modEntityId", is(gene)). + body("entity.assertedGenes[0].modEntityId", is(gene2)). + body("entity.inferredAllele.modEntityId", is(allele)). + body("entity.assertedAllele.modEntityId", is(allele2)). body("entity.dataProvider.crossReference.referencedCurie", is("TEST:0001")). body("entity.dataProvider.crossReference.displayName", is("TEST:0001")). body("entity.dataProvider.crossReference.resourceDescriptorPage.name", is("homepage")). @@ -447,7 +447,7 @@ public void geneDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exception body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-20T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-19T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:Gene0002|is_marker_for|false|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). - body("entity.subject.curie", is(gene2)). + body("entity.subject.modEntityId", is(gene2)). body("entity.object.curie", is(doTerm2)). body("entity.relation.name", is(geneRelation)). body("entity.geneticSex.name", is(geneticSex2)). @@ -478,10 +478,10 @@ public void geneDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exception body("entity.conditionRelations[0].conditions[0].conditionChemical.curie", is(chemicalTerm2)). body("entity.conditionRelations[0].conditions[0].conditionFreeText", is("Free text 2")). body("entity.conditionRelations[0].conditions[0].conditionSummary", is("Test ExperimentalConditionOntologyTerm 2:Test ExperimentalConditionOntologyTerm:Test AnatomicalTerm 2:Test GOTerm 2:Test ChemicalTerm 2:Homo sapiens:Some amount 2:Free text 2")). - body("entity.diseaseGeneticModifiers[0].curie", is(gene)). + body("entity.diseaseGeneticModifiers[0].modEntityId", is(gene)). body("entity.diseaseGeneticModifierRelation.name", is(diseaseGeneticModifierRelation2)). body("entity.with", hasSize(1)). - body("entity.with[0].curie", is(withGene2)). + body("entity.with[0].modEntityId", is(withGene2)). body("entity.singleReference.curie", is(reference2)). body("entity.relatedNotes", hasSize(1)). body("entity.relatedNotes[0].internal", is(true)). @@ -495,7 +495,7 @@ public void geneDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exception body("entity.relatedNotes[0].references[0].curie", is(reference2)). body("entity.annotationType.name", is(annotationType2)). body("entity.diseaseQualifiers[0].name", is(diseaseQualifier2)). - body("entity.sgdStrainBackground.curie", is(sgdBackgroundStrain2)). + body("entity.sgdStrainBackground.modEntityId", is(sgdBackgroundStrain2)). body("entity.evidenceCodes", hasSize(1)). body("entity.evidenceCodes[0].curie", is(ecoTerm2)). body("entity.dataProvider.sourceOrganization.abbreviation", is(dataProvider2)). @@ -527,7 +527,7 @@ public void alleleDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exceptio body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-20T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-19T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:Allele0002|is_implicated_in|false|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). - body("entity.subject.curie", is(allele2)). + body("entity.subject.modEntityId", is(allele2)). body("entity.object.curie", is(doTerm2)). body("entity.relation.name", is(alleleAndGeneRelation)). body("entity.geneticSex.name", is(geneticSex2)). @@ -558,10 +558,10 @@ public void alleleDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exceptio body("entity.conditionRelations[0].conditions[0].conditionChemical.curie", is(chemicalTerm2)). body("entity.conditionRelations[0].conditions[0].conditionFreeText", is("Free text 2")). body("entity.conditionRelations[0].conditions[0].conditionSummary", is("Test ExperimentalConditionOntologyTerm 2:Test ExperimentalConditionOntologyTerm:Test AnatomicalTerm 2:Test GOTerm 2:Test ChemicalTerm 2:Homo sapiens:Some amount 2:Free text 2")). - body("entity.diseaseGeneticModifiers[0].curie", is(gene)). + body("entity.diseaseGeneticModifiers[0].modEntityId", is(gene)). body("entity.diseaseGeneticModifierRelation.name", is(diseaseGeneticModifierRelation2)). body("entity.with", hasSize(1)). - body("entity.with[0].curie", is(withGene2)). + body("entity.with[0].modEntityId", is(withGene2)). body("entity.singleReference.curie", is(reference2)). body("entity.relatedNotes", hasSize(1)). body("entity.relatedNotes[0].internal", is(true)). @@ -579,8 +579,8 @@ public void alleleDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exceptio body("entity.evidenceCodes[0].curie", is(ecoTerm2)). body("entity.dataProvider.sourceOrganization.abbreviation", is(dataProvider2)). body("entity.secondaryDataProvider.sourceOrganization.abbreviation", is(dataProvider)). - body("entity.inferredGene.curie", is(gene2)). - body("entity.assertedGenes[0].curie", is(gene)). + body("entity.inferredGene.modEntityId", is(gene2)). + body("entity.assertedGenes[0].modEntityId", is(gene)). body("entity.dataProvider.crossReference.referencedCurie", is("TEST:0002")). body("entity.dataProvider.crossReference.displayName", is("TEST:0002")). body("entity.dataProvider.crossReference.resourceDescriptorPage.name", is("homepage")). @@ -608,7 +608,7 @@ public void agmDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exception { body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-20T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-19T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:AGM0002|is_exacerbated_model_of|false|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). - body("entity.subject.curie", is(agm2)). + body("entity.subject.modEntityId", is(agm2)). body("entity.object.curie", is(doTerm2)). body("entity.relation.name", is(agmRelation2)). body("entity.geneticSex.name", is(geneticSex2)). @@ -639,10 +639,10 @@ public void agmDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exception { body("entity.conditionRelations[0].conditions[0].conditionChemical.curie", is(chemicalTerm2)). body("entity.conditionRelations[0].conditions[0].conditionFreeText", is("Free text 2")). body("entity.conditionRelations[0].conditions[0].conditionSummary", is("Test ExperimentalConditionOntologyTerm 2:Test ExperimentalConditionOntologyTerm:Test AnatomicalTerm 2:Test GOTerm 2:Test ChemicalTerm 2:Homo sapiens:Some amount 2:Free text 2")). - body("entity.diseaseGeneticModifiers[0].curie", is(gene)). + body("entity.diseaseGeneticModifiers[0].modEntityId", is(gene)). body("entity.diseaseGeneticModifierRelation.name", is(diseaseGeneticModifierRelation2)). body("entity.with", hasSize(1)). - body("entity.with[0].curie", is(withGene2)). + body("entity.with[0].modEntityId", is(withGene2)). body("entity.singleReference.curie", is(reference2)). body("entity.relatedNotes", hasSize(1)). body("entity.relatedNotes[0].internal", is(true)). @@ -660,10 +660,10 @@ public void agmDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exception { body("entity.evidenceCodes[0].curie", is(ecoTerm2)). body("entity.dataProvider.sourceOrganization.abbreviation", is(dataProvider2)). body("entity.secondaryDataProvider.sourceOrganization.abbreviation", is(dataProvider)). - body("entity.inferredGene.curie", is(gene2)). - body("entity.assertedGenes[0].curie", is(gene)). - body("entity.inferredAllele.curie", is(allele2)). - body("entity.assertedAllele.curie", is(allele)). + body("entity.inferredGene.modEntityId", is(gene2)). + body("entity.assertedGenes[0].modEntityId", is(gene)). + body("entity.inferredAllele.modEntityId", is(allele2)). + body("entity.assertedAllele.modEntityId", is(allele)). body("entity.dataProvider.crossReference.referencedCurie", is("TEST:0002")). body("entity.dataProvider.crossReference.displayName", is("TEST:0002")). body("entity.dataProvider.crossReference.resourceDescriptorPage.name", is("homepage")). diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/GeneBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/GeneBulkUploadITCase.java index 74fcbedaf..e01e4b46b 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/GeneBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/GeneBulkUploadITCase.java @@ -74,7 +74,7 @@ public void geneBulkUploadCheckFields() throws Exception { get(geneGetEndpoint + "GENETEST:Gene0001"). then(). statusCode(200). - body("entity.curie", is("GENETEST:Gene0001")). + body("entity.modEntityId", is("GENETEST:Gene0001")). body("entity.taxon.curie", is("NCBITaxon:6239")). body("entity.internal", is(true)). body("entity.obsolete", is(true)). @@ -156,7 +156,7 @@ public void geneBulkUploadUpdateFields() throws Exception { get(geneGetEndpoint + "GENETEST:Gene0001"). then(). statusCode(200). - body("entity.curie", is("GENETEST:Gene0001")). + body("entity.modEntityId", is("GENETEST:Gene0001")). body("entity.taxon.curie", is("NCBITaxon:10116")). body("entity.internal", is(false)). body("entity.obsolete", is(false)). @@ -231,7 +231,7 @@ public void geneBulkUploadUpdateFields() throws Exception { @Test @Order(3) public void geneBulkUploadMissingRequiredFields() throws Exception { - checkFailedBulkLoad(geneBulkPostEndpoint, geneTestFilePath + "MR_01_no_curie.json"); + checkFailedBulkLoad(geneBulkPostEndpoint, geneTestFilePath + "MR_01_no_mod_ids.json"); checkFailedBulkLoad(geneBulkPostEndpoint, geneTestFilePath + "MR_02_no_taxon.json"); checkFailedBulkLoad(geneBulkPostEndpoint, geneTestFilePath + "MR_03_no_gene_symbol.json"); checkFailedBulkLoad(geneBulkPostEndpoint, geneTestFilePath + "MR_04_no_gene_symbol_display_text.json"); @@ -258,7 +258,7 @@ public void geneBulkUploadMissingRequiredFields() throws Exception { @Test @Order(4) public void geneBulkUploadEmptyRequiredFields() throws Exception { - checkFailedBulkLoad(geneBulkPostEndpoint, geneTestFilePath + "ER_01_empty_curie.json"); + checkFailedBulkLoad(geneBulkPostEndpoint, geneTestFilePath + "ER_01_empty_mod_ids.json"); checkFailedBulkLoad(geneBulkPostEndpoint, geneTestFilePath + "ER_02_empty_taxon.json"); checkFailedBulkLoad(geneBulkPostEndpoint, geneTestFilePath + "ER_03_empty_gene_symbol_display_text.json"); checkFailedBulkLoad(geneBulkPostEndpoint, geneTestFilePath + "ER_04_empty_gene_full_name_display_text.json"); @@ -315,7 +315,7 @@ public void geneBulkUploadUpdateMissingNonRequiredFieldsLevel1() throws Exceptio get(geneGetEndpoint + "GENETEST:Gene0001"). then(). statusCode(200). - body("entity.curie", is("GENETEST:Gene0001")). + body("entity.modEntityId", is("GENETEST:Gene0001")). body("entity", not(hasKey("createdBy"))). body("entity", not(hasKey("updatedBy"))). body("entity", not(hasKey("dateCreated"))). @@ -336,7 +336,7 @@ public void geneBulkUploadUpdateMissingNonRequiredFieldsLevel2() throws Exceptio when(). get(geneGetEndpoint + "GENETEST:Gene0001").then(). statusCode(200). - body("entity.curie", is("GENETEST:Gene0001")). + body("entity.modEntityId", is("GENETEST:Gene0001")). body("entity.geneSymbol", not(hasKey("synonymScope"))). body("entity.geneSymbol", not(hasKey("synonymUrl"))). body("entity.geneSymbol", not(hasKey("evidence"))). @@ -383,7 +383,7 @@ public void geneBulkUploadUpdateEmptyNonRequiredFields() throws Exception { get(geneGetEndpoint + "GENETEST:Gene0001"). then(). statusCode(200). - body("entity.curie", is("GENETEST:Gene0001")). + body("entity.modEntityId", is("GENETEST:Gene0001")). body("entity", not(hasKey("createdBy"))). body("entity", not(hasKey("updatedBy"))). body("entity", not(hasKey("dateCreated"))). diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/VariantBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/VariantBulkUploadITCase.java index f8e81b98e..b17ba391d 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/VariantBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/VariantBulkUploadITCase.java @@ -83,7 +83,7 @@ public void variantBulkUploadCheckFields() throws Exception { get(variantGetEndpoint + "VARIANTTEST:Variant0001"). then(). statusCode(200). - body("entity.curie", is("VARIANTTEST:Variant0001")). + body("entity.modEntityId", is("VARIANTTEST:Variant0001")). body("entity.taxon.curie", is("NCBITaxon:6239")). body("entity.internal", is(true)). body("entity.obsolete", is(true)). @@ -120,7 +120,7 @@ public void variantBulkUploadUpdateCheckFields() throws Exception { get(variantGetEndpoint + "VARIANTTEST:Variant0001"). then(). statusCode(200). - body("entity.curie", is("VARIANTTEST:Variant0001")). + body("entity.modEntityId", is("VARIANTTEST:Variant0001")). body("entity.taxon.curie", is("NCBITaxon:10116")). body("entity.internal", is(false)). body("entity.obsolete", is(false)). @@ -150,7 +150,7 @@ public void variantBulkUploadUpdateCheckFields() throws Exception { @Test @Order(3) public void variantBulkUploadMissingRequiredFields() throws Exception { - checkFailedBulkLoad(variantBulkPostEndpoint, variantTestFilePath + "MR_01_no_curie.json"); + checkFailedBulkLoad(variantBulkPostEndpoint, variantTestFilePath + "MR_01_no_mod_ids.json"); checkFailedBulkLoad(variantBulkPostEndpoint, variantTestFilePath + "MR_02_no_taxon.json"); checkFailedBulkLoad(variantBulkPostEndpoint, variantTestFilePath + "MR_03_no_variant_type.json"); checkFailedBulkLoad(variantBulkPostEndpoint, variantTestFilePath + "MR_04_no_data_provider.json"); @@ -166,7 +166,7 @@ public void variantBulkUploadMissingRequiredFields() throws Exception { @Test @Order(4) public void variantBulkUploadEmptyRequiredFields() throws Exception { - checkFailedBulkLoad(variantBulkPostEndpoint, variantTestFilePath + "ER_01_empty_curie.json"); + checkFailedBulkLoad(variantBulkPostEndpoint, variantTestFilePath + "ER_01_empty_mod_ids.json"); checkFailedBulkLoad(variantBulkPostEndpoint, variantTestFilePath + "ER_02_empty_taxon.json"); checkFailedBulkLoad(variantBulkPostEndpoint, variantTestFilePath + "ER_03_empty_variant_type.json"); checkFailedBulkLoad(variantBulkPostEndpoint, variantTestFilePath + "ER_04_empty_data_provider_source_organization_abbreviation.json"); @@ -205,7 +205,7 @@ public void variantBulkUploadUpdateMissingNonRequiredFields() throws Exception { get(variantGetEndpoint + "VARIANTTEST:Variant0001"). then(). statusCode(200). - body("entity.curie", is("VARIANTTEST:Variant0001")). + body("entity.modEntityId", is("VARIANTTEST:Variant0001")). body("entity", not(hasKey("createdBy"))). body("entity", not(hasKey("updatedBy"))). body("entity", not(hasKey("dateCreated"))). @@ -226,7 +226,7 @@ public void variantBulkUploadUpdateMissingNonRequiredFieldsLevel2() throws Excep get(variantGetEndpoint + "VARIANTTEST:Variant0001"). then(). statusCode(200). - body("entity.curie", is("VARIANTTEST:Variant0001")). + body("entity.modEntityId", is("VARIANTTEST:Variant0001")). body("entity.relatedNotes[0]", not(hasKey("evidence"))). body("entity.relatedNotes[0]", not(hasKey("createdBy"))). body("entity.relatedNotes[0]", not(hasKey("updatedBy"))). @@ -245,7 +245,7 @@ public void variantBulkUploadUpdateEmptyNonRequiredFields() throws Exception { get(variantGetEndpoint + "VARIANTTEST:Variant0001"). then(). statusCode(200). - body("entity.curie", is("VARIANTTEST:Variant0001")). + body("entity.modEntityId", is("VARIANTTEST:Variant0001")). body("entity", not(hasKey("createdBy"))). body("entity", not(hasKey("updatedBy"))). body("entity", not(hasKey("dateCreated"))). @@ -282,7 +282,7 @@ public void variantBulkUploadDuplicateNotes() throws Exception { get(variantGetEndpoint + "VARIANTTEST:DN01"). then(). statusCode(200). - body("entity.curie", is("VARIANTTEST:DN01")). + body("entity.modEntityId", is("VARIANTTEST:DN01")). body("entity.relatedNotes", hasSize(1)); } diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java index 40be55c28..536ce3297 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java @@ -76,8 +76,8 @@ public void alleleGeneAssociationBulkUploadCheckFields() throws Exception { then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.object.curie", is(geneCurie)). - body("entity.subject.curie", is(alleleCurie)). + body("entity.object.modEntityId", is(geneCurie)). + body("entity.subject.modEntityId", is(alleleCurie)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference)). body("entity.evidenceCode.curie", is(evidenceCodeCurie)). @@ -104,7 +104,7 @@ public void alleleGeneAssociationBulkUploadCheckFields() throws Exception { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relationName)). - body("entity.alleleGeneAssociations[0].object.curie", is(geneCurie)). + body("entity.alleleGeneAssociations[0].object.modEntityId", is(geneCurie)). body("entity.alleleGeneAssociations[0].subject", not(hasKey("alleleGeneAssociations"))); RestAssured.given(). @@ -114,7 +114,7 @@ public void alleleGeneAssociationBulkUploadCheckFields() throws Exception { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relationName)). - body("entity.alleleGeneAssociations[0].object.curie", is(geneCurie)). + body("entity.alleleGeneAssociations[0].object.modEntityId", is(geneCurie)). body("entity.alleleGeneAssociations[0].object", not(hasKey("alleleGeneAssociations"))); } @@ -131,7 +131,7 @@ public void alleleGeneAssociationBulkUploadUpdateCheckFields() throws Exception then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.object.curie", is(geneCurie)). + body("entity.object.modEntityId", is(geneCurie)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2)). body("entity.evidenceCode.curie", is(evidenceCodeCurie2)). diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java index 1cd698405..f415d2d61 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java @@ -68,7 +68,7 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.object.curie", is(geneCurie)). + body("entity.object.modEntityId", is(geneCurie)). body("entity.subject.modEntityId", is(constructModEntityId)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference)). @@ -96,7 +96,7 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce body("entity.modEntityId", is(constructModEntityId)). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relationName)). - body("entity.constructGenomicEntityAssociations[0].object.curie", is(geneCurie)). + body("entity.constructGenomicEntityAssociations[0].object.modEntityId", is(geneCurie)). body("entity.constructGenomicEntityAssociations[0].subject", not(hasKey("constructGenomicEntityAssociations"))); RestAssured.given(). @@ -106,7 +106,7 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relationName)). - body("entity.constructGenomicEntityAssociations[0].object.curie", is(geneCurie)). + body("entity.constructGenomicEntityAssociations[0].object.modEntityId", is(geneCurie)). body("entity.constructGenomicEntityAssociations[0].object", not(hasKey("constructGenomicEntityAssociations"))); } @@ -121,7 +121,7 @@ public void constructGenomicEntityAssociationBulkUploadUpdateCheckFields() throw then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.object.curie", is(geneCurie)). + body("entity.object.modEntityId", is(geneCurie)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2)). body("entity.internal", is(false)). diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/OrthologyBulkUploadFmsITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/OrthologyBulkUploadFmsITCase.java index 47be2559c..b01f9c427 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/OrthologyBulkUploadFmsITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/OrthologyBulkUploadFmsITCase.java @@ -56,8 +56,8 @@ public void orthologyBulkUploadCheckFields() throws Exception { statusCode(200). body("totalResults", is(1)). body("results", hasSize(1)). - body("results[0].subjectGene.curie", is("GENETEST:Gene0001")). - body("results[0].objectGene.curie", is("HGNC:0001")). + body("results[0].subjectGene.modEntityId", is("GENETEST:Gene0001")). + body("results[0].objectGene.modEntityId", is("HGNC:0001")). body("results[0].subjectGene.taxon.curie", is("NCBITaxon:6239")). body("results[0].objectGene.taxon.curie", is("NCBITaxon:9606")). body("results[0].moderateFilter", is(false)). diff --git a/src/test/resources/bulk/01_gene/ER_01_empty_curie.json b/src/test/resources/bulk/01_gene/ER_01_empty_mod_ids.json similarity index 100% rename from src/test/resources/bulk/01_gene/ER_01_empty_curie.json rename to src/test/resources/bulk/01_gene/ER_01_empty_mod_ids.json diff --git a/src/test/resources/bulk/01_gene/MR_01_no_curie.json b/src/test/resources/bulk/01_gene/MR_01_no_mod_ids.json similarity index 100% rename from src/test/resources/bulk/01_gene/MR_01_no_curie.json rename to src/test/resources/bulk/01_gene/MR_01_no_mod_ids.json diff --git a/src/test/resources/bulk/02_allele/ER_01_empty_curie.json b/src/test/resources/bulk/02_allele/ER_01_empty_mod_ids.json similarity index 100% rename from src/test/resources/bulk/02_allele/ER_01_empty_curie.json rename to src/test/resources/bulk/02_allele/ER_01_empty_mod_ids.json diff --git a/src/test/resources/bulk/02_allele/MR_01_no_curie.json b/src/test/resources/bulk/02_allele/MR_01_no_mod_ids.json similarity index 100% rename from src/test/resources/bulk/02_allele/MR_01_no_curie.json rename to src/test/resources/bulk/02_allele/MR_01_no_mod_ids.json diff --git a/src/test/resources/bulk/03_agm/ER_01_empty_curie.json b/src/test/resources/bulk/03_agm/ER_01_empty_mod_ids.json similarity index 100% rename from src/test/resources/bulk/03_agm/ER_01_empty_curie.json rename to src/test/resources/bulk/03_agm/ER_01_empty_mod_ids.json diff --git a/src/test/resources/bulk/03_agm/MR_01_no_curie.json b/src/test/resources/bulk/03_agm/MR_01_no_mod_ids.json similarity index 100% rename from src/test/resources/bulk/03_agm/MR_01_no_curie.json rename to src/test/resources/bulk/03_agm/MR_01_no_mod_ids.json diff --git a/src/test/resources/bulk/06_variant/ER_01_empty_curie.json b/src/test/resources/bulk/06_variant/ER_01_empty_mod_ids.json similarity index 100% rename from src/test/resources/bulk/06_variant/ER_01_empty_curie.json rename to src/test/resources/bulk/06_variant/ER_01_empty_mod_ids.json diff --git a/src/test/resources/bulk/06_variant/MR_01_no_curie.json b/src/test/resources/bulk/06_variant/MR_01_no_mod_ids.json similarity index 100% rename from src/test/resources/bulk/06_variant/MR_01_no_curie.json rename to src/test/resources/bulk/06_variant/MR_01_no_mod_ids.json From d38ff23cbd0027486d4febade7b692443463c764 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 8 Dec 2023 10:30:19 +0000 Subject: [PATCH 006/159] More refactoring --- .../curation_api/dao/base/BaseSQLDAO.java | 45 --------------- .../curation_api/dao/base/CurieObjectDAO.java | 32 +++++++++++ .../dao/base/SubmittedObjectDAO.java | 43 +++++++++++++++ .../dao/ontology/NcbiTaxonTermDAO.java | 52 +----------------- .../model/entities/base/SubmittedObject.java | 10 ++++ .../AlleleDiseaseAnnotationService.java | 1 - .../services/BiologicalEntityService.java | 16 +++++- .../services/DiseaseAnnotationService.java | 1 - .../GeneDiseaseAnnotationService.java | 1 - .../services/GenomicEntityService.java | 34 ++++++++++++ .../InformationContentEntityService.java | 2 +- .../services/MoleculeService.java | 4 +- .../services/OrganizationService.java | 1 - .../services/ReferenceService.java | 2 +- .../services/base/BaseEntityCrudService.java | 6 -- .../base/BaseOntologyTermService.java | 14 ++--- .../services/base/CurieObjectCrudService.java | 22 +++++++- .../base/SubmittedObjectCrudService.java | 32 ++++++++++- .../helpers/UniqueIdGeneratorHelper.java | 9 +++ .../DiseaseAnnotationUniqueIdHelper.java | 14 ++--- .../ExperimentalConditionSummary.java | 6 +- .../ReferenceSynchronisationHelper.java | 19 +++---- .../services/ontology/EcoTermService.java | 2 +- .../ontology/NcbiTaxonTermService.java | 55 ++++++++++++++++++- .../ExperimentalConditionValidator.java | 6 +- .../base/SubmittedObjectValidator.java | 11 +++- .../dto/AGMDiseaseAnnotationDTOValidator.java | 22 ++++---- .../AlleleDiseaseAnnotationDTOValidator.java | 14 ++--- .../dto/DiseaseAnnotationDTOValidator.java | 12 ++-- .../ExperimentalConditionDTOValidator.java | 9 +-- .../GeneDiseaseAnnotationDTOValidator.java | 11 ++-- .../AlleleGeneAssociationDTOValidator.java | 11 ++-- ...eGenomicEntityAssociationDTOValidator.java | 6 -- ...tGenomicEntityAssociationDTOValidator.java | 12 +--- .../dto/fms/OrthologyFmsDTOValidator.java | 8 +-- 35 files changed, 333 insertions(+), 212 deletions(-) create mode 100644 src/main/java/org/alliancegenome/curation_api/dao/base/CurieObjectDAO.java create mode 100644 src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java create mode 100644 src/main/java/org/alliancegenome/curation_api/services/GenomicEntityService.java diff --git a/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java index de3645cdf..fe8f5bf8d 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java @@ -91,51 +91,6 @@ public List persist(List entities) { entityManager.persist(entities); return entities; } - - public E findByCurie(String curie) { - Log.debug("SqlDAO: findByCurie: " + curie + " " + myClass); - if (curie != null) { - SearchResponse response = findByField("curie", curie); - if (response == null || response.getSingleResult() == null) { - Log.debug("Entity Not Found: " + curie); - return null; - } - E entity = response.getSingleResult(); - Log.debug("Entity Found: " + entity); - return entity; - } else { - Log.debug("Input Param is null: " + curie); - return null; - } - } - - public E findByIdentifierString(String id) { - Log.debug("SqlDAO: findByIdentifierString: " + id + " " + myClass); - if (id != null) { - SearchResponse response = null; - if (id.startsWith("AGRKB:")) { - response = findByField("curie", id); - } else { - if (response == null || response.getSingleResult() == null) { - response = findByField("modEntityId", id); - if (response == null || response.getSingleResult() == null) - response = findByField("modInternalId", id); - } - } - - if (response == null || response.getSingleResult() == null) { - Log.debug("Entity Not Found: " + id); - return null; - } - - E entity = response.getSingleResult(); - Log.debug("Entity Found: " + entity); - return entity; - } else { - Log.debug("Input Param is null: " + id); - return null; - } - } public E find(Long id) { Log.debug("SqlDAO: find: " + id + " " + myClass); diff --git a/src/main/java/org/alliancegenome/curation_api/dao/base/CurieObjectDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/base/CurieObjectDAO.java new file mode 100644 index 000000000..77107b5f8 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/dao/base/CurieObjectDAO.java @@ -0,0 +1,32 @@ +package org.alliancegenome.curation_api.dao.base; + +import org.alliancegenome.curation_api.model.entities.base.CurieObject; +import org.alliancegenome.curation_api.response.SearchResponse; + +import io.quarkus.logging.Log; + +public class CurieObjectDAO extends BaseSQLDAO { + + + protected CurieObjectDAO(Class myClass) { + super(myClass); + } + + public E findByCurie(String curie) { + Log.debug("SqlDAO: findByCurie: " + curie + " " + myClass); + if (curie != null) { + SearchResponse response = findByField("curie", curie); + if (response == null || response.getSingleResult() == null) { + Log.debug("Entity Not Found: " + curie); + return null; + } + E entity = response.getSingleResult(); + Log.debug("Entity Found: " + entity); + return entity; + } else { + Log.debug("Input Param is null: " + curie); + return null; + } + } + +} diff --git a/src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java new file mode 100644 index 000000000..5351fc743 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java @@ -0,0 +1,43 @@ +package org.alliancegenome.curation_api.dao.base; + +import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; +import org.alliancegenome.curation_api.response.SearchResponse; + +import io.quarkus.logging.Log; + +public class SubmittedObjectDAO extends CurieObjectDAO { + + + protected SubmittedObjectDAO(Class myClass) { + super(myClass); + } + + public E findByIdentifierString(String id) { + Log.debug("SqlDAO: findByIdentifierString: " + id + " " + myClass); + if (id != null) { + SearchResponse response = null; + if (id.startsWith("AGRKB:")) { + response = findByField("curie", id); + } else { + if (response == null || response.getSingleResult() == null) { + response = findByField("modEntityId", id); + if (response == null || response.getSingleResult() == null) + response = findByField("modInternalId", id); + } + } + + if (response == null || response.getSingleResult() == null) { + Log.debug("Entity Not Found: " + id); + return null; + } + + E entity = response.getSingleResult(); + Log.debug("Entity Found: " + entity); + return entity; + } else { + Log.debug("Input Param is null: " + id); + return null; + } + } + +} diff --git a/src/main/java/org/alliancegenome/curation_api/dao/ontology/NcbiTaxonTermDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/ontology/NcbiTaxonTermDAO.java index 1902f7ffc..085345d2f 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/ontology/NcbiTaxonTermDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/ontology/NcbiTaxonTermDAO.java @@ -1,65 +1,15 @@ package org.alliancegenome.curation_api.dao.ontology; -import java.util.HashMap; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import org.alliancegenome.curation_api.dao.base.BaseSQLDAO; -import org.alliancegenome.curation_api.interfaces.ncbi.NCBIRESTInterface; import org.alliancegenome.curation_api.model.entities.ontology.NCBITaxonTerm; -import org.alliancegenome.curation_api.model.ingest.NCBITaxonResponseDTO; import jakarta.enterprise.context.ApplicationScoped; -import si.mazi.rescu.RestProxyFactory; @ApplicationScoped public class NcbiTaxonTermDAO extends BaseSQLDAO { - private final int MAX_ATTEMPTS = 5; - + protected NcbiTaxonTermDAO() { super(NCBITaxonTerm.class); } - private NCBIRESTInterface api = RestProxyFactory.createProxy(NCBIRESTInterface.class, "https://eutils.ncbi.nlm.nih.gov"); - - public NCBITaxonTerm downloadAndSave(String taxonCurie) { - - Pattern taxonIdPattern = Pattern.compile("^NCBITaxon:(\\d+)$"); - Matcher taxonIdMatcher = taxonIdPattern.matcher(taxonCurie); - if (!taxonIdMatcher.find()) { - return null; - } - - HashMap taxonMap = null; - int attemptsRemaining = MAX_ATTEMPTS; - while (attemptsRemaining-- > 0) { - try { - NCBITaxonResponseDTO resp = api.getTaxonFromNCBI("taxonomy", "json", taxonIdMatcher.group(1)); - HashMap result = resp.getResult(); - taxonMap = (HashMap) result.get(taxonIdMatcher.group(1)); - - break; - } catch (Exception e) { - e.printStackTrace(); - continue; - } - } - - if (taxonMap == null || taxonMap.get("error") != null) - return null; - - String name = (String) taxonMap.get("scientificname"); - NCBITaxonTerm taxon = new NCBITaxonTerm(); - taxon.setName(name); - taxon.setCurie(taxonCurie); - if (taxonMap.get("status").equals("active")) { - taxon.setObsolete(false); - } else { - taxon.setObsolete(true); - } - persist(taxon); - - return taxon; - } - } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java index a18b4451d..796222dfe 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java @@ -84,4 +84,14 @@ public String getIdentifier() { return null; } + @Transient + @JsonIgnore + public String getSubmittedIdentifier() { + if (StringUtils.isNotBlank(modEntityId)) + return modEntityId; + if (StringUtils.isNotBlank(modInternalId)) + return modInternalId; + return null; + } + } diff --git a/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java index 30099daf7..7bae67ed6 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java @@ -41,7 +41,6 @@ protected void init() { setSQLDao(alleleDiseaseAnnotationDAO); } - @Override public ObjectResponse get(String identifier) { SearchResponse ret = findByField("curie", identifier); if (ret != null && ret.getTotalResults() == 1) diff --git a/src/main/java/org/alliancegenome/curation_api/services/BiologicalEntityService.java b/src/main/java/org/alliancegenome/curation_api/services/BiologicalEntityService.java index d2d34c17d..2f17fec9f 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/BiologicalEntityService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/BiologicalEntityService.java @@ -1,15 +1,18 @@ package org.alliancegenome.curation_api.services; import org.alliancegenome.curation_api.dao.BiologicalEntityDAO; +import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; +import org.alliancegenome.curation_api.exceptions.ObjectUpdateException; import org.alliancegenome.curation_api.model.entities.BiologicalEntity; -import org.alliancegenome.curation_api.services.base.CurieObjectCrudService; +import org.alliancegenome.curation_api.model.ingest.dto.BiologicalEntityDTO; +import org.alliancegenome.curation_api.services.base.SubmittedObjectCrudService; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @RequestScoped -public class BiologicalEntityService extends CurieObjectCrudService { +public class BiologicalEntityService extends SubmittedObjectCrudService { @Inject BiologicalEntityDAO biologicalEntityDAO; @@ -19,4 +22,13 @@ public class BiologicalEntityService extends CurieObjectCrudService get(String identifier) { SearchResponse ret = findByField("curie", identifier); if (ret != null && ret.getTotalResults() == 1) diff --git a/src/main/java/org/alliancegenome/curation_api/services/GeneDiseaseAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/GeneDiseaseAnnotationService.java index 12ee620a2..b8c2318f5 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/GeneDiseaseAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/GeneDiseaseAnnotationService.java @@ -42,7 +42,6 @@ protected void init() { setSQLDao(geneDiseaseAnnotationDAO); } - @Override public ObjectResponse get(String identifier) { SearchResponse ret = findByField("curie", identifier); if (ret != null && ret.getTotalResults() == 1) diff --git a/src/main/java/org/alliancegenome/curation_api/services/GenomicEntityService.java b/src/main/java/org/alliancegenome/curation_api/services/GenomicEntityService.java new file mode 100644 index 000000000..44a105294 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/services/GenomicEntityService.java @@ -0,0 +1,34 @@ +package org.alliancegenome.curation_api.services; + +import org.alliancegenome.curation_api.dao.GenomicEntityDAO; +import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; +import org.alliancegenome.curation_api.exceptions.ObjectUpdateException; +import org.alliancegenome.curation_api.model.entities.GenomicEntity; +import org.alliancegenome.curation_api.model.ingest.dto.GenomicEntityDTO; +import org.alliancegenome.curation_api.services.base.SubmittedObjectCrudService; + +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; + +@RequestScoped +public class GenomicEntityService extends SubmittedObjectCrudService { + + @Inject + GenomicEntityDAO genomicEntityDAO; + + @Override + @PostConstruct + protected void init() { + setSQLDao(genomicEntityDAO); + } + + @Override + public GenomicEntity upsert(GenomicEntityDTO dto, BackendBulkDataProvider dataProvider) + throws ObjectUpdateException { + return null; + } + + @Override + public void removeOrDeprecateNonUpdated(Long id, String loadDescription) {} +} diff --git a/src/main/java/org/alliancegenome/curation_api/services/InformationContentEntityService.java b/src/main/java/org/alliancegenome/curation_api/services/InformationContentEntityService.java index 9aab842b7..048fb4dd8 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/InformationContentEntityService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/InformationContentEntityService.java @@ -23,7 +23,7 @@ protected void init() { } public InformationContentEntity retrieveFromDbOrLiteratureService(String curieOrXref) { - InformationContentEntity ice = informationContentEntityDAO.findByCurie(curieOrXref); + InformationContentEntity ice = findByCurie(curieOrXref); if (ice == null) ice = referenceService.retrieveFromDbOrLiteratureService(curieOrXref); diff --git a/src/main/java/org/alliancegenome/curation_api/services/MoleculeService.java b/src/main/java/org/alliancegenome/curation_api/services/MoleculeService.java index a90448729..d0284dfec 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/MoleculeService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/MoleculeService.java @@ -52,7 +52,7 @@ protected void init() { @Transactional public Molecule getByCurie(String id) { - Molecule molecule = moleculeDAO.findByCurie(id); + Molecule molecule = findByCurie(id); if (molecule != null) { molecule.getSynonyms().size(); } @@ -102,7 +102,7 @@ public void processUpdate(MoleculeFmsDTO dto) throws ObjectUpdateException { } try { - Molecule molecule = moleculeDAO.findByCurie(dto.getId()); + Molecule molecule = findByCurie(dto.getId()); if (molecule == null) { molecule = new Molecule(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/OrganizationService.java b/src/main/java/org/alliancegenome/curation_api/services/OrganizationService.java index 5bae94149..b27c61847 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/OrganizationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/OrganizationService.java @@ -28,7 +28,6 @@ protected void init() { setSQLDao(organizationDAO); } - @Override public ObjectResponse get(String orgId) { Organization org = null; diff --git a/src/main/java/org/alliancegenome/curation_api/services/ReferenceService.java b/src/main/java/org/alliancegenome/curation_api/services/ReferenceService.java index 489acc2f3..b83bbd49c 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ReferenceService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ReferenceService.java @@ -40,7 +40,7 @@ public Reference retrieveFromDbOrLiteratureService(String curieOrXref) { Reference reference = null; if (curieOrXref.startsWith("AGRKB:")) { - reference = referenceDAO.findByIdentifierString(curieOrXref); + reference = findByCurie(curieOrXref); } else { SearchResponse response = referenceDAO.findByField("crossReferences.referencedCurie", curieOrXref); List nonObsoleteRefs = new ArrayList<>(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/base/BaseEntityCrudService.java b/src/main/java/org/alliancegenome/curation_api/services/base/BaseEntityCrudService.java index 71b06eb58..876dda050 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/base/BaseEntityCrudService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/base/BaseEntityCrudService.java @@ -52,12 +52,6 @@ public ObjectResponse get(Long id) { return ret; } - public ObjectResponse get(String id) { - E object = dao.findByIdentifierString(id); - ObjectResponse ret = new ObjectResponse(object); - return ret; - } - @Transactional public ObjectResponse update(E entity) { // log.info("Authed Person: " + authenticatedPerson); diff --git a/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java b/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java index 44d61bf9d..7a60aec3d 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java @@ -37,7 +37,7 @@ public abstract class BaseOntologyTermService incomingParents = new HashSet<>(); HashSet parentAdds = new HashSet<>(); @@ -225,7 +225,7 @@ public ObjectListResponse getRootNodes() { } public ObjectListResponse getChildren(String curie) { - E term = dao.findByIdentifierString(curie); + E term = findByCurie(curie); if (term != null) { return (ObjectListResponse) new ObjectListResponse(term.getIsaChildren()); } else { @@ -234,7 +234,7 @@ public ObjectListResponse getChildren(String curie) { } public ObjectListResponse getDescendants(String curie) { - E term = dao.findByIdentifierString(curie); + E term = findByCurie(curie); if (term != null) { return (ObjectListResponse) new ObjectListResponse(term.getIsaDescendants()); } else { @@ -243,7 +243,7 @@ public ObjectListResponse getDescendants(String curie) { } public ObjectListResponse getParents(String curie) { - E term = dao.findByIdentifierString(curie); + E term = findByCurie(curie); if (term != null) { return (ObjectListResponse) new ObjectListResponse(term.getIsaParents()); } else { @@ -252,7 +252,7 @@ public ObjectListResponse getParents(String curie) { } public ObjectListResponse getAncestors(String curie) { - E term = dao.findByIdentifierString(curie); + E term = findByCurie(curie); if (term != null) { return (ObjectListResponse) new ObjectListResponse(term.getIsaAncestors()); } else { diff --git a/src/main/java/org/alliancegenome/curation_api/services/base/CurieObjectCrudService.java b/src/main/java/org/alliancegenome/curation_api/services/base/CurieObjectCrudService.java index db7f3ae5e..447bac191 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/base/CurieObjectCrudService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/base/CurieObjectCrudService.java @@ -3,24 +3,42 @@ import org.alliancegenome.curation_api.dao.base.BaseEntityDAO; import org.alliancegenome.curation_api.model.entities.base.CurieObject; import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; +import io.quarkus.logging.Log; import jakarta.transaction.Transactional; public abstract class CurieObjectCrudService> extends BaseEntityCrudService { public ObjectResponse get(String curie) { - E object = dao.findByCurie(curie); + E object = findByCurie(curie); ObjectResponse ret = new ObjectResponse(object); return ret; } @Transactional public ObjectResponse delete(String curie) { - E object = dao.findByCurie(curie); + E object = findByCurie(curie); if (object != null) dao.remove(object.getId()); ObjectResponse ret = new ObjectResponse<>(object); return ret; } + + public E findByCurie(String curie) { + if (curie != null) { + SearchResponse response = findByField("curie", curie); + if (response == null || response.getSingleResult() == null) { + Log.debug("Entity Not Found: " + curie); + return null; + } + E entity = response.getSingleResult(); + Log.debug("Entity Found: " + entity); + return entity; + } else { + Log.debug("Input Param is null: " + curie); + return null; + } + } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java b/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java index a6cdc19a0..dab6cee55 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java @@ -6,14 +6,16 @@ import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; +import io.quarkus.logging.Log; import jakarta.transaction.Transactional; public abstract class SubmittedObjectCrudService> extends CurieObjectCrudService { @Override public ObjectResponse get(String identifierString) { - E object = dao.findByIdentifierString(identifierString); + E object = findByIdentifierString(identifierString); ObjectResponse ret = new ObjectResponse(object); return ret; } @@ -21,7 +23,7 @@ public ObjectResponse get(String identifierString) { @Override @Transactional public ObjectResponse delete(String identifierString) { - E object = dao.findByIdentifierString(identifierString); + E object = findByIdentifierString(identifierString); if (object != null) dao.remove(object.getId()); ObjectResponse ret = new ObjectResponse<>(object); @@ -32,4 +34,30 @@ public ObjectResponse delete(String identifierString) { public abstract void removeOrDeprecateNonUpdated(Long id, String loadDescription); + public E findByIdentifierString(String id) { + if (id != null) { + SearchResponse response = null; + if (id.startsWith("AGRKB:")) { + response = findByField("curie", id); + } else { + if (response == null || response.getSingleResult() == null) { + response = findByField("modEntityId", id); + if (response == null || response.getSingleResult() == null) + response = findByField("modInternalId", id); + } + } + + if (response == null || response.getSingleResult() == null) { + Log.debug("Entity Not Found: " + id); + return null; + } + + E entity = response.getSingleResult(); + Log.debug("Entity Found: " + entity); + return entity; + } else { + Log.debug("Input Param is null: " + id); + return null; + } + } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/UniqueIdGeneratorHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/UniqueIdGeneratorHelper.java index 40aada356..651738340 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/UniqueIdGeneratorHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/UniqueIdGeneratorHelper.java @@ -3,7 +3,9 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; +import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -33,5 +35,12 @@ public void addList(List list) { } } } + + public void addSubmittedObjectList(List list) { + if (CollectionUtils.isNotEmpty(list)) { + List submittedIdentifiers = list.stream().map(SubmittedObject::getSubmittedIdentifier).collect(Collectors.toList()); + addList(submittedIdentifiers); + } + } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java index 1b10a91c8..fc9b6399b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java @@ -47,9 +47,9 @@ public static String getConditionRelationUniqueId(ConditionRelationDTO dto, Stri return uniqueId.getUniqueId(); } - public static String getDiseaseAnnotationUniqueId(DiseaseAnnotationDTO annotationDTO, String subjectCurie, String refCurie) { + public static String getDiseaseAnnotationUniqueId(DiseaseAnnotationDTO annotationDTO, String subjectIdentifier, String refCurie) { UniqueIdGeneratorHelper uniqueId = new UniqueIdGeneratorHelper(); - uniqueId.add(subjectCurie); + uniqueId.add(subjectIdentifier); uniqueId.add(annotationDTO.getDiseaseRelationName()); if (annotationDTO.getNegated()) { uniqueId.add(annotationDTO.getNegated().toString()); @@ -70,7 +70,7 @@ public static String getDiseaseAnnotationUniqueId(DiseaseAnnotationDTO annotatio } uniqueId.addList(annotationDTO.getDiseaseQualifierNames()); uniqueId.add(annotationDTO.getDiseaseGeneticModifierRelationName()); - uniqueId.addList(annotationDTO.getDiseaseGeneticModifierCuries()); + uniqueId.addList(annotationDTO.getDiseaseGeneticModifierIdentifiers()); return uniqueId.getUniqueId(); } @@ -87,8 +87,7 @@ public static String getDiseaseAnnotationUniqueId(DiseaseAnnotation annotation) uniqueId.add(annotation.getSingleReference().getCurie()); if (CollectionUtils.isNotEmpty(annotation.getEvidenceCodes())) uniqueId.addList(annotation.getEvidenceCodes().stream().map(ECOTerm::getCurie).collect(Collectors.toList())); - if (CollectionUtils.isNotEmpty(annotation.getWith())) - uniqueId.addList(annotation.getWith().stream().map(Gene::getCurie).collect(Collectors.toList())); + uniqueId.addSubmittedObjectList(annotation.getWith()); if (CollectionUtils.isNotEmpty(annotation.getConditionRelations())) { uniqueId.addList(annotation.getConditionRelations().stream().map(condition -> { UniqueIdGeneratorHelper gen = new UniqueIdGeneratorHelper(); @@ -101,8 +100,7 @@ public static String getDiseaseAnnotationUniqueId(DiseaseAnnotation annotation) uniqueId.addList(annotation.getDiseaseQualifiers().stream().map(VocabularyTerm::getName).collect(Collectors.toList())); if (annotation.getDiseaseGeneticModifierRelation() != null) uniqueId.add(annotation.getDiseaseGeneticModifierRelation().getName()); - if (CollectionUtils.isNotEmpty(annotation.getDiseaseGeneticModifiers())) - uniqueId.addList(annotation.getDiseaseGeneticModifiers().stream().map(BiologicalEntity::getCurie).collect(Collectors.toList())); + uniqueId.addSubmittedObjectList(annotation.getDiseaseGeneticModifiers()); return uniqueId.getUniqueId(); } @@ -138,7 +136,7 @@ public static String getExperimentalConditionUniqueId(ExperimentalConditionDTO d return uniqueId.getUniqueId(); } - public String getEvidenceCurie(EvidenceFmsDTO dto) { + public String getEvidenceCuri(EvidenceFmsDTO dto) { UniqueIdGeneratorHelper uniqueId = new UniqueIdGeneratorHelper(); if (dto.getPublication().getCrossReference() != null) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/ExperimentalConditionSummary.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/ExperimentalConditionSummary.java index 4321f9238..912c3b650 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/ExperimentalConditionSummary.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/ExperimentalConditionSummary.java @@ -1,6 +1,5 @@ package org.alliancegenome.curation_api.services.helpers.diseaseAnnotations; -import org.alliancegenome.curation_api.dao.ontology.NcbiTaxonTermDAO; import org.alliancegenome.curation_api.model.entities.ExperimentalCondition; import org.alliancegenome.curation_api.model.entities.ontology.AnatomicalTerm; import org.alliancegenome.curation_api.model.entities.ontology.ChemicalTerm; @@ -14,6 +13,7 @@ import org.alliancegenome.curation_api.services.ontology.ChemicalTermService; import org.alliancegenome.curation_api.services.ontology.ExperimentalConditionOntologyTermService; import org.alliancegenome.curation_api.services.ontology.GoTermService; +import org.alliancegenome.curation_api.services.ontology.NcbiTaxonTermService; import org.alliancegenome.curation_api.services.ontology.ZecoTermService; import org.apache.commons.lang3.StringUtils; @@ -32,7 +32,7 @@ public class ExperimentalConditionSummary { @Inject GoTermService goTermService; @Inject - NcbiTaxonTermDAO ncbiTaxonTermDAO; + NcbiTaxonTermService ncbiTaxonTermService; @Inject ChemicalTermService chemicalTermService; @@ -95,7 +95,7 @@ public String getConditionSummary(ExperimentalConditionDTO conditionDto) { } if (StringUtils.isNotBlank(conditionDto.getConditionTaxonCurie())) { - NCBITaxonTerm conditionTaxon = ncbiTaxonTermDAO.find(conditionDto.getConditionTaxonCurie()); + NCBITaxonTerm conditionTaxon = ncbiTaxonTermService.findByCurie(conditionDto.getConditionTaxonCurie()); conditionSummary.add(conditionTaxon.getName()); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/references/ReferenceSynchronisationHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/references/ReferenceSynchronisationHelper.java index 63ca2bd68..8eda83cfc 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/references/ReferenceSynchronisationHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/references/ReferenceSynchronisationHelper.java @@ -14,6 +14,7 @@ import org.alliancegenome.curation_api.model.input.Pagination; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.ReferenceService; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; import org.apache.commons.collections.CollectionUtils; @@ -27,6 +28,8 @@ public class ReferenceSynchronisationHelper { @Inject ReferenceDAO referenceDAO; @Inject + ReferenceService referenceService; + @Inject LiteratureReferenceDAO literatureReferenceDAO; @Inject CrossReferenceDAO crossReferenceDAO; @@ -36,7 +39,7 @@ public Reference retrieveFromLiteratureService(String curie) { LiteratureReference litRef = fetchLiteratureServiceReference(curie); if (litRef != null) { - Reference ref = referenceDAO.findByIdentifierString(curie); + Reference ref = referenceService.findByCurie(curie); if (ref == null) ref = new Reference(); ref = copyLiteratureReferenceFields(litRef, ref); @@ -83,11 +86,8 @@ public void synchroniseReferences() { } protected Reference copyLiteratureReferenceFields(LiteratureReference litRef, Reference ref) { - String originalCurie = ref.getCurie(); - if (!litRef.getCurie().equals(originalCurie)) { - ref = new Reference(); - ref.setCurie(litRef.getCurie()); - } + + ref.setCurie(litRef.getCurie()); ref.setObsolete(false); List xrefs = new ArrayList<>(); @@ -112,10 +112,6 @@ protected Reference copyLiteratureReferenceFields(LiteratureReference litRef, Re ref.setCrossReferences(xrefs); ref.setShortCitation(litRef.citationShort); - if (!ref.getCurie().equals(originalCurie) && originalCurie != null) { - referenceDAO.updateReferenceForeignKeys(originalCurie, ref.getCurie()); - referenceDAO.remove(originalCurie); - } return ref; } @@ -127,13 +123,14 @@ public ObjectResponse synchroniseReference(Long id) { if (ref == null) return response; + LiteratureReference litRef = fetchLiteratureServiceReference(ref.getCurie()); if (litRef == null) { ref.setObsolete(true); } else { ref = copyLiteratureReferenceFields(litRef, ref); } - + response.setEntity(referenceDAO.persist(ref)); return response; diff --git a/src/main/java/org/alliancegenome/curation_api/services/ontology/EcoTermService.java b/src/main/java/org/alliancegenome/curation_api/services/ontology/EcoTermService.java index c936afcf0..6100e684b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ontology/EcoTermService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ontology/EcoTermService.java @@ -37,7 +37,7 @@ public void updateAbbreviations() { if (res != null && res.getTotalResults() == 1) { List ecoVocabularyTerms = res.getResults().get(0).getMemberTerms(); ecoVocabularyTerms.forEach((ecoVocabularyTerm) -> { - ECOTerm ecoTerm = ecoTermDAO.findByCurie(ecoVocabularyTerm.getName()); + ECOTerm ecoTerm = findByCurie(ecoVocabularyTerm.getName()); if (ecoTerm != null) { ecoTerm.setAbbreviation(ecoVocabularyTerm.getAbbreviation()); List subsets = ecoTerm.getSubsets(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/ontology/NcbiTaxonTermService.java b/src/main/java/org/alliancegenome/curation_api/services/ontology/NcbiTaxonTermService.java index 63a61f711..ce35da177 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ontology/NcbiTaxonTermService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ontology/NcbiTaxonTermService.java @@ -2,9 +2,13 @@ import java.util.Date; import java.util.HashMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.alliancegenome.curation_api.dao.ontology.NcbiTaxonTermDAO; +import org.alliancegenome.curation_api.interfaces.ncbi.NCBIRESTInterface; import org.alliancegenome.curation_api.model.entities.ontology.NCBITaxonTerm; +import org.alliancegenome.curation_api.model.ingest.NCBITaxonResponseDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.base.BaseOntologyTermService; @@ -12,6 +16,7 @@ import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; +import si.mazi.rescu.RestProxyFactory; @RequestScoped public class NcbiTaxonTermService extends BaseOntologyTermService { @@ -28,6 +33,10 @@ protected void init() { setSQLDao(ncbiTaxonTermDAO); } + private final int MAX_ATTEMPTS = 5; + + private NCBIRESTInterface api = RestProxyFactory.createProxy(NCBIRESTInterface.class, "https://eutils.ncbi.nlm.nih.gov"); + @Override public ObjectResponse get(String taxonCurie) { NCBITaxonTerm term = null; @@ -51,15 +60,55 @@ public ObjectResponse get(String taxonCurie) { } - private NCBITaxonTerm getTaxonFromDB(String taxonCurie) { - NCBITaxonTerm taxon = ncbiTaxonTermDAO.findByCurie(taxonCurie); + public NCBITaxonTerm getTaxonFromDB(String taxonCurie) { + NCBITaxonTerm taxon = findByCurie(taxonCurie); if (taxon == null) { - taxon = ncbiTaxonTermDAO.downloadAndSave(taxonCurie); + taxon = downloadAndSave(taxonCurie); if (taxon == null) { Log.warn("Taxon ID could not be found"); } } return taxon; } + + public NCBITaxonTerm downloadAndSave(String taxonCurie) { + + Pattern taxonIdPattern = Pattern.compile("^NCBITaxon:(\\d+)$"); + Matcher taxonIdMatcher = taxonIdPattern.matcher(taxonCurie); + if (!taxonIdMatcher.find()) { + return null; + } + + HashMap taxonMap = null; + int attemptsRemaining = MAX_ATTEMPTS; + while (attemptsRemaining-- > 0) { + try { + NCBITaxonResponseDTO resp = api.getTaxonFromNCBI("taxonomy", "json", taxonIdMatcher.group(1)); + HashMap result = resp.getResult(); + taxonMap = (HashMap) result.get(taxonIdMatcher.group(1)); + + break; + } catch (Exception e) { + e.printStackTrace(); + continue; + } + } + + if (taxonMap == null || taxonMap.get("error") != null) + return null; + + String name = (String) taxonMap.get("scientificname"); + NCBITaxonTerm taxon = new NCBITaxonTerm(); + taxon.setName(name); + taxon.setCurie(taxonCurie); + if (taxonMap.get("status").equals("active")) { + taxon.setObsolete(false); + } else { + taxon.setObsolete(true); + } + ncbiTaxonTermDAO.persist(taxon); + + return taxon; + } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java index 5e7f58f3f..4c749a112 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java @@ -21,9 +21,9 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.ExperimentalConditionSummary; +import org.alliancegenome.curation_api.services.ontology.NcbiTaxonTermService; import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -45,6 +45,8 @@ public class ExperimentalConditionValidator extends AuditedObjectValidator extends CurieObjectValidator { +public class SubmittedObjectValidator extends AuditedObjectValidator { @Inject DataProviderService dataProviderService; @Inject DataProviderValidator dataProviderValidator; @@ -31,6 +31,15 @@ public E validateSubmittedObjectFields(E uiEntity, E dbEntity) { return dbEntity; } + public String validateCurie(E uiEntity) { + String curie = handleStringField(uiEntity.getCurie()); + if (curie != null && !curie.startsWith("AGRKB:")) { + addMessageResponse("curie", ValidationConstants.INVALID_MESSAGE); + return null; + } + return curie; + } + public String validateModInternalId(E uiEntity) { String modInternalId = uiEntity.getModInternalId(); if (StringUtils.isBlank(modInternalId)) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java index e4d8b7d3f..b5b2bb369 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java @@ -6,9 +6,6 @@ import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.constants.VocabularyConstants; import org.alliancegenome.curation_api.dao.AGMDiseaseAnnotationDAO; -import org.alliancegenome.curation_api.dao.AffectedGenomicModelDAO; -import org.alliancegenome.curation_api.dao.AlleleDAO; -import org.alliancegenome.curation_api.dao.GeneDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectUpdateException; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; @@ -21,6 +18,9 @@ import org.alliancegenome.curation_api.model.ingest.dto.AGMDiseaseAnnotationDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.AffectedGenomicModelService; +import org.alliancegenome.curation_api.services.AlleleService; +import org.alliancegenome.curation_api.services.GeneService; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; import org.apache.commons.collections.CollectionUtils; @@ -37,11 +37,11 @@ public class AGMDiseaseAnnotationDTOValidator extends DiseaseAnnotationDTOValida @Inject VocabularyTermService vocabularyTermService; @Inject - AffectedGenomicModelDAO agmDAO; + AffectedGenomicModelService agmService; @Inject - GeneDAO geneDAO; + GeneService geneService; @Inject - AlleleDAO alleleDAO; + AlleleService alleleService; public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotationDTO dto, BackendBulkDataProvider dataProvider) throws ObjectUpdateException, ObjectValidationException { @@ -58,7 +58,7 @@ public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotation if (StringUtils.isBlank(dto.getAgmIdentifier())) { adaResponse.addErrorMessage("agm_identifier", ValidationConstants.REQUIRED_MESSAGE); } else { - agm = agmDAO.findByIdentifierString(dto.getAgmIdentifier()); + agm = agmService.findByIdentifierString(dto.getAgmIdentifier()); if (agm == null) { adaResponse.addErrorMessage("agm_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAgmIdentifier() + ")"); } else { @@ -108,7 +108,7 @@ public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotation } if (StringUtils.isNotBlank(dto.getInferredGeneIdentifier())) { - Gene inferredGene = geneDAO.findByIdentifierString(dto.getInferredGeneIdentifier()); + Gene inferredGene = geneService.findByIdentifierString(dto.getInferredGeneIdentifier()); if (inferredGene == null) adaResponse.addErrorMessage("inferred_gene_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getInferredGeneIdentifier() + ")"); annotation.setInferredGene(inferredGene); @@ -119,7 +119,7 @@ public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotation if (CollectionUtils.isNotEmpty(dto.getAssertedGeneIdentifiers())) { List assertedGenes = new ArrayList<>(); for (String assertedGeneIdentifier : dto.getAssertedGeneIdentifiers()) { - Gene assertedGene = geneDAO.findByIdentifierString(assertedGeneIdentifier); + Gene assertedGene = geneService.findByIdentifierString(assertedGeneIdentifier); if (assertedGene == null) { adaResponse.addErrorMessage("asserted_gene_identifiers", ValidationConstants.INVALID_MESSAGE + " (" + assertedGeneIdentifier + ")"); } else { @@ -132,7 +132,7 @@ public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotation } if (StringUtils.isNotBlank(dto.getInferredAlleleIdentifier())) { - Allele inferredAllele = alleleDAO.findByIdentifierString(dto.getInferredAlleleIdentifier()); + Allele inferredAllele = alleleService.findByIdentifierString(dto.getInferredAlleleIdentifier()); if (inferredAllele == null) adaResponse.addErrorMessage("inferred_allele_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getInferredAlleleIdentifier() + ")"); annotation.setInferredAllele(inferredAllele); @@ -141,7 +141,7 @@ public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotation } if (StringUtils.isNotBlank(dto.getAssertedAlleleIdentifier())) { - Allele assertedAllele = alleleDAO.findByIdentifierString(dto.getAssertedAlleleIdentifier()); + Allele assertedAllele = alleleService.findByIdentifierString(dto.getAssertedAlleleIdentifier()); if (assertedAllele == null) adaResponse.addErrorMessage("asserted_allele_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAssertedAlleleIdentifier() + ")"); annotation.setAssertedAllele(assertedAllele); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java index b48f48521..958e863ec 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java @@ -5,9 +5,7 @@ import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.constants.VocabularyConstants; -import org.alliancegenome.curation_api.dao.AlleleDAO; import org.alliancegenome.curation_api.dao.AlleleDiseaseAnnotationDAO; -import org.alliancegenome.curation_api.dao.GeneDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; import org.alliancegenome.curation_api.model.entities.Allele; @@ -18,6 +16,8 @@ import org.alliancegenome.curation_api.model.ingest.dto.AlleleDiseaseAnnotationDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.AlleleService; +import org.alliancegenome.curation_api.services.GeneService; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; import org.apache.commons.collections.CollectionUtils; @@ -32,9 +32,9 @@ public class AlleleDiseaseAnnotationDTOValidator extends DiseaseAnnotationDTOVal @Inject AlleleDiseaseAnnotationDAO alleleDiseaseAnnotationDAO; @Inject - AlleleDAO alleleDAO; + AlleleService alleleService; @Inject - GeneDAO geneDAO; + GeneService geneService; @Inject VocabularyTermService vocabularyTermService; @@ -52,7 +52,7 @@ public AlleleDiseaseAnnotation validateAlleleDiseaseAnnotationDTO(AlleleDiseaseA if (StringUtils.isBlank(dto.getAlleleIdentifier())) { adaResponse.addErrorMessage("allele_identifier", ValidationConstants.REQUIRED_MESSAGE); } else { - allele = alleleDAO.findByIdentifierString(dto.getAlleleIdentifier()); + allele = alleleService.findByIdentifierString(dto.getAlleleIdentifier()); if (allele == null) { adaResponse.addErrorMessage("allele_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAlleleIdentifier() + ")"); } else { @@ -102,7 +102,7 @@ public AlleleDiseaseAnnotation validateAlleleDiseaseAnnotationDTO(AlleleDiseaseA } if (StringUtils.isNotBlank(dto.getInferredGeneIdentifier())) { - Gene inferredGene = geneDAO.findByIdentifierString(dto.getInferredGeneIdentifier()); + Gene inferredGene = geneService.findByIdentifierString(dto.getInferredGeneIdentifier()); if (inferredGene == null) adaResponse.addErrorMessage("inferred_gene_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getInferredGeneIdentifier() + ")"); annotation.setInferredGene(inferredGene); @@ -113,7 +113,7 @@ public AlleleDiseaseAnnotation validateAlleleDiseaseAnnotationDTO(AlleleDiseaseA if (CollectionUtils.isNotEmpty(dto.getAssertedGeneIdentifiers())) { List assertedGenes = new ArrayList<>(); for (String assertedGeneIdentifier : dto.getAssertedGeneIdentifiers()) { - Gene assertedGene = geneDAO.findByIdentifierString(assertedGeneIdentifier); + Gene assertedGene = geneService.findByIdentifierString(assertedGeneIdentifier); if (assertedGene == null) { adaResponse.addErrorMessage("asserted_gene_identifiers", ValidationConstants.INVALID_MESSAGE + " (" + assertedGeneIdentifier + ")"); } else { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java index fafe08894..9bcd37a71 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java @@ -6,9 +6,7 @@ import org.alliancegenome.curation_api.constants.OntologyConstants; import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.constants.VocabularyConstants; -import org.alliancegenome.curation_api.dao.BiologicalEntityDAO; import org.alliancegenome.curation_api.dao.DataProviderDAO; -import org.alliancegenome.curation_api.dao.GeneDAO; import org.alliancegenome.curation_api.model.entities.BiologicalEntity; import org.alliancegenome.curation_api.model.entities.DataProvider; import org.alliancegenome.curation_api.model.entities.DiseaseAnnotation; @@ -18,6 +16,8 @@ import org.alliancegenome.curation_api.model.entities.ontology.ECOTerm; import org.alliancegenome.curation_api.model.ingest.dto.DiseaseAnnotationDTO; import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.services.BiologicalEntityService; +import org.alliancegenome.curation_api.services.GeneService; import org.alliancegenome.curation_api.services.ReferenceService; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.ontology.DoTermService; @@ -40,9 +40,9 @@ public class DiseaseAnnotationDTOValidator extends AnnotationDTOValidator { @Inject VocabularyTermService vocabularyTermService; @Inject - GeneDAO geneDAO; + GeneService geneService; @Inject - BiologicalEntityDAO biologicalEntityDAO; + BiologicalEntityService biologicalEntityService; @Inject DataProviderDTOValidator dataProviderDtoValidator; @Inject @@ -90,7 +90,7 @@ public ObjectRespo if (!withIdentifier.startsWith("HGNC:")) { daResponse.addErrorMessage("with_gene_identifiers", ValidationConstants.INVALID_MESSAGE + " (" + withIdentifier + ")"); } else { - Gene withGene = geneDAO.findByIdentifierString(withIdentifier); + Gene withGene = geneService.findByIdentifierString(withIdentifier); if (withGene == null) { daResponse.addErrorMessage("with_gene_identifiers", ValidationConstants.INVALID_MESSAGE + " (" + withIdentifier + ")"); } else { @@ -141,7 +141,7 @@ public ObjectRespo daResponse.addErrorMessage("disease_genetic_modifier_relation_name", ValidationConstants.INVALID_MESSAGE + " (" + dto.getDiseaseGeneticModifierRelationName() + ")"); List diseaseGeneticModifiers = new ArrayList<>(); for (String modifierIdentifier : dto.getDiseaseGeneticModifierIdentifiers()) { - BiologicalEntity diseaseGeneticModifier = biologicalEntityDAO.findByIdentifierString(modifierIdentifier); + BiologicalEntity diseaseGeneticModifier = biologicalEntityService.findByIdentifierString(modifierIdentifier); if (diseaseGeneticModifier == null) { daResponse.addErrorMessage("disease_genetic_modifier_identifiers", ValidationConstants.INVALID_MESSAGE + " (" + modifierIdentifier + ")"); } else { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java index acab94ca1..65ceb4e27 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java @@ -3,7 +3,6 @@ import org.alliancegenome.curation_api.constants.OntologyConstants; import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.dao.ExperimentalConditionDAO; -import org.alliancegenome.curation_api.dao.ontology.NcbiTaxonTermDAO; import org.alliancegenome.curation_api.model.entities.ExperimentalCondition; import org.alliancegenome.curation_api.model.entities.ontology.AnatomicalTerm; import org.alliancegenome.curation_api.model.entities.ontology.ChemicalTerm; @@ -21,6 +20,7 @@ import org.alliancegenome.curation_api.services.ontology.ChemicalTermService; import org.alliancegenome.curation_api.services.ontology.ExperimentalConditionOntologyTermService; import org.alliancegenome.curation_api.services.ontology.GoTermService; +import org.alliancegenome.curation_api.services.ontology.NcbiTaxonTermService; import org.alliancegenome.curation_api.services.ontology.ZecoTermService; import org.alliancegenome.curation_api.services.validation.dto.base.BaseDTOValidator; import org.apache.commons.lang3.StringUtils; @@ -40,7 +40,7 @@ public class ExperimentalConditionDTOValidator extends BaseDTOValidator { @Inject AnatomicalTermService anatomicalTermService; @Inject - NcbiTaxonTermDAO ncbiTaxonTermDAO; + NcbiTaxonTermService ncbiTaxonTermService; @Inject GoTermService goTermService; @Inject @@ -103,10 +103,7 @@ public ObjectResponse validateExperimentalConditionDTO(Ex NCBITaxonTerm conditionTaxon = null; if (StringUtils.isNotBlank(dto.getConditionTaxonCurie())) { - conditionTaxon = ncbiTaxonTermDAO.findByCurie(dto.getConditionTaxonCurie()); - if (conditionTaxon == null) { - conditionTaxon = ncbiTaxonTermDAO.downloadAndSave(dto.getConditionTaxonCurie()); - } + conditionTaxon = ncbiTaxonTermService.getTaxonFromDB(dto.getConditionTaxonCurie()); if (conditionTaxon == null) ecResponse.addErrorMessage("condition_taxon_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getConditionTaxonCurie() + ")"); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java index 3e10c721f..5374b102e 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java @@ -2,9 +2,7 @@ import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.constants.VocabularyConstants; -import org.alliancegenome.curation_api.dao.AffectedGenomicModelDAO; import org.alliancegenome.curation_api.dao.ConditionRelationDAO; -import org.alliancegenome.curation_api.dao.GeneDAO; import org.alliancegenome.curation_api.dao.GeneDiseaseAnnotationDAO; import org.alliancegenome.curation_api.dao.NoteDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; @@ -17,6 +15,7 @@ import org.alliancegenome.curation_api.model.ingest.dto.GeneDiseaseAnnotationDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.AffectedGenomicModelService; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; import org.apache.commons.lang3.StringUtils; @@ -30,9 +29,7 @@ public class GeneDiseaseAnnotationDTOValidator extends DiseaseAnnotationDTOValid @Inject GeneDiseaseAnnotationDAO geneDiseaseAnnotationDAO; @Inject - AffectedGenomicModelDAO affectedGenomicModelDAO; - @Inject - GeneDAO geneDAO; + AffectedGenomicModelService affectedGenomicModelService; @Inject NoteDAO noteDAO; @Inject @@ -54,7 +51,7 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat if (StringUtils.isBlank(dto.getGeneIdentifier())) { gdaResponse.addErrorMessage("gene_identifier", ValidationConstants.REQUIRED_MESSAGE); } else { - gene = geneDAO.findByIdentifierString(dto.getGeneIdentifier()); + gene = geneService.findByIdentifierString(dto.getGeneIdentifier()); if (gene == null) { gdaResponse.addErrorMessage("gene_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGeneIdentifier() + ")"); } else { @@ -93,7 +90,7 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat AffectedGenomicModel sgdStrainBackground = null; if (StringUtils.isNotBlank(dto.getSgdStrainBackgroundIdentifier())) { - sgdStrainBackground = affectedGenomicModelDAO.findByIdentifierString(dto.getSgdStrainBackgroundIdentifier()); + sgdStrainBackground = affectedGenomicModelService.findByIdentifierString(dto.getSgdStrainBackgroundIdentifier()); if (sgdStrainBackground == null || !sgdStrainBackground.getTaxon().getName().startsWith("Saccharomyces cerevisiae")) { gdaResponse.addErrorMessage("sgd_strain_background_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getSgdStrainBackgroundIdentifier() + ")"); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java index 1e1ad4719..291df3ad0 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java @@ -4,7 +4,6 @@ import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.constants.VocabularyConstants; -import org.alliancegenome.curation_api.dao.GeneDAO; import org.alliancegenome.curation_api.dao.associations.alleleAssociations.AlleleGeneAssociationDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; @@ -16,6 +15,8 @@ import org.alliancegenome.curation_api.model.ingest.dto.associations.alleleAssociations.AlleleGeneAssociationDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.AlleleService; +import org.alliancegenome.curation_api.services.GeneService; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.apache.commons.lang3.StringUtils; @@ -28,7 +29,9 @@ public class AlleleGeneAssociationDTOValidator extends AlleleGenomicEntityAssoci @Inject AlleleGeneAssociationDAO alleleGeneAssociationDAO; @Inject - GeneDAO geneDAO; + AlleleService alleleService; + @Inject + GeneService geneService; @Inject VocabularyTermService vocabularyTermService; @@ -39,7 +42,7 @@ public AlleleGeneAssociation validateAlleleGeneAssociationDTO(AlleleGeneAssociat if (StringUtils.isBlank(dto.getAlleleIdentifier())) { agaResponse.addErrorMessage("allele_identifier", ValidationConstants.REQUIRED_MESSAGE); } else { - subject = alleleDAO.findByIdentifierString(dto.getAlleleIdentifier()); + subject = alleleService.findByIdentifierString(dto.getAlleleIdentifier()); if (subject == null) { agaResponse.addErrorMessage("allele_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAlleleIdentifier() + ")"); } else if (beDataProvider != null && !subject.getDataProvider().getSourceOrganization().getAbbreviation().equals(beDataProvider.sourceOrganization)) { @@ -51,7 +54,7 @@ public AlleleGeneAssociation validateAlleleGeneAssociationDTO(AlleleGeneAssociat if (StringUtils.isBlank(dto.getGeneIdentifier())) { agaResponse.addErrorMessage("gene_identifier", ValidationConstants.REQUIRED_MESSAGE); } else { - object = geneDAO.findByIdentifierString(dto.getGeneIdentifier()); + object = geneService.findByIdentifierString(dto.getGeneIdentifier()); if (object == null) { agaResponse.addErrorMessage("gene_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGeneIdentifier() + ")"); } else if (beDataProvider != null && !subject.getDataProvider().getSourceOrganization().getAbbreviation().equals(beDataProvider.sourceOrganization)) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGenomicEntityAssociationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGenomicEntityAssociationDTOValidator.java index 6f399dfed..1793d46ab 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGenomicEntityAssociationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGenomicEntityAssociationDTOValidator.java @@ -3,8 +3,6 @@ import org.alliancegenome.curation_api.constants.OntologyConstants; import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.constants.VocabularyConstants; -import org.alliancegenome.curation_api.dao.AlleleDAO; -import org.alliancegenome.curation_api.dao.NoteDAO; import org.alliancegenome.curation_api.model.entities.Note; import org.alliancegenome.curation_api.model.entities.associations.alleleAssociations.AlleleGenomicEntityAssociation; import org.alliancegenome.curation_api.model.entities.ontology.ECOTerm; @@ -21,10 +19,6 @@ @RequestScoped public class AlleleGenomicEntityAssociationDTOValidator extends EvidenceAssociationDTOValidator { - @Inject - AlleleDAO alleleDAO; - @Inject - NoteDAO noteDAO; @Inject NoteDTOValidator noteDtoValidator; @Inject diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java index d8da968fc..2877dfa23 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java @@ -2,29 +2,23 @@ import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; import java.util.List; -import java.util.Set; import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.constants.VocabularyConstants; import org.alliancegenome.curation_api.dao.ConstructDAO; -import org.alliancegenome.curation_api.dao.GenomicEntityDAO; -import org.alliancegenome.curation_api.dao.NoteDAO; import org.alliancegenome.curation_api.dao.associations.constructAssociations.ConstructGenomicEntityAssociationDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; -import org.alliancegenome.curation_api.model.entities.Allele; import org.alliancegenome.curation_api.model.entities.Construct; import org.alliancegenome.curation_api.model.entities.GenomicEntity; import org.alliancegenome.curation_api.model.entities.Note; import org.alliancegenome.curation_api.model.entities.VocabularyTerm; import org.alliancegenome.curation_api.model.entities.associations.constructAssociations.ConstructGenomicEntityAssociation; -import org.alliancegenome.curation_api.model.ingest.dto.AlleleDTO; -import org.alliancegenome.curation_api.model.ingest.dto.NoteDTO; import org.alliancegenome.curation_api.model.ingest.dto.associations.constructAssociations.ConstructGenomicEntityAssociationDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.GenomicEntityService; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.helpers.notes.NoteIdentityHelper; import org.alliancegenome.curation_api.services.validation.dto.NoteDTOValidator; @@ -41,7 +35,7 @@ public class ConstructGenomicEntityAssociationDTOValidator extends EvidenceAssoc @Inject ConstructDAO constructDAO; @Inject - GenomicEntityDAO genomicEntityDAO; + GenomicEntityService genomicEntityService; @Inject NoteDTOValidator noteDtoValidator; @Inject @@ -74,7 +68,7 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati if (StringUtils.isBlank(dto.getGenomicEntityIdentifier())) { assocResponse.addErrorMessage("genomic_entity_identifier", ValidationConstants.REQUIRED_MESSAGE); } else { - genomicEntity = genomicEntityDAO.findByIdentifierString(dto.getGenomicEntityIdentifier()); + genomicEntity = genomicEntityService.findByIdentifierString(dto.getGenomicEntityIdentifier()); if (genomicEntity == null) assocResponse.addErrorMessage("genomic_entity_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGenomicEntityIdentifier() + ")"); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java index f77495815..9fc880a9b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java @@ -7,7 +7,6 @@ import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.constants.VocabularyConstants; -import org.alliancegenome.curation_api.dao.GeneDAO; import org.alliancegenome.curation_api.dao.orthology.GeneToGeneOrthologyGeneratedDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; @@ -18,6 +17,7 @@ import org.alliancegenome.curation_api.model.ingest.dto.fms.OrthologyFmsDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.GeneService; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.ontology.NcbiTaxonTermService; import org.alliancegenome.curation_api.services.validation.dto.base.BaseDTOValidator; @@ -34,7 +34,7 @@ public class OrthologyFmsDTOValidator extends BaseDTOValidator { @Inject GeneToGeneOrthologyGeneratedDAO generatedOrthologyDAO; @Inject - GeneDAO geneDAO; + GeneService geneService; @Inject NcbiTaxonTermService ncbiTaxonTermService; @Inject @@ -63,7 +63,7 @@ public GeneToGeneOrthologyGenerated validateOrthologyFmsDTO(OrthologyFmsDTO dto) Gene subjectGene = null; if (StringUtils.isNotBlank(dto.getGene1())) { - subjectGene = geneDAO.findByIdentifierString(subjectGeneIdentifier); + subjectGene = geneService.findByIdentifierString(subjectGeneIdentifier); if (subjectGene == null) { orthologyResponse.addErrorMessage("gene1", ValidationConstants.INVALID_MESSAGE + " (" + subjectGeneIdentifier + ")"); } else { @@ -83,7 +83,7 @@ public GeneToGeneOrthologyGenerated validateOrthologyFmsDTO(OrthologyFmsDTO dto) Gene objectGene = null; if (StringUtils.isNotBlank(dto.getGene2())) { - objectGene = geneDAO.findByIdentifierString(objectGeneIdentifier); + objectGene = geneService.findByIdentifierString(objectGeneIdentifier); if (objectGene == null) { orthologyResponse.addErrorMessage("gene2", ValidationConstants.INVALID_MESSAGE + " (" + objectGeneIdentifier + ")"); } else { From 7a2fdf1fdfa3ef5909a1b4fb412533d77b0fa8ee Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 8 Dec 2023 11:37:17 +0000 Subject: [PATCH 007/159] CRUD integraion test updates --- .../AlleleGeneAssociationCrudController.java | 6 +- ...enomicEntityAssociationCrudController.java | 4 +- .../AlleleGeneAssociationCrudInterface.java | 2 +- ...GenomicEntityAssociationCrudInterface.java | 2 +- .../AlleleGeneAssociationService.java | 14 +++- ...structGenomicEntityAssociationService.java | 4 +- .../curation_api/base/BaseITCase.java | 60 +++++++------- .../AffectedGenomicModelITCase.java | 30 +++---- .../crud/controllers/AlleleITCase.java | 40 ++++----- .../controllers/DiseaseAnnotationITCase.java | 82 +++++++++---------- .../crud/controllers/GeneITCase.java | 36 ++++---- .../crud/controllers/VariantITCase.java | 40 ++++----- .../AlleleGeneAssociationITCase.java | 44 +++++----- ...nstructGenomicEntityAssociationITCase.java | 34 ++++---- 14 files changed, 202 insertions(+), 196 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/associations/alleleAssociations/AlleleGeneAssociationCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/associations/alleleAssociations/AlleleGeneAssociationCrudController.java index 740169b69..b9dd16464 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/associations/alleleAssociations/AlleleGeneAssociationCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/associations/alleleAssociations/AlleleGeneAssociationCrudController.java @@ -51,8 +51,8 @@ public APIResponse updateAlleleGeneAssociations(String dataProvider, return alleleGeneAssociationExecutor.runLoad(dataProvider, associations); } - public ObjectResponse getAssociation(String alleleCurie, String relationName, - String geneCurie) { - return alleleGeneAssociationService.getAssociation(alleleCurie, relationName, geneCurie); + public ObjectResponse getAssociation(Long alleleId, String relationName, + Long geneId) { + return alleleGeneAssociationService.getAssociation(alleleId, relationName, geneId); } } diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/associations/constructAssociations/ConstructGenomicEntityAssociationCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/associations/constructAssociations/ConstructGenomicEntityAssociationCrudController.java index aadf60042..87733278f 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/associations/constructAssociations/ConstructGenomicEntityAssociationCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/associations/constructAssociations/ConstructGenomicEntityAssociationCrudController.java @@ -52,7 +52,7 @@ public APIResponse updateConstructGenomicEntityAssociations(String dataProvider, } public ObjectResponse getAssociation(Long constructId, String relationName, - String genomicEntityCurie) { - return constructGenomicEntityAssociationService.getAssociation(constructId, relationName, genomicEntityCurie); + Long genomicEntityId) { + return constructGenomicEntityAssociationService.getAssociation(constructId, relationName, genomicEntityId); } } diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/associations/alleleAssociations/AlleleGeneAssociationCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/associations/alleleAssociations/AlleleGeneAssociationCrudInterface.java index a0f6d48a0..372834ebe 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/associations/alleleAssociations/AlleleGeneAssociationCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/associations/alleleAssociations/AlleleGeneAssociationCrudInterface.java @@ -35,7 +35,7 @@ public interface AlleleGeneAssociationCrudInterface extends BaseIdCrudInterface< @GET @Path("/findBy") @JsonView(View.FieldsAndLists.class) - public ObjectResponse getAssociation(@QueryParam("alleleCurie") String alleleCurie, @QueryParam("relationName") String relationName, @QueryParam("geneCurie") String geneCurie); + public ObjectResponse getAssociation(@QueryParam("alleleId") Long alleleId, @QueryParam("relationName") String relationName, @QueryParam("geneId") Long geneId); @POST @Path("/validate") diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/associations/constructAssociations/ConstructGenomicEntityAssociationCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/associations/constructAssociations/ConstructGenomicEntityAssociationCrudInterface.java index 51e633704..2688b1ed5 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/associations/constructAssociations/ConstructGenomicEntityAssociationCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/associations/constructAssociations/ConstructGenomicEntityAssociationCrudInterface.java @@ -35,7 +35,7 @@ public interface ConstructGenomicEntityAssociationCrudInterface extends BaseIdCr @GET @Path("/findBy") @JsonView(View.FieldsAndLists.class) - public ObjectResponse getAssociation(@QueryParam("constructId") Long constructId, @QueryParam("relationName") String relationName, @QueryParam("genomicEntityCurie") String geneCurie); + public ObjectResponse getAssociation(@QueryParam("constructId") Long constructId, @QueryParam("relationName") String relationName, @QueryParam("genomicEntityId") Long genomicEntityId); @POST @Path("/validate") diff --git a/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java b/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java index 6a94dc6ca..b71fa256f 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java @@ -23,6 +23,8 @@ import org.alliancegenome.curation_api.model.ingest.dto.associations.alleleAssociations.AlleleGeneAssociationDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.AlleleService; +import org.alliancegenome.curation_api.services.GeneService; import org.alliancegenome.curation_api.services.PersonService; import org.alliancegenome.curation_api.services.base.BaseAssociationDTOCrudService; import org.alliancegenome.curation_api.services.validation.associations.alleleAssociations.AlleleGeneAssociationValidator; @@ -47,10 +49,14 @@ public class AlleleGeneAssociationService extends BaseAssociationDTOCrudService< @Inject AlleleDAO alleleDAO; @Inject + AlleleService alleleService; + @Inject NoteDAO noteDAO; @Inject GeneDAO geneDAO; @Inject + GeneService geneService; + @Inject PersonService personService; @Inject PersonDAO personDAO; @@ -135,13 +141,13 @@ public AlleleGeneAssociation deprecateOrDeleteAssociation(Long id, Boolean throw return null; } - public ObjectResponse getAssociation(String alleleCurie, String relationName, String geneCurie) { + public ObjectResponse getAssociation(Long alleleId, String relationName, Long geneId) { AlleleGeneAssociation association = null; - + Map params = new HashMap<>(); - params.put("subject.curie", alleleCurie); + params.put("subject.id", alleleId); params.put("relation.name", relationName); - params.put("object.curie", geneCurie); + params.put("object.id", geneId); SearchResponse resp = alleleGeneAssociationDAO.findByParams(params); if (resp != null && resp.getSingleResult() != null) diff --git a/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java b/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java index 92ae81d85..517ccbb41 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java @@ -126,13 +126,13 @@ public ConstructGenomicEntityAssociation deprecateOrDeleteAssociation(Long id, B return null; } - public ObjectResponse getAssociation(Long constructId, String relationName, String genomicEntityCurie) { + public ObjectResponse getAssociation(Long constructId, String relationName, Long genomicEntityId) { ConstructGenomicEntityAssociation association = null; Map params = new HashMap<>(); params.put("subject.id", constructId); params.put("relation.name", relationName); - params.put("object.curie", genomicEntityCurie); + params.put("object.id", genomicEntityId); SearchResponse resp = constructGenomicEntityAssociationDAO.findByParams(params); if (resp != null && resp.getSingleResult() != null) diff --git a/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java b/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java index 7fd3b1b54..d27b9b5ef 100644 --- a/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java @@ -121,12 +121,12 @@ public void checkSuccessfulBulkLoad(String endpoint, String filePath) throws Exc body("history.completedRecords", is(1)); } - public AffectedGenomicModel createAffectedGenomicModel(String curie, String taxonCurie, String subtypeName, String name, Boolean obsolete) { + public AffectedGenomicModel createAffectedGenomicModel(String modEntityId, String taxonCurie, String subtypeName, String name, Boolean obsolete) { Vocabulary subtypeVocabulary = getVocabulary(VocabularyConstants.AGM_SUBTYPE_VOCABULARY); VocabularyTerm subtype = getVocabularyTerm(subtypeVocabulary, subtypeName); AffectedGenomicModel model = new AffectedGenomicModel(); - model.setCurie(curie); + model.setModEntityId(modEntityId); model.setTaxon(getNCBITaxonTerm(taxonCurie)); model.setSubtype(subtype); model.setName(name); @@ -142,17 +142,17 @@ public AffectedGenomicModel createAffectedGenomicModel(String curie, String taxo return model; } - public Allele createAllele(String curie, String taxonCurie, Boolean obsolete, VocabularyTerm symbolNameTerm) { + public Allele createAllele(String modEntityId, String taxonCurie, Boolean obsolete, VocabularyTerm symbolNameTerm) { Allele allele = new Allele(); - allele.setCurie(curie); + allele.setModEntityId(modEntityId); allele.setTaxon(getNCBITaxonTerm(taxonCurie)); allele.setObsolete(obsolete); allele.setInternal(false); AlleleSymbolSlotAnnotation symbol = new AlleleSymbolSlotAnnotation(); symbol.setNameType(symbolNameTerm); - symbol.setDisplayText(curie); - symbol.setFormatText(curie); + symbol.setDisplayText(modEntityId); + symbol.setFormatText(modEntityId); allele.setAlleleSymbol(symbol); @@ -166,9 +166,9 @@ public Allele createAllele(String curie, String taxonCurie, Boolean obsolete, Vo return allele; } - public BiologicalEntity createBiologicalEntity(String curie, String taxonCurie) { + public BiologicalEntity createBiologicalEntity(String modEntityId, String taxonCurie) { BiologicalEntity bioEntity = new BiologicalEntity(); - bioEntity.setCurie(curie); + bioEntity.setModEntityId(modEntityId); bioEntity.setTaxon(getNCBITaxonTerm(taxonCurie)); RestAssured.given(). @@ -315,16 +315,16 @@ public ExperimentalCondition createExperimentalCondition(String uniqueId, String return response.getEntity(); } - public Gene createGene(String curie, String taxonCurie, Boolean obsolete, VocabularyTerm symbolNameTerm) { + public Gene createGene(String modEntityId, String taxonCurie, Boolean obsolete, VocabularyTerm symbolNameTerm) { Gene gene = new Gene(); - gene.setCurie(curie); + gene.setModEntityId(modEntityId); gene.setTaxon(getNCBITaxonTerm(taxonCurie)); gene.setObsolete(obsolete); GeneSymbolSlotAnnotation symbol = new GeneSymbolSlotAnnotation(); symbol.setNameType(symbolNameTerm); - symbol.setDisplayText(curie); - symbol.setFormatText(curie); + symbol.setDisplayText(modEntityId); + symbol.setFormatText(modEntityId); gene.setGeneSymbol(symbol); @@ -604,10 +604,10 @@ public ZFATerm createZfaTerm(String curie, Boolean obsolete) { return zfaTerm; } - public AffectedGenomicModel getAffectedGenomicModel(String curie) { + public AffectedGenomicModel getAffectedGenomicModel(String identifier) { ObjectResponse res = RestAssured.given(). when(). - get("/api/agm/" + curie). + get("/api/agm/" + identifier). then(). statusCode(200). extract().body().as(getObjectResponseTypeRefAffectedGenomicModel()); @@ -626,10 +626,10 @@ public AGMDiseaseAnnotation getAgmDiseaseAnnotation(String uniqueId) { return res.getEntity(); } - public Allele getAllele(String curie) { + public Allele getAllele(String identifier) { ObjectResponse res = RestAssured.given(). when(). - get("/api/allele/" + curie). + get("/api/allele/" + identifier). then(). statusCode(200). extract().body().as(getObjectResponseTypeRefAllele()); @@ -648,10 +648,10 @@ public AlleleDiseaseAnnotation getAlleleDiseaseAnnotation(String uniqueId) { return res.getEntity(); } - public AlleleGeneAssociation getAlleleGeneAssociation(String alleleCurie, String relationName, String geneCurie) { + public AlleleGeneAssociation getAlleleGeneAssociation(Long alleleId, String relationName, Long geneId) { ObjectResponse res = RestAssured.given(). when(). - get("/api/allelegeneassociation/findBy" + "?alleleCurie=" + alleleCurie + "&relationName=" + relationName + "&geneCurie=" + geneCurie). + get("/api/allelegeneassociation/findBy" + "?alleleId=" + alleleId + "&relationName=" + relationName + "&geneId=" + geneId). then(). statusCode(200). extract().body().as(getObjectResponseTypeRefAlleleGeneAssociation()); @@ -682,10 +682,10 @@ public Construct getConstruct(String identifier) { return res.getEntity(); } - public ConstructGenomicEntityAssociation getConstructGenomicEntityAssociation(Long constructId, String relationName, String genomicEntityCurie) { + public ConstructGenomicEntityAssociation getConstructGenomicEntityAssociation(Long constructId, String relationName, Long genomicEntityId) { ObjectResponse res = RestAssured.given(). when(). - get("/api/constructgenomicentityassociation/findBy" + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityCurie=" + genomicEntityCurie). + get("/api/constructgenomicentityassociation/findBy" + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityId=" + genomicEntityId). then(). statusCode(200). extract().body().as(getObjectResponseTypeRefConstructGenomicEntityAssociation()); @@ -704,10 +704,10 @@ public ExperimentalCondition getExperimentalCondition(String conditionSummary) { return res.getEntity(); } - public Gene getGene(String curie) { + public Gene getGene(String identifier) { ObjectResponse res = RestAssured.given(). when(). - get("/api/gene/" + curie). + get("/api/gene/" + identifier). then(). statusCode(200). extract().body().as(getObjectResponseTypeRefGene()); @@ -999,12 +999,12 @@ public ZECOTerm getZecoTerm(String curie) { return response.getEntity(); } - public void loadAffectedGenomicModel(String curie, String name, String taxonCurie, String subtypeName, DataProvider dataProvider) throws Exception { + public void loadAffectedGenomicModel(String modEntityId, String name, String taxonCurie, String subtypeName, DataProvider dataProvider) throws Exception { Vocabulary subtypeVocabulary = getVocabulary(VocabularyConstants.AGM_SUBTYPE_VOCABULARY); VocabularyTerm subtype = getVocabularyTerm(subtypeVocabulary, subtypeName); AffectedGenomicModel agm = new AffectedGenomicModel(); - agm.setCurie(curie); + agm.setModEntityId(modEntityId); agm.setTaxon(getNCBITaxonTerm(taxonCurie)); agm.setName(name); agm.setSubtype(subtype); @@ -1018,9 +1018,9 @@ public void loadAffectedGenomicModel(String curie, String name, String taxonCuri statusCode(200); } - public void loadAllele(String curie, String symbol, String taxonCurie, VocabularyTerm symbolNameTerm, DataProvider dataProvider) throws Exception { + public void loadAllele(String identifier, String symbol, String taxonCurie, VocabularyTerm symbolNameTerm, DataProvider dataProvider) throws Exception { Allele allele = new Allele(); - allele.setCurie(curie); + allele.setModEntityId(identifier); allele.setTaxon(getNCBITaxonTerm(taxonCurie)); allele.setInternal(false); allele.setDataProvider(dataProvider); @@ -1105,16 +1105,16 @@ public void loadExperimentalConditionTerm(String curie, String name) throws Exce statusCode(200); } - public void loadGene(String curie, String taxonCurie, VocabularyTerm symbolNameTerm, DataProvider dataProvider) { + public void loadGene(String modEntityId, String taxonCurie, VocabularyTerm symbolNameTerm, DataProvider dataProvider) { Gene gene = new Gene(); - gene.setCurie(curie); + gene.setModEntityId(modEntityId); gene.setTaxon(getNCBITaxonTerm(taxonCurie)); gene.setDataProvider(dataProvider); GeneSymbolSlotAnnotation symbol = new GeneSymbolSlotAnnotation(); symbol.setNameType(symbolNameTerm); - symbol.setDisplayText(curie); - symbol.setFormatText(curie); + symbol.setDisplayText(modEntityId); + symbol.setFormatText(modEntityId); gene.setGeneSymbol(symbol); diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AffectedGenomicModelITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AffectedGenomicModelITCase.java index 0760d6b2e..5724f2637 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AffectedGenomicModelITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AffectedGenomicModelITCase.java @@ -75,7 +75,7 @@ public void createValidAGM() { loadRequiredEntities(); AffectedGenomicModel agm = new AffectedGenomicModel(); - agm.setCurie(AGM); + agm.setModEntityId(AGM); agm.setTaxon(taxon); agm.setName("Test AGM"); agm.setDateCreated(datetime); @@ -95,7 +95,7 @@ public void createValidAGM() { get("/api/agm/" + AGM). then(). statusCode(200). - body("entity.curie", is(AGM)). + body("entity.modEntityId", is(AGM)). body("entity.name", is("Test AGM")). body("entity.subtype.name", is(subtype.getName())). body("entity.taxon.curie", is(taxon.getCurie())). @@ -133,7 +133,7 @@ public void editAGM() { get("/api/agm/" + AGM). then(). statusCode(200). - body("entity.curie", is(AGM)). + body("entity.modEntityId", is(AGM)). body("entity.name", is("AGM edited")). body("entity.subtype.name", is(subtype2.getName())). body("entity.taxon.curie", is(taxon2.getCurie())). @@ -158,16 +158,16 @@ public void createAGMWithMissingRequiredFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.modInternalID", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")). body("errorMessages.taxon", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.subtype", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @Order(4) - public void editAGMWithMissingCurie() { + public void editAGMWithMissingModEntityId() { AffectedGenomicModel agm = getAffectedGenomicModel(AGM); - agm.setCurie(null); + agm.setModEntityId(null); RestAssured.given(). contentType("application/json"). @@ -177,7 +177,7 @@ public void editAGMWithMissingCurie() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.modInternalID", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); } @Test @@ -205,7 +205,7 @@ public void editAGMWithMissingRequiredFields() { @Order(6) public void createAGMWithEmptyRequiredFields() { AffectedGenomicModel agm = new AffectedGenomicModel(); - agm.setCurie(""); + agm.setModEntityId(""); agm.setTaxon(taxon); agm.setSubtype(subtype); @@ -217,14 +217,14 @@ public void createAGMWithEmptyRequiredFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); } @Test @Order(7) - public void editAGMWithEmptyCurie() { + public void editAGMWithEmptyModEntityId() { AffectedGenomicModel agm = getAffectedGenomicModel(AGM); - agm.setCurie(""); + agm.setModEntityId(""); RestAssured.given(). contentType("application/json"). @@ -234,7 +234,7 @@ public void editAGMWithEmptyCurie() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.modInternalID", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); } @Test @@ -248,7 +248,7 @@ public void createAGMWithInvalidFields() { invalidDataProvider.setSourceOrganization(nonPersistedOrganization); AffectedGenomicModel agm = new AffectedGenomicModel(); - agm.setCurie("AGM:0008"); + agm.setModEntityId("AGM:0008"); agm.setTaxon(nonPersistedTaxon); agm.setSubtype(nonPersistedTerm); agm.setDataProvider(invalidDataProvider); @@ -298,7 +298,7 @@ public void editAGMWithInvalidFields() { @Order(10) public void createAGMWithObsoleteFields() { AffectedGenomicModel agm = new AffectedGenomicModel(); - agm.setCurie("AGM:0010"); + agm.setModEntityId("AGM:0010"); agm.setTaxon(obsoleteTaxon); agm.setSubtype(obsoleteSubtype); agm.setDataProvider(obsoleteDataProvider); @@ -364,7 +364,7 @@ public void editAGMWithNullNonRequiredFields() { @Order(13) public void createAGMWithOnlyRequiredFields() { AffectedGenomicModel agm = new AffectedGenomicModel(); - agm.setCurie("AGM:0015"); + agm.setModEntityId("AGM:0015"); agm.setTaxon(taxon); agm.setSubtype(subtype); diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java index b8e9a109e..e86ed9b0a 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java @@ -205,7 +205,7 @@ public void createValidAllele() { loadRequiredEntities(); Allele allele = new Allele(); - allele.setCurie(ALLELE); + allele.setModEntityId(ALLELE); allele.setTaxon(taxon); allele.setInCollection(mmpInCollection); allele.setReferences(List.of(reference)); @@ -237,7 +237,7 @@ public void createValidAllele() { get("/api/allele/" + ALLELE). then(). statusCode(200). - body("entity.curie", is(ALLELE)). + body("entity.modEntityId", is(ALLELE)). body("entity.taxon.curie", is(taxon.getCurie())). body("entity.internal", is(false)). body("entity.obsolete", is(false)). @@ -296,7 +296,7 @@ public void createValidAllele() { public void editAllele() { Allele allele = getAllele(ALLELE); allele.setCreatedBy(person); - allele.setCurie(ALLELE); + allele.setModEntityId(ALLELE); allele.setTaxon(taxon2); allele.setInCollection(wgsInCollection); allele.setReferences(List.of(reference2)); @@ -391,7 +391,7 @@ public void editAllele() { get("/api/allele/" + ALLELE). then(). statusCode(200). - body("entity.curie", is(ALLELE)). + body("entity.modEntityId", is(ALLELE)). body("entity.inCollection.name", is(wgsInCollection.getName())). body("entity.references[0].curie", is(reference2.getCurie())). body("entity.dateCreated", is(datetime2.toString())). @@ -459,16 +459,16 @@ public void createAlleleWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")). body("errorMessages.taxon", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.alleleSymbol", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @Order(4) - public void editAlleleWithMissingCurie() { + public void editAlleleWithMissingModEntityId() { Allele allele = getAllele(ALLELE); - allele.setCurie(null); + allele.setModEntityId(null); RestAssured.given(). contentType("application/json"). @@ -478,7 +478,7 @@ public void editAlleleWithMissingCurie() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")); } @Test @@ -506,7 +506,7 @@ public void editAlleleWithMissingRequiredFieldsLevel1() { @Order(6) public void createAlleleWithEmptyRequiredFields() { Allele allele = new Allele(); - allele.setCurie(""); + allele.setModEntityId(""); allele.setTaxon(taxon); allele.setInCollection(mmpInCollection); allele.setReferences(List.of(reference)); @@ -531,14 +531,14 @@ public void createAlleleWithEmptyRequiredFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")); } @Test @Order(7) - public void editAlleleWithEmptyCurie() { + public void editAlleleWithEmptyModEntityId() { Allele allele = getAllele(ALLELE); - allele.setCurie(""); + allele.setModEntityId(""); RestAssured.given(). contentType("application/json"). @@ -548,14 +548,14 @@ public void editAlleleWithEmptyCurie() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")); } @Test @Order(8) public void createAlleleWithMissingRequiredFieldsLevel2() { Allele allele = new Allele(); - allele.setCurie("Allele:0008"); + allele.setModEntityId("Allele:0008"); allele.setTaxon(taxon); AlleleMutationTypeSlotAnnotation invalidMutationType = new AlleleMutationTypeSlotAnnotation(); @@ -697,7 +697,7 @@ public void editAlleleWithMissingRequiredFieldsLevel2() { @Order(10) public void createAlleleWithEmptyRequiredFieldsLevel2() { Allele allele = new Allele(); - allele.setCurie("Allele:0010"); + allele.setModEntityId("Allele:0010"); allele.setTaxon(taxon); AlleleSymbolSlotAnnotation invalidSymbol = createAlleleSymbolSlotAnnotation(null, "", symbolNameType, null, null); @@ -802,7 +802,7 @@ public void createAlleleWithInvalidFields() { invalidNote.setFreeText("Invalid"); Allele allele = new Allele(); - allele.setCurie("Allele:0012"); + allele.setModEntityId("Allele:0012"); allele.setTaxon(nonPersistedTaxon); allele.setInCollection(dominantInheritanceMode); allele.setReferences(List.of(nonPersistedReference)); @@ -1010,7 +1010,7 @@ public void editAlleleWithInvalidFields() { @Order(14) public void createAlleleWithObsoleteFields() { Allele allele = new Allele(); - allele.setCurie("Allele:0012"); + allele.setModEntityId("Allele:0012"); allele.setTaxon(obsoleteTaxon); allele.setInCollection(obsoleteCollection); allele.setReferences(List.of(obsoleteReference)); @@ -1359,7 +1359,7 @@ public void editAlleleWithNullNonRequiredFieldsLevel1() { @Order(19) public void createAlleleWithOnlyRequiredFieldsLevel1() { Allele allele = new Allele(); - allele.setCurie("ALLELE:0019"); + allele.setModEntityId("ALLELE:0019"); allele.setTaxon(taxon); allele.setAlleleSymbol(alleleSymbol); @@ -1376,7 +1376,7 @@ public void createAlleleWithOnlyRequiredFieldsLevel1() { @Order(20) public void createAlleleWithOnlyRequiredFieldsLevel2() { Allele allele = new Allele(); - allele.setCurie("ALLELE:0020"); + allele.setModEntityId("ALLELE:0020"); allele.setTaxon(taxon); AlleleMutationTypeSlotAnnotation minimalAlleleMutationType = createAlleleMutationTypeSlotAnnotation(null, List.of(soTerm)); @@ -1417,7 +1417,7 @@ public void createAlleleWithOnlyRequiredFieldsLevel2() { @Order(21) public void createAlleleWithDuplicateNote() { Allele allele = new Allele(); - allele.setCurie("ALLELE:0021"); + allele.setModEntityId("ALLELE:0021"); allele.setTaxon(taxon); AlleleSymbolSlotAnnotation alleleSymbol = createAlleleSymbolSlotAnnotation(null, "Test symbol", symbolNameType, null, null); diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java index 271a40dce..685182c64 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java @@ -202,11 +202,11 @@ private void loadRequiredEntities() { nonPersistedOrganization = new Organization(); nonPersistedOrganization.setAbbreviation("INV"); nonPersistedAllele = new Allele(); - nonPersistedAllele.setCurie("ALLELE:Invalid"); + nonPersistedAllele.setModEntityId("ALLELE:Invalid"); nonPersistedGene = new Gene(); - nonPersistedGene.setCurie("GENE:Invalid"); + nonPersistedGene.setModEntityId("GENE:Invalid"); nonPersistedAgm = new AffectedGenomicModel(); - nonPersistedAgm.setCurie("AGM:Invalid"); + nonPersistedAgm.setModEntityId("AGM:Invalid"); nonPersistedReference = new Reference(); nonPersistedReference.setCurie("AGRKB:Invalid"); nonPersistedCondition = new ExperimentalCondition(); @@ -253,8 +253,8 @@ public void createGeneDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("GENE:da0001|is_implicated_in|false|DOID:da0001|AGRKB:100000005|ECO:da00001|HGNC:1|has_condition|ZECO:da001|severity|ameliorated_by|SGD:da0002")). body("entity.modEntityId", is(GENE_DISEASE_ANNOTATION)). - body("entity.subject.curie", is(gene.getCurie())). - body("entity.object.curie", is(doTerm.getCurie())). + body("entity.subject.modEntityId", is(gene.getModEntityId())). + body("entity.object.modEntityId", is(doTerm.getCurie())). body("entity.relation.name", is(alleleAndGeneRelation.getName())). body("entity.negated", is(false)). body("entity.internal", is(false)). @@ -266,11 +266,11 @@ public void createGeneDiseaseAnnotation() { body("entity.dateCreated", is(datetime.toString())). body("entity.geneticSex.name", is(geneticSex.getName())). body("entity.diseaseGeneticModifierRelation.name", is(diseaseGeneticModifierRelation.getName())). - body("entity.diseaseGeneticModifiers[0].curie", is(agm2.getCurie())). + body("entity.diseaseGeneticModifiers[0].modEntityId", is(agm2.getModEntityId())). body("entity.annotationType.name", is(annotationType.getName())). body("entity.diseaseQualifiers[0].name", is(diseaseQualifier.getName())). - body("entity.with[0].curie", is(withGene.getCurie())). - body("entity.sgdStrainBackground.curie", is(agm.getCurie())). + body("entity.with[0].modEntityId", is(withGene.getModEntityId())). + body("entity.sgdStrainBackground.modEntityId", is(agm.getModEntityId())). body("entity.relatedNotes", hasSize(1)). body("entity.relatedNotes[0].noteType.name", is(relatedNote.getNoteType().getName())). body("entity.relatedNotes[0].freeText", is(relatedNote.getFreeText())). @@ -324,8 +324,8 @@ public void createAlleleDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("ALLELE:da0001|is_implicated_in|false|DOID:da0001|AGRKB:100000005|ECO:da00001|HGNC:1|has_condition|ZECO:da001|severity|ameliorated_by|SGD:da0002")). body("entity.modEntityId", is(ALLELE_DISEASE_ANNOTATION)). - body("entity.subject.curie", is(allele.getCurie())). - body("entity.object.curie", is(doTerm.getCurie())). + body("entity.subject.modEntityId", is(allele.getModEntityId())). + body("entity.object.modEntityId", is(doTerm.getCurie())). body("entity.relation.name", is(alleleAndGeneRelation.getName())). body("entity.negated", is(false)). body("entity.internal", is(false)). @@ -337,10 +337,10 @@ public void createAlleleDiseaseAnnotation() { body("entity.dateCreated", is(datetime.toString())). body("entity.geneticSex.name", is(geneticSex.getName())). body("entity.diseaseGeneticModifierRelation.name", is(diseaseGeneticModifierRelation.getName())). - body("entity.diseaseGeneticModifiers[0].curie", is(agm2.getCurie())). + body("entity.diseaseGeneticModifiers[0].modEntityId", is(agm2.getModEntityId())). body("entity.annotationType.name", is(annotationType.getName())). body("entity.diseaseQualifiers[0].name", is(diseaseQualifier.getName())). - body("entity.with[0].curie", is(withGene.getCurie())). + body("entity.with[0].modEntityId", is(withGene.getModEntityId())). body("entity.relatedNotes", hasSize(1)). body("entity.relatedNotes[0].noteType.name", is(relatedNote.getNoteType().getName())). body("entity.relatedNotes[0].freeText", is(relatedNote.getFreeText())). @@ -353,9 +353,9 @@ public void createAlleleDiseaseAnnotation() { body("entity.conditionRelations[0].internal", is(false)). body("entity.dataProvider.sourceOrganization.abbreviation", is(dataProvider.getSourceOrganization().getAbbreviation())). body("entity.secondaryDataProvider.sourceOrganization.abbreviation", is(dataProvider2.getSourceOrganization().getAbbreviation())). - body("entity.inferredGene.curie", is(gene.getCurie())). + body("entity.inferredGene.modEntityId", is(gene.getModEntityId())). body("entity.assertedGenes", hasSize(1)). - body("entity.assertedGenes[0].curie", is(gene2.getCurie())); + body("entity.assertedGenes[0].modEntityId", is(gene2.getModEntityId())); } @Test @@ -399,8 +399,8 @@ public void createAgmDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("SGD:da0001|is_model_of|false|DOID:da0001|AGRKB:100000005|ECO:da00001|HGNC:1|has_condition|ZECO:da001|severity|ameliorated_by|SGD:da0002")). body("entity.modEntityId", is(AGM_DISEASE_ANNOTATION)). - body("entity.subject.curie", is(agm.getCurie())). - body("entity.object.curie", is(doTerm.getCurie())). + body("entity.subject.modEntityId", is(agm.getModEntityId())). + body("entity.object.modEntityId", is(doTerm.getCurie())). body("entity.relation.name", is(agmRelation.getName())). body("entity.negated", is(false)). body("entity.internal", is(false)). @@ -412,10 +412,10 @@ public void createAgmDiseaseAnnotation() { body("entity.dateCreated", is(datetime.toString())). body("entity.geneticSex.name", is(geneticSex.getName())). body("entity.diseaseGeneticModifierRelation.name", is(diseaseGeneticModifierRelation.getName())). - body("entity.diseaseGeneticModifiers[0].curie", is(agm2.getCurie())). + body("entity.diseaseGeneticModifiers[0].modEntityId", is(agm2.getModEntityId())). body("entity.annotationType.name", is(annotationType.getName())). body("entity.diseaseQualifiers[0].name", is(diseaseQualifier.getName())). - body("entity.with[0].curie", is(withGene.getCurie())). + body("entity.with[0].modEntityId", is(withGene.getModEntityId())). body("entity.relatedNotes", hasSize(1)). body("entity.relatedNotes[0].noteType.name", is(relatedNote.getNoteType().getName())). body("entity.relatedNotes[0].freeText", is(relatedNote.getFreeText())). @@ -428,11 +428,11 @@ public void createAgmDiseaseAnnotation() { body("entity.conditionRelations[0].internal", is(false)). body("entity.dataProvider.sourceOrganization.abbreviation", is(dataProvider.getSourceOrganization().getAbbreviation())). body("entity.secondaryDataProvider.sourceOrganization.abbreviation", is(dataProvider2.getSourceOrganization().getAbbreviation())). - body("entity.inferredGene.curie", is(gene.getCurie())). + body("entity.inferredGene.modEntityId", is(gene.getModEntityId())). body("entity.assertedGenes", hasSize(1)). - body("entity.assertedGenes[0].curie", is(gene2.getCurie())). - body("entity.inferredAllele.curie", is(allele.getCurie())). - body("entity.assertedAllele.curie", is(allele2.getCurie())); + body("entity.assertedGenes[0].modEntityId", is(gene2.getModEntityId())). + body("entity.inferredAllele.modEntityId", is(allele.getModEntityId())). + body("entity.assertedAllele.modEntityId", is(allele2.getModEntityId())); } @Test @@ -487,8 +487,8 @@ public void editGeneDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("GENE:da0002|is_marker_for|true|DOID:da0002|AGRKB:100000006|ECO:da00002|HGNC:2|induced_by|ZECO:da002|onset|exacerbated_by|SGD:da0001")). body("entity.modEntityId", is(GENE_DISEASE_ANNOTATION)). - body("entity.subject.curie", is(gene2.getCurie())). - body("entity.object.curie", is(doTerm2.getCurie())). + body("entity.subject.modEntityId", is(gene2.getModEntityId())). + body("entity.object.modEntityId", is(doTerm2.getCurie())). body("entity.relation.name", is(geneRelation.getName())). body("entity.negated", is(true)). body("entity.internal", is(true)). @@ -500,11 +500,11 @@ public void editGeneDiseaseAnnotation() { body("entity.dateCreated", is(datetime2.toString())). body("entity.geneticSex.name", is(geneticSex2.getName())). body("entity.diseaseGeneticModifierRelation.name", is(diseaseGeneticModifierRelation2.getName())). - body("entity.diseaseGeneticModifiers[0].curie", is(agm.getCurie())). + body("entity.diseaseGeneticModifiers[0].modEntityId", is(agm.getModEntityId())). body("entity.annotationType.name", is(annotationType2.getName())). body("entity.diseaseQualifiers[0].name", is(diseaseQualifier2.getName())). - body("entity.with[0].curie", is(withGene2.getCurie())). - body("entity.sgdStrainBackground.curie", is(agm2.getCurie())). + body("entity.with[0].modEntityId", is(withGene2.getModEntityId())). + body("entity.sgdStrainBackground.modEntityId", is(agm2.getModEntityId())). body("entity.relatedNotes", hasSize(1)). body("entity.relatedNotes[0].noteType.name", is(editedNote.getNoteType().getName())). body("entity.relatedNotes[0].freeText", is(editedNote.getFreeText())). @@ -571,8 +571,8 @@ public void editAlleleDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("ALLELE:da0002|is_implicated_in|true|DOID:da0002|AGRKB:100000006|ECO:da00002|HGNC:2|induced_by|ZECO:da002|onset|exacerbated_by|SGD:da0001")). body("entity.modEntityId", is(ALLELE_DISEASE_ANNOTATION)). - body("entity.subject.curie", is(allele2.getCurie())). - body("entity.object.curie", is(doTerm2.getCurie())). + body("entity.subject.modEntityId", is(allele2.getModEntityId())). + body("entity.object.modEntityId", is(doTerm2.getCurie())). body("entity.relation.name", is(alleleAndGeneRelation.getName())). body("entity.negated", is(true)). body("entity.internal", is(true)). @@ -584,10 +584,10 @@ public void editAlleleDiseaseAnnotation() { body("entity.dateCreated", is(datetime2.toString())). body("entity.geneticSex.name", is(geneticSex2.getName())). body("entity.diseaseGeneticModifierRelation.name", is(diseaseGeneticModifierRelation2.getName())). - body("entity.diseaseGeneticModifiers[0].curie", is(agm.getCurie())). + body("entity.diseaseGeneticModifiers[0].modEntityId", is(agm.getModEntityId())). body("entity.annotationType.name", is(annotationType2.getName())). body("entity.diseaseQualifiers[0].name", is(diseaseQualifier2.getName())). - body("entity.with[0].curie", is(withGene2.getCurie())). + body("entity.with[0].modEntityId", is(withGene2.getModEntityId())). body("entity.relatedNotes", hasSize(1)). body("entity.relatedNotes[0].noteType.name", is(editedNote.getNoteType().getName())). body("entity.relatedNotes[0].freeText", is(editedNote.getFreeText())). @@ -600,9 +600,9 @@ public void editAlleleDiseaseAnnotation() { body("entity.conditionRelations[0].internal", is(true)). body("entity.dataProvider.sourceOrganization.abbreviation", is(dataProvider2.getSourceOrganization().getAbbreviation())). body("entity.secondaryDataProvider.sourceOrganization.abbreviation", is(dataProvider.getSourceOrganization().getAbbreviation())). - body("entity.inferredGene.curie", is(gene2.getCurie())). + body("entity.inferredGene.modEntityId", is(gene2.getModEntityId())). body("entity.assertedGenes", hasSize(1)). - body("entity.assertedGenes[0].curie", is(gene.getCurie())); + body("entity.assertedGenes[0].modEntityId", is(gene.getModEntityId())); } @Test @@ -660,8 +660,8 @@ public void editAgmDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("SGD:da0002|is_exacerbated_model_of|true|DOID:da0002|AGRKB:100000006|ECO:da00002|HGNC:2|induced_by|ZECO:da002|onset|exacerbated_by|SGD:da0001")). body("entity.modEntityId", is(AGM_DISEASE_ANNOTATION)). - body("entity.subject.curie", is(agm2.getCurie())). - body("entity.object.curie", is(doTerm2.getCurie())). + body("entity.subject.modEntityId", is(agm2.getModEntityId())). + body("entity.object.modEntityId", is(doTerm2.getCurie())). body("entity.relation.name", is(agmRelation2.getName())). body("entity.negated", is(true)). body("entity.internal", is(true)). @@ -673,10 +673,10 @@ public void editAgmDiseaseAnnotation() { body("entity.dateCreated", is(datetime2.toString())). body("entity.geneticSex.name", is(geneticSex2.getName())). body("entity.diseaseGeneticModifierRelation.name", is(diseaseGeneticModifierRelation2.getName())). - body("entity.diseaseGeneticModifiers[0].curie", is(agm.getCurie())). + body("entity.diseaseGeneticModifiers[0].modEntityId", is(agm.getModEntityId())). body("entity.annotationType.name", is(annotationType2.getName())). body("entity.diseaseQualifiers[0].name", is(diseaseQualifier2.getName())). - body("entity.with[0].curie", is(withGene2.getCurie())). + body("entity.with[0].modEntityId", is(withGene2.getModEntityId())). body("entity.relatedNotes", hasSize(1)). body("entity.relatedNotes[0].noteType.name", is(editedNote.getNoteType().getName())). body("entity.relatedNotes[0].freeText", is(editedNote.getFreeText())). @@ -689,11 +689,11 @@ public void editAgmDiseaseAnnotation() { body("entity.conditionRelations[0].internal", is(true)). body("entity.dataProvider.sourceOrganization.abbreviation", is(dataProvider2.getSourceOrganization().getAbbreviation())). body("entity.secondaryDataProvider.sourceOrganization.abbreviation", is(dataProvider.getSourceOrganization().getAbbreviation())). - body("entity.inferredGene.curie", is(gene2.getCurie())). + body("entity.inferredGene.modEntityId", is(gene2.getModEntityId())). body("entity.assertedGenes", hasSize(1)). - body("entity.assertedGenes[0].curie", is(gene.getCurie())). - body("entity.inferredAllele.curie", is(allele2.getCurie())). - body("entity.assertedAllele.curie", is(allele.getCurie())); + body("entity.assertedGenes[0].modEntityId", is(gene.getModEntityId())). + body("entity.inferredAllele.modEntityId", is(allele2.getModEntityId())). + body("entity.assertedAllele.modEntityId", is(allele.getModEntityId())); } @Test diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/GeneITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/GeneITCase.java index 952f9a65c..e57e3e23a 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/GeneITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/GeneITCase.java @@ -125,7 +125,7 @@ public void createValidGene() { loadRequiredEntities(); Gene gene = new Gene(); - gene.setCurie(GENE); + gene.setModEntityId(GENE); gene.setDateCreated(datetime); gene.setTaxon(taxon); gene.setGeneType(soTerm); @@ -149,7 +149,7 @@ public void createValidGene() { get("/api/gene/" + GENE). then(). statusCode(200). - body("entity.curie", is(GENE)). + body("entity.modEntityId", is(GENE)). body("entity.taxon.curie", is(taxon.getCurie())). body("entity.geneType.curie", is(soTerm.getCurie())). body("entity.internal", is(false)). @@ -249,7 +249,7 @@ public void editGene() { get("/api/gene/" + GENE). then(). statusCode(200). - body("entity.curie", is(GENE)). + body("entity.modEntityId", is(GENE)). body("entity.taxon.curie", is(taxon2.getCurie())). body("entity.geneType.curie", is(soTerm2.getCurie())). body("entity.internal", is(true)). @@ -300,16 +300,16 @@ public void createGeneWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")). body("errorMessages.taxon", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.geneSymbol", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @Order(4) - public void editGeneWithMissingCurie() { + public void editGeneWithMissingModEntityId() { Gene gene = getGene(GENE); - gene.setCurie(null); + gene.setModEntityId(null); RestAssured.given(). contentType("application/json"). @@ -319,7 +319,7 @@ public void editGeneWithMissingCurie() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); } @Test @@ -348,7 +348,7 @@ public void editGeneWithMissingRequiredFieldsLevel1() { public void createGeneWithEmptyRequiredFieldsLevel1() { Gene gene = new Gene(); - gene.setCurie(""); + gene.setModEntityId(""); gene.setTaxon(taxon); gene.setGeneSymbol(geneSymbol); @@ -360,14 +360,14 @@ public void createGeneWithEmptyRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); } @Test @Order(7) - public void editGeneWithEmptyCurie() { + public void editGeneWithEmptyModEntityId() { Gene gene = getGene(GENE); - gene.setCurie(""); + gene.setModEntityId(""); RestAssured.given(). contentType("application/json"). @@ -377,7 +377,7 @@ public void editGeneWithEmptyCurie() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); } @Test @@ -385,7 +385,7 @@ public void editGeneWithEmptyCurie() { public void createGeneWithMissingRequiredFieldsLevel2() { Gene gene = new Gene(); - gene.setCurie("GENE:0008"); + gene.setModEntityId("GENE:0008"); gene.setTaxon(taxon); GeneSymbolSlotAnnotation invalidSymbol = new GeneSymbolSlotAnnotation(); @@ -490,7 +490,7 @@ public void editGeneWithMissingRequiredFieldsLevel2() { public void createGeneWithEmptyRequiredFieldsLevel2() { Gene gene = new Gene(); - gene.setCurie("GENE:0010"); + gene.setModEntityId("GENE:0010"); gene.setTaxon(taxon); GeneSymbolSlotAnnotation invalidSymbol = createGeneSymbolSlotAnnotation(null, "", symbolNameType, null, null); @@ -591,7 +591,7 @@ public void createGeneWithInvalidFields() { invalidDataProvider.setSourceOrganization(nonPersistedOrganization); Gene gene = new Gene(); - gene.setCurie("GENE:0012"); + gene.setModEntityId("GENE:0012"); gene.setTaxon(nonPersistedTaxon); gene.setGeneType(nonPersistedSoTerm); gene.setDataProvider(invalidDataProvider); @@ -714,7 +714,7 @@ public void editGeneWithInvalidFields() { @Order(14) public void createGeneWithObsoleteFields() { Gene gene = new Gene(); - gene.setCurie("GENE:0014"); + gene.setModEntityId("GENE:0014"); gene.setTaxon(obsoleteTaxon); gene.setGeneType(obsoleteSoTerm); gene.setDataProvider(obsoleteDataProvider); @@ -926,7 +926,7 @@ public void editGeneWithNullNonRequiredFieldsLevel1() { @Order(18) public void createGeneWithOnlyRequiredFields() { Gene gene = new Gene(); - gene.setCurie("GENE:0020"); + gene.setModEntityId("GENE:0020"); gene.setTaxon(taxon); gene.setGeneSymbol(geneSymbol); @@ -943,7 +943,7 @@ public void createGeneWithOnlyRequiredFields() { @Order(19) public void createGeneWithOnlyRequiredFieldsLevel2() { Gene gene = new Gene(); - gene.setCurie("GENE:0021"); + gene.setModEntityId("GENE:0021"); gene.setTaxon(taxon); GeneSymbolSlotAnnotation minimalGeneSymbol = createGeneSymbolSlotAnnotation(null, "Test symbol", symbolNameType, null, null); diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/VariantITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/VariantITCase.java index f5efdfb88..6e5881685 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/VariantITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/VariantITCase.java @@ -108,7 +108,7 @@ public void createValidVariant() { loadRequiredEntities(); Variant variant = new Variant(); - variant.setCurie(VARIANT); + variant.setModEntityId(VARIANT); variant.setTaxon(taxon); variant.setVariantType(variantTypeTerm); variant.setVariantStatus(variantStatus); @@ -130,7 +130,7 @@ public void createValidVariant() { get("/api/variant/" + VARIANT). then(). statusCode(200). - body("entity.curie", is(VARIANT)). + body("entity.modEntityId", is(VARIANT)). body("entity.taxon.curie", is(taxon.getCurie())). body("entity.internal", is(false)). body("entity.obsolete", is(false)). @@ -153,7 +153,7 @@ public void createValidVariant() { public void editVariant() { Variant variant = getVariant(VARIANT); variant.setCreatedBy(person); - variant.setCurie(VARIANT); + variant.setModEntityId(VARIANT); variant.setTaxon(taxon2); variant.setVariantType(variantTypeTerm2); variant.setVariantStatus(variantStatus2); @@ -183,7 +183,7 @@ public void editVariant() { get("/api/variant/" + VARIANT). then(). statusCode(200). - body("entity.curie", is(VARIANT)). + body("entity.modEntityId", is(VARIANT)). body("entity.variantType.curie", is(variantTypeTerm2.getCurie())). body("entity.variantStatus.name", is(variantStatus2.getName())). body("entity.sourceGeneralConsequence.curie", is(sgcTerm2.getCurie())). @@ -215,16 +215,16 @@ public void createVariantWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")). body("errorMessages.taxon", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.variantType", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @Order(4) - public void editVariantWithMissingCurie() { + public void editVariantWithMissingModEntityId() { Variant variant = getVariant(VARIANT); - variant.setCurie(null); + variant.setModEntityId(null); RestAssured.given(). contentType("application/json"). @@ -234,7 +234,7 @@ public void editVariantWithMissingCurie() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")); } @Test @@ -262,7 +262,7 @@ public void editVariantWithMissingRequiredFieldsLevel1() { @Order(6) public void createVariantWithEmptyRequiredFields() { Variant variant = new Variant(); - variant.setCurie(""); + variant.setModEntityId(""); variant.setTaxon(taxon); variant.setVariantType(variantTypeTerm); RestAssured.given(). @@ -273,14 +273,14 @@ public void createVariantWithEmptyRequiredFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")); } @Test @Order(7) - public void editVariantWithEmptyCurie() { + public void editVariantWithEmptyModEntityId() { Variant variant = getVariant(VARIANT); - variant.setCurie(""); + variant.setModEntityId(""); RestAssured.given(). contentType("application/json"). @@ -290,14 +290,14 @@ public void editVariantWithEmptyCurie() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.curie", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")); } @Test @Order(8) public void createVariantWithMissingRequiredFieldsLevel2() { Variant variant = new Variant(); - variant.setCurie("Variant:0008"); + variant.setModEntityId("Variant:0008"); variant.setTaxon(taxon); variant.setVariantType(variantTypeTerm); @@ -345,7 +345,7 @@ public void editVariantWithMissingRequiredFieldsLevel2() { @Order(10) public void createVariantWithEmptyRequiredFieldsLevel2() { Variant variant = new Variant(); - variant.setCurie("Variant:0010"); + variant.setModEntityId("Variant:0010"); variant.setTaxon(taxon); variant.setVariantType(variantTypeTerm); @@ -402,7 +402,7 @@ public void createVariantWithInvalidFields() { invalidNote.setReferences(List.of(nonPersistedReference)); Variant variant = new Variant(); - variant.setCurie("Variant:0012"); + variant.setModEntityId("Variant:0012"); variant.setTaxon(nonPersistedTaxon); variant.setVariantType(nonPersistedSoTerm); variant.setVariantStatus(noteType); @@ -476,7 +476,7 @@ public void editVariantWithInvalidFields() { @Order(14) public void createVariantWithObsoleteFields() { Variant variant = new Variant(); - variant.setCurie("Variant:0012"); + variant.setModEntityId("Variant:0012"); variant.setTaxon(obsoleteTaxon); variant.setVariantType(obsoleteSoTerm); variant.setVariantStatus(obsoleteVariantStatus); @@ -600,7 +600,7 @@ public void editVariantWithNullNonRequiredFieldsLevel1() { @Order(19) public void createVariantWithOnlyRequiredFieldsLevel1() { Variant variant = new Variant(); - variant.setCurie("VARIANT:0019"); + variant.setModEntityId("VARIANT:0019"); variant.setTaxon(taxon); variant.setVariantType(variantTypeTerm); @@ -617,7 +617,7 @@ public void createVariantWithOnlyRequiredFieldsLevel1() { @Order(20) public void createVariantWithOnlyRequiredFieldsLevel2() { Variant variant = new Variant(); - variant.setCurie("VARIANT:0020"); + variant.setModEntityId("VARIANT:0020"); variant.setTaxon(taxon); variant.setVariantType(variantTypeTerm); @@ -637,7 +637,7 @@ public void createVariantWithOnlyRequiredFieldsLevel2() { @Order(21) public void createVariantWithDuplicateNote() { Variant variant = new Variant(); - variant.setCurie("VARIANT:0021"); + variant.setModEntityId("VARIANT:0021"); variant.setTaxon(taxon); variant.setVariantType(variantTypeTerm); diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java index b75624266..1b3a1c8e3 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java @@ -114,12 +114,12 @@ public void createValidAlleleGeneAssociation() { RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?alleleCurie=" + allele.getCurie() + "&relationName=" + relation.getName() + "&geneCurie=" + gene.getCurie()). + get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relation.getName() + "&geneId=" + gene.getId()). then(). statusCode(200). body("entity.relation.name", is(relation.getName())). - body("entity.object.curie", is(gene.getCurie())). - body("entity.subject.curie", is(allele.getCurie())). + body("entity.object.modEntityId", is(gene.getModEntityId())). + body("entity.subject.modEntityId", is(allele.getModEntityId())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference.getCurie())). body("entity.evidenceCode.curie", is(ecoTerm.getCurie())). @@ -142,7 +142,7 @@ public void createValidAlleleGeneAssociation() { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relation.getName())). - body("entity.alleleGeneAssociations[0].object.curie", is(gene.getCurie())). + body("entity.alleleGeneAssociations[0].object.modEntityId", is(gene.getModEntityId())). body("entity.alleleGeneAssociations[0].subject", not(hasKey("alleleGeneAssociations"))); RestAssured.given(). @@ -152,14 +152,14 @@ public void createValidAlleleGeneAssociation() { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relation.getName())). - body("entity.alleleGeneAssociations[0].object.curie", is(gene.getCurie())). + body("entity.alleleGeneAssociations[0].object.modEntityId", is(gene.getModEntityId())). body("entity.alleleGeneAssociations[0].object", not(hasKey("alleleGeneAssociations"))); } @Test @Order(2) public void editAlleleGeneAssociation() { - AlleleGeneAssociation association = getAlleleGeneAssociation(allele.getCurie(), relation.getName(), gene.getCurie()); + AlleleGeneAssociation association = getAlleleGeneAssociation(allele.getId(), relation.getName(), gene.getId()); association.setSubject(allele2); association.setRelation(relation2); association.setObject(gene2); @@ -179,12 +179,12 @@ public void editAlleleGeneAssociation() { RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?alleleCurie=" + allele2.getCurie() + "&relationName=" + relation2.getName() + "&geneCurie=" + gene2.getCurie()). + get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele2.getId() + "&relationName=" + relation2.getName() + "&geneId=" + gene2.getId()). then(). statusCode(200). body("entity.relation.name", is(relation2.getName())). - body("entity.object.curie", is(gene2.getCurie())). - body("entity.subject.curie", is(allele2.getCurie())). + body("entity.object.modEntityId", is(gene2.getModEntityId())). + body("entity.subject.modEntityId", is(allele2.getModEntityId())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2.getCurie())). body("entity.evidenceCode.curie", is(ecoTerm2.getCurie())). @@ -269,7 +269,7 @@ public void createAlleleGeneAssociationWithEmptyRequiredFieldsLevel2() { @Test @Order(6) public void editAlleleGeneAssociationWithMissingRequiredFieldsLevel1() { - AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getCurie(), relation2.getName(), gene2.getCurie()); + AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getId(), relation2.getName(), gene2.getId()); association.setSubject(null); association.setRelation(null); association.setObject(null); @@ -290,7 +290,7 @@ public void editAlleleGeneAssociationWithMissingRequiredFieldsLevel1() { @Test @Order(7) public void editAlleleGeneAssociationWithMissingRequiredFieldsLevel2() { - AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getCurie(), relation2.getName(), gene2.getCurie()); + AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getId(), relation2.getName(), gene2.getId()); Note invalidNote = association.getRelatedNote(); invalidNote.setFreeText(null); @@ -313,7 +313,7 @@ public void editAlleleGeneAssociationWithMissingRequiredFieldsLevel2() { @Test @Order(8) public void editAlleleGeneAssociationWithEmptyRequiredFieldsLevel2() { - AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getCurie(), relation2.getName(), gene2.getCurie()); + AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getId(), relation2.getName(), gene2.getId()); Note invalidNote = association.getRelatedNote(); invalidNote.setFreeText(""); @@ -334,9 +334,9 @@ public void editAlleleGeneAssociationWithEmptyRequiredFieldsLevel2() { @Order(9) public void createAlleleGeneAssociationWithInvalidFields() { Allele nonPersistedAllele = new Allele(); - nonPersistedAllele.setCurie("NP:Allele01"); + nonPersistedAllele.setModEntityId("NP:Allele01"); Gene nonPersistedGene = new Gene(); - nonPersistedGene.setCurie("NP:Gene01"); + nonPersistedGene.setModEntityId("NP:Gene01"); Reference nonPersistedReference = new Reference(); nonPersistedReference.setCurie("AGRKB:Invalid"); ECOTerm nonPersistedEcoTerm = new ECOTerm(); @@ -377,9 +377,9 @@ public void createAlleleGeneAssociationWithInvalidFields() { @Order(9) public void editAlleleGeneAssociationWithInvalidFields() { Allele nonPersistedAllele = new Allele(); - nonPersistedAllele.setCurie("NP:Allele01"); + nonPersistedAllele.setModEntityId("NP:Allele01"); Gene nonPersistedGene = new Gene(); - nonPersistedGene.setCurie("NP:Gene01"); + nonPersistedGene.setModEntityId("NP:Gene01"); Reference nonPersistedReference = new Reference(); nonPersistedReference.setCurie("AGRKB:Invalid"); ECOTerm nonPersistedEcoTerm = new ECOTerm(); @@ -390,7 +390,7 @@ public void editAlleleGeneAssociationWithInvalidFields() { invalidNote.setReferences(List.of(nonPersistedReference)); invalidNote.setFreeText("Invalid"); - AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getCurie(), relation2.getName(), gene2.getCurie()); + AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getId(), relation2.getName(), gene2.getId()); association.setSubject(nonPersistedAllele); association.setRelation(noteType); association.setObject(nonPersistedGene); @@ -455,7 +455,7 @@ public void createAlleleGeneAssociationWithObsoleteFields() { @Test @Order(11) public void editAlleleGeneAssociationWithObsoleteFields() { - AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getCurie(), relation2.getName(), gene2.getCurie()); + AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getId(), relation2.getName(), gene2.getId()); association.setSubject(obsoleteAllele); association.setRelation(obsoleteRelation); @@ -490,7 +490,7 @@ public void editAlleleGeneAssociationWithObsoleteFields() { @Test @Order(12) public void editAlleleGeneAssociationWithNullNonRequiredFieldsLevel2() { - AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getCurie(), relation2.getName(), gene2.getCurie()); + AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getId(), relation2.getName(), gene2.getId()); Note editedNote = association.getRelatedNote(); editedNote.setReferences(null); @@ -505,7 +505,7 @@ public void editAlleleGeneAssociationWithNullNonRequiredFieldsLevel2() { RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?alleleCurie=" + allele2.getCurie() + "&relationName=" + relation2.getName() + "&geneCurie=" + gene2.getCurie()). + get(alleleGeneAssociationGetEndpoint + "?allleleId=" + allele2.getId() + "&relationName=" + relation2.getName() + "&geneId=" + gene2.getId()). then(). statusCode(200). body("entity", hasKey("relatedNote")). @@ -515,7 +515,7 @@ public void editAlleleGeneAssociationWithNullNonRequiredFieldsLevel2() { @Test @Order(13) public void editAlleleGeneAssociationWithNullNonRequiredFieldsLevel1() { - AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getCurie(), relation2.getName(), gene2.getCurie()); + AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getId(), relation2.getName(), gene2.getId()); association.setEvidence(null); association.setEvidenceCode(null); @@ -531,7 +531,7 @@ public void editAlleleGeneAssociationWithNullNonRequiredFieldsLevel1() { RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?alleleCurie=" + allele2.getCurie() + "&relationName=" + relation2.getName() + "&geneCurie=" + gene2.getCurie()). + get(alleleGeneAssociationGetEndpoint + "?allleleId=" + allele2.getId() + "&relationName=" + relation2.getName() + "&geneId=" + gene2.getId()). then(). statusCode(200). body("entity", not(hasKey("evidence"))). diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java index 64d9e21c3..0baa39554 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java @@ -107,12 +107,12 @@ public void createValidConstructGenomicEntityAssociation() { RestAssured.given(). when(). - get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + construct.getId() + "&relationName=" + relation.getName() + "&genomicEntityCurie=" + gene.getCurie()). + get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + construct.getId() + "&relationName=" + relation.getName() + "&genomicEntityId=" + gene.getId()). then(). statusCode(200). body("entity.relation.name", is(relation.getName())). - body("entity.object.curie", is(gene.getCurie())). - body("entity.subject.curie", is(construct.getCurie())). + body("entity.object.modEntityId", is(gene.getModEntityId())). + body("entity.subject.modEntityId", is(construct.getModEntityId())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference.getCurie())). body("entity.internal", is(true)). @@ -134,24 +134,24 @@ public void createValidConstructGenomicEntityAssociation() { statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relation.getName())). - body("entity.constructGenomicEntityAssociations[0].object.curie", is(gene.getCurie())). + body("entity.constructGenomicEntityAssociations[0].object.modEntityId", is(gene.getModEntityId())). body("entity.constructGenomicEntityAssociations[0].subject", not(hasKey("constructGeneAssociations"))); RestAssured.given(). when(). - get(geneGetEndpoint + gene.getCurie()). + get(geneGetEndpoint + gene.getModEntityId()). then(). statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relation.getName())). - body("entity.constructGenomicEntityAssociations[0].object.curie", is(gene.getCurie())). + body("entity.constructGenomicEntityAssociations[0].object.modEntityId", is(gene.getModEntityId())). body("entity.constructGenomicEntityAssociations[0].subject", not(hasKey("constructGeneAssociations"))); } @Test @Order(2) public void editConstructGenomicEntityAssociation() { - ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct.getId(), relation.getName(), gene.getCurie()); + ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct.getId(), relation.getName(), gene.getId()); association.setSubject(construct2); association.setRelation(relation2); association.setObject(gene2); @@ -170,7 +170,7 @@ public void editConstructGenomicEntityAssociation() { RestAssured.given(). when(). - get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + construct2.getId() + "&relationName=" + relation2.getName() + "&genomicEntityCurie=" + gene2.getCurie()). + get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + construct2.getId() + "&relationName=" + relation2.getName() + "&genomicEntityId=" + gene2.getId()). then(). statusCode(200). body("entity.relation.name", is(relation2.getName())). @@ -259,7 +259,7 @@ public void createConstructGenomicEntityAssociationWithEmptyRequiredFieldsLevel2 @Test @Order(6) public void editConstructGenomicEntityAssociationWithMissingRequiredFieldsLevel1() { - ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getCurie()); + ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getId()); association.setSubject(null); association.setRelation(null); association.setObject(null); @@ -280,7 +280,7 @@ public void editConstructGenomicEntityAssociationWithMissingRequiredFieldsLevel1 @Test @Order(7) public void editConstructGenomicEntityAssociationWithMissingRequiredFieldsLevel2() { - ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getCurie()); + ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getId()); Note invalidNote = association.getRelatedNotes().get(0); invalidNote.setFreeText(null); @@ -303,7 +303,7 @@ public void editConstructGenomicEntityAssociationWithMissingRequiredFieldsLevel2 @Test @Order(8) public void editConstructGenomicEntityAssociationWithEmptyRequiredFieldsLevel2() { - ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getCurie()); + ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getId()); Note invalidNote = association.getRelatedNotes().get(0); invalidNote.setFreeText(""); @@ -378,7 +378,7 @@ public void editConstructGenomicEntityAssociationWithInvalidFields() { invalidNote.setReferences(List.of(nonPersistedReference)); invalidNote.setFreeText("Invalid"); - ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getCurie()); + ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getId()); association.setSubject(nonPersistedConstruct); association.setRelation(noteType); association.setObject(nonPersistedGene); @@ -439,7 +439,7 @@ public void createConstructGenomicEntityAssociationWithObsoleteFields() { @Test @Order(11) public void editConstructGenomicEntityAssociationWithObsoleteFields() { - ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getCurie()); + ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getId()); association.setSubject(obsoleteConstruct); association.setRelation(obsoleteRelation); @@ -472,7 +472,7 @@ public void editConstructGenomicEntityAssociationWithObsoleteFields() { @Test @Order(12) public void editConstructGenomicEntityAssociationWithNullNonRequiredFieldsLevel2() { - ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getCurie()); + ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getId()); Note editedNote = association.getRelatedNotes().get(0); editedNote.setReferences(null); @@ -488,7 +488,7 @@ public void editConstructGenomicEntityAssociationWithNullNonRequiredFieldsLevel2 RestAssured.given(). when(). - get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + construct2.getId() + "&relationName=" + relation2.getName() + "&genomicEntityCurie=" + gene2.getCurie()). + get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + construct2.getId() + "&relationName=" + relation2.getName() + "&genomicEntityId=" + gene2.getId()). then(). statusCode(200). body("entity", hasKey("relatedNotes")). @@ -498,7 +498,7 @@ public void editConstructGenomicEntityAssociationWithNullNonRequiredFieldsLevel2 @Test @Order(13) public void editConstructGenomicEntityAssociationWithNullNonRequiredFieldsLevel1() { - ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getCurie()); + ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getId()); association.setEvidence(null); association.setRelatedNotes(null); @@ -513,7 +513,7 @@ public void editConstructGenomicEntityAssociationWithNullNonRequiredFieldsLevel1 RestAssured.given(). when(). - get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + construct2.getId() + "&relationName=" + relation2.getName() + "&genomicEntityCurie=" + gene2.getCurie()). + get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + construct2.getId() + "&relationName=" + relation2.getName() + "&genomicEntityId=" + gene2.getId()). then(). statusCode(200). body("entity", not(hasKey("evidence"))). From 2155b2ed91ce2e0ebf9b50c119a60730f2e1db18 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Wed, 13 Dec 2023 08:50:58 +0000 Subject: [PATCH 008/159] Initial migration work --- .../bridges/BiologicalEntityTypeBridge.java | 2 + .../model/entities/AGMDiseaseAnnotation.java | 3 +- .../curation_api/model/entities/Agent.java | 1 - .../curation_api/model/entities/Allele.java | 10 +- .../entities/AlleleDiseaseAnnotation.java | 10 +- .../model/entities/Annotation.java | 9 +- .../model/entities/Association.java | 5 +- .../model/entities/BiologicalEntity.java | 7 +- .../model/entities/ConditionRelation.java | 2 + .../model/entities/Construct.java | 7 +- .../model/entities/DiseaseAnnotation.java | 22 +- .../model/entities/EvidenceAssociation.java | 4 +- .../model/entities/ExperimentalCondition.java | 2 + .../curation_api/model/entities/Gene.java | 2 +- .../model/entities/GeneDiseaseAnnotation.java | 3 - .../model/entities/GenomicEntity.java | 7 +- .../entities/InformationContentEntity.java | 6 - .../curation_api/model/entities/Note.java | 7 +- .../model/entities/Organization.java | 6 +- .../curation_api/model/entities/Reagent.java | 7 +- .../model/entities/Reference.java | 4 +- .../model/entities/ResourceDescriptor.java | 2 +- .../entities/ResourceDescriptorPage.java | 2 +- .../entities/SingleReferenceAssociation.java | 2 +- .../curation_api/model/entities/Species.java | 2 + .../curation_api/model/entities/Synonym.java | 2 + .../curation_api/model/entities/Variant.java | 8 +- .../model/entities/Vocabulary.java | 2 +- .../model/entities/VocabularyTerm.java | 2 +- .../model/entities/VocabularyTermSet.java | 2 + .../AlleleGeneAssociation.java | 4 +- .../ConstructGenomicEntityAssociation.java | 6 +- .../model/entities/base/AuditedObject.java | 3 + .../model/entities/base/CurieObject.java | 3 +- .../model/entities/base/SubmittedObject.java | 1 - .../model/entities/ontology/OntologyTerm.java | 30 +- .../orthology/GeneToGeneOrthology.java | 4 +- .../orthology/GeneToGeneOrthologyCurated.java | 4 +- .../slotAnnotations/NameSlotAnnotation.java | 5 +- .../slotAnnotations/SlotAnnotation.java | 4 +- .../AlleleDatabaseStatusSlotAnnotation.java | 4 +- .../AlleleFullNameSlotAnnotation.java | 2 +- .../AlleleFunctionalImpactSlotAnnotation.java | 8 +- ...mlineTransmissionStatusSlotAnnotation.java | 4 +- .../AlleleInheritanceModeSlotAnnotation.java | 6 +- .../AlleleMutationTypeSlotAnnotation.java | 6 +- ...AlleleNomenclatureEventSlotAnnotation.java | 4 +- .../AlleleSecondaryIdSlotAnnotation.java | 2 +- .../AlleleSymbolSlotAnnotation.java | 2 +- .../AlleleSynonymSlotAnnotation.java | 2 +- .../ConstructComponentSlotAnnotation.java | 4 +- .../ConstructFullNameSlotAnnotation.java | 2 +- .../ConstructSymbolSlotAnnotation.java | 2 +- .../ConstructSynonymSlotAnnotation.java | 2 +- .../GeneFullNameSlotAnnotation.java | 2 +- .../GeneSecondaryIdSlotAnnotation.java | 2 +- .../GeneSymbolSlotAnnotation.java | 2 +- .../GeneSynonymSlotAnnotation.java | 2 +- .../GeneSystematicNameSlotAnnotation.java | 2 +- .../services/validation/NoteValidator.java | 3 + .../validation/dto/NoteDTOValidator.java | 3 + .../v0.30.0.1__linkml_v2.0.0_update.sql | 968 +++++++++++++++++- 62 files changed, 1116 insertions(+), 132 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/bridges/BiologicalEntityTypeBridge.java b/src/main/java/org/alliancegenome/curation_api/model/bridges/BiologicalEntityTypeBridge.java index 8ba03d561..1e1f5b318 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/bridges/BiologicalEntityTypeBridge.java +++ b/src/main/java/org/alliancegenome/curation_api/model/bridges/BiologicalEntityTypeBridge.java @@ -21,6 +21,8 @@ public class BiologicalEntityTypeBridge implements TypeBinder { @Override public void bind(TypeBindingContext context) { + context.dependencies().use("curie").use("taxon"); + IndexSchemaElement schemaElement = context.indexSchemaElement(); IndexFieldType type = context.typeFactory().asString().analyzer("autocompleteAnalyzer").searchAnalyzer("autocompleteSearchAnalyzer").toIndexFieldType(); diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java index 06a59977f..68efed837 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java @@ -47,7 +47,6 @@ public class AGMDiseaseAnnotation extends DiseaseAnnotation { @ManyToOne @Fetch(FetchMode.SELECT) @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) - @JoinColumn(foreignKey = @ForeignKey(name = "fk_agmdasubject")) @JsonView({ View.FieldsOnly.class }) private AffectedGenomicModel subject; @@ -69,7 +68,7 @@ public class AGMDiseaseAnnotation extends DiseaseAnnotation { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @Fetch(FetchMode.SELECT) - @JoinTable(indexes = @Index(columnList = "agmdiseaseannotation_id")) + @JoinTable(indexes = @Index(name = "agmdiseaseannotation_gene_agmdiseaseannotation_index", columnList = "agmdiseaseannotation_id")) @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class }) private List assertedGenes; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Agent.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Agent.java index f6942d4cb..47f8409de 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Agent.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Agent.java @@ -3,7 +3,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; -import org.alliancegenome.curation_api.model.entities.base.UniqueIdAuditedObject; import jakarta.persistence.MappedSuperclass; import lombok.Data; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java index c42a00a24..15c2972d9 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java @@ -62,7 +62,11 @@ public class Allele extends GenomicEntity { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany(fetch = FetchType.EAGER) @Fetch(FetchMode.JOIN) - @JoinTable(indexes = { @Index(columnList = "allele_curie"), @Index(columnList = "references_curie"), @Index(columnList = "allele_curie, references_curie") }) + @JoinTable(indexes = { + @Index(name = "allele_reference_allele_index", columnList = "allele_id"), + @Index(name = "allele_reference_references_index", columnList = "references_id"), + @Index(name = "allele_reference_allele_references_index", columnList = "allele_id, references_id") + }) @JsonView({ View.FieldsAndLists.class, View.AlleleView.class }) private List references; @@ -151,7 +155,9 @@ public class Allele extends GenomicEntity { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true) @JsonView({ View.FieldsAndLists.class, View.AlleleView.class }) - @JoinTable(indexes = { @Index(columnList = "allele_curie"), @Index(columnList = "relatedNotes_id")}) + @JoinTable(indexes = { + @Index(name = "allele_note_allele_index", columnList = "allele_id"), + @Index(name = "allele_note_relatednotes_index", columnList = "relatedNotes_id")}) private List relatedNotes; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java index ee454ed10..9b4f58c0d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java @@ -21,9 +21,7 @@ import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; -import jakarta.persistence.ForeignKey; import jakarta.persistence.Index; -import jakarta.persistence.JoinColumn; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; import jakarta.persistence.ManyToOne; @@ -41,7 +39,7 @@ @JsonTypeName("AlleleDiseaseAnnotation") @OnDelete(action = OnDeleteAction.CASCADE) @AGRCurationSchemaVersion(min = "1.3.2", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotation.class }) -@Table(indexes = { @Index(name = "AlleleDiseaseAnnotation_inferredGene_index", columnList = "inferredGene_curie"), @Index(name = "AlleleDiseaseAnnotation_Subject_index", columnList = "subject_curie")}) +@Table(indexes = { @Index(name = "AlleleDiseaseAnnotation_inferredGene_index", columnList = "inferredGene_id"), @Index(name = "AlleleDiseaseAnnotation_Subject_index", columnList = "subject_id")}) public class AlleleDiseaseAnnotation extends DiseaseAnnotation { @IndexedEmbedded(includeDepth = 2) @@ -49,7 +47,6 @@ public class AlleleDiseaseAnnotation extends DiseaseAnnotation { @ManyToOne @Fetch(FetchMode.SELECT) @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) - @JoinColumn(foreignKey = @ForeignKey(name = "fk_alleledasubject")) @JsonView({ View.FieldsOnly.class }) private Allele subject; @@ -64,7 +61,10 @@ public class AlleleDiseaseAnnotation extends DiseaseAnnotation { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @Fetch(FetchMode.SELECT) - @JoinTable(indexes = { @Index(columnList = "allelediseaseannotation_id"), @Index(columnList = "assertedgenes_curie")}) + @JoinTable(indexes = { + @Index(name = "allelediseaseannotationgene_diseaseannotation_index", columnList = "allelediseaseannotation_id"), + @Index(name = "allelediseaseannotationgene_assertedgenes_index", columnList = "assertedgenes_id") + }) @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class }) private List assertedGenes; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java index 3e54dbc33..837f5f6a4 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java @@ -25,8 +25,6 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; import jakarta.persistence.ManyToOne; @@ -35,12 +33,13 @@ import jakarta.persistence.UniqueConstraint; import lombok.Data; import lombok.EqualsAndHashCode; +import lombok.ToString; @Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) +@ToString(callSuper = true) @Schema(name = "annotation", description = "POJO that represents an annotation") @AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @@ -88,14 +87,14 @@ public class Annotation extends SingleReferenceAssociation { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class }) - @JoinTable(indexes = { @Index(name = "annotation_conditionrelation_annotation_id_index", columnList = "annotation_id"), @Index(name = "annotation_conditionrelation_conditionrelations_id_index", columnList = "conditionrelations_id")}) + @JoinTable(indexes = { @Index(name = "annotation_conditionrelation_annotation_index", columnList = "annotation_id"), @Index(name = "annotation_conditionrelation_conditionrelations_index", columnList = "conditionrelations_id")}) private List conditionRelations; @IndexedEmbedded(includeDepth = 1) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true) @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class }) - @JoinTable(indexes = { @Index(name = "annotation_note_annotation_id_index", columnList = "annotation_id"), @Index(name = "annotation_note_relatednotes_id_index",columnList = "relatednotes_id")}) + @JoinTable(indexes = { @Index(name = "annotation_note_annotation_index", columnList = "annotation_id"), @Index(name = "annotation_note_relatednotes_index",columnList = "relatednotes_id")}) private List relatedNotes; @IndexedEmbedded(includeDepth = 2) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java index a667e8404..bf67de042 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java @@ -7,16 +7,15 @@ import org.hibernate.envers.Audited; import jakarta.persistence.Entity; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import lombok.Data; import lombok.EqualsAndHashCode; +import lombok.ToString; @Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) +@ToString(callSuper = true) @Schema(name = "association", description = "POJO that represents an association") @AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) public class Association extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java index 966055c42..077c7bb84 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java @@ -19,8 +19,6 @@ import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; import lombok.Data; @@ -33,13 +31,12 @@ @Audited @Entity @TypeBinding(binder = @TypeBinderRef(type = BiologicalEntityTypeBridge.class)) -@Inheritance(strategy = InheritanceType.JOINED) @Data -@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SubmittedObject.class }) @Table(indexes = { - @Index(name = "biologicalentity_taxon_index", columnList = "taxon_curie") + @Index(name = "biologicalentity_taxon_index", columnList = "taxon_id") }) public class BiologicalEntity extends SubmittedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java index 50eeedff9..1609dfad7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java @@ -28,12 +28,14 @@ import jakarta.persistence.ManyToOne; import lombok.Data; import lombok.EqualsAndHashCode; +import lombok.ToString; @Audited @Entity @Data @Indexed @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@ToString(callSuper = true) @Schema(name = "ConditionRelation", description = "POJO that describes the Condition Relation") @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { ExperimentalCondition.class }) public class ConditionRelation extends UniqueIdAuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java index 0111711e8..7a53efb1a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java @@ -23,8 +23,6 @@ import jakarta.persistence.CascadeType; import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; import jakarta.persistence.OneToMany; @@ -38,7 +36,6 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @Schema(name = "construct", description = "POJO that represents a construct") @ToString(exclude = {"constructGenomicEntityAssociations", "constructComponents", "constructSymbol", "constructFullName", "constructSynonyms"}, callSuper = true) @AGRCurationSchemaVersion(min = "1.10.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Reagent.class }) @@ -68,8 +65,8 @@ public class Construct extends Reagent { @ManyToMany @JsonView({ View.FieldsAndLists.class, View.ConstructView.class }) @JoinTable(indexes = { - @Index(name = "construct_reference_construct_id_index", columnList = "construct_id"), - @Index(name = "construct_reference_references_curie_index", columnList = "references_curie") + @Index(name = "construct_reference_construct_index", columnList = "construct_id"), + @Index(name = "construct_reference_references_index", columnList = "references_id") }) private List references; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java index 503bdb787..0da1ef773 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java @@ -53,7 +53,7 @@ @Schema(name = "Disease_Annotation", description = "Annotation class representing a disease annotation") @Table(indexes = { - @Index(name = "DiseaseAnnotation_object_index", columnList = "object_curie"), + @Index(name = "DiseaseAnnotation_object_index", columnList = "object_id"), @Index(name = "DiseaseAnnotation_relation_index", columnList = "relation_id"), @Index(name = "DiseaseAnnotation_annotationType_index", columnList = "annotationType_id"), @Index(name = "DiseaseAnnotation_geneticSex_index", columnList = "geneticSex_id"), @@ -86,14 +86,20 @@ public abstract class DiseaseAnnotation extends Annotation { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class }) - @JoinTable(indexes = { @Index(columnList = "diseaseannotation_id"), @Index(columnList = "evidencecodes_curie")}) + @JoinTable(indexes = { + @Index(name = "diseaseannotation_ecoterm_diseaseannotation_index", columnList = "diseaseannotation_id"), + @Index(name = "diseaseannotation_ecoterm_evidencecodes_index", columnList = "evidencecodes_id") + }) private List evidenceCodes; @IndexedEmbedded(includeDepth = 2) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @Fetch(FetchMode.SELECT) - @JoinTable(indexes = { @Index(columnList = "diseaseannotation_id"), @Index(columnList = "with_curie") }) + @JoinTable(indexes = { + @Index(name = "diseaseannotation_gene_diseaseannotation_index", columnList = "diseaseannotation_id"), + @Index(name = "diseaseannotation_gene_with_index", columnList = "with_id") + }) @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class }) private List with; @@ -107,7 +113,10 @@ public abstract class DiseaseAnnotation extends Annotation { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class }) - @JoinTable(indexes = { @Index(columnList = "diseaseannotation_id"), @Index(columnList = "diseasequalifiers_id")}) + @JoinTable(indexes = { + @Index(name = "diseaseannotation_vocabularyterm_diseaseannotation_index", columnList = "diseaseannotation_id"), + @Index(name = "diseaseannotation_vocabularyterm_diseasequalifiers_index", columnList = "diseasequalifiers_id") + }) private List diseaseQualifiers; @IndexedEmbedded(includeDepth = 1) @@ -128,7 +137,10 @@ public abstract class DiseaseAnnotation extends Annotation { @ManyToMany @Fetch(FetchMode.SELECT) @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class }) - @JoinTable(indexes = { @Index(columnList = "diseaseannotation_id"), @Index(columnList = "diseasegeneticmodifiers_curie")}) + @JoinTable(indexes = { + @Index(name = "diseaseannotation_biologicalentity_diseaseannotation_index", columnList = "diseaseannotation_id"), + @Index(name = "diseaseannotation_biologicalentity_dgms_index", columnList = "diseasegeneticmodifiers_id") + }) private List diseaseGeneticModifiers; @IndexedEmbedded(includeDepth = 1) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java index 0c6325216..229b02993 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java @@ -37,8 +37,8 @@ public class EvidenceAssociation extends Association { @ManyToMany @JsonView({ View.FieldsAndLists.class, View.AlleleView.class, View.GeneView.class, View.ConstructView.class }) @JoinTable(indexes = { - @Index(name = "evidenceassociation_infocontent_evidenceassociation_id_index", columnList = "evidenceassociation_id"), - @Index(name = "evidenceassociation_infocontent_evidence_curie_index", columnList = "evidence_curie") + @Index(name = "evidenceassociation_infocontent_evidenceassociation_index", columnList = "evidenceassociation_id"), + @Index(name = "evidenceassociation_infocontent_evidence_index", columnList = "evidence_id") }) private List evidence; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ExperimentalCondition.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ExperimentalCondition.java index 0aaddf49a..fa2e1986a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ExperimentalCondition.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ExperimentalCondition.java @@ -30,12 +30,14 @@ import jakarta.persistence.ManyToOne; import lombok.Data; import lombok.EqualsAndHashCode; +import lombok.ToString; @Audited @Entity @Indexed @Data @EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) @Schema(name = "ExperimentalCondition", description = "POJO that describes the Experimental Condition") @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) public class ExperimentalCondition extends UniqueIdAuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java index dc68b9cba..db77b6d41 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java @@ -39,7 +39,7 @@ @ToString(exclude = { "geneDiseaseAnnotations", "geneSymbol", "geneFullName", "geneSystematicName", "geneSynonyms", "geneSecondaryIds", "alleleGeneAssociations" }, callSuper = true) @Schema(name = "Gene", description = "POJO that represents the Gene") @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { GenomicEntity.class }, partial = true) -@Table(indexes = { @Index(name = "gene_genetype_index", columnList = "geneType_curie"), }) +@Table(indexes = { @Index(name = "gene_genetype_index", columnList = "geneType_id"), }) public class Gene extends GenomicEntity { @ManyToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java index 1f73389b8..922e6c93c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java @@ -17,8 +17,6 @@ import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; -import jakarta.persistence.ForeignKey; -import jakarta.persistence.JoinColumn; import jakarta.persistence.ManyToOne; import jakarta.persistence.Transient; import lombok.Data; @@ -39,7 +37,6 @@ public class GeneDiseaseAnnotation extends DiseaseAnnotation { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) - @JoinColumn(foreignKey = @ForeignKey(name = "fk_genedasubject")) @JsonView({ View.FieldsOnly.class }) private Gene subject; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java index 53480a7d0..12519ed80 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java @@ -19,7 +19,6 @@ import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; -import jakarta.persistence.ManyToMany; import jakarta.persistence.OneToMany; import lombok.Data; import lombok.EqualsAndHashCode; @@ -38,9 +37,9 @@ public class GenomicEntity extends BiologicalEntity { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true) @JoinTable(indexes = { - @Index(columnList = "genomicentity_curie, crossreferences_id", name = "genomicentity_crossreference_ge_curie_xref_id_index"), - @Index(columnList = "genomicentity_curie", name = "genomicentity_crossreference_genomicentity_curie_index"), - @Index(columnList = "crossreferences_id", name = "genomicentity_crossreference_crossreferences_id_index") + @Index(columnList = "genomicentity_id, crossreferences_id", name = "genomicentity_crossreference_ge_xref_index"), + @Index(columnList = "genomicentity_id", name = "genomicentity_crossreference_genomicentity_index"), + @Index(columnList = "crossreferences_id", name = "genomicentity_crossreference_crossreferences_index") }) @JsonView({ View.FieldsAndLists.class }) private List crossReferences; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java index 54a65a6fc..bc63dfec3 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java @@ -9,23 +9,17 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import jakarta.persistence.Entity; -import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; -import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @Audited @Entity -@Inheritance(strategy = InheritanceType.JOINED) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Reference.class, name = "Reference") }) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -@Table(indexes = { @Index(name = "informationcontent_createdby_index", columnList = "createdBy_id"), @Index(name = "informationcontent_updatedby_index", columnList = "updatedBy_id"), }) public class InformationContentEntity extends CurieObject { } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java index ab79bd1ce..fa7e999d4 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonView; -import jakarta.persistence.AttributeOverride; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Index; @@ -38,7 +37,6 @@ @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) -@AttributeOverride(name = "internal", column = @Column(columnDefinition = "boolean default true", nullable = false)) @Schema(name = "Note", description = "POJO that represents the Note") @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Table(indexes = { @Index(name = "Note_noteType_index", columnList = "noteType_id")}) @@ -60,6 +58,9 @@ public class Note extends AuditedObject { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @JsonView({ View.FieldsAndLists.class, View.NoteView.class, View.AlleleView.class, View.ConstructView.class, View.VariantView.class }) - @JoinTable(indexes = { @Index(columnList = "note_id"), @Index(columnList = "references_curie")}) + @JoinTable(indexes = { + @Index(name = "note_reference_note_index", columnList = "note_id"), + @Index(name = "note_reference_references_index", columnList = "references_id") + }) private List references; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java index 01eb846c9..ec1d9cdda 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java @@ -33,11 +33,7 @@ @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Agent.class }) -@Table(indexes = { - @Index(name = "organization_homepageresourcedescriptorpage_id_index", columnList = "homepageresourcedescriptorpage_id"), - @Index(name = "organization_createdby_index", columnList = "createdBy_id"), - @Index(name = "organization_updatedby_index", columnList = "updatedBy_id"), -}) +@Table(indexes = { @Index(name = "organization_homepageresourcedescriptorpage_id_index", columnList = "homepageresourcedescriptorpage_id") }) public class Organization extends Agent { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java index cd00ede1e..6e1fc7f32 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java @@ -20,18 +20,17 @@ import jakarta.persistence.ElementCollection; import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; +import lombok.ToString; @Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) +@ToString(callSuper = true) @Schema(name = "reagent", description = "POJO that represents a reagent") @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SubmittedObject.class }) @@ -52,7 +51,7 @@ public class Reagent extends SubmittedObject { @KeywordField(name = "secondaryIdentifiers_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") @ElementCollection @JsonView({View.FieldsAndLists.class, View.ConstructView.class}) - @JoinTable(indexes = @Index(name = "reagent_secondaryidentifiers_reagent_id_index", columnList = "reagent_id")) + @JoinTable(indexes = @Index(name = "reagent_secondaryidentifiers_reagent_index", columnList = "reagent_id")) private List secondaryIdentifiers; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java index 723cf5a4f..b1ad60054 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java @@ -51,7 +51,9 @@ public class Reference extends InformationContentEntity { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @JsonView({View.FieldsOnly.class}) - @JoinTable(indexes = {@Index(columnList = "Reference_curie"), @Index(columnList = "crossReferences_id")}) + @JoinTable(indexes = { + @Index(name = "reference_crossreference_reference_index", columnList = "Reference_id"), + @Index(name = "reference_crossreference_crossreferences_index", columnList = "crossReferences_id")}) @EqualsAndHashCode.Include private List crossReferences; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java index 820165442..276669d12 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java @@ -36,7 +36,7 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@ToString(exclude = {"resourcePages"}) +@ToString(exclude = {"resourcePages"}, callSuper = true) @AGRCurationSchemaVersion(min = "1.5.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Schema(name = "ResourceDescriptor", description = "Annotation class representing a resource descriptor") public class ResourceDescriptor extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java index 851972d3a..9a756f958 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java @@ -31,7 +31,7 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@ToString() +@ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Table(indexes = { @Index(name = "resourcedescriptorpage_resourcedescriptor_id_index", columnList = "resourcedescriptor_id")}) @Schema(name = "ResourceDescriptorPage", description = "Annotation class representing a resource descriptor page") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java index 4968f36c1..076327970 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java @@ -29,7 +29,7 @@ @AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Association.class }) @Table(indexes = { - @Index(name = "singlereferenceassociation_singlereference_index", columnList = "singleReference_curie") + @Index(name = "singlereferenceassociation_singlereference_index", columnList = "singleReference_id") }) public class SingleReferenceAssociation extends Association { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java index ae74d7b8d..cc878b390 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java @@ -32,6 +32,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import lombok.ToString; @Audited @Entity @@ -39,6 +40,7 @@ @Indexed @NoArgsConstructor @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@ToString(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE,dependencies = { AuditedObject.class }) public class Species extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java index 00d726e18..c39c91cb5 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java @@ -18,12 +18,14 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import lombok.ToString; @Audited @Entity @Data @NoArgsConstructor @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.2.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) public class Synonym extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Variant.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Variant.java index f71020c30..f8c5c526d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Variant.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Variant.java @@ -35,9 +35,9 @@ @ToString(exclude = { }, callSuper = true) @AGRCurationSchemaVersion(min = "1.10.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { GenomicEntity.class }) @Table(indexes = { - @Index(name = "variant_varianttype_index", columnList = "varianttype_curie"), + @Index(name = "variant_varianttype_index", columnList = "varianttype_id"), @Index(name = "variant_variantstatus_index", columnList = "variantstatus_id"), - @Index(name = "variant_sourcegeneralconsequence_index", columnList = "sourcegeneralconsequence_curie") + @Index(name = "variant_sourcegeneralconsequence_index", columnList = "sourcegeneralconsequence_id") }) public class Variant extends GenomicEntity { @@ -65,8 +65,8 @@ public class Variant extends GenomicEntity { @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true) @JsonView({ View.FieldsAndLists.class, View.VariantView.class }) @JoinTable(indexes = { - @Index(name = "variant_note_variant_curie_index", columnList = "variant_curie"), - @Index(name = "variant_note_relatednotes_id_index", columnList = "relatedNotes_id") + @Index(name = "variant_note_variant_index", columnList = "variant_id"), + @Index(name = "variant_note_relatednotes_index", columnList = "relatedNotes_id") }) private List relatedNotes; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java index 69decb257..05adc0cdf 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java @@ -34,7 +34,7 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@ToString +@ToString(callSuper = true) @Schema(name = "Vocabulary", description = "POJO that represents the Vocabulary") @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Table( diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java index 7949ca165..e7835bc37 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java @@ -37,7 +37,7 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@ToString(exclude = { "vocabulary", "vocabularyTermSets" }) +@ToString(exclude = { "vocabulary", "vocabularyTermSets" }, callSuper = true) @Table(indexes = { @Index(name = "vocabularyterm_name_index", columnList = "name"), @Index(name = "vocabularyterm_vocabulary_id_index", columnList = "vocabulary_id") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java index 3273631bc..41f62dba1 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java @@ -29,6 +29,7 @@ import jakarta.persistence.UniqueConstraint; import lombok.Data; import lombok.EqualsAndHashCode; +import lombok.ToString; @Audited @Indexed @@ -36,6 +37,7 @@ @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @Schema(name = "VocabularyTermSet", description = "POJO that represents the Vocabulary Term Set") +@ToString(callSuper = true) @Table( indexes = { @Index(name = "vocabularytermset_name_index", columnList = "name"), diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java index ed1d38cab..5120137db 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java @@ -33,8 +33,8 @@ @AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AlleleGenomicEntityAssociation.class }) @Schema(name = "AlleleGeneAssociation", description = "POJO representing an association between an allele and a gene") @Table(indexes = { - @Index(name = "allelegeneassociation_subject_index", columnList = "subject_curie"), - @Index(name = "allelegeneassociation_object_index", columnList = "object_curie") + @Index(name = "allelegeneassociation_subject_index", columnList = "subject_id"), + @Index(name = "allelegeneassociation_object_index", columnList = "object_id") }) public class AlleleGeneAssociation extends AlleleGenomicEntityAssociation { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java index 256b35112..022fdc177 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java @@ -42,7 +42,7 @@ @Schema(name = "ConstructGenomicEntityAssociation", description = "POJO representing an association between a construct and a genomic entity") @Table(indexes = { @Index(name = "constructgenomicentityassociation_subject_index", columnList = "subject_id"), - @Index(name = "constructgenomicentityassociation_object_index", columnList = "object_curie"), + @Index(name = "constructgenomicentityassociation_object_index", columnList = "object_id"), @Index(name = "constructgenomicentityassociation_relation_index", columnList = "relation_id") }) public class ConstructGenomicEntityAssociation extends EvidenceAssociation { @@ -75,8 +75,8 @@ public class ConstructGenomicEntityAssociation extends EvidenceAssociation { @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true) @JsonView({ View.FieldsAndLists.class, View.ConstructView.class }) @JoinTable(indexes = { - @Index(name = "cgeassociation_note_cgeassociation_id_index", columnList = "constructgenomicentityassociation_id"), - @Index(name = "cgeassociation_note_relatednotes_id_index", columnList = "relatedNotes_id") + @Index(name = "cgeassociation_note_cgeassociation_index", columnList = "constructgenomicentityassociation_id"), + @Index(name = "cgeassociation_note_relatednotes_index", columnList = "relatedNotes_id") }) private List relatedNotes; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java index 882f596de..70aa1860e 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java @@ -34,6 +34,8 @@ import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; import lombok.Data; @@ -46,6 +48,7 @@ @Entity @ToString(exclude = { "createdBy", "updatedBy" }) @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE) +@Inheritance(strategy = InheritanceType.JOINED) @Table(indexes = { @Index(name = "auditedobject_createdby_index", columnList = "createdBy_id"), @Index(name = "auditedobject_updatedby_index", columnList = "updatedBy_id") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java index 2017f0cb3..cde8b805f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java @@ -24,10 +24,9 @@ @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @Audited @Entity -@ToString(callSuper = true) +@ToString(onlyExplicitlyIncluded = true, callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Table( indexes = { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java index 796222dfe..b29e85145 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java @@ -34,7 +34,6 @@ @Audited @Entity -@Inheritance(strategy = InheritanceType.JOINED) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java index 14dc12f02..5015338c6 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java @@ -27,8 +27,6 @@ import jakarta.persistence.ElementCollection; import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; import jakarta.persistence.Table; @@ -41,13 +39,8 @@ @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @Entity -@Inheritance(strategy = InheritanceType.JOINED) @ToString(exclude = { "isaParents", "isaChildren", "isaAncestors", "isaDescendants", "crossReferences", "synonyms", "secondaryIdentifiers", "subsets" }, callSuper = true) @AGRCurationSchemaVersion(min = LinkMLSchemaConstants.MIN_ONTOLOGY_RELEASE, max = LinkMLSchemaConstants.MAX_ONTOLOGY_RELEASE, dependencies = { AuditedObject.class }) -@Table(indexes = { - @Index(name = "ontologyterm_createdby_index", columnList = "createdBy_id"), - @Index(name = "ontologyterm_updatedby_index", columnList = "updatedBy_id") -}) public class OntologyTerm extends CurieObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @@ -77,27 +70,27 @@ public class OntologyTerm extends CurieObject { @ElementCollection @JsonView(View.FieldsAndLists.class) @Column(columnDefinition = "TEXT") - @JoinTable(indexes = @Index(columnList = "ontologyterm_curie")) + @JoinTable(indexes = @Index(name = "ontologyterm_definitionurls_ontologyterm_index", columnList = "ontologyterm_id")) private List definitionUrls; @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "subsets_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") @ElementCollection @JsonView(View.FieldsAndLists.class) - @JoinTable(indexes = @Index(columnList = "ontologyterm_curie")) + @JoinTable(indexes = @Index(name = "ontologyterm_subsets_ontologyterm_index", columnList = "ontologyterm_id")) private List subsets; @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "secondaryIdentifiers_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") @ElementCollection @JsonView(View.FieldsAndLists.class) - @JoinTable(indexes = @Index(columnList = "ontologyterm_curie")) + @JoinTable(indexes = @Index(name = "ontologyterm_secondaryidentifiers_ontologyterm_index", columnList = "ontologyterm_id")) private List secondaryIdentifiers; @IndexedEmbedded(includeDepth = 1) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany - @JoinTable(indexes = @Index(columnList = "ontologyterm_curie", name = "ontologyterm_synonym_ontologyterm_curie_index")) + @JoinTable(indexes = @Index(columnList = "ontologyterm_id", name = "ontologyterm_synonym_ontologyterm_index")) @JsonView({ View.FieldsAndLists.class }) private List synonyms; @@ -105,13 +98,19 @@ public class OntologyTerm extends CurieObject { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) - @JoinTable(indexes = { @Index(columnList = "ontologyterm_curie", name = "ontologyterm_crossreference_ontologyterm_curie_index"), @Index(columnList = "crossreferences_id", name = "ontologyterm_crossreference_crossreferences_id_index") }) + @JoinTable(indexes = { + @Index(columnList = "ontologyterm_id", name = "ontologyterm_crossreference_ontologyterm_index"), + @Index(columnList = "crossreferences_id", name = "ontologyterm_crossreference_crossreferences_index") + }) @JsonView({ View.FieldsAndLists.class }) private List crossReferences; @ManyToMany // @JsonView(View.OntologyTermView.class) - @JoinTable(name = "ontologyterm_isa_parent_children", indexes = { @Index(columnList = "isaparents_curie"), @Index(columnList = "isachildren_curie") }) + @JoinTable(name = "ontologyterm_isa_parent_children", indexes = { + @Index(name = "ontologyterm_isa_parent_children_isaparents_index", columnList = "isaparents_id"), + @Index(name = "ontologyterm_isa_parent_children_isachildren_index", columnList = "isachildren_id") + }) private Set isaParents; @ManyToMany(mappedBy = "isaParents") @@ -119,7 +118,10 @@ public class OntologyTerm extends CurieObject { private Set isaChildren; @ManyToMany - @JoinTable(name = "ontologyterm_isa_ancestor_descendant", indexes = { @Index(columnList = "isaancestors_curie"), @Index(columnList = "isadescendants_curie") }) + @JoinTable(name = "ontologyterm_isa_ancestor_descendant", indexes = { + @Index(name = "ontologyterm_isa_ancestor_descendant_isancestors_index", columnList = "isaancestors_id"), + @Index(name = "ontologyterm_isa_ancestor_descendant_isadescendants_index", columnList = "isadescendants_id") + }) private Set isaAncestors; @ManyToMany(mappedBy = "isaAncestors") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java index 295fb3e77..03da3ca56 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java @@ -32,8 +32,8 @@ @Schema(name = "GeneToGeneOrthology", description = "POJO that represents orthology between two genes") @AGRCurationSchemaVersion(min = "1.7.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Table(indexes = { - @Index(name = "genetogeneorthology_subjectgene_index", columnList = "subjectgene_curie"), - @Index(name = "genetogeneorthology_objectgene_index", columnList = "objectgene_curie") + @Index(name = "genetogeneorthology_subjectgene_index", columnList = "subjectgene_id"), + @Index(name = "genetogeneorthology_objectgene_index", columnList = "objectgene_id") }) public class GeneToGeneOrthology extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthologyCurated.java b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthologyCurated.java index 7d976d6b2..67b5f2835 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthologyCurated.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthologyCurated.java @@ -30,8 +30,8 @@ @Schema(name = "GeneToGeneOrthologyCurated", description = "POJO that represents curated orthology between two genes") @AGRCurationSchemaVersion(min = "1.7.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class, GeneToGeneOrthology.class }) @Table(indexes = { - @Index(name = "genetogeneorthologycurated_singlereference_index", columnList = "singlereference_curie"), - @Index(name = "genetogeneorthologycurated_evidencecode_index", columnList = "evidencecode_curie") + @Index(name = "genetogeneorthologycurated_singlereference_index", columnList = "singlereference_id"), + @Index(name = "genetogeneorthologycurated_evidencecode_index", columnList = "evidencecode_id") }) public class GeneToGeneOrthologyCurated extends GeneToGeneOrthology { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/NameSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/NameSlotAnnotation.java index 31498d242..2bb5abb5d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/NameSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/NameSlotAnnotation.java @@ -37,7 +37,10 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotation.class }) @Schema(name = "NameSlotAnnotation", description = "POJO representing a name slot annotation") -@Table(indexes = { @Index(name = "nameslotannotation_nametype_index", columnList = "nameType_id"), @Index(name = "nameslotannotation_synonymscope_index", columnList = "synonymScope_id") }) +@Table(indexes = { + @Index(name = "nameslotannotation_nametype_index", columnList = "nameType_id"), + @Index(name = "nameslotannotation_synonymscope_index", columnList = "synonymScope_id") +}) public abstract class NameSlotAnnotation extends SlotAnnotation { @IndexedEmbedded(includeDepth = 1) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java index 9f09e17e1..fde8dd426 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java @@ -38,8 +38,8 @@ public class SlotAnnotation extends AuditedObject { @IndexedEmbedded(includeDepth = 2) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany - @JoinTable(indexes = { @Index(name = "slotannotation_informationcontententity_slotannotation_id_index", columnList = "slotannotation_id"), - @Index(name = "slotannotation_informationcontententity_evidence_curie_index", columnList = "evidence_curie"), + @JoinTable(indexes = { @Index(name = "slotannotation_informationcontententity_slotannotation_index", columnList = "slotannotation_id"), + @Index(name = "slotannotation_informationcontententity_evidence_index", columnList = "evidence_id"), }) @JsonView({ View.FieldsAndLists.class, View.AlleleView.class, View.GeneView.class, View.ConstructView.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleDatabaseStatusSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleDatabaseStatusSlotAnnotation.java index 12748f324..f0978b6e8 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleDatabaseStatusSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleDatabaseStatusSlotAnnotation.java @@ -31,8 +31,8 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotation.class }) @Schema(name = "AlleleDatabaseStatusSlotAnnotation", description = "POJO representing an allele database status slot annotation") -@Table(indexes = { @Index(name = "alleledatabasestatus_singleallele_curie_index", columnList = "singleallele_curie"), - @Index(name = "alleledatabasestatus_databasestatus_id_index", columnList = "databasestatus_id")}) +@Table(indexes = { @Index(name = "alleledatabasestatus_singleallele_index", columnList = "singleallele_id"), + @Index(name = "alleledatabasestatus_databasestatus_index", columnList = "databasestatus_id")}) public class AlleleDatabaseStatusSlotAnnotation extends SlotAnnotation { @OneToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFullNameSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFullNameSlotAnnotation.java index 7aec9a786..43633b7e1 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFullNameSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFullNameSlotAnnotation.java @@ -24,7 +24,7 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { NameSlotAnnotation.class }) @Schema(name = "AlleleFullNameSlotAnnotation", description = "POJO representing an allele full name slot annotation") -@Table(indexes = { @Index(name = "allelefullname_singleallele_curie_index", columnList = "singleallele_curie"), }) +@Table(indexes = { @Index(name = "allelefullname_singleallele_index", columnList = "singleallele_id"), }) public class AlleleFullNameSlotAnnotation extends NameSlotAnnotation { @OneToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotation.java index ae100744d..a8987580e 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotation.java @@ -43,8 +43,8 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotation.class }) @Schema(name = "AlleleFunctionalImpactSlotAnnotation", description = "POJO representing an allele functional impact slot annotation") -@Table(indexes = { @Index(name = "allelefunctionalimpact_singleallele_curie_index", columnList = "singleallele_curie"), - @Index(name = "allelefunctionalimpact_phenotypeterm_curie_index", columnList = "phenotypeterm_curie")}) +@Table(indexes = { @Index(name = "allelefunctionalimpact_singleallele_index", columnList = "singleallele_id"), + @Index(name = "allelefunctionalimpact_phenotypeterm_index", columnList = "phenotypeterm_id")}) public class AlleleFunctionalImpactSlotAnnotation extends SlotAnnotation { @ManyToOne @@ -55,8 +55,8 @@ public class AlleleFunctionalImpactSlotAnnotation extends SlotAnnotation { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @Fetch(FetchMode.SELECT) - @JoinTable(indexes = { @Index(name = "allelefunctionalimpactslotannotation_id_index", columnList = "allelefunctionalimpactslotannotation_id"), - @Index(name = "allelefunctionalimpactslotannotation_functionalimpacts_id_index", columnList = "functionalimpacts_id"), }) + @JoinTable(indexes = { @Index(name = "allelefunctionalimpactsa_vocabterm_afisa_index", columnList = "allelefunctionalimpactslotannotation_id"), + @Index(name = "allelefunctionalimpactsa_vocabterm_functionalimpacts_index", columnList = "functionalimpacts_id"), }) @JsonView({ View.FieldsAndLists.class, View.AlleleView.class }) private List functionalImpacts; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleGermlineTransmissionStatusSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleGermlineTransmissionStatusSlotAnnotation.java index 157ebc4a1..a0a3b56b8 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleGermlineTransmissionStatusSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleGermlineTransmissionStatusSlotAnnotation.java @@ -30,8 +30,8 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotation.class }) @Schema(name = "AlleleGermlineTransmissionStatusSlotAnnotation", description = "POJO representing an allele germline transmission status slot annotation") -@Table(indexes = { @Index(name = "allelegermlinetransmissionstatus_singleallele_curie_index", columnList = "singleallele_curie"), - @Index(name = "allelegermlinetransmissionstatus_status_id_index", columnList = "germlinetransmissionstatus_id")}) +@Table(indexes = { @Index(name = "allelegermlinetransmissionstatus_singleallele_index", columnList = "singleallele_id"), + @Index(name = "allelegermlinetransmissionstatus_status_index", columnList = "germlinetransmissionstatus_id")}) public class AlleleGermlineTransmissionStatusSlotAnnotation extends SlotAnnotation { @ManyToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotation.java index fc1d8b699..fa78311ba 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotation.java @@ -37,9 +37,9 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotation.class }) @Schema(name = "AlleleInheritanceModeSlotAnnotation", description = "POJO representing an allele inheritance mode slot annotation") -@Table(indexes = { @Index(name = "alleleinheritancemode_singleallele_curie_index", columnList = "singleallele_curie"), - @Index(name = "alleleinheritancemode_inheritancemode_id_index", columnList = "inheritancemode_id"), - @Index(name = "alleleinheritancemode_phenotypeterm_curie_index", columnList = "phenotypeterm_curie")}) +@Table(indexes = { @Index(name = "alleleinheritancemode_singleallele_index", columnList = "singleallele_id"), + @Index(name = "alleleinheritancemode_inheritancemode_index", columnList = "inheritancemode_id"), + @Index(name = "alleleinheritancemode_phenotypeterm_index", columnList = "phenotypeterm_id")}) public class AlleleInheritanceModeSlotAnnotation extends SlotAnnotation { @ManyToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotation.java index 8a02fcba8..59cd8a4cd 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotation.java @@ -36,7 +36,7 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotation.class }) @Schema(name = "AlleleMutationtTypeSlotAnnotation", description = "POJO representing an allele mutation type slot annotation") -@Table(indexes = { @Index(name = "allelemutationtype_singleallele_curie_index", columnList = "singleallele_curie") }) +@Table(indexes = { @Index(name = "allelemutationtype_singleallele_index", columnList = "singleallele_id") }) public class AlleleMutationTypeSlotAnnotation extends SlotAnnotation { @ManyToOne @@ -47,8 +47,8 @@ public class AlleleMutationTypeSlotAnnotation extends SlotAnnotation { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @Fetch(FetchMode.SELECT) - @JoinTable(indexes = { @Index(name = "allelemutationtypeslotannotation_id_index", columnList = "allelemutationtypeslotannotation_id"), - @Index(name = "allelemutationtypeslotannotation_mutationtypes_curie_index", columnList = "mutationtypes_curie"), }) + @JoinTable(indexes = { @Index(name = "allelemutationtypesa_soterm_amsa_index", columnList = "allelemutationtypeslotannotation_id"), + @Index(name = "allelemutationtypesa_soterm_mutationtypes_index", columnList = "mutationtypes_id"), }) @JsonView({ View.FieldsAndLists.class, View.AlleleView.class }) private List mutationTypes; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleNomenclatureEventSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleNomenclatureEventSlotAnnotation.java index cfacf2469..0b893ea78 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleNomenclatureEventSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleNomenclatureEventSlotAnnotation.java @@ -30,8 +30,8 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotation.class }) @Schema(name = "AlleleNomenclatureSlotAnnotation", description = "POJO representing an allele nomenclature event slot annotation") -@Table(indexes = { @Index(name = "allelenomenclatureevent_singleallele_curie_index", columnList = "singleallele_curie"), - @Index(name = "allelenomenclatureevent_nomenclatureevent_id_index", columnList = "nomenclatureevent_id")}) +@Table(indexes = { @Index(name = "allelenomenclatureevent_singleallele_index", columnList = "singleallele_id"), + @Index(name = "allelenomenclatureevent_nomenclatureevent_index", columnList = "nomenclatureevent_id")}) public class AlleleNomenclatureEventSlotAnnotation extends SlotAnnotation { @ManyToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSecondaryIdSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSecondaryIdSlotAnnotation.java index 3ed08e607..3624ff1d0 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSecondaryIdSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSecondaryIdSlotAnnotation.java @@ -25,7 +25,7 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotation.class }) @Schema(name = "AlleleSecondaryIdSlotAnnotation", description = "POJO representing an allele secondary ID slot annotation") -@Table(indexes = { @Index(name = "allelesecondaryid_singleallele_curie_index", columnList = "singleallele_curie"), }) +@Table(indexes = { @Index(name = "allelesecondaryid_singleallele_index", columnList = "singleallele_id"), }) public class AlleleSecondaryIdSlotAnnotation extends SecondaryIdSlotAnnotation { @ManyToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSymbolSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSymbolSlotAnnotation.java index 5467ec8c8..9a7d829c5 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSymbolSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSymbolSlotAnnotation.java @@ -24,7 +24,7 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { NameSlotAnnotation.class }) @Schema(name = "AlleleSymbolSlotAnnotation", description = "POJO representing an allele symbol slot annotation") -@Table(indexes = { @Index(name = "allelesymbol_singleallele_curie_index", columnList = "singleallele_curie"), }) +@Table(indexes = { @Index(name = "allelesymbol_singleallele_index", columnList = "singleallele_id"), }) public class AlleleSymbolSlotAnnotation extends NameSlotAnnotation { @OneToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSynonymSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSynonymSlotAnnotation.java index db7fa3aa2..31ef845ed 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSynonymSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSynonymSlotAnnotation.java @@ -24,7 +24,7 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { NameSlotAnnotation.class }) @Schema(name = "AlleleSynonymSlotAnnotation", description = "POJO representing an allele synonym slot annotation") -@Table(indexes = { @Index(name = "allelesynonym_singleallele_curie_index", columnList = "singleallele_curie"), }) +@Table(indexes = { @Index(name = "allelesynonym_singleallele_index", columnList = "singleallele_id"), }) public class AlleleSynonymSlotAnnotation extends NameSlotAnnotation { @ManyToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructComponentSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructComponentSlotAnnotation.java index ec7b38747..0cc08140c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructComponentSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructComponentSlotAnnotation.java @@ -50,7 +50,7 @@ @Table(indexes = { @Index(name = "constructcomponentslotannotation_singleconstruct_index", columnList = "singleConstruct_id"), @Index(name = "constructcomponentslotannotation_componentsymbol_index", columnList = "componentSymbol"), - @Index(name = "constructcomponentslotannotation_taxon_index", columnList = "taxon_curie"), + @Index(name = "constructcomponentslotannotation_taxon_index", columnList = "taxon_id"), @Index(name = "constructcomponentslotannotation_relation_index", columnList = "relation_id") }) public class ConstructComponentSlotAnnotation extends SlotAnnotation { @@ -89,6 +89,6 @@ public class ConstructComponentSlotAnnotation extends SlotAnnotation { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @OneToMany @JsonView({ View.FieldsAndLists.class, View.ConstructView.class }) - @JoinTable(indexes = { @Index(name = "constructcomponentsa_note_ccsa_id_index", columnList = "constructcomponentslotannotation_id"), @Index(name = "constructcomponentsa_note_relatednotes_id_index",columnList = "relatednotes_id")}) + @JoinTable(indexes = { @Index(name = "constructcomponentsa_note_ccsa_index", columnList = "constructcomponentslotannotation_id"), @Index(name = "constructcomponentsa_note_relatednotes_index",columnList = "relatednotes_id")}) private List relatedNotes; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructFullNameSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructFullNameSlotAnnotation.java index 6f0619769..235ba7c26 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructFullNameSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructFullNameSlotAnnotation.java @@ -24,7 +24,7 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.10.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { NameSlotAnnotation.class }) @Schema(name = "ConstructFullNameSlotAnnotation", description = "POJO representing a construct full name slot annotation") -@Table(indexes = { @Index(name = "constructfullname_singleconstruct_id_index", columnList = "singleconstruct_id"), }) +@Table(indexes = { @Index(name = "constructfullname_singleconstruct_index", columnList = "singleconstruct_id"), }) public class ConstructFullNameSlotAnnotation extends NameSlotAnnotation { @OneToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSymbolSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSymbolSlotAnnotation.java index 8bde4841d..833485194 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSymbolSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSymbolSlotAnnotation.java @@ -24,7 +24,7 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.10.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { NameSlotAnnotation.class }) @Schema(name = "ConstructSymbolSlotAnnotation", description = "POJO representing a construct symbol slot annotation") -@Table(indexes = { @Index(name = "constructsymbol_singleconstruct_id_index", columnList = "singleconstruct_id"), }) +@Table(indexes = { @Index(name = "constructsymbol_singleconstruct_index", columnList = "singleconstruct_id"), }) public class ConstructSymbolSlotAnnotation extends NameSlotAnnotation { @OneToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSynonymSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSynonymSlotAnnotation.java index 75cafa636..556d1a3d9 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSynonymSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSynonymSlotAnnotation.java @@ -24,7 +24,7 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.10.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { NameSlotAnnotation.class }) @Schema(name = "ConstructSynonymSlotAnnotation", description = "POJO representing a construct synonym slot annotation") -@Table(indexes = { @Index(name = "constructsynonym_singleconstruct_id_index", columnList = "singleconstruct_id"), }) +@Table(indexes = { @Index(name = "constructsynonym_singleconstruct_index", columnList = "singleconstruct_id"), }) public class ConstructSynonymSlotAnnotation extends NameSlotAnnotation { @ManyToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneFullNameSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneFullNameSlotAnnotation.java index e9dedd885..32789765e 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneFullNameSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneFullNameSlotAnnotation.java @@ -24,7 +24,7 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { NameSlotAnnotation.class }) @Schema(name = "GeneFullNameSlotAnnotation", description = "POJO representing a gene full name slot annotation") -@Table(indexes = { @Index(name = "genefullname_singlegene_curie_index", columnList = "singlegene_curie"), }) +@Table(indexes = { @Index(name = "genefullname_singlegene_index", columnList = "singlegene_id"), }) public class GeneFullNameSlotAnnotation extends NameSlotAnnotation { @OneToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSecondaryIdSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSecondaryIdSlotAnnotation.java index 09d942abf..ef558b85c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSecondaryIdSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSecondaryIdSlotAnnotation.java @@ -25,7 +25,7 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.7.2", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotation.class }) @Schema(name = "GeneSecondaryIdSlotAnnotation", description = "POJO representing a gene secondary ID slot annotation") -@Table(indexes = { @Index(name = "genesecondaryid_singlegene_curie_index", columnList = "singlegene_curie"), }) +@Table(indexes = { @Index(name = "genesecondaryid_singlegene_index", columnList = "singlegene_id"), }) public class GeneSecondaryIdSlotAnnotation extends SecondaryIdSlotAnnotation { @ManyToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSymbolSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSymbolSlotAnnotation.java index e4abd7525..9793e2b7f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSymbolSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSymbolSlotAnnotation.java @@ -24,7 +24,7 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { NameSlotAnnotation.class }) @Schema(name = "GeneSymbolSlotAnnotation", description = "POJO representing a gene symbol slot annotation") -@Table(indexes = { @Index(name = "genesymbol_singlegene_curie_index", columnList = "singlegene_curie"), }) +@Table(indexes = { @Index(name = "genesymbol_singlegene_index", columnList = "singlegene_id"), }) public class GeneSymbolSlotAnnotation extends NameSlotAnnotation { @OneToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSynonymSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSynonymSlotAnnotation.java index b50105383..04cce7d28 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSynonymSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSynonymSlotAnnotation.java @@ -24,7 +24,7 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { NameSlotAnnotation.class }) @Schema(name = "GeneSynonymSlotAnnotation", description = "POJO representing a gene synonym slot annotation") -@Table(indexes = { @Index(name = "genesynonym_singlegene_curie_index", columnList = "singlegene_curie"), }) +@Table(indexes = { @Index(name = "genesynonym_singlegene_index", columnList = "singlegene_id"), }) public class GeneSynonymSlotAnnotation extends NameSlotAnnotation { @ManyToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSystematicNameSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSystematicNameSlotAnnotation.java index 2c1d31036..8091c2a71 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSystematicNameSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSystematicNameSlotAnnotation.java @@ -24,7 +24,7 @@ @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { NameSlotAnnotation.class }) @Schema(name = "GeneSystematicNameSlotAnnotation", description = "POJO representing a gene systematic name slot annotation") -@Table(indexes = { @Index(name = "genesystematicname_singlegene_curie_index", columnList = "singlegene_curie"), }) +@Table(indexes = { @Index(name = "genesystematicname_singlegene_index", columnList = "singlegene_id"), }) public class GeneSystematicNameSlotAnnotation extends NameSlotAnnotation { @OneToOne diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/NoteValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/NoteValidator.java index 56afad20c..1488c5214 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/NoteValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/NoteValidator.java @@ -80,6 +80,9 @@ public Note validateNote(Note uiEntity, String noteVocabularySetName, Boolean th } else { dbEntity.setReferences(null); } + + if (dbEntity.getInternal() == null) + dbEntity.setInternal(true); if (response.hasErrors()) { if (throwError) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/NoteDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/NoteDTOValidator.java index f1dc5668e..2a7a710d0 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/NoteDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/NoteDTOValidator.java @@ -65,6 +65,9 @@ public ObjectResponse validateNoteDTO(NoteDTO dto, String noteTypeVocabula } else { note.setReferences(null); } + + if (note.getInternal() == null) + note.setInternal(true); noteResponse.setEntity(note); diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index b9e3c2b88..4af9fa3a1 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -13,5 +13,969 @@ ALTER TABLE allelegeneassociation_aud RENAME objectgene_curie TO object_curie; ALTER INDEX gene_taxon_index RENAME TO gene_genetype_index; -ALTER TABLE organization DROP COLUMN uniqueid; -ALTER TABLE organization_aud DROP COLUMN uniqueid; \ No newline at end of file +ALTER TABLE organization DROP COLUMN IF EXISTS uniqueid; +ALTER TABLE organization_aud DROP COLUMN IF EXISTS uniqueid; + +DROP TABLE paperhandle; +DROP TABLE paperhandle_aud; + +-- Drop indexes and constraints + +ALTER TABLE affectedgenomicmodel DROP CONSTRAINT affectedgenomicmodel_pkey; +ALTER TABLE affectedgenomicmodel DROP CONSTRAINT fkke1qw7ijaa33fqv1bifsiwiv9; + +ALTER TABLE affectedgenomicmodel_aud DROP CONSTRAINT affectedgenomicmodel_aud_pkey; +ALTER TABLE affectedgenomicmodel_aud DROP CONSTRAINT fkd6m9in16kh1tqvln37a13r3hx; + +ALTER TABLE agmdiseaseannotation DROP CONSTRAINT agmdiseaseannotation_assertedallele_curie_fk; +ALTER TABLE agmdiseaseannotation DROP CONSTRAINT fk_agmdasubject +ALTER TABLE agmdiseaseannotation DROP CONSTRAINT fko9dilcfxv6tw0oaeds0yss8op; +ALTER TABLE agmdiseaseannotation RENAME CONSTRAINT fkp1rktcpoyvnr2f756ncdb8k24 TO agmdiseaseannotation_id_fk; +ALTER TABLE agmdiseaseannotation DROP CONSTRAINT fktj1uj3to13fi4q32bc2p65lah; + +ALTER TABLE agmdiseaseannotation_aud RENAME CONSTRAINT fkl6x226295n9ms1kugrsi88efp TO agmdiseaseannotation_aud_id_rev_fk; + +ALTER TABLE agmdiseaseannotation_gene DROP CONSTRAINT agmdiseaseannotation_gene_assertedgenes_curie_fk; +ALTER INDEX idxbcpc5ib23w0ssq0wskm99vxmq RENAME TO agmdiseaseannotation_gene_agmdiseaseannotation_index; + +ALTER TABLE agmdiseaseannotation_gene_aud RENAME CONSTRAINT fkrbw9608l4haci5t3w3ll9xmcu TO agmdiseaseannotation_gene_aud_rev_fk; + +ALTER TABLE allele DROP CONSTRAINT allele_pkey; +ALTER TABLE allele DROP CONSTRAINT fk42r7586hi59wcwakfyr30l6l3; + +ALTER TABLE allele_aud DROP CONSTRAINT allele_aud_pkey; +ALTER TABLE allele_aud DROP CONSTRAINT fkc4cub43jynmwqke9rpwpglhkt; + +ALTER TABLE allele_note DROP CONSTRAINT allele_note_allele_curie_fk; +ALTER TABLE allele_note DROP CONSTRAINT uk_3ja9wii4jxp0krcfpturumjhb; +ALTER TABLE allele_note RENAME CONSTRAINT allele_note_relatednotes_id_key TO allele_note_relatednotes_id_uk; +ALTER INDEX idx3ja9wii4jxp0krcfpturumjhb RENAME TO allele_note_relatednotes_index; +DROP INDEX idx50j986kkb5ymfepkamokl1q9w; + +ALTER TABLE allele_note_aud DROP CONSTRAINT allele_note_aud_pkey; + +ALTER TABLE allele_reference DROP CONSTRAINT allele_reference_allele_curie_fk; +ALTER TABLE allele_reference DROP CONSTRAINT allele_reference_references_curie_fk; +DROP INDEX idx4jhjumoyh806jhpi2c0cf3t7w; +DROP INDEX idxo6e5hexti6nfdj1v6ytnlwjvd; +DROP INDEX idxsfk08sqo0k364ixvsd8iui53i; + +ALTER TABLE allele_reference_aud DROP CONSTRAINT allele_reference_aud_pkey; +ALTER TABLE allele_reference_aud RENAME CONSTRAINT fkhuya942qqdhsi6m0v37njxh30 TO allele_reference_aud_rev_fk; + +ALTER TABLE alleledatabasestatusslotannotation DROP CONSTRAINT alleledatabasestatus_singleallele_curie_fk; +ALTER INDEX alleledatabasestatus_databasestatus_id_index RENAME TO alleledatabasestatus_databasestatus_index; +DROP INDEX alleledatabasestatus_singleallele_curie_index; + +ALTER TABLE allelediseaseannotation DROP CONSTRAINT fk_alleledasubject; +ALTER TABLE allelediseaseannotation RENAME CONSTRAINT fk3unb0kaxocbodllqe35hu4w0c TO allelediseaseannotation_id_fk; +ALTER TABLE allelediseaseannotation DROP CONSTRAINT fknecrivvmqgg2ifhppubrjy5ey; +DROP INDEX allelediseaseannotation_inferredgene_index; +DROP INDEX allelediseaseannotation_subject_index; + +ALTER TABLE allelediseaseannotation_gene DROP CONSTRAINT allelediseaseannotation_gene_assertedgenes_curie_fk; +ALTER INDEX idxgb71atjgxqcgqnronvuprq8g4 RENAME TO allelediseaseannotationgene_diseaseannotation_index; +DROP INDEX idxf6sdkewbxohussr4fs7440vj5; + +ALTER TABLE allelefullnameslotannotation DROP CONSTRAINT allelefullname_singleallele_curie_fk; +DROP INDEX allelefullname_singleallele_curie_index; + +ALTER TABLE allelefunctionalimpactslotannotation DROP CONSTRAINT allelefunctionalimpactslotannotation_singleallele_curie_fk; +ALTER TABLE allelefunctionalimpactslotannotation RENAME CONSTRAINT fkng1x5duqyvks0enxdtr7andrl TO allelefunctionalimpactslotannotation_id_fk; +ALTER TABLE allelefunctionalimpactslotannotation DROP CONSTRAINT allelefunctionalimpactslotannotation_phenotypeterm_curie_fk; + +ALTER TABLE allelefunctionalimpactslotannotation_vocabularyterm RENAME CONSTRAINT allelefunctionalimpactsa_vocabterm_afisa_curie_fk TO allelefunctionalimpactsa_vocabterm_afisa_id_fk; +ALTER TABLE allelefunctionalimpactslotannotation_vocabularyterm RENAME CONSTRAINT allelefunctionalimpactsa_vocabterm_functionimpacts_id_fk TO allelefunctionalimpactsa_vocabterm_functionalimpacts_id_fk; +ALTER INDEX allelefunctionalimpactslotannotation_functionalimpacts_id_index RENAME TO allelefunctionalimpactsa_vocabterm_functionalimpacts_index; +ALTER INDEX allelefunctionalimpactslotannotation_id_index TO allelefunctionalimpactsa_vocabterm_afisa_index; + +ALTER TABLE allelegeneassociation DROP CONSTRAINT allelegeneassociation_object_curie_fk; +ALTER TABLE allelegeneassociation DROP CONSTRAINT allelegeneassociation_subject_curie_fk; +DROP INDEX allelegeneassociation_object_index; +DROP INDEX allelegeneassociation_subject_index; + +ALTER TABLE allelegenomicentityassociation DROP CONSTRAINT allelegenomicentityassociation_evidencecode_curie_fk; +ALTER TABLE allelegenomicentityassociation RENAME CONSTRAINT fk1qks8xk2i7ml0qnhgx8q6ieex TO allelegenomicentityassociation_id_fk; + +ALTER TABLE allelegermlinetransmissionstatusslotannotation DROP CONSTRAINT allelegermlinetransmissionstatus_singleallele_curie_fk; +ALTER TABLE allelegermlinetransmissionstatusslotannotation RENAME CONSTRAINT fkimjfrsvtapxj0gl4ocsfc68iy TO allelegermlinetransmissionstatus_id_fk; +ALTER INDEX allelegermlinetransmissionstatus_status_id_index RENAME TO allelegermlinetransmissionstatus_status_index; + +ALTER TABLE alleleinheritancemodeslotannotation DROP CONSTRAINT alleleinheritancemodeslotannotation_phenotypeterm_curie_fk; +ALTER TABLE alleleinheritancemodeslotannotation DROP CONSTRAINT fkcgj3a3skh2a666q8wvehcs1pw; +DROP INDEX alleleinheritancemode_phenotypeterm_curie_index; +DROP INDEX alleleinheritancemode_singleallele_curie_index; +ALTER INDEX alleleinheritancemode_inheritancemode_id_index RENAME TO alleleinheritancemode_inheritancemode_index; + +ALTER TABLE allelemutationtypeslotannotation DROP CONSTRAINT allelemutationtypeslotannotation_singleallele_curie_fk; +DROP INDEX allelemutationtype_singleallele_curie_index; + +ALTER TABLE allelemutationtypeslotannotation_soterm RENAME CONSTRAINT allelemutationtypeslotannotation_aud_amsa_id_fk TO allelemutationtypesa_soterm_amsa_id_fk; +ALTER TABLE allelemutationtypeslotannotation_soterm DROP CONSTRAINT allelemutationtypeslotannotation_aud_mutationtypes_curie_fk; +ALTER INDEX allelemutationtypeslotannotation_id_index RENAME TO allelemutationtypesa_soterm_amsa_index; + +ALTER TABLE allelenomenclatureeventslotannotation DROP CONSTRAINT allelenomenclatureeventslotannotation_singleallele_curie_fk; +DROP INDEX allelenomenclatureevent_singleallele_curie_index; +ALTER INDEX allelenomenclatureevent_nomenclatureevent_id_index RENAME TO allelenomenclatureevent_nomenclatureevent_index; + +ALTER TABLE allelesecondaryidslotannotation DROP CONSTRAINT allelesecondaryidslotannotation_singleallele_curie_fk; +ALTER TABLE allelesecondaryidslotannotation RENAME CONSTRAINT fko6369ool2dxdy8odi2i9brj4r TO allelesecondaryidslotannotation_id_fk; +DROP INDEX allelesecondaryid_singleallele_curie_index; + +ALTER TABLE allelesymbolslotannotation DROP CONSTRAINT allelesymbolslotannotation_singleallele_curie_fk; +DROP INDEX allelesymbol_singleallele_curie_index; + +ALTER TABLE allelesynonymslotannotation DROP CONSTRAINT allelesynonymslotannotation_singleallele_curie_fk; +DROP INDEX allelesynonym_singleallele_curie_index; + +ALTER TABLE anatomicalterm DROP CONSTRAINT anatomicalterm_pkey; +ALTER TABLE anatomicalterm DROP CONSTRAINT fkfepti479fro1b09ybaltkofqu; + +ALTER TABLE anatomicalterm_aud DROP CONSTRAINT antomicalterm_aud_pkey; +ALTER TABLE anatomicalterm_aud DROP CONSTRAINT fkan2c886jcsep01s7rqibfghfh; + +ALTER INDEX annotation_conditionrelation_annotation_id_index RENAME TO annotation_conditionrelation_annotation_index; +ALTER INDEX annotation_conditionrelation_conditionrelations_id_index RENAME TO annotation_conditionrelation_conditionrelations_index; + +ALTER TABLE annotation_note RENAME CONSTRAINT fks4im5g992bpgi6wa1rp9y8vil TO annotation_note_annotation_id_fk; +ALTER INDEX annotation_note_annotation_id_index RENAME TO annotation_note_annotation_index; +ALTER INDEX annotation_note_relatednotes_id_index RENAME TO annotation_note_relatednotes_index; + +ALTER TABLE apoterm DROP CONSTRAINT apoterm_pkey; +ALTER TABLE apoterm DROP CONSTRAINT apoterm_curie_fk; + +ALTER TABLE apoterm_aud DROP CONSTRAINT apoterm_aud_pkey; +ALTER TABLE apoterm_aud DROP CONSTRAINT apoterm_aud_curie_rev_fk; + +ALTER TABLE atpterm DROP CONSTRAINT atpterm_pkey; +ALTER TABLE atpterm DROP CONSTRAINT fksnxpka3rhxycguxrcyfyobtjf; + +ALTER TABLE atpterm_aud DROP CONSTRAINT atpterm_aud_pkey; +ALTER TABLE atpterm_aud DROP CONSTRAINT fki65mb9a7b4el107fk4ox2f0kd; + +ALTER TABLE biologicalentity DROP CONSTRAINT biologicalentity_pkey; +ALTER TABLE biologicalentity DROP CONSTRAINT fk5c19vicptarinu2wgj7xyhhum; +DROP INDEX biologicalentity_taxon_index; + +ALTER TABLE biologicalentity_aud DROP CONSTRAINT biologicalentity_aud_pkey; +ALTER TABLE biologicalentity_aud DROP CONSTRAINT fk5hkwd2k49xql5qy0aby85qtad; + +ALTER TABLE bspoterm_aud DROP CONSTRAINT bspoterm_aud_pkey; +ALTER TABLE bspoterm_aud DROP CONSTRAINT bspoterm_aud_curie_rev_fk; + +ALTER TABLE bulkload_aud DROP CONSTRAINT fkhhh8994753467hwa33blp22dc; + +ALTER TABLE bulkloadfile_aud DROP CONSTRAINT fk7sl5m81qa11sr40chch9vg6uj; + +ALTER TABLE bulkloadfileexception_aud DROP CONSTRAINT fkm7op2ir0vi9pwcctl39kqbo70; + +ALTER TABLE bulkloadfilehistory_aud DROP CONSTRAINT fkppa5tcqtwv560svqkq6b958hc; + +ALTER TABLE bulkloadgroup_aud DROP CONSTRAINT fk722g0iotb8v01pq0cej3w7gke; + +ALTER TABLE chebiterm DROP CONSTRAINT chebiterm_pkey; +ALTER TABLE chebiterm DROP CONSTRAINT fk7enwyeblw2xt5yo5co0keko5f; + +ALTER TABLE chebiterm_aud DROP CONSTRAINT chebiterm_aud_pkey; +ALTER TABLE chebiterm_aud DROP CONSTRAINT fk7grscrrhdcw9ek6agi78j4ca1; + +ALTER TABLE chemicalterm DROP CONSTRAINT chemicalterm_pkey; +ALTER TABLE chemicalterm DROP CONSTRAINT fk2fegif3wy9egh5r2yy8wplrwu; + +ALTER TABLE chemicalterm_aud DROP CONSTRAINT chemicalterm_aud_pkey; +ALTER TABLE chemicalterm_aud DROP CONSTRAINT fkieeg5x1a11dqom8dw4valm169; + +ALTER TABLE clterm DROP CONSTRAINT clterm_pkey; +ALTER TABLE clterm DROP CONSTRAINT clterm_curie_fk; + +ALTER TABLE clterm_aud DROP CONSTRAINT clterm_aud_pkey; +ALTER TABLE clterm_aud DROP CONSTRAINT clterm_aud_curie_rev_fk; + +ALTER TABLE cmoterm DROP CONSTRAINT clterm_pkey; +ALTER TABLE cmoterm DROP CONSTRAINT clterm_curie_fk; + +ALTER TABLE cmoterm_aud DROP CONSTRAINT cmoterm_aud_pkey; +ALTER TABLE cmoterm_aud DROP CONSTRAINT cmoterm_aud_curie_rev_fk; + +ALTER TABLE conditionrelation RENAME CONSTRAINT fkn8t4joy3iheftpbxt0omvxl52 TO conditionrelation_conditionrelationtype_id_fk; +ALTER TABLE conditionrelation DROP CONSTRAINT conditionrelation_singlereference_curie_fk; + +ALTER TABLE conditionrelation_aud DROP CONSTRAINT fkkcw0iu1vmw6ttm7g645947yyy; + +ALTER TABLE construct_reference DROP CONSTRAINT construct_reference_references_curie_fk; +ALTER INDEX construct_reference_construct_id_index TO construct_reference_construct_index; +DROP INDEX construct_reference_references_curie_index; + +ALTER TABLE constructcomponentslotannotation DROP CONSTRAINT constructcomponentslotannotation_taxon_curie_fk; +DROP INDEX constructcomponentslotannotation_taxon_index; + +ALTER INDEX constructcomponentsa_note_ccsa_id_index RENAME TO constructcomponentsa_note_ccsa_index; +ALTER INDEX constructcomponentsa_note_relatednotes_id_index RENAME TO constructcomponentsa_note_relatednotes_index + +ALTER INDEX constructfullname_singleconstruct_id_index RENAME TO constructfullname_singleconstruct_index; + +ALTER TABLE constructgenomicentityassociation DROP CONSTRAINT constructgenomicentityassociation_object_curie_fk; +ALTER TABLE constructgenomicentityassociation RENAME CONSTRAINT fkgrhw9gxslaub14x4b0mc7v9mk TO constructgenomicentityassociation_id_fk; +DROP INDEX constructgenomicentityassociation_object_index; + +ALTER INDEX cgeassociation_note_cgeassociation_id_index RENAME TO cgeassociation_note_cgeassociation_index; +ALTER INDEX cgeassociation_note_relatednotes_id_index RENAME TO cgeassociation_note_relatednotes_index; + +ALTER INDEX constructsymbol_singleconstruct_id_index RENAME TO constructsymbol_singleconstruct_index; + +ALTER INDEX constructsynonym_singleconstruct_id_index RENAME TO constructsynonym_singleconstruct_index; + +ALTER TABLE crossreference_aud DROP CONSTRAINT fkricj7nn0u0fec2l2r2fo7al55; + +ALTER TABLE curationreport_aud DROP CONSTRAINT fks2fh7j9mb60yfxyd83gklhgmo; + +ALTER TABLE curationreportgroup_aud DROP CONSTRAINT fk7pl1pmjstb9eqi80e353a06v8; + +ALTER TABLE curationreporthistory_aud DROP CONSTRAINT fk5mffk8y6qajllde8m24dwjn9v; + +ALTER TABLE daoterm DROP CONSTRAINT daoterm_pkey; +ALTER TABLE daoterm DROP CONSTRAINT fk3xjbjyyuqqyvspspeael1m7fe; + +ALTER TABLE daoterm_aud DROP CONSTRAINT daoterm_aud_pkey; +ALTER TABLE daoterm_aud DROP CONSTRAINT fkgif1cep78abowfodb5rxvoq1x; + +ALTER TABLE dataprovider_aud DROP CONSTRAINT fk66rd9ltf5l9paxmvyr63tcqwf; + +ALTER TABLE diseaseannotation DROP CONSTRAINT diseaseannotation_object_curie_fk; +DROP INDEX diseaseannotation_object_index; + +ALTER TABLE diseaseannotation_biologicalentity DROP CONSTRAINT diseaseannotation_biologicalentity_dgm_curie_fk; +ALTER INDEX idxa408leg4b6rrhx0e0e35yno7t RENAME TO diseaseannotation_biologicalentity_diseaseannotation_index; +DROP INDEX idxon9a94gwp0jl6t2sfjqv0iwa5; + +ALTER TABLE diseaseannotation_ecoterm RENAME CONSTRAINT idxon9a94gwp0jl6t2sfjqv0iwa5 TO diseaseannotation_ecoterm_diseaseannotation_id_fk; +ALTER TABLE diseaseannotation_ecoterm DROP CONSTRAINT fkp79bf46xsyojpvjjguoe3vuuu; +DROP INDEX idx3u0swr7xss7wjjve7ocd08u27; +ALTER INDEX idxntbiegjxs3ooqy894m4y5vgwb RENAME TO diseaseannotation_ecoterm_diseaseannotation_index; + +ALTER TABLE diseaseannotation_gene DROP CONSTRAINT fk6akpr16qusnfom0fdhjjevkb2; +ALTER TABLE diseaseannotation_gene RENAME CONSTRAINT fky4jlhsgseecd3gkxjtwp28ba TO diseaseannotation_gene_diseaseannotation_id_fk; +DROP INDEX idxc8bxs3ggb4rt2kmnqja0js5mq; +ALTER INDEX idxj6eavg6eannqn6uhvja6p4enf RENAME TO diseaseannotation_gene_diseaseannotation_index; + +ALTER TABLE diseaseannotation_vocabularyterm RENAME CONSTRAINT fk7jhlm01yyrnyd26c5extqi9iv TO diseaseannotation_vocabularyterm_diseasequalifiers_id_fk; +ALTER TABLE diseaseannotation_vocabularyterm RENAME CONSTRAINT fkb7dg8qvpicnh87s0162sn62gl TO diseaseannotation_vocabularyterm_diseaseannotation_id_fk; +ALTER INDEX idxbnb14fsatd291upd9af38fnyp RENAME TO diseaseannotation_vocabularyterm_diseasequalifiers_index; +ALTER INDEX idxc8oiw5qoippfjl0b6s9oegiss RENAME TO diseaseannotation_vocabularyterm_diseaseannotation_index; + +ALTER TABLE doterm DROP CONSTRAINT doterm_pkey; +ALTER TABLE doterm DROP CONSTRAINT fkp8el2duba9ym3l6gd5dy43swk; + +ALTER TABLE doterm_aud DROP CONSTRAINT doterm_aud_pkey; +ALTER TABLE doterm_aud DROP CONSTRAINT fkkgu80ih0f55tskr386gucsqh2; + +ALTER TABLE dpoterm DROP CONSTRAINT dpoterm_pkey; +ALTER TABLE dpoterm DROP CONSTRAINT dpoterm_curie_fk; + +ALTER TABLE dpoterm_aud DROP CONSTRAINT dpoterm_aud_pkey; +ALTER TABLE dpoterm_aud DROP CONSTRAINT dpoterm_aud_curie_rev_fk; + +ALTER TABLE ecoterm DROP CONSTRAINT doterm_pkey; +ALTER TABLE ecoterm DROP CONSTRAINT fkskvp24kfp723htxmk0m9ev4ns; + +ALTER TABLE ecoterm_aud DROP CONSTRAINT doterm_aud_pkey; +ALTER TABLE ecoterm_aud DROP CONSTRAINT fkrdtwy8r0gnnh6numgdbgi9e6s; + +ALTER TABLE emapaterm DROP CONSTRAINT emapaterm_pkey; +ALTER TABLE emapaterm DROP CONSTRAINT fkcm3tpjo7lxsx61pj7gs5y9f9u; + +ALTER TABLE emapaterm_aud DROP CONSTRAINT emapaterm_aud_pkey; +ALTER TABLE emapaterm_aud DROP CONSTRAINT fkaipxoy4lm50q9mphk2yp7whyh; + +ALTER TABLE evidenceassociation_informationcontententity DROP CONSTRAINT evidenceassociation_infocontent_evidence_curie_fk; +ALTER INDEX evidenceassociation_infocontent_evidenceassociation_id_index RENAME TO evidenceassociation_infocontent_evidenceassociation_index; +DROP INDEX evidenceassociation_infocontent_evidence_curie_index; + +ALTER TABLE experimentalcondition DROP CONSTRAINT fk2rmhalgeg6rghpat78b2cpcoc; +ALTER TABLE experimentalcondition DROP CONSTRAINT fkagp6m2xqeu7bapu5hyh2pmha9; +ALTER TABLE experimentalcondition DROP CONSTRAINT fkcl89ywjgllce228a0uo8fd0ee; +ALTER TABLE experimentalcondition DROP CONSTRAINT fkhi2109btsx06x2u9kdg7y7xp0; +ALTER TABLE experimentalcondition DROP CONSTRAINT fkp0oqdnt9bmx68i84neufkcb3a; +ALTER TABLE experimentalcondition DROP CONSTRAINT fksso9a3875a8t0ver6u6qciuap; + +ALTER TABLE experimentalconditionontologyterm DROP CONSTRAINT experimentalconditionontologyterm_pkey; +ALTER TABLE experimentalconditionontologyterm DROP CONSTRAINT fk5jlaea2evnqnrlf72jglhqq6p; + +ALTER TABLE experimentalconditionontologyterm_aud DROP CONSTRAINT experimentalconditionontologyterm_aud_pkey; +ALTER TABLE experimentalconditionontologyterm_aud DROP CONSTRAINT fkkr4o08hq0jboq6g4ou5gmn8xd; + +ALTER TABLE fbdvterm DROP CONSTRAINT fbdvterm_pkey; +ALTER TABLE fbdvterm DROP CONSTRAINT fkn7q3y19l70sef1h4f9ippnjoa; + +ALTER TABLE fbdvterm_aud DROP CONSTRAINT fbdvterm_aud_pkey; +ALTER TABLE fbdvterm_aud DROP CONSTRAINT fkvtaradvq4e6fdjecf2m4ujap; + +ALTER TABLE gene DROP CONSTRAINT gene_pkey; +ALTER TABLE gene DROP CONSTRAINT fk9v4jtwy759c3cfub0uxye5rue; +ALTER TABLE gene DROP CONSTRAINT fkiaxg0dhug3stym3gjovw598w1; +DROP INDEX gene_taxon_index; + +ALTER TABLE gene_aud DROP CONSTRAINT gene_aud_pkey; +ALTER TABLE gene_aud DROP CONSTRAINT fk4n82maba8vniaxet7w2w1sfg4; + +ALTER TABLE genediseaseannotation RENAME CONSTRAINT fk3j5deigrhrwln0srh51vtw3m8 TO genediseaseannotation_id_fk; +ALTER TABLE genediseaseannotation DROP CONSTRAINT fk51h0w9jsd45qw5f3v2v0o28mu; +ALTER TABLE genediseaseannotation DROP CONSTRAINT fk_genedasubject; + +ALTER TABLE genefullnameslotannotation DROP CONSTRAINT genefullnameslotannotation_singlegene_curie_fk; +DROP INDEX genefullname_singlegene_curie_index; + +ALTER TABLE genesecondaryidslotannotation DROP CONSTRAINT fkhtdt6peje2s446u44ax3knp14; +ALTER TABLE genesecondaryidslotannotation RENAME CONSTRAINT fkq0oks812epecjvubiasibhw2s TO genesecondaryidslotannotation_id_fk; +DROP INDEX genesecondaryid_singlegene_curie_index; + +ALTER TABLE genesymbolslotannotation DROP CONSTRAINT genesymbolslotannotation_singlegene_curie_fk; +DROP INDEX genesymbol_singlegene_curie_index; + +ALTER TABLE genesynonymslotannotation DROP CONSTRAINT genesynonymslotannotation_singlegene_curie_fk; +DROP INDEX genesynonym_singlegene_curie_index; + +ALTER TABLE genesystematicnameslotannotation DROP CONSTRAINT genesystematicnameslotannotation_singlegene_curie_fk; +DROP INDEX genesystematicname_singlegene_curie_index; + +ALTER TABLE genetogeneorthology DROP CONSTRAINT genetogeneorthology_objectgene_curie_fk; +ALTER TABLE genetogeneorthology DROP CONSTRAINT genetogeneorthology_subjectgene_curie_fk; +DROP INDEX genetogeneorthology_objectgene_index; +DROP INDEX genetogeneorthology_subjectgene_index; + +ALTER TABLE genetogeneorthologycurated DROP CONSTRAINT genetogeneorthologycurated_evidencecode_curie_fk; +ALTER TABLE genetogeneorthologycurated DROP CONSTRAINT genetogeneorthologycurated_singlereference_curie_fk; +DROP INDEX genetogeneorthologycurated_evidencecode_index; +DROP INDEX genetogeneorthologycurated_singlereference_index; + +ALTER TABLE genomicentity DROP CONSTRAINT genomicentity_pkey; +ALTER TABLE genomicentity DROP CONSTRAINT fkhi54si7gksfs3f6jrbytaddbi; + +ALTER TABLE genomicentity_aud DROP CONSTRAINT genomicentity_aud_pkey; +ALTER TABLE genomicentity_aud DROP CONSTRAINT fknd0sic0qo3ko71w4d9k5urg48; + +ALTER TABLE genomicentity_crossreference DROP CONSTRAINT fk9b9qofiu2sump8fnfxgux1lvl; +ALTER INDEX genomicentity_crossreference_crossreferences_id_index RENAME TO genomicentity_crossreference_crossreferences_index; +DROP INDEX genomicentity_crossreference_ge_curie_xref_id_index; +DROP INDEX genomicentity_crossreference_genomicentity_curie_index; + +ALTER TABLE goterm DROP CONSTRAINT goterm_pkey; +ALTER TABLE goterm DROP CONSTRAINT fk4gf262ba8btx03wi3vl5vhfao; + +ALTER TABLE goterm_aud DROP CONSTRAINT goterm_aud_pkey; +ALTER TABLE goterm_aud DROP CONSTRAINT fk4kjm9hm06yutma1ilq04h967s; + +ALTER TABLE hpterm DROP CONSTRAINT hpterm_pkey; +ALTER TABLE hpterm DROP CONSTRAINT hpterm_curie_fk; + +ALTER TABLE hpterm_aud DROP CONSTRAINT hpterm_aud_pkey; +ALTER TABLE hpterm_aud DROP CONSTRAINT hpterm_aud_curie_rev_fk; + +ALTER TABLE materm DROP CONSTRAINT materm_pkey; +ALTER TABLE materm DROP CONSTRAINT fktlgqvrv4vuh8gqihevh6adya4; + +ALTER TABLE materm_aud DROP CONSTRAINT materm_aud_pkey; +ALTER TABLE materm_aud DROP CONSTRAINT fk7lfprbh8k8mnw9yf8ywp7xieg; + +ALTER TABLE miterm DROP CONSTRAINT miterm_pkey; +ALTER TABLE miterm DROP CONSTRAINT miterm_curie_fk; + +ALTER TABLE miterm_aud DROP CONSTRAINT miterm_aud_pkey; +ALTER TABLE miterm_aud DROP CONSTRAINT miterm_aud_curie_rev_fk; + +ALTER TABLE mmoterm DROP CONSTRAINT mmoterm_pkey; +ALTER TABLE mmoterm DROP CONSTRAINT mmoterm_curie_fk; + +ALTER TABLE mmoterm_aud DROP CONSTRAINT mmoterm_aud_pkey; +ALTER TABLE mmoterm_aud DROP CONSTRAINT mmoterm_aud_curie_rev_fk; + +ALTER TABLE mmusdvterm DROP CONSTRAINT mmusdvterm_pkey; +ALTER TABLE mmusdvterm DROP CONSTRAINT fkmkv8r93hlnf06oa8xy2usdq9g; + +ALTER TABLE mmusdvterm_aud DROP CONSTRAINT mmusdvterm_aud_pkey; +ALTER TABLE mmusdvterm_aud DROP CONSTRAINT fk19prhk8fikp11bpxxm2tqxh6u; + +ALTER TABLE modterm DROP CONSTRAINT modterm_pkey; +ALTER TABLE modterm DROP CONSTRAINT modterm_curie_fk; + +ALTER TABLE modterm_aud DROP CONSTRAINT modterm_aud_pkey; +ALTER TABLE modterm_aud DROP CONSTRAINT modterm_aud_curie_rev_fk; + +ALTER TABLE molecule DROP CONSTRAINT molecule_pkey; +ALTER TABLE molecule DROP CONSTRAINT fknnf79fdaivbnqu0p9kes1jtd1; + +ALTER TABLE molecule_aud DROP CONSTRAINT molecule_aud_pkey; +ALTER TABLE molecule_aud DROP CONSTRAINT fkcbo1onn61w7v5ivh1e1h2tcd7; + +ALTER TABLE mpathterm DROP CONSTRAINT mpathterm_pkey; +ALTER TABLE mpathterm DROP CONSTRAINT mpathterm_curie_fk; + +ALTER TABLE mpathterm_aud DROP CONSTRAINT mpathterm_aud_pkey; +ALTER TABLE mpathterm_aud DROP CONSTRAINT mpathterm_aud_curie_rev_fk; + +ALTER TABLE mpterm DROP CONSTRAINT mpterm_pkey; +ALTER TABLE mpterm DROP CONSTRAINT fkorn5mvrebk70b70o3sepp2fwe; + +ALTER TABLE mpterm_aud DROP CONSTRAINT mpterm_aud_pkey; +ALTER TABLE mpterm_aud DROP CONSTRAINT fkjw611qjy95wa8gjjthb1uptjy; + +ALTER TABLE ncbitaxonterm DROP CONSTRAINT ncbitaxonterm_pkey; +ALTER TABLE ncbitaxonterm DROP CONSTRAINT fk47k37g37jc1e4wdt76ajmn0xk; + +ALTER TABLE ncbitaxonterm_aud DROP CONSTRAINT ncbitaxonterm_aud_pkey; +ALTER TABLE ncbitaxonterm_aud DROP CONSTRAINT fkap27v3trsn5u9q93qb8ikabrf; + +ALTER TABLE note_aud DROP CONSTRAINT fk1r4uoh4rg9vyahvb8bpd6dfn7; + +ALTER TABLE note_reference RENAME CONSTRAINT fknr8td9rfl6vd6cstukci0e0qq TO note_reference_note_id_fk; +ALTER TABLE note_reference DROP CONSTRAINT note_reference_references_curie_fk; +ALTER INDEX idxk4kbcn96bs4gafx883i9sj7my RENAME TO note_reference_note_index; + +ALTER TABLE obiterm DROP CONSTRAINT obiterm_pkey; +ALTER TABLE obiterm DROP CONSTRAINT obiterm_curie_fk; + +ALTER TABLE obiterm_aud DROP CONSTRAINT obiterm_aud_pkey; +ALTER TABLE obiterm_aud DROP CONSTRAINT obiterm_aud_curie_rev_fk; + +ALTER TABLE ontologyterm DROP CONSTRAINT ontologyterm_pkey; + +ALTER TABLE ontologyterm_aud DROP CONSTRAINT ontologyterm_aud_pkey; +ALTER TABLE ontologyterm_aud DROP CONSTRAINT fkdxjp2u3w3xoi7p9j7huceg2ts; + +ALTER TABLE ontologyterm_crossreference DROP CONSTRAINT fk3e1a40poh1ehjk91h42bx7i45; +DROP INDEX ontologyterm_crossreference_ontologyterm_curie_index; +ALTER INDEX ontologyterm_crossreference_crossreferences_id_index RENAME TO ontologyterm_crossreference_crossreferences_index; + +ALTER TABLE ontologyterm_definitionurls DROP CONSTRAINT fknhkhso5kmei3t37mkhodkkfgt; +DROP INDEX idx171k63a40d8huvbhohveql7so; + +ALTER TABLE ontologyterm_isa_ancestor_descendant DROP CONSTRAINT ontologyterm_ancestor_descendant_pkey; +ALTER TABLE ontologyterm_isa_ancestor_descendant DROP CONSTRAINT fkh6pn8ibta2l7jnov2ds2dqyyt; +ALTER TABLE ontologyterm_isa_ancestor_descendant DROP CONSTRAINT fk62tk8kyfxk80w7n06w0d4o5yf; +DROP INDEX idxll2agbrj7gqreke3x7hr8wvi8; +DROP INDEX idxss79m7jisaqcm3kfq5r7gro16; + +ALTER TABLE ontologyterm_isa_parent_children DROP CONSTRAINT ontologyterm_parent_children_pkey; +ALTER TABLE ontologyterm_isa_parent_children DROP CONSTRAINT fkhjjhjxsp6gacmykm0bwijv0tj; +ALTER TABLE ontologyterm_isa_parent_children DROP CONSTRAINT fkqrefoml52l7b5nr5w3diqr5er; +DROP INDEX idx1wx6c7akkhro1m34rawo283t0; +DROP INDEX idx91kybf28ecbonyxlh4s46c756; + +ALTER TABLE ontologyterm_secondaryidentifiers DROP CONSTRAINT fkpkg5jfw6wypf4v43bpb4ergu7; +DROP INDEX idxsvjjbf5eugfrbue5yo4jgarpn; + +ALTER TABLE ontologyterm_subsets DROP CONSTRAINT fkchq4ex53obwegdhgxrovd5r53; +DROP INDEX idxips7lcqafkikxweue2p0h13t9; + +ALTER TABLE ontologyterm_synonym RENAME CONSTRAINT fk4uyg8s1tkgg3vp1cb8dn3vyvr TO ontologyterm_synonym_synonyms_id_fk; +ALTER TABLE ontologyterm_synonym DROP CONSTRAINT fkjf8xunyry3dy9njpqb01tvjsr; +DROP INDEX ontologyterm_synonym_ontologyterm_curie_index; + +ALTER TABLE organization_aud DROP CONSTRAINT organization_aud_rev_fk; + +ALTER TABLE patoterm DROP CONSTRAINT patoterm_pkey; +ALTER TABLE patoterm DROP CONSTRAINT patoterm_curie_fk; + +ALTER TABLE patoterm_aud DROP CONSTRAINT patoterm_aud_pkey; +ALTER TABLE patoterm_aud DROP CONSTRAINT patoterm_aud_curie_rev_fk; + +ALTER TABLE person_aud DROP CONSTRAINT fkqbm2y5o4elhanxeq26reu73yd; + +ALTER TABLE phenotypeterm DROP CONSTRAINT phenotypeterm_pkey; +ALTER TABLE phenotypeterm DROP CONSTRAINT fk4ymq8h2kdhq6ix6sfb4q4fn7a; + +ALTER TABLE phenotypeterm_aud DROP CONSTRAINT phenotypeterm_aud_pkey; +ALTER TABLE phenotypeterm_aud DROP CONSTRAINT fksap791c8unrey4xnqcydm8kv1; + +ALTER TABLE pwterm DROP CONSTRAINT pwterm_pkey; +ALTER TABLE pwterm DROP CONSTRAINT pwterm_curie_fk; + +ALTER TABLE pwterm_aud DROP CONSTRAINT pwterm_aud_pkey; +ALTER TABLE pwterm_aud DROP CONSTRAINT pwterm_aud_curie_rev_fk; + +ALTER TABLE reagent_aud DROP CONSTRAINT reagent_aud_rev_fk; + +ALTER INDEX reagent_secondaryidentifiers_reagent_id_index RENAME TO reagent_secondaryidentifiers_reagent_index; + +ALTER reference DROP CONSTRAINT reference_pkey; +ALTER reference DROP CONSTRAINT fk17o77er2650ydtr1dhtd0y5kn; + +ALTER reference_aud DROP CONSTRAINT reference_aud_pkey; +ALTER reference_aud DROP CONSTRAINT fk897g2lxdu1btxkcikigm6j4wo; +ALTER reference_aud DROP CONSTRAINT reference_aud_curie_rev_fk; + +ALTER TABLE reference_crossreference DROP CONSTRAINT reference_crossreference_reference_curie_fk; +DROP INDEX idx5f73olsmf7f70k9nimewmv2ov; +ALTER INDEX reference_crossreference_crossreferences_id_index RENAME TO reference_crossreference_crossreferences_index; +DROP INDEX idx8o0l1xsm13k7qe0btnlr0x32j; + +ALTER TABLE resourcedescriptor_aud DROP CONSTRAINT resourcedescriptor_aud_rev_fk; + +ALTER TABLE resourcedescriptorpage_aud DROP CONSTRAINT resourcedescriptorpage_aud_rev_fk; +-- Add columns + +-- Add constraints and indexes + +ALTER TABLE affectedgenomicmodel ADD PRIMARY KEY (id); +ALTER TABLE affectedgenomicmodel ADD CONSTRAINT affectedgenomicmodel_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); + +ALTER TABLE affectedgenomicmodel_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE affectedgenomicmodel_aud ADD CONSTRAINT affectedgenomicmodel_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); + +ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_subject_id_fk (subject_id) REFERENCES affectedgenomicmodel (id); +ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_assertedallele_id_fk (assertedallele_id) REFERENCES allele (id); +ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredallele_id_fk (inferredallele_id) REFERENCES allele (id); +ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredgene_id_fk (inferredgene_id) REFERENCES gene (id); + +ALTER TABLE agmdiseaseannotation_gene ADD CONSTRAINT agmdiseaseannotation_gene_assertedgenes_id_fk (assertedgenes_id) REFERENCES gene (id); + +ALTER TABLE allele ADD PRIMARY KEY (id); +ALTER TABLE allele ADD CONSTRAINT allele_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); + +ALTER TABLE allele_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE allele_aud ADD CONSTRAINT allele_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); + +ALTER TABLE allele_note ADD CONSTRAINT allele_note_allele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id); +CREATE INDEX allele_note_allele_index ON allele_note USING btree (allele_id); + +ALTER TABLE allele_note_aud ADD PRIMARY KEY (allele_id, relatednotes_id, rev); + +ALTER TABLE allele_reference ADD CONSTRAINT allele_reference_allele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id); +ALTER TABLE allele_reference ADD CONSTRAINT allele_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); +CREATE INDEX allele_reference_allele_index ON allele_reference USING btree (allele_id); +CREATE INDEX allele_reference_references_index ON allele_reference USING btree (references_id); +CREATE INDEX allele_reference_allele_references_index ON allele_reference USING btree (allele_id, references_id); + +ALTER TABLE allele_reference_aud ADD PRIMARY KEY (allele_id, references_id, rev); + +ALTER TABLE alleledatabasestatusslotannotation ADD CONSTRAINT alleledatabasestatus_singleallele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id); +CREATE INDEX alleledatabasestatus_singleallele_index ON alleledatabasestatusslotannotation USING btree (allele_id); + +ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannoation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES allele (id); +ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id); +CREATE INDEX allelediseaseannotation_inferredgene_index ON allelediseaseannotation USING btree (inferredgene_id); +CREATE INDEX allelediseaseannotation_subject_index ON allelediseaseannotation USING btree (subject_id); + +ALTER TABLE allelediseaseannotation_gene ADD CONSTRAINT allelediseaseannotation_gene_assertedgenes_id_fk; +CREATE INDEX allelediseaseannotationgene_assertedgenes_index ON allelediseaseannotation_gene USING btree (assertedgenes_id); + +CREATE INDEX allelefullname_singleallele_index ON allelefullnameslotannotation USING btree (allele_id); + +ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctionalimpactslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctionalimpactslotannotation_phenotypeterm_id_fk FOREIGN KEY (phenotypeterm_id) REFERENCES phenotypeterm (id); +CREATE INDEX allelefunctionalimpact_singleallele_index ON allelefunctionalimpactslotannotation USING btree (singleallele_id); +CREATE INDEX allelefunctionalimpact_phenotypeterm_index ON allelefunctionalimpactslotannotation USING btree (phenotypeterm_id); + +ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_object_id_fk FOREIGN KEY (object_id) REFERENCES gene (id); +ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES allele (id); +CREATE INDEX allelegeneassociation_object_index ON allelegeneassociation USING btree (object_id); +CREATE INDEX allelegeneassociation_subject_index ON allelegeneassociation USING btree (subject_id); + +ALTER TABLE allelegenomicentityassociation ADD CONSTRAINT allelegenomicentityassociation_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES ecoterm (id); + +ALTER TABLE allelegermlinetransmissionstatusslotannotation ADD CONSTRAINT allelegermlinetransmissionstatus_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX allelegermlinetransmissionstatus_singleallele_index ON allelegermlinetransmissionstatusslotannotation USING btree (singleallele_id); + +ALTER TABLE alleleinheritancemodeslotannotation ADD CONSTRAINT alleleinheritancemode_phenotypeterm_id_fk FOREIGN KEY (phenotypeterm_id) REFERENCES phenotypeterm (id); +ALTER TABLE alleleinheritancemodeslotannotation ADD CONSTRAINT alleleinheritancemode_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX alleleinheritancemode_phenotypeterm_index ON alleleinheritancemodeslotannotation USING btree (phenotypeterm_id); +CREATE INDEX alleleinheritancemode_singleallele_index ON alleleinheritancemodeslotannotation USING btree (singleallele_id); + +ALTER TABLE allelemutationtypeslotannotation ADD CONSTRAINT allelemutationtype_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX allelemutationtype_singleallele_index ON allelemutationtypeslotannotation USING btree (singleallele_id); + +ALTER TABLE allelemutationtypeslotannotation_soterm ADD CONSTRAINT allelemutationtypesa_soterm_mutationtypes_id_fk FOREIGN KEY (mutationtypes_id) REFERENCES soterm (id); +CREATE INDEX allelemutationtypesa_soterm_mutationtypes_index ON allelemutationtypeslotannotation_soterm USING btree (mutationtypes_id); + +ALTER TABLE allelenomenclatureeventslotannotation ADD CONSTRAINT allelenomenclatureeventslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX allelenomenclatureevent_singleallele_index ON allelenomenclatureeventslotannotation USING btree (singleallele_id); + +ALTER TABLE allelesecondaryidslotannotation ADD CONSTRAINT allelesecondaryidslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX allelesecondaryid_singleallele_index ON allelesecondaryidslotannotation USING btree (singleallele_id); + +ALTER TABLE allelesymbolslotannotation ADD CONSTRAINT allelesymbolslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX allelesymbol_singleallele_index ON allelesymbolslotannotation USING btree (singleallele_id); + +ALTER TABLE allelesynonymslotannotation ADD CONSTRAINT allelesynonymslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX allelesynonym_singleallele_index ON allelesynonymslotannotation USING btree (singleallele_id); + +ALTER TABLE anatomicalterm ADD PRIMARY KEY (id); +ALTER TABLE anatomicalterm ADD CONSTRAINT anatomicalterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE anatomicalterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE anatomicalterm_aud ADD CONSTRAINT anatomicalterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE apoterm ADD PRIMARY KEY (id); +ALTER TABLE apoterm ADD CONSTRAINT apoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); + +ALTER TABLE apoterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE apoterm_aud ADD CONSTRAINT apoterm_aud_id_rev_fk (id, rev) REFERENCES phenotypeterm_aud (id, rev); + +ALTER TABLE atpterm ADD PRIMARY KEY (id); +ALTER TABLE atpterm ADD CONSTRAINT atpterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE atpterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE atpterm_aud ADD CONSTRAINT atpterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE biologicalentity ADD PRIMARY KEY (id); +ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_id_fk FOREIGN KEY (id) REFERENCES submittedobject (id); +ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); +CREATE INDEX biologicalentity_taxon_index ON biologicalentity USING btree (taxon_id); + +ALTER TABLE biologicalentity_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE biologicalentity_aud ADD CONSTRAINT biologicalentity_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES submittedobject_aud (id, rev); + +ALTER TABLE bspoterm ADD PRIMARY KEY (id); +ALTER TABLE bspoterm ADD CONSTRAINT bspoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE bspoterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE bspoterm_aud ADD CONSTRAINT bspoterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE bulkload ADD CONSTRAINT bulkload_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE bulkload_aud ADD CONSTRAINT bulkload_aud_id_rev_fk (id, rev) REFRENCES auditedobject_aud (id, rev); + +ALTER TABLE bulkloadfile ADD CONSTRAINT bulkloadfile_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE bulkloadfile_aud ADD CONSTRAINT bulkloadfile_aud_id_rev_fk (id, rev) REFRENCES auditedobject_aud (id, rev); + +ALTER TABLE bulkloadfileexception ADD CONSTRAINT bulkloadfileexception_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE bulkloadfileexception_aud ADD CONSTRAINT bulkloadfileexception_aud_id_rev_fk (id, rev) REFRENCES auditedobject_aud (id, rev); + +ALTER TABLE bulkloadfilehistory ADD CONSTRAINT bulkloadfilehistory_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE bulkloadfilehistory_aud ADD CONSTRAINT bulkloadfilehistory_aud_id_rev_fk (id, rev) REFRENCES auditedobject_aud (id, rev); + +ALTER TABLE bulkloadgroup ADD CONSTRAINT bulkloadgroup_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE bulkloadgroup_aud ADD CONSTRAINT bulkloadgroup_aud_id_rev_fk (id, rev) REFRENCES auditedobject_aud (id, rev); + +ALTER TABLE chebiterm ADD PRIMARY KEY (id); +ALTER TABLE chebiterm ADD CONSTRAINT chebiterm_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); + +ALTER TABLE chebiterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE chebiterm_aud ADD CONSTRAINT chebiterm_aud_id_rev_fk (id, rev) REFERENCES chemicalterm_aud (id, rev); + +ALTER TABLE chemicalterm ADD PRIMARY KEY (id); +ALTER TABLE chemicalterm ADD CONSTRAINT chemicalterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE chemicalterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE chemicalterm_aud ADD CONSTRAINT chemicalterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE clterm ADD PRIMARY KEY (id); +ALTER TABLE clterm ADD CONSTRAINT clterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); + +ALTER TABLE clterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE clterm_aud ADD CONSTRAINT clterm_aud_id_rev_fk (id, rev) REFERENCES anatomicalterm_aud (id, rev); + +ALTER TABLE cmoterm ADD PRIMARY KEY (id); +ALTER TABLE cmoterm ADD CONSTRAINT cmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE cmoterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE cmoterm_aud ADD CONSTRAINT cmoterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE conditionrelation ADD CONSTRAINT conditionrelation_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE conditionrelation ADD CONSTRAINT conditionrelation_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); + +ALTER TABLE conditionrelation_aud ADD CONSTRAINT conditionrelation_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); + +ALTER TABLE construct_reference ADD CONSTRAINT construct_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); +CREATE INDEX construct_reference_references_index ON construct_reference USING btree (references_id); + +ALTER TABLE constructcomponentslotannotation ADD CONSTRAINT constructcomponentslotannotation_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); +CREATE INDEX constructcomponentslotannotation_taxon_index ON constructcomponentslotannotation USING btree (taxon_id); + +ALTER TABLE constructgenomicentityassociation ADD CONSTRAINT constructgenomicentityassociation_object_id_fk FOREIGN KEY (genomicentity_id) REFERENCES genomicentity (id); +CREATE INDEX constructgenomicentityassociation_object_index ON constructgenomicentityassociation USING btree (object_id); + +ALTER TABLE crossreference ADD CONSTRAINT crossreference_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE crossreference_aud ADD CONSTRAINT crossreference_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); + +ALTER TABLE curationreport ADD CONSTRAINT curationreport_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE curationreport_aud ADD CONSTRAINT curationreport_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); + +ALTER TABLE curationreportgroup ADD CONSTRAINT curationreportgroup_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE curationreportgroup_aud ADD CONSTRAINT curationreportgroup_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); + +ALTER TABLE curationreporthistory ADD CONSTRAINT curationreporthistory_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE curationreportgroup_aud ADD CONSTRAINT curationreporthistory_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); + +ALTER TABLE daoterm ADD PRIMARY KEY (id); +ALTER TABLE daoterm ADD CONSTRAINT daoterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); + +ALTER TABLE daoterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE daoterm_aud ADD CONSTRAINT daoterm_aud_id_rev_fk (id, rev) REFERENCES anatomicalterm_aud (id, rev); + +ALTER TABLE dataprovider ADD CONSTRAINT dataprovider_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE dataprovider_aud ADD CONSTRAINT dataprovider_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); + +ALTER TABLE diseaseannotation ADD CONSTRINAT diseaseannotation_object_id_fk FOREIGN KEY (object_id) REFERENCES doterm (id); +CREATE INDEX diseaseannotation_object_index ON diseaseannotation USING btree (object_id); + +ALTER TABLE diseaseannotation_biologicalentity ADD CONSTRAINT diseaseannotation_biologicalentity_dgm_id_fk FOREIGN KEY (diseasegeneticmodifiers_id) REFERENCES biologicalentity (id); +CREATE INDEX diseaseannotation_biologicalentity_dgms_index ON diseaseannotation_biologicalentity USING btree (diseasegeneticmodifiers_id); + +ALTER TABLE diseaseannotation_ecoterm ADD CONSTRAINT diseaseannotation_ecoterm_evidencecodes_id_fk FOREIGN KEY (evidencecodes_id) REFERENCES ecoterm (id); +CREATE INDEX diseaseannotation_ecoterm_evidencecodes_index ON diseaseannotation_ecoterm USING btree (evidencecodes_id); + +ALTER TABLE diseaseannotation_gene ADD CONSTRAINT diseaseannotation_gene_with_id_fk FOREIGN KEY (with_id) REFERENCES gene (id); +CREATE INDEX diseaseannotation_gene_with_index ON diseaseannotation_gene USING btree (with_id); + +ALTER TABLE doterm ADD PRIMARY KEY (id); +ALTER TABLE doterm ADD CONSTRAINT doterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE doterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE doterm_aud ADD CONSTRAINT doterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE dpoterm ADD PRIMARY KEY (id); +ALTER TABLE dpoterm ADD CONSTRAINT dpoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); + +ALTER TABLE dpoterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE dpoterm_aud ADD CONSTRAINT dpoterm_aud_id_rev_fk (id, rev) REFERENCES phenotypeterm_aud (id, rev); + +ALTER TABLE ecoterm ADD PRIMARY KEY (id); +ALTER TABLE ecoterm ADD CONSTRAINT ecoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE ecoterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE ecoterm_aud ADD CONSTRAINT ecoterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE emapaterm ADD PRIMARY KEY (id); +ALTER TABLE emapaterm ADD CONSTRAINT emapaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); + +ALTER TABLE emapaterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE emapaterm_aud ADD CONSTRAINT emapaterm_aud_id_rev_fk (id, rev) REFERENCES anatomicalterm_aud (id, rev); + +ALTER TABLE evidenceassociation_informationcontententity ADD CONSTRAINT evidenceassociation_infocontent_evidence_id_fk FOREIGN KEY (evidence_id) REFERENCES informationcontententity (id); +CREATE INDEX evidenceassociation_infocontent_evidence_index ON evidenceassociation_informationcontententity USING btree (evidence_id); + +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionchemical_id_fk FOREIGN KEY (conditionchemical_id) REFERENCES chemicalterm (id); +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionid_id_fk FOREIGN KEY (conditionid_id) REFERENCES experimentalconditionontologyterm (id); +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditiontaxon_id_fk FOREIGN KEY (conditiontaxon_id) REFERENCES ncbitaxontermterm (id); +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditiongeneontology_id_fk FOREIGN KEY (conditiongeneontology_id) REFERENCES goterm (id); +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionclass_id_fk FOREIGN KEY (conditionclass_id) REFERENCES zecoterm (id); +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionanatomy_id_fk FOREIGN KEY (conditionanatomy_id) REFERENCES anatomicalterm (id); + +ALTER TABLE experimentalconditionontologyterm ADD PRIMARY KEY (id); +ALTER TABLE experimentalconditionontologyterm ADD CONSTRAINT experimentalconditionontologyterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE experimentalconditionontologyterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE experimentalconditionontologyterm_aud ADD CONSTRAINT experimentalconditionontologyterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE fbdvterm ADD PRIMARY KEY (id); +ALTER TABLE fbdvterm ADD CONSTRAINT fbdvterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); + +ALTER TABLE fbdvterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE fbdvterm_aud ADD CONSTRAINT fbdvterm_aud_id_rev_fk (id, rev) REFERENCES stageterm_aud (id, rev); + +ALTER TABLE gene ADD PRIMARY KEY (id); +ALTER TABLE gene ADD CONSTRAINT gene_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); +ALTER TABLE gene ADD CONSTRAINT gene_genetype_id_fk FOREIGN KEY (genetype_id) REFERENCES soterm (id); +CREATE INDEX gene_genetype_index ON gene USING btree (genetype_id); + +ALTER TABLE gene_aud ADD PRIMARY_KEY (id, rev); +ALTER TABLE gene_aud ADD CONSTRAINT gene_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); + +ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES gene (id); +ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_sgdstrainbackground_id_fk (sgdstrainbackground_id) REFERENCES affectedgenomicmodel (id); + +ALTER TABLE genefullnameslotannotation ADD CONSTRAINT genefullnameslotannotation_singlegene_id_fk (singlegene_id) REFERENCES gene (id); +CREATE INDEX genefullname_singlegene_index ON genefullnameslotannotation USING btree (singlegene_id); + +ALTER TABLE genesecondaryidslotannotation ADD CONSTRAINT genesecondaryidslotannotation_singlegene_id_fk (singlegene_id) REFERENCES gene (id); +CREATE INDEX genesecondaryid_singlegene_index ON genesecondaryidslotannotation USING btree (singlegene_id); + +ALTER TABLE genesymbolslotannotation ADD CONSTRAINT genesymbolslotannotation_singlegene_id_fk (singlegene_id) REFERENCES gene (id); +CREATE INDEX genesymbol_singlegene_index ON genesymbolslotannotation USING btree (singlegene_id); + +ALTER TABLE genesynonymslotannotation ADD CONSTRAINT genesynonymslotannotation_singlegene_id_fk (singlegene_id) REFERENCES gene (id); +CREATE INDEX genesynonym_singlegene_index ON genesynonymslotannotation USING btree (singlegene_id); + +ALTER TABLE genesystematicnameslotannotation ADD CONSTRAINT genesystematicnameslotannotation_singlegene_id_fk (singlegene_id) REFERENCES gene (id); +CREATE INDEX genesystematicname_singlegene_index ON genesystematicnameslotannotation USING btree (singlegene_id); + +ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_object_id_fk FOREIGN KEY (object_id) REFERENCES gene (id); +ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_subject_id_fk FOREIGN KEY (subject_id) REFERENCES gene (id); +CREATE INDEX genetogeneorthology_object_index ON genetogeneorthology USING btree (object_id); +CREATE INDEX genetogeneorthology_subject_index ON genetogeneorthology USING btree (subject_id); + +ALTER TABLE genetogeneorthologycurated ADD CONSTRAINT genetogeneorthologycurated_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES ecoterm (id); +ALTER TABLE genetogeneorthologycurated ADD CONSTRAINT genetogeneorthologycurated_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); +CREATE INDEX genetogeneorthologycurated_evidencecode_index ON genetogeneorthologycurated USING btree (evidencecode_id); +CREATE INDEX genetogeneorthologycurated_singlereference_index ON genetogeneorthologycurated USING btree (singlereference_id); + +ALTER TABLE genomicentity ADD PRIMARY KEY (id); +ALTER TABLE genomicentity ADD CONSTRAINT genomicentity_id_fk FOREIGN KEY (id) REFERENCES biologicalentity (id); + +ALTER TABLE genomicentity_aud ADD PRIMARY_KEY (id, rev); +ALTER TABLE genomicentity_aud ADD CONSTRAINT genomicentity_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES biologicalentity_aud (id, rev); + +ALTER TABLE genomicentity_crossreference ADD CONSTRAINT genomicentitycrossreference_genomicentity_id_fk FOREIGN KEY (genomicentity_id) REFERENCES genomicentity (id); +CREATE INDEX genomicentity_crossreference_ge_xref_index ON genomicentity_crossreference USING btree (genomicentity_id, crossreferences_id); +CREATE INDEX genomicentity_crossreference_genomicentity_index ON genomicentity_crossreference USING btree (genomicentity_id); + +ALTER TABLE goterm ADD PRIMARY KEY (id); +ALTER TABLE goterm ADD CONSTRAINT goterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE goterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE goterm_aud ADD CONSTRAINT goterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE hpterm ADD PRIMARY KEY (id); +ALTER TABLE hpterm ADD CONSTRAINT hpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); + +ALTER TABLE hpterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE hpterm_aud ADD CONSTRAINT hpterm_aud_id_rev_fk (id, rev) REFERENCES phenotypeterm_aud (id, rev); + +ALTER TABLE materm ADD PRIMARY KEY (id); +ALTER TABLE materm ADD CONSTRAINT materm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); + +ALTER TABLE materm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE materm_aud ADD CONSTRAINT materm_aud_id_rev_fk (id, rev) REFERENCES anatomicalterm_aud (id, rev); + +ALTER TABLE miterm ADD PRIMARY KEY (id); +ALTER TABLE miterm ADD CONSTRAINT miterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE miterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE miterm_aud ADD CONSTRAINT miterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE mmoterm ADD PRIMARY KEY (id); +ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE mmoterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE mmoterm_aud ADD CONSTRAINT mmoterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE mmusdvterm ADD PRIMARY KEY (id); +ALTER TABLE mmusdvterm ADD CONSTRAINT mmusdvterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); + +ALTER TABLE mmusdvterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE mmusdvterm_aud ADD CONSTRAINT mmusdvterm_aud_id_rev_fk (id, rev) REFERENCES stageterm_aud (id, rev); + +ALTER TABLE modterm ADD PRIMARY KEY (id); +ALTER TABLE modterm ADD CONSTRAINT modterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE modterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE modterm_aud ADD CONSTRAINT modterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE molecule ADD PRIMARY KEY (id); +ALTER TABLE molecule ADD CONSTRAINT molecule_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); + +ALTER TABLE molecule_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE molecule_aud ADD CONSTRAINT molecule_aud_id_rev_fk (id, rev) REFERENCES chemicalterm_aud (id, rev); + +ALTER TABLE mpathterm ADD PRIMARY KEY (id); +ALTER TABLE mpathterm ADD CONSTRAINT mpathterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE mpathterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE mpathterm_aud ADD CONSTRAINT mpathterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE mpterm ADD PRIMARY KEY (id); +ALTER TABLE mpterm ADD CONSTRAINT mpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); + +ALTER TABLE mpterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE mpterm_aud ADD CONSTRAINT mpterm_aud_id_rev_fk (id, rev) REFERENCES phenotypeterm_aud (id, rev); + +ALTER TABLE ncbitaxonterm ADD PRIMARY KEY (id); +ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE ncbitaxonterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE ncbitaxonterm_aud ADD CONSTRAINT ncbitaxonterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE note ADD CONSTRAINT note_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE note_aud ADD CONSTRAINT note_aud_id_rev_fk (id, rev) REFRENCES auditedobject_aud (id, rev); + +ALTER TABLE note_reference ADD CONSTRAINT note_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); +CREATE INDEX note_reference_references_index ON note_reference USING btree (references_id); + +ALTER TABLE obiterm ADD PRIMARY KEY (id); +ALTER TABLE obiterm ADD CONSTRAINT obiterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE obiterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE obiterm_aud ADD CONSTRAINT obiterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE ontologyterm ADD PRIMARY KEY (id); +ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); + +ALTER TABLE ontologyterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE ontologyterm_aud ADD CONSTRAINT ontologyterm_aud_id_rev_fk (id, rev) REFERENCES curieobject_aud (id, rev); + +ALTER TABLE ontologyterm_crossreference ADD CONSTRAINT ontologyterm_crossreference_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); +CREATE INDEX ontologyterm_crossreference_ontologyterm_index ON ontologyterm_crossreference USING btree (ontologyterm_id); + +ALTER TABLE ontologyterm_definitionurls ADD CONSTRAINT ontologyterm_definitionurls_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); +CREATE INDEX ontologyterm_definitionurls_ontologyterm_index ON ontologyterm_definitionurls USING btree (ontologyterm_id); + +ALTER TABLE ontologyterm_isa_ancestor_descendant ADD PRIMARY KEY (isadescendants_id, isaancestors_id); +ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_isaancestors_id_fk FOREIGN KEY (isaancestors_id) REFERENCES ontologyterm(id); +ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_isadescendants_id_fk FOREIGN KEY (isadescendants_id) REFERENCES ontologyterm(id); +CREATE INDEX ontologyterm_isa_ancestor_descendant_isaancestors_index ON ontologyterm_isa_ancestor_descendant USING btree (isaancestors_id); +CREATE INDEX ontologyterm_isa_ancestor_descendant_isadescendants_index ON ontologyterm_isa_ancestor_descendant USING btree (isadescendants_id); + +ALTER TABLE ontologyterm_isa_parent_children ADD PRIMARY KEY (isachildren_id, isaparents_id); +ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_isachildren_id_fk FOREIGN KEY (isachildren_id) REFERENCES ontologyterm (id); +ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_isaparents_id_fk FOREIGN KEY (isaparents_id) REFERENCES ontologyterm (id); +CREATE INDEX ontologyterm_isa_parent_children_isachildren_index ON ontologyterm_isa_parent_children USING btree (isachildren_id); +CREATE INDEX ontologyterm_isa_parent_children_isaparents_index ON ontologyterm_isa_parent_children USING btree (isaparents_id); + +ALTER TABLE ontologyterm_secondaryidentifiers ADD CONSTRAINT ontologyterm_secondaryidentifiers_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); +CREATE INDEX ontologyterm_secondaryidentifiers_ontologyterm_index ON ontologyterm_secondaryidentifiers USING btree (ontologyterm_id); + +ALTER TABLE ontologyterm_subsets ADD CONSTRAINT ontologyterm_subsets_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); +CREATE INDEX ontologyterm_subsets_ontologyterm_index ON ontologyterm_subsets USING btree (ontologyterm_id); + +ALTER TABLE ontologyterm_synonym ADD CONSTRAINT ontologyterm_synonym_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); +CREATE INDEX ontologyterm_synonym_ontologyterm_index ON ontologyterm_synonym USING btree (ontologyterm_id); + +ALTER TABLE organization ADD CONSTRAINT organization_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE organization_aud ADD CONSTRAINT organization_aud_id_rev_fk (id, rev) REFERENCES auditedobject_aud (id, rev); + +ALTER TABLE patoterm ADD PRIMARY KEY (id); +ALTER TABLE patoterm ADD CONSTRAINT patoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE patoterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE patoterm_aud ADD CONSTRAINT patoterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE person ADD CONSTRAINT person_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE person_aud ADD CONSTRAINT person_aud_id_rev_fk (id, rev) REFERENCES auditedobject_aud (id, rev); + +ALTER TABLE phenotypeterm ADD PRIMARY KEY (id); +ALTER TABLE phenotypeterm ADD CONSTRAINT phenotypeterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE phenotypeterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE phenotypeterm_aud ADD CONSTRAINT phenotypeterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE pwterm ADD PRIMARY KEY (id); +ALTER TABLE pwterm ADD CONSTRAINT pwterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); + +ALTER TABLE pwterm_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE pwterm_aud ADD CONSTRAINT pwterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); + +ALTER TABLE reagent ADD CONSTRAINT reagent_id_fk FOREIGN KEY (id) REFERENCES submittedobject (id); + +ALTER TABLE reagent_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE reagent_aud ADD CONSTRAINT reagent_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES submittedobject_aud (id, rev); + +ALTER TABLE reference ADD PRIMARY KEY (id); +ALTER TABLE reference ADD CONSTRAINT reference_id_fk FOREIGN KEY (id) REFERENCES informationcontententity (id); + +ALTER TABLE reference_aud ADD PRIMARY KEY (id, rev); +ALTER TABLE reference_aud ADD CONSTRAINT reference_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES informationcontententity_aud (id, rev); + +ALTER TABLE reference_crossreference ADD CONSTRAINT reference_crossreference_reference_id_fk FOREIGN KEY (reference_id) REFERENCES reference (id); +CREATE INDEX reference_crossreference_reference_index ON reference_crossreference USING btree (reference_id); + +ALTER TABLE resourcedescriptor ADD CONSTRAINT resourcedescriptor_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE resourcedescriptor_aud ADD CONSTRAINT resourcedescriptor_aud_id_rev_fk (id, rev) REFERENCES auditedobject_aud (id, rev); + +ALTER TABLE resourcedescriptorpage ADD CONSTRAINT resourcedescriptorpage_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); + +ALTER TABLE resourcedescriptorpage_aud ADD CONSTRAINT resourcedescriptorpage_aud_id_rev_fk (id, rev) REFERENCES auditedobject_aud (id, rev); \ No newline at end of file From 3994854b68b2e8997b05e548e6fa1212449e5edc Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 19 Dec 2023 09:54:36 +0000 Subject: [PATCH 009/159] Migration and fixes --- .../base/CurieObjectCrudController.java | 5 + .../base/SubmittedObjectCrudController.java | 5 + .../controllers/crud/GeneCrudController.java | 6 - .../base/CurieObjectCrudInterface.java | 47 +- .../crud/ConstructCrudInterface.java | 6 - .../GeneDiseaseAnnotationExecutor.java | 4 + .../entities/InformationContentEntity.java | 2 + .../model/entities/base/CurieObject.java | 8 +- .../model/entities/base/SubmittedObject.java | 6 +- .../slotAnnotations/SlotAnnotation.java | 6 +- .../GeneDiseaseAnnotationValidator.java | 1 - .../services/validation/NoteValidator.java | 3 - .../base/AuditedObjectValidator.java | 9 +- .../dto/DiseaseAnnotationDTOValidator.java | 16 +- .../GeneDiseaseAnnotationDTOValidator.java | 23 +- .../validation/dto/base/BaseDTOValidator.java | 3 +- .../v0.30.0.1__linkml_v2.0.0_update.sql | 2030 ++++++++++++----- .../curation_api/base/BaseITCase.java | 2 +- .../bulkupload/ConstructBulkUploadITCase.java | 2 +- ...AlleleGeneAssociationBulkUploadITCase.java | 16 +- ...omicEntityAssociationBulkUploadITCase.java | 20 +- 21 files changed, 1629 insertions(+), 591 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/base/CurieObjectCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/base/CurieObjectCrudController.java index d358d984f..e618e1501 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/base/CurieObjectCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/base/CurieObjectCrudController.java @@ -9,6 +9,11 @@ public abstract class CurieObjectCrudController, E extends CurieObject, D extends BaseEntityDAO> extends BaseEntityCrudController implements CurieObjectCrudInterface { protected CurieObjectCrudService service; + + protected void setService(S service) { + super.setService(service); + this.service = service; + } public ObjectResponse get(String curie) { return service.get(curie); diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/base/SubmittedObjectCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/base/SubmittedObjectCrudController.java index 3a72b50c7..1986fef94 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/base/SubmittedObjectCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/base/SubmittedObjectCrudController.java @@ -13,6 +13,11 @@ public abstract class SubmittedObjectCrudController service; + protected void setService(S service) { + super.setService(service); + this.service = service; + } + @Override public ObjectResponse get(String identifierString) { return service.get(identifierString); diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneCrudController.java index 549cf8510..9e9c26e1e 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneCrudController.java @@ -9,7 +9,6 @@ import org.alliancegenome.curation_api.model.entities.Gene; import org.alliancegenome.curation_api.model.ingest.dto.GeneDTO; import org.alliancegenome.curation_api.response.APIResponse; -import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.GeneService; import jakarta.annotation.PostConstruct; @@ -31,11 +30,6 @@ protected void init() { setService(geneService); } - @Override - public ObjectResponse get(String id) { - return geneService.get(id); - } - @Override public APIResponse updateGenes(String dataProvider, List geneData) { return geneExecutor.runLoad(dataProvider, geneData); diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java index bd8a7de7f..f3019e5fd 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java @@ -1,31 +1,76 @@ package org.alliancegenome.curation_api.interfaces.base; +import java.util.HashMap; +import java.util.List; + import org.alliancegenome.curation_api.model.entities.base.CurieObject; +import org.alliancegenome.curation_api.response.ObjectListResponse; import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.view.View; +import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody; +import org.eclipse.microprofile.openapi.annotations.tags.Tag; import com.fasterxml.jackson.annotation.JsonView; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.DefaultValue; import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; import jakarta.ws.rs.Path; import jakarta.ws.rs.PathParam; import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; import jakarta.ws.rs.core.MediaType; @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface CurieObjectCrudInterface extends BaseIdCrudInterface { +public interface CurieObjectCrudInterface { + + @POST + @Path("/") + @JsonView(View.FieldsOnly.class) + public ObjectResponse create(E entity); + + @POST + @Path("/multiple") + @JsonView(View.FieldsOnly.class) + public ObjectListResponse create(List entities); @GET @Path("/{curie}") @JsonView(View.FieldsOnly.class) public ObjectResponse get(@PathParam("curie") String curie); + @PUT + @Path("/") + @JsonView(View.FieldsOnly.class) + public ObjectResponse update(E entity); + @DELETE @Path("/{curie}") @JsonView(View.FieldsOnly.class) public ObjectResponse delete(@PathParam("curie") String curie); + @POST + @Path("/find") + @Tag(name = "Relational Database Browsing Endpoints") + @JsonView(View.FieldsAndLists.class) + public SearchResponse find(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); + + @POST + @Path("/search") + @Tag(name = "Elastic Search Browsing Endpoints") + @JsonView({ View.FieldsAndLists.class }) + public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); + + @GET + @Path("/reindex") + @Tag(name = "Reindex Endpoints") + public void reindex(@DefaultValue("1000") @QueryParam("batchSizeToLoadObjects") Integer batchSizeToLoadObjects, @DefaultValue("10000") @QueryParam("idFetchSize") Integer idFetchSize, + @DefaultValue("0") @QueryParam("limitIndexedObjectsTo") Integer limitIndexedObjectsTo, @DefaultValue("4") @QueryParam("threadsToLoadObjects") Integer threadsToLoadObjects, + @DefaultValue("14400") @QueryParam("transactionTimeout") Integer transactionTimeout, @DefaultValue("1") @QueryParam("typesToIndexInParallel") Integer typesToIndexInParallel); + } diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ConstructCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ConstructCrudInterface.java index 110c6cdb7..aadb58e61 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ConstructCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ConstructCrudInterface.java @@ -28,12 +28,6 @@ @Consumes(MediaType.APPLICATION_JSON) public interface ConstructCrudInterface extends SubmittedObjectCrudInterface, BaseDTOCrudControllerInterface { - @Override - @GET - @JsonView(View.ConstructView.class) - @Path("/{id}") - public ObjectResponse get(@PathParam("id") Long id); - @GET @Path("/{identifierString}") @JsonView(View.ConstructView.class) diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java index ebeec05b5..9e0ab2faf 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java @@ -20,6 +20,7 @@ import org.alliancegenome.curation_api.services.GeneDiseaseAnnotationService; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; +import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import lombok.extern.jbosslog.JBossLog; @@ -91,10 +92,13 @@ public void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataPro if(idsAdded != null) { idsAdded.add(annotation.getId()); } + Log.info("SAVING"); } catch (ObjectUpdateException e) { + Log.info("ERROR:" + e.getData()); history.incrementFailed(); addException(history, e.getData()); } catch (Exception e) { + Log.info("ERROR2:" + e.getMessage()); history.incrementFailed(); addException(history, new ObjectUpdateExceptionData(annotationDTO, e.getMessage(), e.getStackTrace())); } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java index bc63dfec3..c5628f0ff 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java @@ -9,6 +9,8 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import jakarta.persistence.Entity; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java index cde8b805f..b294656bd 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java @@ -14,8 +14,6 @@ import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.Table; import jakarta.persistence.UniqueConstraint; import lombok.Data; @@ -23,10 +21,10 @@ import lombok.ToString; @Data -@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@EqualsAndHashCode(callSuper = true) @Audited @Entity -@ToString(onlyExplicitlyIncluded = true, callSuper = true) +@ToString(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Table( indexes = { @@ -41,8 +39,6 @@ public class CurieObject extends AuditedObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "curie_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") @JsonView({ View.FieldsOnly.class }) - @EqualsAndHashCode.Include - @ToString.Include protected String curie; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java index b29e85145..4c829363a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java @@ -22,8 +22,6 @@ import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; import jakarta.persistence.Transient; @@ -35,7 +33,7 @@ @Audited @Entity @Data -@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { CurieObject.class }) @Table(indexes = { @@ -53,13 +51,11 @@ public class SubmittedObject extends CurieObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "modEntityId_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") @JsonView({ View.FieldsOnly.class }) - @EqualsAndHashCode.Include private String modEntityId; @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "modInternalId_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") @JsonView({ View.FieldsOnly.class }) - @EqualsAndHashCode.Include private String modInternalId; @IndexedEmbedded(includePaths = {"sourceOrganization.abbreviation", "sourceOrganization.fullName", "sourceOrganization.shortName", "crossReference.displayName", "crossReference.referencedCurie", diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java index fde8dd426..4f0aa4c4b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java @@ -38,9 +38,9 @@ public class SlotAnnotation extends AuditedObject { @IndexedEmbedded(includeDepth = 2) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany - @JoinTable(indexes = { @Index(name = "slotannotation_informationcontententity_slotannotation_index", columnList = "slotannotation_id"), - @Index(name = "slotannotation_informationcontententity_evidence_index", columnList = "evidence_id"), - + @JoinTable(indexes = { + @Index(name = "slotannotation_informationcontententity_slotannotation_index", columnList = "slotannotation_id"), + @Index(name = "slotannotation_informationcontententity_evidence_index", columnList = "evidence_id") }) @JsonView({ View.FieldsAndLists.class, View.AlleleView.class, View.GeneView.class, View.ConstructView.class }) private List evidence; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java index e632f862a..e56f61001 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java @@ -13,7 +13,6 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/NoteValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/NoteValidator.java index 1488c5214..56afad20c 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/NoteValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/NoteValidator.java @@ -80,9 +80,6 @@ public Note validateNote(Note uiEntity, String noteVocabularySetName, Boolean th } else { dbEntity.setReferences(null); } - - if (dbEntity.getInternal() == null) - dbEntity.setInternal(true); if (response.hasErrors()) { if (throwError) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/base/AuditedObjectValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/base/AuditedObjectValidator.java index 1b05b3302..e95884649 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/base/AuditedObjectValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/base/AuditedObjectValidator.java @@ -4,6 +4,7 @@ import java.util.List; import org.alliancegenome.curation_api.auth.AuthenticatedUser; +import org.alliancegenome.curation_api.model.entities.Note; import org.alliancegenome.curation_api.model.entities.Person; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.response.ObjectResponse; @@ -25,10 +26,14 @@ public class AuditedObjectValidator { public ObjectResponse response; public E validateAuditedObjectFields(E uiEntity, E dbEntity, Boolean newEntity) { - Boolean internal = uiEntity.getInternal() == null ? false : uiEntity.getInternal(); + Boolean defaultInternal = false; + if (uiEntity instanceof Note) + defaultInternal = true; + + Boolean internal = uiEntity.getInternal() == null ? defaultInternal : uiEntity.getInternal(); dbEntity.setInternal(internal); - Boolean obsolete = uiEntity.getObsolete() == null ? false : uiEntity.getObsolete(); + Boolean obsolete = uiEntity.getObsolete() == null ? defaultInternal : uiEntity.getObsolete(); dbEntity.setObsolete(obsolete); if (newEntity && uiEntity.getDateCreated() == null) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java index 9bcd37a71..c3a9c5d83 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java @@ -25,6 +25,7 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -52,6 +53,7 @@ public ObjectRespo ObjectResponse daResponse = validateAnnotationDTO(annotation, dto, VocabularyConstants.DISEASE_ANNOTATION_NOTE_TYPES_VOCABULARY_TERM_SET); annotation = daResponse.getEntity(); + Log.info("GOT HERE 10a"); if (StringUtils.isBlank(dto.getDoTermCurie())) { daResponse.addErrorMessage("do_term_curie", ValidationConstants.REQUIRED_MESSAGE); } else { @@ -61,6 +63,7 @@ public ObjectRespo annotation.setObject(disease); } + Log.info("GOT HERE 10b"); if (CollectionUtils.isEmpty(dto.getEvidenceCodeCuries())) { daResponse.addErrorMessage("evidence_code_curies", ValidationConstants.REQUIRED_MESSAGE); } else { @@ -78,12 +81,14 @@ public ObjectRespo annotation.setEvidenceCodes(ecoTerms); } + Log.info("GOT HERE 10c"); if (dto.getNegated() != null) { annotation.setNegated(dto.getNegated()); } else { annotation.setNegated(false); } + Log.info("GOT HERE 10d"); if (CollectionUtils.isNotEmpty(dto.getWithGeneIdentifiers())) { List withGenes = new ArrayList<>(); for (String withIdentifier : dto.getWithGeneIdentifiers()) { @@ -102,7 +107,8 @@ public ObjectRespo } else { annotation.setWith(null); } - + + Log.info("GOT HERE 10e"); DataProvider secondaryDataProvider = null; if (dto.getSecondaryDataProviderDto() != null) { ObjectResponse dpResponse = dataProviderDtoValidator.validateDataProviderDTO(dto.getSecondaryDataProviderDto(), annotation.getSecondaryDataProvider()); @@ -114,6 +120,7 @@ public ObjectRespo } annotation.setSecondaryDataProvider(secondaryDataProvider); + Log.info("GOT HERE 10f"); if (CollectionUtils.isNotEmpty(dto.getDiseaseQualifierNames())) { List diseaseQualifiers = new ArrayList<>(); for (String qualifier : dto.getDiseaseQualifierNames()) { @@ -129,25 +136,30 @@ public ObjectRespo annotation.setDiseaseQualifiers(null); } + Log.info("GOT HERE 10g"); if (CollectionUtils.isNotEmpty(dto.getDiseaseGeneticModifierIdentifiers()) || StringUtils.isNotBlank(dto.getDiseaseGeneticModifierRelationName())) { if (CollectionUtils.isEmpty(dto.getDiseaseGeneticModifierIdentifiers())) { daResponse.addErrorMessage("disease_genetic_modifier_relation_name", ValidationConstants.DEPENDENCY_MESSAGE_PREFIX + "disease_genetic_modifier_identifiers"); } else if (StringUtils.isBlank(dto.getDiseaseGeneticModifierRelationName())) { daResponse.addErrorMessage("disease_genetic_modifier_identifiers", ValidationConstants.DEPENDENCY_MESSAGE_PREFIX + "disease_genetic_modifier_relation_name"); } else { + Log.info("GOT HERE 10ga"); VocabularyTerm diseaseGeneticModifierRelation = vocabularyTermService.getTermInVocabulary(VocabularyConstants.DISEASE_GENETIC_MODIFIER_RELATION_VOCABULARY, dto.getDiseaseGeneticModifierRelationName()).getEntity(); if (diseaseGeneticModifierRelation == null) daResponse.addErrorMessage("disease_genetic_modifier_relation_name", ValidationConstants.INVALID_MESSAGE + " (" + dto.getDiseaseGeneticModifierRelationName() + ")"); List diseaseGeneticModifiers = new ArrayList<>(); for (String modifierIdentifier : dto.getDiseaseGeneticModifierIdentifiers()) { + Log.info("GOT HERE 10gb"); BiologicalEntity diseaseGeneticModifier = biologicalEntityService.findByIdentifierString(modifierIdentifier); if (diseaseGeneticModifier == null) { daResponse.addErrorMessage("disease_genetic_modifier_identifiers", ValidationConstants.INVALID_MESSAGE + " (" + modifierIdentifier + ")"); } else { + Log.info("GOT HERE 10gc"); diseaseGeneticModifiers.add(diseaseGeneticModifier); } } + Log.info("GOT HERE 10gd"); annotation.setDiseaseGeneticModifiers(diseaseGeneticModifiers); annotation.setDiseaseGeneticModifierRelation(diseaseGeneticModifierRelation); } @@ -156,6 +168,7 @@ public ObjectRespo annotation.setDiseaseGeneticModifierRelation(null); } + Log.info("GOT HERE 10h"); VocabularyTerm annotationType = null; if (StringUtils.isNotBlank(dto.getAnnotationTypeName())) { annotationType = vocabularyTermService.getTermInVocabulary(VocabularyConstants.ANNOTATION_TYPE_VOCABULARY, dto.getAnnotationTypeName()).getEntity(); @@ -164,6 +177,7 @@ public ObjectRespo } annotation.setAnnotationType(annotationType); + Log.info("GOT HERE 10i"); VocabularyTerm geneticSex = null; if (StringUtils.isNotBlank(dto.getGeneticSexName())) { geneticSex = vocabularyTermService.getTermInVocabulary(VocabularyConstants.GENETIC_SEX_VOCABULARY, dto.getGeneticSexName()).getEntity(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java index 5374b102e..6d44a2a07 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java @@ -20,6 +20,7 @@ import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; import org.apache.commons.lang3.StringUtils; +import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -40,21 +41,31 @@ public class GeneDiseaseAnnotationDTOValidator extends DiseaseAnnotationDTOValid public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotationDTO dto, BackendBulkDataProvider dataProvider) throws ObjectValidationException { GeneDiseaseAnnotation annotation = new GeneDiseaseAnnotation(); Gene gene; - + Log.info("GOT HERE 1"); ObjectResponse gdaResponse = new ObjectResponse(); + Log.info("GOT HERE 2"); ObjectResponse refResponse = validateReference(annotation, dto); + + Log.info("GOT HERE 3"); gdaResponse.addErrorMessages(refResponse.getErrorMessages()); Reference validatedReference = refResponse.getEntity().getSingleReference(); + + Log.info("GOT HERE 4"); String refCurie = validatedReference == null ? null : validatedReference.getCurie(); + Log.info("GOT HERE 5"); if (StringUtils.isBlank(dto.getGeneIdentifier())) { gdaResponse.addErrorMessage("gene_identifier", ValidationConstants.REQUIRED_MESSAGE); } else { + + Log.info("GOT HERE 6"); gene = geneService.findByIdentifierString(dto.getGeneIdentifier()); if (gene == null) { gdaResponse.addErrorMessage("gene_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGeneIdentifier() + ")"); } else { + + Log.info("GOT HERE 7"); String annotationId; String identifyingField; String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getGeneIdentifier(), refCurie); @@ -72,6 +83,7 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat identifyingField = "uniqueId"; } + Log.info("GOT HERE 8"); SearchResponse annotationList = geneDiseaseAnnotationDAO.findByField(identifyingField, annotationId); if (annotationList != null && annotationList.getResults().size() > 0) { annotation = annotationList.getResults().get(0); @@ -85,7 +97,8 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat } } } - + + Log.info("GOT HERE 9"); annotation.setSingleReference(validatedReference); AffectedGenomicModel sgdStrainBackground = null; @@ -96,11 +109,13 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat } } annotation.setSgdStrainBackground(sgdStrainBackground); - + + Log.info("GOT HERE 10"); ObjectResponse daResponse = validateDiseaseAnnotationDTO(annotation, dto); annotation = daResponse.getEntity(); gdaResponse.addErrorMessages(daResponse.getErrorMessages()); - + + Log.info("GOT HERE 11"); if (StringUtils.isNotEmpty(dto.getDiseaseRelationName())) { VocabularyTerm diseaseRelation = vocabularyTermService.getTermInVocabularyTermSet(VocabularyConstants.GENE_DISEASE_RELATION_VOCABULARY_TERM_SET, dto.getDiseaseRelationName()).getEntity(); if (diseaseRelation == null) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseDTOValidator.java index 50e42bb88..367422506 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseDTOValidator.java @@ -15,6 +15,7 @@ import org.alliancegenome.curation_api.model.entities.ontology.NCBITaxonTerm; import org.alliancegenome.curation_api.model.ingest.dto.BiologicalEntityDTO; import org.alliancegenome.curation_api.model.ingest.dto.GenomicEntityDTO; +import org.alliancegenome.curation_api.model.ingest.dto.NoteDTO; import org.alliancegenome.curation_api.model.ingest.dto.base.AuditedObjectDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.DataProviderService; @@ -55,7 +56,7 @@ public ObjectResponse v updatedBy = personService.fetchByUniqueIdOrCreate(dto.getUpdatedByCurie()); entity.setUpdatedBy(updatedBy); - Boolean internal = false; + Boolean internal = dto instanceof NoteDTO ? true : false; if (dto.getInternal() != null) internal = dto.getInternal(); entity.setInternal(internal); diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index 4af9fa3a1..32c348780 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -11,971 +11,1923 @@ ALTER TABLE allelegeneassociation_aud RENAME objectgene_curie TO object_curie; -- Random cleanup -ALTER INDEX gene_taxon_index RENAME TO gene_genetype_index; - ALTER TABLE organization DROP COLUMN IF EXISTS uniqueid; ALTER TABLE organization_aud DROP COLUMN IF EXISTS uniqueid; -DROP TABLE paperhandle; -DROP TABLE paperhandle_aud; +DROP TABLE IF EXISTS paperhandle; +DROP TABLE IF EXISTS paperhandle_aud; + +ALTER TABLE agmdiseaseannotation DROP COLUMN IF EXISTS predicate; +ALTER TABLE allelediseaseannotation DROP COLUMN IF EXISTS predicate; +ALTER TABLE genediseaseannotation DROP COLUMN IF EXISTS predicate; + +ALTER TABLE synonym ALTER COLUMN name SET DATA TYPE text; + +ALTER TABLE person_aud ADD COLUMN uniqueid varchar (2000); -- Drop indexes and constraints -ALTER TABLE affectedgenomicmodel DROP CONSTRAINT affectedgenomicmodel_pkey; ALTER TABLE affectedgenomicmodel DROP CONSTRAINT fkke1qw7ijaa33fqv1bifsiwiv9; - -ALTER TABLE affectedgenomicmodel_aud DROP CONSTRAINT affectedgenomicmodel_aud_pkey; ALTER TABLE affectedgenomicmodel_aud DROP CONSTRAINT fkd6m9in16kh1tqvln37a13r3hx; - ALTER TABLE agmdiseaseannotation DROP CONSTRAINT agmdiseaseannotation_assertedallele_curie_fk; -ALTER TABLE agmdiseaseannotation DROP CONSTRAINT fk_agmdasubject +ALTER TABLE agmdiseaseannotation DROP CONSTRAINT fk_agmdasubject; ALTER TABLE agmdiseaseannotation DROP CONSTRAINT fko9dilcfxv6tw0oaeds0yss8op; ALTER TABLE agmdiseaseannotation RENAME CONSTRAINT fkp1rktcpoyvnr2f756ncdb8k24 TO agmdiseaseannotation_id_fk; ALTER TABLE agmdiseaseannotation DROP CONSTRAINT fktj1uj3to13fi4q32bc2p65lah; - ALTER TABLE agmdiseaseannotation_aud RENAME CONSTRAINT fkl6x226295n9ms1kugrsi88efp TO agmdiseaseannotation_aud_id_rev_fk; - ALTER TABLE agmdiseaseannotation_gene DROP CONSTRAINT agmdiseaseannotation_gene_assertedgenes_curie_fk; ALTER INDEX idxbcpc5ib23w0ssq0wskm99vxmq RENAME TO agmdiseaseannotation_gene_agmdiseaseannotation_index; - ALTER TABLE agmdiseaseannotation_gene_aud RENAME CONSTRAINT fkrbw9608l4haci5t3w3ll9xmcu TO agmdiseaseannotation_gene_aud_rev_fk; - -ALTER TABLE allele DROP CONSTRAINT allele_pkey; ALTER TABLE allele DROP CONSTRAINT fk42r7586hi59wcwakfyr30l6l3; - -ALTER TABLE allele_aud DROP CONSTRAINT allele_aud_pkey; ALTER TABLE allele_aud DROP CONSTRAINT fkc4cub43jynmwqke9rpwpglhkt; - ALTER TABLE allele_note DROP CONSTRAINT allele_note_allele_curie_fk; ALTER TABLE allele_note DROP CONSTRAINT uk_3ja9wii4jxp0krcfpturumjhb; ALTER TABLE allele_note RENAME CONSTRAINT allele_note_relatednotes_id_key TO allele_note_relatednotes_id_uk; ALTER INDEX idx3ja9wii4jxp0krcfpturumjhb RENAME TO allele_note_relatednotes_index; DROP INDEX idx50j986kkb5ymfepkamokl1q9w; - -ALTER TABLE allele_note_aud DROP CONSTRAINT allele_note_aud_pkey; - ALTER TABLE allele_reference DROP CONSTRAINT allele_reference_allele_curie_fk; ALTER TABLE allele_reference DROP CONSTRAINT allele_reference_references_curie_fk; -DROP INDEX idx4jhjumoyh806jhpi2c0cf3t7w; +DROP INDEX idxce99mr9ponwii377kkwpess1l; DROP INDEX idxo6e5hexti6nfdj1v6ytnlwjvd; DROP INDEX idxsfk08sqo0k364ixvsd8iui53i; - -ALTER TABLE allele_reference_aud DROP CONSTRAINT allele_reference_aud_pkey; ALTER TABLE allele_reference_aud RENAME CONSTRAINT fkhuya942qqdhsi6m0v37njxh30 TO allele_reference_aud_rev_fk; - ALTER TABLE alleledatabasestatusslotannotation DROP CONSTRAINT alleledatabasestatus_singleallele_curie_fk; ALTER INDEX alleledatabasestatus_databasestatus_id_index RENAME TO alleledatabasestatus_databasestatus_index; DROP INDEX alleledatabasestatus_singleallele_curie_index; - ALTER TABLE allelediseaseannotation DROP CONSTRAINT fk_alleledasubject; ALTER TABLE allelediseaseannotation RENAME CONSTRAINT fk3unb0kaxocbodllqe35hu4w0c TO allelediseaseannotation_id_fk; ALTER TABLE allelediseaseannotation DROP CONSTRAINT fknecrivvmqgg2ifhppubrjy5ey; DROP INDEX allelediseaseannotation_inferredgene_index; DROP INDEX allelediseaseannotation_subject_index; - ALTER TABLE allelediseaseannotation_gene DROP CONSTRAINT allelediseaseannotation_gene_assertedgenes_curie_fk; ALTER INDEX idxgb71atjgxqcgqnronvuprq8g4 RENAME TO allelediseaseannotationgene_diseaseannotation_index; DROP INDEX idxf6sdkewbxohussr4fs7440vj5; - -ALTER TABLE allelefullnameslotannotation DROP CONSTRAINT allelefullname_singleallele_curie_fk; +ALTER TABLE allelefullnameslotannotation DROP CONSTRAINT allelefullnameslotannotation_singleallele_curie_fk; DROP INDEX allelefullname_singleallele_curie_index; - ALTER TABLE allelefunctionalimpactslotannotation DROP CONSTRAINT allelefunctionalimpactslotannotation_singleallele_curie_fk; ALTER TABLE allelefunctionalimpactslotannotation RENAME CONSTRAINT fkng1x5duqyvks0enxdtr7andrl TO allelefunctionalimpactslotannotation_id_fk; ALTER TABLE allelefunctionalimpactslotannotation DROP CONSTRAINT allelefunctionalimpactslotannotation_phenotypeterm_curie_fk; - ALTER TABLE allelefunctionalimpactslotannotation_vocabularyterm RENAME CONSTRAINT allelefunctionalimpactsa_vocabterm_afisa_curie_fk TO allelefunctionalimpactsa_vocabterm_afisa_id_fk; ALTER TABLE allelefunctionalimpactslotannotation_vocabularyterm RENAME CONSTRAINT allelefunctionalimpactsa_vocabterm_functionimpacts_id_fk TO allelefunctionalimpactsa_vocabterm_functionalimpacts_id_fk; ALTER INDEX allelefunctionalimpactslotannotation_functionalimpacts_id_index RENAME TO allelefunctionalimpactsa_vocabterm_functionalimpacts_index; -ALTER INDEX allelefunctionalimpactslotannotation_id_index TO allelefunctionalimpactsa_vocabterm_afisa_index; - +ALTER INDEX allelefunctionalimpactslotannotation_id_index RENAME TO allelefunctionalimpactsa_vocabterm_afisa_index; ALTER TABLE allelegeneassociation DROP CONSTRAINT allelegeneassociation_object_curie_fk; ALTER TABLE allelegeneassociation DROP CONSTRAINT allelegeneassociation_subject_curie_fk; DROP INDEX allelegeneassociation_object_index; DROP INDEX allelegeneassociation_subject_index; - ALTER TABLE allelegenomicentityassociation DROP CONSTRAINT allelegenomicentityassociation_evidencecode_curie_fk; ALTER TABLE allelegenomicentityassociation RENAME CONSTRAINT fk1qks8xk2i7ml0qnhgx8q6ieex TO allelegenomicentityassociation_id_fk; - ALTER TABLE allelegermlinetransmissionstatusslotannotation DROP CONSTRAINT allelegermlinetransmissionstatus_singleallele_curie_fk; ALTER TABLE allelegermlinetransmissionstatusslotannotation RENAME CONSTRAINT fkimjfrsvtapxj0gl4ocsfc68iy TO allelegermlinetransmissionstatus_id_fk; ALTER INDEX allelegermlinetransmissionstatus_status_id_index RENAME TO allelegermlinetransmissionstatus_status_index; - ALTER TABLE alleleinheritancemodeslotannotation DROP CONSTRAINT alleleinheritancemodeslotannotation_phenotypeterm_curie_fk; ALTER TABLE alleleinheritancemodeslotannotation DROP CONSTRAINT fkcgj3a3skh2a666q8wvehcs1pw; DROP INDEX alleleinheritancemode_phenotypeterm_curie_index; DROP INDEX alleleinheritancemode_singleallele_curie_index; ALTER INDEX alleleinheritancemode_inheritancemode_id_index RENAME TO alleleinheritancemode_inheritancemode_index; - -ALTER TABLE allelemutationtypeslotannotation DROP CONSTRAINT allelemutationtypeslotannotation_singleallele_curie_fk; +ALTER TABLE allelemutationtypeslotannotation RENAME CONSTRAINT allelemutationtypeslotannotationtype_id_fk TO allelemutationtypeslotannotation_id_fk; +ALTER TABLE allelemutationtypeslotannotation DROP CONSTRAINT allelemutationtypeslotannotationtype_singleallele_curie_fk; DROP INDEX allelemutationtype_singleallele_curie_index; - ALTER TABLE allelemutationtypeslotannotation_soterm RENAME CONSTRAINT allelemutationtypeslotannotation_aud_amsa_id_fk TO allelemutationtypesa_soterm_amsa_id_fk; ALTER TABLE allelemutationtypeslotannotation_soterm DROP CONSTRAINT allelemutationtypeslotannotation_aud_mutationtypes_curie_fk; ALTER INDEX allelemutationtypeslotannotation_id_index RENAME TO allelemutationtypesa_soterm_amsa_index; - ALTER TABLE allelenomenclatureeventslotannotation DROP CONSTRAINT allelenomenclatureeventslotannotation_singleallele_curie_fk; DROP INDEX allelenomenclatureevent_singleallele_curie_index; ALTER INDEX allelenomenclatureevent_nomenclatureevent_id_index RENAME TO allelenomenclatureevent_nomenclatureevent_index; - ALTER TABLE allelesecondaryidslotannotation DROP CONSTRAINT allelesecondaryidslotannotation_singleallele_curie_fk; ALTER TABLE allelesecondaryidslotannotation RENAME CONSTRAINT fko6369ool2dxdy8odi2i9brj4r TO allelesecondaryidslotannotation_id_fk; DROP INDEX allelesecondaryid_singleallele_curie_index; - ALTER TABLE allelesymbolslotannotation DROP CONSTRAINT allelesymbolslotannotation_singleallele_curie_fk; DROP INDEX allelesymbol_singleallele_curie_index; - ALTER TABLE allelesynonymslotannotation DROP CONSTRAINT allelesynonymslotannotation_singleallele_curie_fk; DROP INDEX allelesynonym_singleallele_curie_index; - -ALTER TABLE anatomicalterm DROP CONSTRAINT anatomicalterm_pkey; ALTER TABLE anatomicalterm DROP CONSTRAINT fkfepti479fro1b09ybaltkofqu; - -ALTER TABLE anatomicalterm_aud DROP CONSTRAINT antomicalterm_aud_pkey; ALTER TABLE anatomicalterm_aud DROP CONSTRAINT fkan2c886jcsep01s7rqibfghfh; - ALTER INDEX annotation_conditionrelation_annotation_id_index RENAME TO annotation_conditionrelation_annotation_index; ALTER INDEX annotation_conditionrelation_conditionrelations_id_index RENAME TO annotation_conditionrelation_conditionrelations_index; - ALTER TABLE annotation_note RENAME CONSTRAINT fks4im5g992bpgi6wa1rp9y8vil TO annotation_note_annotation_id_fk; ALTER INDEX annotation_note_annotation_id_index RENAME TO annotation_note_annotation_index; ALTER INDEX annotation_note_relatednotes_id_index RENAME TO annotation_note_relatednotes_index; - -ALTER TABLE apoterm DROP CONSTRAINT apoterm_pkey; ALTER TABLE apoterm DROP CONSTRAINT apoterm_curie_fk; - -ALTER TABLE apoterm_aud DROP CONSTRAINT apoterm_aud_pkey; ALTER TABLE apoterm_aud DROP CONSTRAINT apoterm_aud_curie_rev_fk; - -ALTER TABLE atpterm DROP CONSTRAINT atpterm_pkey; ALTER TABLE atpterm DROP CONSTRAINT fksnxpka3rhxycguxrcyfyobtjf; - -ALTER TABLE atpterm_aud DROP CONSTRAINT atpterm_aud_pkey; ALTER TABLE atpterm_aud DROP CONSTRAINT fki65mb9a7b4el107fk4ox2f0kd; - -ALTER TABLE biologicalentity DROP CONSTRAINT biologicalentity_pkey; ALTER TABLE biologicalentity DROP CONSTRAINT fk5c19vicptarinu2wgj7xyhhum; DROP INDEX biologicalentity_taxon_index; - -ALTER TABLE biologicalentity_aud DROP CONSTRAINT biologicalentity_aud_pkey; ALTER TABLE biologicalentity_aud DROP CONSTRAINT fk5hkwd2k49xql5qy0aby85qtad; - -ALTER TABLE bspoterm_aud DROP CONSTRAINT bspoterm_aud_pkey; +ALTER TABLE bspoterm DROP CONSTRAINT bspoterm_curie_fk; ALTER TABLE bspoterm_aud DROP CONSTRAINT bspoterm_aud_curie_rev_fk; - ALTER TABLE bulkload_aud DROP CONSTRAINT fkhhh8994753467hwa33blp22dc; - ALTER TABLE bulkloadfile_aud DROP CONSTRAINT fk7sl5m81qa11sr40chch9vg6uj; - ALTER TABLE bulkloadfileexception_aud DROP CONSTRAINT fkm7op2ir0vi9pwcctl39kqbo70; - ALTER TABLE bulkloadfilehistory_aud DROP CONSTRAINT fkppa5tcqtwv560svqkq6b958hc; - ALTER TABLE bulkloadgroup_aud DROP CONSTRAINT fk722g0iotb8v01pq0cej3w7gke; - -ALTER TABLE chebiterm DROP CONSTRAINT chebiterm_pkey; ALTER TABLE chebiterm DROP CONSTRAINT fk7enwyeblw2xt5yo5co0keko5f; - -ALTER TABLE chebiterm_aud DROP CONSTRAINT chebiterm_aud_pkey; ALTER TABLE chebiterm_aud DROP CONSTRAINT fk7grscrrhdcw9ek6agi78j4ca1; - -ALTER TABLE chemicalterm DROP CONSTRAINT chemicalterm_pkey; ALTER TABLE chemicalterm DROP CONSTRAINT fk2fegif3wy9egh5r2yy8wplrwu; - -ALTER TABLE chemicalterm_aud DROP CONSTRAINT chemicalterm_aud_pkey; ALTER TABLE chemicalterm_aud DROP CONSTRAINT fkieeg5x1a11dqom8dw4valm169; - -ALTER TABLE clterm DROP CONSTRAINT clterm_pkey; ALTER TABLE clterm DROP CONSTRAINT clterm_curie_fk; - -ALTER TABLE clterm_aud DROP CONSTRAINT clterm_aud_pkey; ALTER TABLE clterm_aud DROP CONSTRAINT clterm_aud_curie_rev_fk; - -ALTER TABLE cmoterm DROP CONSTRAINT clterm_pkey; -ALTER TABLE cmoterm DROP CONSTRAINT clterm_curie_fk; - -ALTER TABLE cmoterm_aud DROP CONSTRAINT cmoterm_aud_pkey; +ALTER TABLE cmoterm DROP CONSTRAINT cmoterm_curie_fk; ALTER TABLE cmoterm_aud DROP CONSTRAINT cmoterm_aud_curie_rev_fk; - ALTER TABLE conditionrelation RENAME CONSTRAINT fkn8t4joy3iheftpbxt0omvxl52 TO conditionrelation_conditionrelationtype_id_fk; ALTER TABLE conditionrelation DROP CONSTRAINT conditionrelation_singlereference_curie_fk; - ALTER TABLE conditionrelation_aud DROP CONSTRAINT fkkcw0iu1vmw6ttm7g645947yyy; - ALTER TABLE construct_reference DROP CONSTRAINT construct_reference_references_curie_fk; -ALTER INDEX construct_reference_construct_id_index TO construct_reference_construct_index; +ALTER INDEX construct_reference_construct_id_index RENAME TO construct_reference_construct_index; DROP INDEX construct_reference_references_curie_index; - ALTER TABLE constructcomponentslotannotation DROP CONSTRAINT constructcomponentslotannotation_taxon_curie_fk; DROP INDEX constructcomponentslotannotation_taxon_index; - ALTER INDEX constructcomponentsa_note_ccsa_id_index RENAME TO constructcomponentsa_note_ccsa_index; -ALTER INDEX constructcomponentsa_note_relatednotes_id_index RENAME TO constructcomponentsa_note_relatednotes_index - +ALTER INDEX constructcomponentsa_note_relatednotes_id_index RENAME TO constructcomponentsa_note_relatednotes_index; ALTER INDEX constructfullname_singleconstruct_id_index RENAME TO constructfullname_singleconstruct_index; - ALTER TABLE constructgenomicentityassociation DROP CONSTRAINT constructgenomicentityassociation_object_curie_fk; ALTER TABLE constructgenomicentityassociation RENAME CONSTRAINT fkgrhw9gxslaub14x4b0mc7v9mk TO constructgenomicentityassociation_id_fk; DROP INDEX constructgenomicentityassociation_object_index; - ALTER INDEX cgeassociation_note_cgeassociation_id_index RENAME TO cgeassociation_note_cgeassociation_index; ALTER INDEX cgeassociation_note_relatednotes_id_index RENAME TO cgeassociation_note_relatednotes_index; - ALTER INDEX constructsymbol_singleconstruct_id_index RENAME TO constructsymbol_singleconstruct_index; - ALTER INDEX constructsynonym_singleconstruct_id_index RENAME TO constructsynonym_singleconstruct_index; - ALTER TABLE crossreference_aud DROP CONSTRAINT fkricj7nn0u0fec2l2r2fo7al55; - ALTER TABLE curationreport_aud DROP CONSTRAINT fks2fh7j9mb60yfxyd83gklhgmo; - ALTER TABLE curationreportgroup_aud DROP CONSTRAINT fk7pl1pmjstb9eqi80e353a06v8; - ALTER TABLE curationreporthistory_aud DROP CONSTRAINT fk5mffk8y6qajllde8m24dwjn9v; - -ALTER TABLE daoterm DROP CONSTRAINT daoterm_pkey; ALTER TABLE daoterm DROP CONSTRAINT fk3xjbjyyuqqyvspspeael1m7fe; - -ALTER TABLE daoterm_aud DROP CONSTRAINT daoterm_aud_pkey; ALTER TABLE daoterm_aud DROP CONSTRAINT fkgif1cep78abowfodb5rxvoq1x; - ALTER TABLE dataprovider_aud DROP CONSTRAINT fk66rd9ltf5l9paxmvyr63tcqwf; - ALTER TABLE diseaseannotation DROP CONSTRAINT diseaseannotation_object_curie_fk; DROP INDEX diseaseannotation_object_index; - ALTER TABLE diseaseannotation_biologicalentity DROP CONSTRAINT diseaseannotation_biologicalentity_dgm_curie_fk; ALTER INDEX idxa408leg4b6rrhx0e0e35yno7t RENAME TO diseaseannotation_biologicalentity_diseaseannotation_index; DROP INDEX idxon9a94gwp0jl6t2sfjqv0iwa5; - -ALTER TABLE diseaseannotation_ecoterm RENAME CONSTRAINT idxon9a94gwp0jl6t2sfjqv0iwa5 TO diseaseannotation_ecoterm_diseaseannotation_id_fk; +ALTER TABLE diseaseannotation_ecoterm RENAME CONSTRAINT fk43rw1jai2kqggx518nsu8c4me TO diseaseannotation_ecoterm_diseaseannotation_id_fk; ALTER TABLE diseaseannotation_ecoterm DROP CONSTRAINT fkp79bf46xsyojpvjjguoe3vuuu; DROP INDEX idx3u0swr7xss7wjjve7ocd08u27; ALTER INDEX idxntbiegjxs3ooqy894m4y5vgwb RENAME TO diseaseannotation_ecoterm_diseaseannotation_index; - ALTER TABLE diseaseannotation_gene DROP CONSTRAINT fk6akpr16qusnfom0fdhjjevkb2; ALTER TABLE diseaseannotation_gene RENAME CONSTRAINT fky4jlhsgseecd3gkxjtwp28ba TO diseaseannotation_gene_diseaseannotation_id_fk; DROP INDEX idxc8bxs3ggb4rt2kmnqja0js5mq; ALTER INDEX idxj6eavg6eannqn6uhvja6p4enf RENAME TO diseaseannotation_gene_diseaseannotation_index; - ALTER TABLE diseaseannotation_vocabularyterm RENAME CONSTRAINT fk7jhlm01yyrnyd26c5extqi9iv TO diseaseannotation_vocabularyterm_diseasequalifiers_id_fk; ALTER TABLE diseaseannotation_vocabularyterm RENAME CONSTRAINT fkb7dg8qvpicnh87s0162sn62gl TO diseaseannotation_vocabularyterm_diseaseannotation_id_fk; ALTER INDEX idxbnb14fsatd291upd9af38fnyp RENAME TO diseaseannotation_vocabularyterm_diseasequalifiers_index; ALTER INDEX idxc8oiw5qoippfjl0b6s9oegiss RENAME TO diseaseannotation_vocabularyterm_diseaseannotation_index; - -ALTER TABLE doterm DROP CONSTRAINT doterm_pkey; ALTER TABLE doterm DROP CONSTRAINT fkp8el2duba9ym3l6gd5dy43swk; - -ALTER TABLE doterm_aud DROP CONSTRAINT doterm_aud_pkey; ALTER TABLE doterm_aud DROP CONSTRAINT fkkgu80ih0f55tskr386gucsqh2; - -ALTER TABLE dpoterm DROP CONSTRAINT dpoterm_pkey; ALTER TABLE dpoterm DROP CONSTRAINT dpoterm_curie_fk; - -ALTER TABLE dpoterm_aud DROP CONSTRAINT dpoterm_aud_pkey; ALTER TABLE dpoterm_aud DROP CONSTRAINT dpoterm_aud_curie_rev_fk; - -ALTER TABLE ecoterm DROP CONSTRAINT doterm_pkey; ALTER TABLE ecoterm DROP CONSTRAINT fkskvp24kfp723htxmk0m9ev4ns; - -ALTER TABLE ecoterm_aud DROP CONSTRAINT doterm_aud_pkey; ALTER TABLE ecoterm_aud DROP CONSTRAINT fkrdtwy8r0gnnh6numgdbgi9e6s; - -ALTER TABLE emapaterm DROP CONSTRAINT emapaterm_pkey; ALTER TABLE emapaterm DROP CONSTRAINT fkcm3tpjo7lxsx61pj7gs5y9f9u; - -ALTER TABLE emapaterm_aud DROP CONSTRAINT emapaterm_aud_pkey; ALTER TABLE emapaterm_aud DROP CONSTRAINT fkaipxoy4lm50q9mphk2yp7whyh; - ALTER TABLE evidenceassociation_informationcontententity DROP CONSTRAINT evidenceassociation_infocontent_evidence_curie_fk; ALTER INDEX evidenceassociation_infocontent_evidenceassociation_id_index RENAME TO evidenceassociation_infocontent_evidenceassociation_index; DROP INDEX evidenceassociation_infocontent_evidence_curie_index; - ALTER TABLE experimentalcondition DROP CONSTRAINT fk2rmhalgeg6rghpat78b2cpcoc; ALTER TABLE experimentalcondition DROP CONSTRAINT fkagp6m2xqeu7bapu5hyh2pmha9; ALTER TABLE experimentalcondition DROP CONSTRAINT fkcl89ywjgllce228a0uo8fd0ee; ALTER TABLE experimentalcondition DROP CONSTRAINT fkhi2109btsx06x2u9kdg7y7xp0; ALTER TABLE experimentalcondition DROP CONSTRAINT fkp0oqdnt9bmx68i84neufkcb3a; ALTER TABLE experimentalcondition DROP CONSTRAINT fksso9a3875a8t0ver6u6qciuap; - -ALTER TABLE experimentalconditionontologyterm DROP CONSTRAINT experimentalconditionontologyterm_pkey; ALTER TABLE experimentalconditionontologyterm DROP CONSTRAINT fk5jlaea2evnqnrlf72jglhqq6p; - -ALTER TABLE experimentalconditionontologyterm_aud DROP CONSTRAINT experimentalconditionontologyterm_aud_pkey; ALTER TABLE experimentalconditionontologyterm_aud DROP CONSTRAINT fkkr4o08hq0jboq6g4ou5gmn8xd; - -ALTER TABLE fbdvterm DROP CONSTRAINT fbdvterm_pkey; ALTER TABLE fbdvterm DROP CONSTRAINT fkn7q3y19l70sef1h4f9ippnjoa; - -ALTER TABLE fbdvterm_aud DROP CONSTRAINT fbdvterm_aud_pkey; ALTER TABLE fbdvterm_aud DROP CONSTRAINT fkvtaradvq4e6fdjecf2m4ujap; - -ALTER TABLE gene DROP CONSTRAINT gene_pkey; ALTER TABLE gene DROP CONSTRAINT fk9v4jtwy759c3cfub0uxye5rue; ALTER TABLE gene DROP CONSTRAINT fkiaxg0dhug3stym3gjovw598w1; DROP INDEX gene_taxon_index; - -ALTER TABLE gene_aud DROP CONSTRAINT gene_aud_pkey; ALTER TABLE gene_aud DROP CONSTRAINT fk4n82maba8vniaxet7w2w1sfg4; - ALTER TABLE genediseaseannotation RENAME CONSTRAINT fk3j5deigrhrwln0srh51vtw3m8 TO genediseaseannotation_id_fk; ALTER TABLE genediseaseannotation DROP CONSTRAINT fk51h0w9jsd45qw5f3v2v0o28mu; ALTER TABLE genediseaseannotation DROP CONSTRAINT fk_genedasubject; - ALTER TABLE genefullnameslotannotation DROP CONSTRAINT genefullnameslotannotation_singlegene_curie_fk; DROP INDEX genefullname_singlegene_curie_index; - ALTER TABLE genesecondaryidslotannotation DROP CONSTRAINT fkhtdt6peje2s446u44ax3knp14; ALTER TABLE genesecondaryidslotannotation RENAME CONSTRAINT fkq0oks812epecjvubiasibhw2s TO genesecondaryidslotannotation_id_fk; DROP INDEX genesecondaryid_singlegene_curie_index; - ALTER TABLE genesymbolslotannotation DROP CONSTRAINT genesymbolslotannotation_singlegene_curie_fk; DROP INDEX genesymbol_singlegene_curie_index; - ALTER TABLE genesynonymslotannotation DROP CONSTRAINT genesynonymslotannotation_singlegene_curie_fk; DROP INDEX genesynonym_singlegene_curie_index; - ALTER TABLE genesystematicnameslotannotation DROP CONSTRAINT genesystematicnameslotannotation_singlegene_curie_fk; DROP INDEX genesystematicname_singlegene_curie_index; - ALTER TABLE genetogeneorthology DROP CONSTRAINT genetogeneorthology_objectgene_curie_fk; ALTER TABLE genetogeneorthology DROP CONSTRAINT genetogeneorthology_subjectgene_curie_fk; DROP INDEX genetogeneorthology_objectgene_index; DROP INDEX genetogeneorthology_subjectgene_index; - ALTER TABLE genetogeneorthologycurated DROP CONSTRAINT genetogeneorthologycurated_evidencecode_curie_fk; ALTER TABLE genetogeneorthologycurated DROP CONSTRAINT genetogeneorthologycurated_singlereference_curie_fk; DROP INDEX genetogeneorthologycurated_evidencecode_index; DROP INDEX genetogeneorthologycurated_singlereference_index; - -ALTER TABLE genomicentity DROP CONSTRAINT genomicentity_pkey; ALTER TABLE genomicentity DROP CONSTRAINT fkhi54si7gksfs3f6jrbytaddbi; - -ALTER TABLE genomicentity_aud DROP CONSTRAINT genomicentity_aud_pkey; ALTER TABLE genomicentity_aud DROP CONSTRAINT fknd0sic0qo3ko71w4d9k5urg48; - ALTER TABLE genomicentity_crossreference DROP CONSTRAINT fk9b9qofiu2sump8fnfxgux1lvl; ALTER INDEX genomicentity_crossreference_crossreferences_id_index RENAME TO genomicentity_crossreference_crossreferences_index; DROP INDEX genomicentity_crossreference_ge_curie_xref_id_index; DROP INDEX genomicentity_crossreference_genomicentity_curie_index; - -ALTER TABLE goterm DROP CONSTRAINT goterm_pkey; ALTER TABLE goterm DROP CONSTRAINT fk4gf262ba8btx03wi3vl5vhfao; - -ALTER TABLE goterm_aud DROP CONSTRAINT goterm_aud_pkey; ALTER TABLE goterm_aud DROP CONSTRAINT fk4kjm9hm06yutma1ilq04h967s; - -ALTER TABLE hpterm DROP CONSTRAINT hpterm_pkey; ALTER TABLE hpterm DROP CONSTRAINT hpterm_curie_fk; - -ALTER TABLE hpterm_aud DROP CONSTRAINT hpterm_aud_pkey; ALTER TABLE hpterm_aud DROP CONSTRAINT hpterm_aud_curie_rev_fk; - -ALTER TABLE materm DROP CONSTRAINT materm_pkey; +ALTER TABLE informationcontententity_aud DROP CONSTRAINT informationcontententity_aud_rev_fk; ALTER TABLE materm DROP CONSTRAINT fktlgqvrv4vuh8gqihevh6adya4; - -ALTER TABLE materm_aud DROP CONSTRAINT materm_aud_pkey; ALTER TABLE materm_aud DROP CONSTRAINT fk7lfprbh8k8mnw9yf8ywp7xieg; - -ALTER TABLE miterm DROP CONSTRAINT miterm_pkey; ALTER TABLE miterm DROP CONSTRAINT miterm_curie_fk; - -ALTER TABLE miterm_aud DROP CONSTRAINT miterm_aud_pkey; ALTER TABLE miterm_aud DROP CONSTRAINT miterm_aud_curie_rev_fk; - -ALTER TABLE mmoterm DROP CONSTRAINT mmoterm_pkey; ALTER TABLE mmoterm DROP CONSTRAINT mmoterm_curie_fk; - -ALTER TABLE mmoterm_aud DROP CONSTRAINT mmoterm_aud_pkey; ALTER TABLE mmoterm_aud DROP CONSTRAINT mmoterm_aud_curie_rev_fk; - -ALTER TABLE mmusdvterm DROP CONSTRAINT mmusdvterm_pkey; ALTER TABLE mmusdvterm DROP CONSTRAINT fkmkv8r93hlnf06oa8xy2usdq9g; - -ALTER TABLE mmusdvterm_aud DROP CONSTRAINT mmusdvterm_aud_pkey; ALTER TABLE mmusdvterm_aud DROP CONSTRAINT fk19prhk8fikp11bpxxm2tqxh6u; - -ALTER TABLE modterm DROP CONSTRAINT modterm_pkey; ALTER TABLE modterm DROP CONSTRAINT modterm_curie_fk; - -ALTER TABLE modterm_aud DROP CONSTRAINT modterm_aud_pkey; ALTER TABLE modterm_aud DROP CONSTRAINT modterm_aud_curie_rev_fk; - -ALTER TABLE molecule DROP CONSTRAINT molecule_pkey; ALTER TABLE molecule DROP CONSTRAINT fknnf79fdaivbnqu0p9kes1jtd1; - -ALTER TABLE molecule_aud DROP CONSTRAINT molecule_aud_pkey; ALTER TABLE molecule_aud DROP CONSTRAINT fkcbo1onn61w7v5ivh1e1h2tcd7; - -ALTER TABLE mpathterm DROP CONSTRAINT mpathterm_pkey; ALTER TABLE mpathterm DROP CONSTRAINT mpathterm_curie_fk; - -ALTER TABLE mpathterm_aud DROP CONSTRAINT mpathterm_aud_pkey; ALTER TABLE mpathterm_aud DROP CONSTRAINT mpathterm_aud_curie_rev_fk; - -ALTER TABLE mpterm DROP CONSTRAINT mpterm_pkey; ALTER TABLE mpterm DROP CONSTRAINT fkorn5mvrebk70b70o3sepp2fwe; - -ALTER TABLE mpterm_aud DROP CONSTRAINT mpterm_aud_pkey; ALTER TABLE mpterm_aud DROP CONSTRAINT fkjw611qjy95wa8gjjthb1uptjy; - -ALTER TABLE ncbitaxonterm DROP CONSTRAINT ncbitaxonterm_pkey; ALTER TABLE ncbitaxonterm DROP CONSTRAINT fk47k37g37jc1e4wdt76ajmn0xk; - -ALTER TABLE ncbitaxonterm_aud DROP CONSTRAINT ncbitaxonterm_aud_pkey; ALTER TABLE ncbitaxonterm_aud DROP CONSTRAINT fkap27v3trsn5u9q93qb8ikabrf; - ALTER TABLE note_aud DROP CONSTRAINT fk1r4uoh4rg9vyahvb8bpd6dfn7; - ALTER TABLE note_reference RENAME CONSTRAINT fknr8td9rfl6vd6cstukci0e0qq TO note_reference_note_id_fk; ALTER TABLE note_reference DROP CONSTRAINT note_reference_references_curie_fk; ALTER INDEX idxk4kbcn96bs4gafx883i9sj7my RENAME TO note_reference_note_index; - -ALTER TABLE obiterm DROP CONSTRAINT obiterm_pkey; ALTER TABLE obiterm DROP CONSTRAINT obiterm_curie_fk; - -ALTER TABLE obiterm_aud DROP CONSTRAINT obiterm_aud_pkey; ALTER TABLE obiterm_aud DROP CONSTRAINT obiterm_aud_curie_rev_fk; - -ALTER TABLE ontologyterm DROP CONSTRAINT ontologyterm_pkey; - -ALTER TABLE ontologyterm_aud DROP CONSTRAINT ontologyterm_aud_pkey; ALTER TABLE ontologyterm_aud DROP CONSTRAINT fkdxjp2u3w3xoi7p9j7huceg2ts; - ALTER TABLE ontologyterm_crossreference DROP CONSTRAINT fk3e1a40poh1ehjk91h42bx7i45; DROP INDEX ontologyterm_crossreference_ontologyterm_curie_index; ALTER INDEX ontologyterm_crossreference_crossreferences_id_index RENAME TO ontologyterm_crossreference_crossreferences_index; - ALTER TABLE ontologyterm_definitionurls DROP CONSTRAINT fknhkhso5kmei3t37mkhodkkfgt; DROP INDEX idx171k63a40d8huvbhohveql7so; - ALTER TABLE ontologyterm_isa_ancestor_descendant DROP CONSTRAINT ontologyterm_ancestor_descendant_pkey; ALTER TABLE ontologyterm_isa_ancestor_descendant DROP CONSTRAINT fkh6pn8ibta2l7jnov2ds2dqyyt; ALTER TABLE ontologyterm_isa_ancestor_descendant DROP CONSTRAINT fk62tk8kyfxk80w7n06w0d4o5yf; DROP INDEX idxll2agbrj7gqreke3x7hr8wvi8; DROP INDEX idxss79m7jisaqcm3kfq5r7gro16; - ALTER TABLE ontologyterm_isa_parent_children DROP CONSTRAINT ontologyterm_parent_children_pkey; ALTER TABLE ontologyterm_isa_parent_children DROP CONSTRAINT fkhjjhjxsp6gacmykm0bwijv0tj; ALTER TABLE ontologyterm_isa_parent_children DROP CONSTRAINT fkqrefoml52l7b5nr5w3diqr5er; DROP INDEX idx1wx6c7akkhro1m34rawo283t0; DROP INDEX idx91kybf28ecbonyxlh4s46c756; - ALTER TABLE ontologyterm_secondaryidentifiers DROP CONSTRAINT fkpkg5jfw6wypf4v43bpb4ergu7; DROP INDEX idxsvjjbf5eugfrbue5yo4jgarpn; - ALTER TABLE ontologyterm_subsets DROP CONSTRAINT fkchq4ex53obwegdhgxrovd5r53; DROP INDEX idxips7lcqafkikxweue2p0h13t9; - ALTER TABLE ontologyterm_synonym RENAME CONSTRAINT fk4uyg8s1tkgg3vp1cb8dn3vyvr TO ontologyterm_synonym_synonyms_id_fk; ALTER TABLE ontologyterm_synonym DROP CONSTRAINT fkjf8xunyry3dy9njpqb01tvjsr; DROP INDEX ontologyterm_synonym_ontologyterm_curie_index; - ALTER TABLE organization_aud DROP CONSTRAINT organization_aud_rev_fk; - -ALTER TABLE patoterm DROP CONSTRAINT patoterm_pkey; ALTER TABLE patoterm DROP CONSTRAINT patoterm_curie_fk; - -ALTER TABLE patoterm_aud DROP CONSTRAINT patoterm_aud_pkey; ALTER TABLE patoterm_aud DROP CONSTRAINT patoterm_aud_curie_rev_fk; - ALTER TABLE person_aud DROP CONSTRAINT fkqbm2y5o4elhanxeq26reu73yd; - -ALTER TABLE phenotypeterm DROP CONSTRAINT phenotypeterm_pkey; ALTER TABLE phenotypeterm DROP CONSTRAINT fk4ymq8h2kdhq6ix6sfb4q4fn7a; - -ALTER TABLE phenotypeterm_aud DROP CONSTRAINT phenotypeterm_aud_pkey; ALTER TABLE phenotypeterm_aud DROP CONSTRAINT fksap791c8unrey4xnqcydm8kv1; - -ALTER TABLE pwterm DROP CONSTRAINT pwterm_pkey; ALTER TABLE pwterm DROP CONSTRAINT pwterm_curie_fk; - -ALTER TABLE pwterm_aud DROP CONSTRAINT pwterm_aud_pkey; ALTER TABLE pwterm_aud DROP CONSTRAINT pwterm_aud_curie_rev_fk; - ALTER TABLE reagent_aud DROP CONSTRAINT reagent_aud_rev_fk; - ALTER INDEX reagent_secondaryidentifiers_reagent_id_index RENAME TO reagent_secondaryidentifiers_reagent_index; - -ALTER reference DROP CONSTRAINT reference_pkey; -ALTER reference DROP CONSTRAINT fk17o77er2650ydtr1dhtd0y5kn; - -ALTER reference_aud DROP CONSTRAINT reference_aud_pkey; -ALTER reference_aud DROP CONSTRAINT fk897g2lxdu1btxkcikigm6j4wo; -ALTER reference_aud DROP CONSTRAINT reference_aud_curie_rev_fk; - +ALTER TABLE reference DROP CONSTRAINT fk17o77er2650ydtr1dhtd0y5kn; +ALTER TABLE reference_aud DROP CONSTRAINT fk897g2lxdu1btxkcikigm6j4wo; +ALTER TABLE reference_aud DROP CONSTRAINT reference_aud_curie_rev_fk; ALTER TABLE reference_crossreference DROP CONSTRAINT reference_crossreference_reference_curie_fk; DROP INDEX idx5f73olsmf7f70k9nimewmv2ov; ALTER INDEX reference_crossreference_crossreferences_id_index RENAME TO reference_crossreference_crossreferences_index; DROP INDEX idx8o0l1xsm13k7qe0btnlr0x32j; - ALTER TABLE resourcedescriptor_aud DROP CONSTRAINT resourcedescriptor_aud_rev_fk; - ALTER TABLE resourcedescriptorpage_aud DROP CONSTRAINT resourcedescriptorpage_aud_rev_fk; --- Add columns +ALTER TABLE roterm DROP CONSTRAINT fkyqhfu00n2xcrfg2w4iv9wwx8; +ALTER TABLE roterm_aud DROP CONSTRAINT fk8wmlph21s6vviddt2tx63fhqn; +ALTER TABLE rsterm DROP CONSTRAINT rsterm_curie_fk; +ALTER TABLE rsterm_aud DROP CONSTRAINT rsterm_aud_curie_rev_fk; +ALTER TABLE singlereferenceassociation DROP CONSTRAINT singlereferenceassociation_singlereference_curie_fk; +DROP INDEX singlereferenceassociation_singlereference_index; +ALTER TABLE slotannotation_aud DROP CONSTRAINT slotannotation_aud_rev_fk; +ALTER TABLE slotannotation_informationcontententity DROP CONSTRAINT slotannotation_informationcontententity_evidence_curie_fk; +DROP INDEX slotannotation_informationcontententity_evidence_curie_index; +ALTER INDEX slotannotation_informationcontententity_slotannotation_id_index RENAME TO slotannotation_informationcontententity_slotannotation_index; +ALTER TABLE soterm DROP CONSTRAINT fkri7tkc9slvpex9v83peovegyt; +ALTER TABLE soterm_aud DROP CONSTRAINT fk5i3iqfnxf9hxjq6jmay2gm68g; +ALTER TABLE species DROP CONSTRAINT species_taxon_curie_fk; +ALTER TABLE species_aud DROP CONSTRAINT species_aud_rev_fk; +ALTER TABLE stageterm DROP CONSTRAINT fkas58x03rc132q00y838dv1gsb; +ALTER TABLE stageterm_aud DROP CONSTRAINT fkbe4dl5s3i7ga7hqryddog2g0f; +ALTER TABLE synonym_aud DROP CONSTRAINT fk8y4re95uhgku1km6nsauced0b; +ALTER TABLE uberonterm DROP CONSTRAINT uberonterm_curie_fk; +ALTER TABLE uberonterm_aud DROP CONSTRAINT uberonterm_aud_curie_rev_fk; +ALTER TABLE variant DROP CONSTRAINT variant_curie_fk; +ALTER TABLE variant DROP CONSTRAINT variant_sourcegeneralconsequence_curie_fk; +ALTER TABLE variant DROP CONSTRAINT variant_varianttype_curie_fk; +DROP INDEX variant_sourcegeneralconsequence_index; +DROP INDEX variant_varianttype_index; +ALTER TABLE variant_aud DROP CONSTRAINT variant_aud_curie_rev_fk; +ALTER TABLE variant_note DROP CONSTRAINT variant_note_variant_curie_fk; +DROP INDEX variant_note_variant_curie_index; +ALTER INDEX variant_note_relatednotes_id_index RENAME TO variant_note_relatednotes_index; +ALTER TABLE vocabulary_aud DROP CONSTRAINT fk2pe60ji8kxipj6qf3cd6hjda5; +ALTER TABLE vocabularyterm_aud DROP CONSTRAINT fkfg8df1h10nehkt3pw4cebbde8; +ALTER TABLE vocabularytermset_aud DROP CONSTRAINT fkkqfblby0u8l1h2i3fm7h4ynlh; +ALTER TABLE vtterm DROP CONSTRAINT vtterm_curie_fk; +ALTER TABLE vtterm_aud DROP CONSTRAINT vtterm_aud_curie_rev_fk; +ALTER TABLE wbbtterm DROP CONSTRAINT fkqnxqrnadcxojeti2ienobdqh0; +ALTER TABLE wbbtterm_aud DROP CONSTRAINT fkhu85m34h8hf95s453u3m4ed8y; +ALTER TABLE wblsterm DROP CONSTRAINT fk4k9uvngmwim574bm5mu5q4203; +ALTER TABLE wblsterm_aud DROP CONSTRAINT fkbug8ndvvjf8e7e3rpcih06j63; +ALTER TABLE wbphenotypeterm DROP CONSTRAINT fkhonuwqm6g91le1xigmik3yrwl; +ALTER TABLE wbphenotypeterm_aud DROP CONSTRAINT fk48fs5fxgn3sfvyyiqpgoquuma; +ALTER TABLE xbaterm DROP CONSTRAINT fkcnuymf0pvlgwcfd918o4pgs5n; +ALTER TABLE xbaterm_aud DROP CONSTRAINT fkha6obinkag86qlcpemxmgv4ly; +ALTER TABLE xbedterm DROP CONSTRAINT fkc0dct519510hodhd9d7phfq6g; +ALTER TABLE xbedterm_aud DROP CONSTRAINT fkshxj981p427yuk4qgtvcirp5k; +ALTER TABLE xbsterm DROP CONSTRAINT fkn8tvxj5qdpjssxjl9jneqst92; +ALTER TABLE xbsterm_aud DROP CONSTRAINT fkij9o8qar117chfev5ghkupl3o; +ALTER TABLE xcoterm DROP CONSTRAINT fk35ywtb8qiadqbwsb706ebu81c; +ALTER TABLE xcoterm_aud DROP CONSTRAINT fknlbuiyo3i6daerkmpim317bd3; +ALTER TABLE xpoterm DROP CONSTRAINT fkqeoygtsa6sf94gw089ugocoph; +ALTER TABLE xpoterm_aud DROP CONSTRAINT fkbqybirrf1obv6esgeaj8os211; +ALTER TABLE xsmoterm DROP CONSTRAINT fk36v85u2ghsukqljkkh1jxmtlx; +ALTER TABLE xsmoterm_aud DROP CONSTRAINT fkjdlhxyvw79i14932dqdb1bx8f; +ALTER TABLE zecoterm DROP CONSTRAINT fkqd3f6hcopl67fwai6viq07t88; +ALTER TABLE zecoterm_aud DROP CONSTRAINT fke5wuchgyjhb2orgvht50q2dah; +ALTER TABLE zfaterm DROP CONSTRAINT fk572s3xiqi0y4gjblq8xjyk3f7; +ALTER TABLE zfaterm_aud DROP CONSTRAINT fks66s1k4fon0to2kk7qfsm1xon; +ALTER TABLE zfsterm DROP CONSTRAINT fknkrcnh3l23ol126v9w61nk079; +ALTER TABLE zfsterm_aud DROP CONSTRAINT fk27dwwh5ekpa60ug4ystuwwn6w; + +ALTER TABLE affectedgenomicmodel DROP CONSTRAINT affectedgenomicmodel_pkey; +ALTER TABLE affectedgenomicmodel_aud DROP CONSTRAINT affectedgenomicmodel_aud_pkey; +ALTER TABLE allele DROP CONSTRAINT allele_pkey; +ALTER TABLE allele_aud DROP CONSTRAINT allele_aud_pkey; +ALTER TABLE allele_note_aud DROP CONSTRAINT allele_note_aud_pkey; +ALTER TABLE allele_reference_aud DROP CONSTRAINT allele_reference_aud_pkey; +ALTER TABLE anatomicalterm DROP CONSTRAINT anatomicalterm_pkey; +ALTER TABLE anatomicalterm_aud DROP CONSTRAINT anatomicalterm_aud_pkey; +ALTER TABLE apoterm DROP CONSTRAINT apoterm_pkey; +ALTER TABLE apoterm_aud DROP CONSTRAINT apoterm_aud_pkey; +ALTER TABLE atpterm DROP CONSTRAINT atpterm_pkey; +ALTER TABLE atpterm_aud DROP CONSTRAINT atpterm_aud_pkey; +ALTER TABLE biologicalentity DROP CONSTRAINT biologicalentity_pkey; +ALTER TABLE biologicalentity_aud DROP CONSTRAINT biologicalentity_aud_pkey; +ALTER TABLE bspoterm DROP CONSTRAINT bspoterm_pkey; +ALTER TABLE bspoterm_aud DROP CONSTRAINT bspoterm_aud_pkey; +ALTER TABLE chebiterm DROP CONSTRAINT chebiterm_pkey; +ALTER TABLE chebiterm_aud DROP CONSTRAINT chebiterm_aud_pkey; +ALTER TABLE chemicalterm DROP CONSTRAINT chemicalterm_pkey; +ALTER TABLE chemicalterm_aud DROP CONSTRAINT chemicalterm_aud_pkey; +ALTER TABLE clterm DROP CONSTRAINT clterm_pkey; +ALTER TABLE clterm_aud DROP CONSTRAINT clterm_aud_pkey; +ALTER TABLE cmoterm DROP CONSTRAINT cmoterm_pkey; +ALTER TABLE cmoterm_aud DROP CONSTRAINT cmoterm_aud_pkey; +ALTER TABLE daoterm DROP CONSTRAINT daoterm_pkey; +ALTER TABLE daoterm_aud DROP CONSTRAINT daoterm_aud_pkey; +ALTER TABLE doterm DROP CONSTRAINT doterm_pkey; +ALTER TABLE doterm_aud DROP CONSTRAINT doterm_aud_pkey; +ALTER TABLE dpoterm DROP CONSTRAINT dpoterm_pkey; +ALTER TABLE dpoterm_aud DROP CONSTRAINT dpoterm_aud_pkey; +ALTER TABLE ecoterm DROP CONSTRAINT ecoterm_pkey; +ALTER TABLE ecoterm_aud DROP CONSTRAINT ecoterm_aud_pkey; +ALTER TABLE emapaterm DROP CONSTRAINT emapaterm_pkey; +ALTER TABLE emapaterm_aud DROP CONSTRAINT emapaterm_aud_pkey; +ALTER TABLE experimentalconditionontologyterm DROP CONSTRAINT experimentalconditionontologyterm_pkey; +ALTER TABLE experimentalconditionontologyterm_aud DROP CONSTRAINT experimentalconditionontologyterm_aud_pkey; +ALTER TABLE fbdvterm DROP CONSTRAINT IF EXISTS fbdvterm_pkey; +ALTER TABLE fbdvterm_aud DROP CONSTRAINT fbdvterm_aud_pkey; +ALTER TABLE gene DROP CONSTRAINT gene_pkey; +ALTER TABLE gene_aud DROP CONSTRAINT gene_aud_pkey; +ALTER TABLE genomicentity DROP CONSTRAINT genomicentity_pkey; +ALTER TABLE genomicentity_aud DROP CONSTRAINT genomicentity_aud_pkey; +ALTER TABLE goterm DROP CONSTRAINT goterm_pkey; +ALTER TABLE goterm_aud DROP CONSTRAINT goterm_aud_pkey; +ALTER TABLE hpterm DROP CONSTRAINT hpterm_pkey; +ALTER TABLE hpterm_aud DROP CONSTRAINT hpterm_aud_pkey; +ALTER TABLE informationcontententity DROP CONSTRAINT informationcontententity_pkey; +ALTER TABLE informationcontententity_aud DROP CONSTRAINT informationcontententity_aud_pkey; +ALTER TABLE materm DROP CONSTRAINT materm_pkey; +ALTER TABLE materm_aud DROP CONSTRAINT materm_aud_pkey; +ALTER TABLE miterm DROP CONSTRAINT miterm_pkey; +ALTER TABLE miterm_aud DROP CONSTRAINT miterm_aud_pkey; +ALTER TABLE mmoterm DROP CONSTRAINT mmoterm_pkey; +ALTER TABLE mmoterm_aud DROP CONSTRAINT mmoterm_aud_pkey; +ALTER TABLE mmusdvterm DROP CONSTRAINT IF EXISTS mmusdvterm_pkey; +ALTER TABLE mmusdvterm_aud DROP CONSTRAINT mmusdvterm_aud_pkey; +ALTER TABLE modterm DROP CONSTRAINT modterm_pkey; +ALTER TABLE modterm_aud DROP CONSTRAINT modterm_aud_pkey; +ALTER TABLE molecule DROP CONSTRAINT molecule_pkey; +ALTER TABLE molecule_aud DROP CONSTRAINT molecule_aud_pkey; +ALTER TABLE mpathterm DROP CONSTRAINT mpathterm_pkey; +ALTER TABLE mpathterm_aud DROP CONSTRAINT mpathterm_aud_pkey; +ALTER TABLE mpterm DROP CONSTRAINT mpterm_pkey; +ALTER TABLE mpterm_aud DROP CONSTRAINT mpterm_aud_pkey; +ALTER TABLE ncbitaxonterm DROP CONSTRAINT ncbitaxonterm_pkey; +ALTER TABLE ncbitaxonterm_aud DROP CONSTRAINT ncbitaxonterm_aud_pkey; +ALTER TABLE obiterm DROP CONSTRAINT obiterm_pkey; +ALTER TABLE obiterm_aud DROP CONSTRAINT obiterm_aud_pkey; +ALTER TABLE ontologyterm DROP CONSTRAINT ontologyterm_pkey; +ALTER TABLE ontologyterm_aud DROP CONSTRAINT ontologyterm_aud_pkey; +ALTER TABLE patoterm DROP CONSTRAINT patoterm_pkey; +ALTER TABLE patoterm_aud DROP CONSTRAINT patoterm_aud_pkey; +ALTER TABLE phenotypeterm DROP CONSTRAINT phenotypeterm_pkey; +ALTER TABLE phenotypeterm_aud DROP CONSTRAINT phenotypeterm_aud_pkey; +ALTER TABLE pwterm DROP CONSTRAINT pwterm_pkey; +ALTER TABLE pwterm_aud DROP CONSTRAINT pwterm_aud_pkey; +ALTER TABLE reference DROP CONSTRAINT reference_pkey; +ALTER TABLE reference_aud DROP CONSTRAINT reference_aud_pkey; +ALTER TABLE roterm DROP CONSTRAINT roterm_pkey; +ALTER TABLE roterm_aud DROP CONSTRAINT roterm_aud_pkey; +ALTER TABLE rsterm DROP CONSTRAINT rsterm_pkey; +ALTER TABLE rsterm_aud DROP CONSTRAINT rsterm_aud_pkey; +ALTER TABLE soterm DROP CONSTRAINT soterm_pkey; +ALTER TABLE soterm_aud DROP CONSTRAINT soterm_aud_pkey; +ALTER TABLE stageterm DROP CONSTRAINT stageterm_pkey; +ALTER TABLE stageterm_aud DROP CONSTRAINT stageterm_aud_pkey; +ALTER TABLE uberonterm DROP CONSTRAINT uberonterm_pkey; +ALTER TABLE uberonterm_aud DROP CONSTRAINT uberonterm_aud_pkey; +ALTER TABLE variant DROP CONSTRAINT variant_pkey; +ALTER TABLE variant_aud DROP CONSTRAINT variant_aud_pkey; +ALTER TABLE vtterm DROP CONSTRAINT vtterm_pkey; +ALTER TABLE vtterm_aud DROP CONSTRAINT vtterm_aud_pkey; +ALTER TABLE wbbtterm DROP CONSTRAINT wbbtterm_pkey; +ALTER TABLE wbbtterm_aud DROP CONSTRAINT IF EXISTS wbbtterm_aud_pkey; +ALTER TABLE wblsterm DROP CONSTRAINT wblsterm_pkey; +ALTER TABLE wblsterm_aud DROP CONSTRAINT IF EXISTS wblsterm_aud_pkey; +ALTER TABLE wbphenotypeterm DROP CONSTRAINT wbphenotypeterm_pkey; +ALTER TABLE wbphenotypeterm_aud DROP CONSTRAINT wbphenotypeterm_aud_pkey; +ALTER TABLE xbaterm DROP CONSTRAINT xbaterm_pkey; +ALTER TABLE xbaterm_aud DROP CONSTRAINT IF EXISTS xbaterm_aud_pkey; +ALTER TABLE xbedterm DROP CONSTRAINT xbedterm_pkey; +ALTER TABLE xbedterm_aud DROP CONSTRAINT IF EXISTS xbedterm_aud_pkey; +ALTER TABLE xbsterm DROP CONSTRAINT xbsterm_pkey; +ALTER TABLE xbsterm_aud DROP CONSTRAINT IF EXISTS xbsterm_aud_pkey; +ALTER TABLE xcoterm DROP CONSTRAINT xcoterm_pkey; +ALTER TABLE xcoterm_aud DROP CONSTRAINT IF EXISTS xcoterm_aud_pkey; +ALTER TABLE xpoterm DROP CONSTRAINT xpoterm_pkey; +ALTER TABLE xpoterm_aud DROP CONSTRAINT IF EXISTS xpoterm_aud_pkey; +ALTER TABLE xsmoterm DROP CONSTRAINT xsmoterm_pkey; +ALTER TABLE xsmoterm_aud DROP CONSTRAINT IF EXISTS xsmoterm_aud_pkey; +ALTER TABLE zecoterm DROP CONSTRAINT zecoterm_pkey; +ALTER TABLE zecoterm_aud DROP CONSTRAINT IF EXISTS zecoterm_aud_pkey; +ALTER TABLE zfaterm DROP CONSTRAINT zfaterm_pkey; +ALTER TABLE zfaterm_aud DROP CONSTRAINT IF EXISTS zfaterm_aud_pkey; +ALTER TABLE zfsterm DROP CONSTRAINT zfsterm_pkey; +ALTER TABLE zfsterm_aud DROP CONSTRAINT IF EXISTS zfsterm_aud_pkey; + +-- Create tables + +CREATE TABLE auditedobject ( + id bigint PRIMARY KEY, + old_id bigint, + old_curie varchar(255), + tablename varchar(255), + createdby_id bigint, + updatedby_id bigint, + datecreated timestamp without time zone, + dateupdated timestamp without time zone, + dbdatecreated timestamp without time zone, + dbdateupdated timestamp without time zone, + internal boolean NOT NULL DEFAULT false, + obsolete boolean NOT NULL DEFAULT false + ); + +CREATE TABLE auditedobject_aud ( + id bigint NOT NULL, + createdby_id bigint, + updatedby_id bigint, + datecreated timestamp without time zone, + dateupdated timestamp without time zone, + dbdatecreated timestamp without time zone, + dbdateupdated timestamp without time zone, + internal boolean, + obsolete boolean, + rev integer NOT NULL, + revtype smallint, + PRIMARY KEY (id, rev) + ); + +CREATE TABLE curieobject ( + id bigint PRIMARY KEY, + curie varchar(255) + ); + +CREATE TABLE curieobject_aud ( + id bigint NOT NULL, + curie varchar(255), + rev integer NOT NULL, + PRIMARY KEY (id, rev) + ); + +CREATE TABLE submittedobject ( + id bigint PRIMARY KEY, + modentityid varchar(255), + modinternalid varchar(255), + dataprovider_id bigint + ); + +CREATE TABLE submittedobject_aud ( + id bigint NOT NULL, + modentityid varchar(255), + modinternalid varchar(255), + dataprovider_id bigint, + rev integer NOT NULL, + PRIMARY KEY (id, rev) + ); + +CREATE SEQUENCE auditedobject_seq START WITH 1 INCREMENT BY 50 NO MINVALUE NO MAXVALUE CACHE 1; + +-- Add id equivalents of curie columns + +ALTER TABLE affectedgenomicmodel ADD COLUMN id bigint; +ALTER TABLE agmdiseaseannotation ADD COLUMN inferredallele_id bigint; +ALTER TABLE agmdiseaseannotation ADD COLUMN inferredgene_id bigint; +ALTER TABLE agmdiseaseannotation ADD COLUMN assertedallele_id bigint; +ALTER TABLE agmdiseaseannotation ADD COLUMN subject_id bigint; +ALTER TABLE agmdiseaseannotation_gene ADD COLUMN assertedgenes_id bigint; +ALTER TABLE allele ADD COLUMN id bigint; +ALTER TABLE allele_note ADD COLUMN allele_id bigint; +ALTER TABLE allele_reference ADD COLUMN allele_id bigint; +ALTER TABLE allele_reference ADD COLUMN references_id bigint; +ALTER TABLE alleledatabasestatusslotannotation ADD COLUMN singleallele_id bigint; +ALTER TABLE allelediseaseannotation ADD COLUMN inferredgene_id bigint; +ALTER TABLE allelediseaseannotation ADD COLUMN subject_id bigint; +ALTER TABLE allelediseaseannotation_gene ADD COLUMN assertedgenes_id bigint; +ALTER TABLE allelefullnameslotannotation ADD COLUMN singleallele_id bigint; +ALTER TABLE allelefunctionalimpactslotannotation ADD COLUMN singleallele_id bigint; +ALTER TABLE allelefunctionalimpactslotannotation ADD COLUMN phenotypeterm_id bigint; +ALTER TABLE allelegeneassociation ADD COLUMN subject_id bigint; +ALTER TABLE allelegeneassociation ADD COLUMN object_id bigint; +ALTER TABLE allelegenomicentityassociation ADD COLUMN evidencecode_id bigint; +ALTER TABLE allelegermlinetransmissionstatusslotannotation ADD COLUMN singleallele_id bigint; +ALTER TABLE alleleinheritancemodeslotannotation ADD COLUMN singleallele_id bigint; +ALTER TABLE alleleinheritancemodeslotannotation ADD COLUMN phenotypeterm_id bigint; +ALTER TABLE allelemutationtypeslotannotation ADD COLUMN singleallele_id bigint; +ALTER TABLE allelemutationtypeslotannotation_soterm ADD COLUMN mutationtypes_id bigint; +ALTER TABLE allelenomenclatureeventslotannotation ADD COLUMN singleallele_id bigint; +ALTER TABLE allelesecondaryidslotannotation ADD COLUMN singleallele_id bigint; +ALTER TABLE allelesymbolslotannotation ADD COLUMN singleallele_id bigint; +ALTER TABLE allelesynonymslotannotation ADD COLUMN singleallele_id bigint; +ALTER TABLE anatomicalterm ADD COLUMN id bigint; +ALTER TABLE apoterm ADD COLUMN id bigint; +ALTER TABLE atpterm ADD COLUMN id bigint; +ALTER TABLE biologicalentity ADD COLUMN id bigint; +ALTER TABLE biologicalentity ADD COLUMN taxon_id bigint; +ALTER TABLE bspoterm ADD COLUMN id bigint; +ALTER TABLE chebiterm ADD COLUMN id bigint; +ALTER TABLE chemicalterm ADD COLUMN id bigint; +ALTER TABLE clterm ADD COLUMN id bigint; +ALTER TABLE cmoterm ADD COLUMN id bigint; +ALTER TABLE conditionrelation ADD COLUMN singlereference_id bigint; +ALTER TABLE construct_reference ADD COLUMN references_id bigint; +ALTER TABLE constructcomponentslotannotation ADD COLUMN taxon_id bigint; +ALTER TABLE constructgenomicentityassociation ADD COLUMN object_id bigint; +ALTER TABLE daoterm ADD COLUMN id bigint; +ALTER TABLE diseaseannotation ADD COLUMN object_id bigint; +ALTER TABLE diseaseannotation_biologicalentity ADD COLUMN diseasegeneticmodifiers_id bigint; +ALTER TABLE diseaseannotation_ecoterm ADD COLUMN evidencecodes_id bigint; +ALTER TABLE diseaseannotation_gene ADD COLUMN with_id bigint; +ALTER TABLE doterm ADD COLUMN id bigint; +ALTER TABLE dpoterm ADD COLUMN id bigint; +ALTER TABLE ecoterm ADD COLUMN id bigint; +ALTER TABLE emapaterm ADD COLUMN id bigint; +ALTER TABLE evidenceassociation_informationcontententity ADD COLUMN evidence_id bigint; +ALTER TABLE experimentalcondition ADD COLUMN conditionanatomy_id bigint; +ALTER TABLE experimentalcondition ADD COLUMN conditionchemical_id bigint; +ALTER TABLE experimentalcondition ADD COLUMN conditionclass_id bigint; +ALTER TABLE experimentalcondition ADD COLUMN conditiongeneontology_id bigint; +ALTER TABLE experimentalcondition ADD COLUMN conditionid_id bigint; +ALTER TABLE experimentalcondition ADD COLUMN conditiontaxon_id bigint; +ALTER TABLE experimentalconditionontologyterm ADD COLUMN id bigint; +ALTER TABLE fbdvterm ADD COLUMN id bigint; +ALTER TABLE gene ADD COLUMN id bigint; +ALTER TABLE gene ADD COLUMN genetype_id bigint; +ALTER TABLE genediseaseannotation ADD COLUMN sgdstrainbackground_id bigint; +ALTER TABLE genediseaseannotation ADD COLUMN subject_id bigint; +ALTER TABLE genefullnameslotannotation ADD COLUMN singlegene_id bigint; +ALTER TABLE genesecondaryidslotannotation ADD COLUMN singlegene_id bigint; +ALTER TABLE genesymbolslotannotation ADD COLUMN singlegene_id bigint; +ALTER TABLE genesynonymslotannotation ADD COLUMN singlegene_id bigint; +ALTER TABLE genesystematicnameslotannotation ADD COLUMN singlegene_id bigint; +ALTER TABLE genetogeneorthology ADD COLUMN subjectgene_id bigint; +ALTER TABLE genetogeneorthology ADD COLUMN objectgene_id bigint; +ALTER TABLE genetogeneorthologycurated ADD COLUMN singlereference_id bigint; +ALTER TABLE genetogeneorthologycurated ADD COLUMN evidencecode_id bigint; +ALTER TABLE genomicentity ADD COLUMN id bigint; +ALTER TABLE genomicentity_crossreference ADD COLUMN genomicentity_id bigint; +ALTER TABLE goterm ADD COLUMN id bigint; +ALTER TABLE hpterm ADD COLUMN id bigint; +ALTER TABLE informationcontententity ADD COLUMN id bigint; +ALTER TABLE materm ADD COLUMN id bigint; +ALTER TABLE miterm ADD COLUMN id bigint; +ALTER TABLE mmoterm ADD COLUMN id bigint; +ALTER TABLE mmusdvterm ADD COLUMN id bigint; +ALTER TABLE modterm ADD COLUMN id bigint; +ALTER TABLE molecule ADD COLUMN id bigint; +ALTER TABLE mpathterm ADD COLUMN id bigint; +ALTER TABLE mpterm ADD COLUMN id bigint; +ALTER TABLE ncbitaxonterm ADD COLUMN id bigint; +ALTER TABLE note_reference ADD COLUMN references_id bigint; +ALTER TABLE obiterm ADD COLUMN id bigint; +ALTER TABLE ontologyterm ADD COLUMN id bigint; +ALTER TABLE ontologyterm_crossreference ADD COLUMN ontologyterm_id bigint; +ALTER TABLE ontologyterm_definitionurls ADD COLUMN ontologyterm_id bigint; +ALTER TABLE ontologyterm_isa_ancestor_descendant ADD COLUMN isadescendants_id bigint; +ALTER TABLE ontologyterm_isa_ancestor_descendant ADD COLUMN isaancestors_id bigint; +ALTER TABLE ontologyterm_isa_parent_children ADD COLUMN isachildren_id bigint; +ALTER TABLE ontologyterm_isa_parent_children ADD COLUMN isaparents_id bigint; +ALTER TABLE ontologyterm_secondaryidentifiers ADD COLUMN ontologyterm_id bigint; +ALTER TABLE ontologyterm_subsets ADD COLUMN ontologyterm_id bigint; +ALTER TABLE ontologyterm_synonym ADD COLUMN ontologyterm_id bigint; +ALTER TABLE patoterm ADD COLUMN id bigint; +ALTER TABLE phenotypeterm ADD COLUMN id bigint; +ALTER TABLE pwterm ADD COLUMN id bigint; +ALTER TABLE reference ADD COLUMN id bigint; +ALTER TABLE reference_crossreference ADD COLUMN reference_id bigint; +ALTER TABLE roterm ADD COLUMN id bigint; +ALTER TABLE rsterm ADD COLUMN id bigint; +ALTER TABLE singlereferenceassociation ADD COLUMN singlereference_id bigint; +ALTER TABLE slotannotation_informationcontententity ADD COLUMN evidence_id bigint; +ALTER TABLE soterm ADD COLUMN id bigint; +ALTER TABLE species ADD COLUMN taxon_id bigint; +ALTER TABLE stageterm ADD COLUMN id bigint; +ALTER TABLE uberonterm ADD COLUMN id bigint; +ALTER TABLE variant ADD COLUMN id bigint; +ALTER TABLE variant ADD COLUMN varianttype_id bigint; +ALTER TABLE variant ADD COLUMN sourcegeneralconsequence_id bigint; +ALTER TABLE variant_note ADD COLUMN variant_id bigint; +ALTER TABLE vtterm ADD COLUMN id bigint; +ALTER TABLE wbbtterm ADD COLUMN id bigint; +ALTER TABLE wblsterm ADD COLUMN id bigint; +ALTER TABLE wbphenotypeterm ADD COLUMN id bigint; +ALTER TABLE xbaterm ADD COLUMN id bigint; +ALTER TABLE xbedterm ADD COLUMN id bigint; +ALTER TABLE xbsterm ADD COLUMN id bigint; +ALTER TABLE xcoterm ADD COLUMN id bigint; +ALTER TABLE xpoterm ADD COLUMN id bigint; +ALTER TABLE xsmoterm ADD COLUMN id bigint; +ALTER TABLE zecoterm ADD COLUMN id bigint; +ALTER TABLE zfaterm ADD COLUMN id bigint; +ALTER TABLE zfsterm ADD COLUMN id bigint; + +ALTER TABLE affectedgenomicmodel_aud ADD COLUMN id bigint; +ALTER TABLE agmdiseaseannotation_aud ADD COLUMN inferredallele_id bigint; +ALTER TABLE agmdiseaseannotation_aud ADD COLUMN inferredgene_id bigint; +ALTER TABLE agmdiseaseannotation_aud ADD COLUMN assertedallele_id bigint; +ALTER TABLE agmdiseaseannotation_aud ADD COLUMN subject_id bigint; +ALTER TABLE agmdiseaseannotation_gene_aud ADD COLUMN assertedgenes_id bigint; +ALTER TABLE allele_aud ADD COLUMN id bigint; +ALTER TABLE allele_note_aud ADD COLUMN allele_id bigint; +ALTER TABLE allele_reference_aud ADD COLUMN allele_id bigint; +ALTER TABLE allele_reference_aud ADD COLUMN references_id bigint; +ALTER TABLE alleledatabasestatusslotannotation_aud ADD COLUMN singleallele_id bigint; +ALTER TABLE allelediseaseannotation_aud ADD COLUMN inferredgene_id bigint; +ALTER TABLE allelediseaseannotation_aud ADD COLUMN subject_id bigint; +ALTER TABLE allelediseaseannotation_gene_aud ADD COLUMN assertedgenes_id bigint; +ALTER TABLE allelefullnameslotannotation_aud ADD COLUMN singleallele_id bigint; +ALTER TABLE allelefunctionalimpactslotannotation_aud ADD COLUMN singleallele_id bigint; +ALTER TABLE allelefunctionalimpactslotannotation_aud ADD COLUMN phenotypeterm_id bigint; +ALTER TABLE allelegeneassociation_aud ADD COLUMN subject_id bigint; +ALTER TABLE allelegeneassociation_aud ADD COLUMN object_id bigint; +ALTER TABLE allelegenomicentityassociation_aud ADD COLUMN evidencecode_id bigint; +ALTER TABLE allelegermlinetransmissionstatusslotannotation_aud ADD COLUMN singleallele_id bigint; +ALTER TABLE alleleinheritancemodeslotannotation_aud ADD COLUMN singleallele_id bigint; +ALTER TABLE alleleinheritancemodeslotannotation_aud ADD COLUMN phenotypeterm_id bigint; +ALTER TABLE allelemutationtypeslotannotation_aud ADD COLUMN singleallele_id bigint; +ALTER TABLE allelemutationtypeslotannotation_soterm_aud ADD COLUMN mutationtypes_id bigint; +ALTER TABLE allelenomenclatureeventslotannotation_aud ADD COLUMN singleallele_id bigint; +ALTER TABLE allelesecondaryidslotannotation_aud ADD COLUMN singleallele_id bigint; +ALTER TABLE allelesymbolslotannotation_aud ADD COLUMN singleallele_id bigint; +ALTER TABLE allelesynonymslotannotation_aud ADD COLUMN singleallele_id bigint; +ALTER TABLE anatomicalterm_aud ADD COLUMN id bigint; +ALTER TABLE apoterm_aud ADD COLUMN id bigint; +ALTER TABLE atpterm_aud ADD COLUMN id bigint; +ALTER TABLE biologicalentity_aud ADD COLUMN id bigint; +ALTER TABLE biologicalentity_aud ADD COLUMN taxon_id bigint; +ALTER TABLE bspoterm_aud ADD COLUMN id bigint; +ALTER TABLE chebiterm_aud ADD COLUMN id bigint; +ALTER TABLE chemicalterm_aud ADD COLUMN id bigint; +ALTER TABLE clterm_aud ADD COLUMN id bigint; +ALTER TABLE cmoterm_aud ADD COLUMN id bigint; +ALTER TABLE conditionrelation_aud ADD COLUMN singlereference_id bigint; +ALTER TABLE construct_reference_aud ADD COLUMN references_id bigint; +ALTER TABLE constructcomponentslotannotation_aud ADD COLUMN taxon_id bigint; +ALTER TABLE constructgenomicentityassociation_aud ADD COLUMN object_id bigint; +ALTER TABLE daoterm_aud ADD COLUMN id bigint; +ALTER TABLE diseaseannotation_aud ADD COLUMN object_id bigint; +ALTER TABLE diseaseannotation_biologicalentity_aud ADD COLUMN diseasegeneticmodifiers_id bigint; +ALTER TABLE diseaseannotation_ecoterm_aud ADD COLUMN evidencecodes_id bigint; +ALTER TABLE diseaseannotation_gene_aud ADD COLUMN with_id bigint; +ALTER TABLE doterm_aud ADD COLUMN id bigint; +ALTER TABLE dpoterm_aud ADD COLUMN id bigint; +ALTER TABLE ecoterm_aud ADD COLUMN id bigint; +ALTER TABLE emapaterm_aud ADD COLUMN id bigint; +ALTER TABLE evidenceassociation_informationcontententity_aud ADD COLUMN evidence_id bigint; +ALTER TABLE experimentalcondition_aud ADD COLUMN conditionanatomy_id bigint; +ALTER TABLE experimentalcondition_aud ADD COLUMN conditionchemical_id bigint; +ALTER TABLE experimentalcondition_aud ADD COLUMN conditionclass_id bigint; +ALTER TABLE experimentalcondition_aud ADD COLUMN conditiongeneontology_id bigint; +ALTER TABLE experimentalcondition_aud ADD COLUMN conditionid_id bigint; +ALTER TABLE experimentalcondition_aud ADD COLUMN conditiontaxon_id bigint; +ALTER TABLE experimentalconditionontologyterm_aud ADD COLUMN id bigint; +ALTER TABLE fbdvterm_aud ADD COLUMN id bigint; +ALTER TABLE gene_aud ADD COLUMN id bigint; +ALTER TABLE gene_aud ADD COLUMN genetype_id bigint; +ALTER TABLE genediseaseannotation_aud ADD COLUMN sgdstrainbackground_id bigint; +ALTER TABLE genediseaseannotation_aud ADD COLUMN subject_id bigint; +ALTER TABLE genefullnameslotannotation_aud ADD COLUMN singlegene_id bigint; +ALTER TABLE genesecondaryidslotannotation_aud ADD COLUMN singlegene_id bigint; +ALTER TABLE genesymbolslotannotation_aud ADD COLUMN singlegene_id bigint; +ALTER TABLE genesynonymslotannotation_aud ADD COLUMN singlegene_id bigint; +ALTER TABLE genesystematicnameslotannotation_aud ADD COLUMN singlegene_id bigint; +ALTER TABLE genetogeneorthology_aud ADD COLUMN subjectgene_id bigint; +ALTER TABLE genetogeneorthology_aud ADD COLUMN objectgene_id bigint; +ALTER TABLE genetogeneorthologycurated_aud ADD COLUMN singlereference_id bigint; +ALTER TABLE genetogeneorthologycurated_aud ADD COLUMN evidencecode_id bigint; +ALTER TABLE genomicentity_aud ADD COLUMN id bigint; +ALTER TABLE genomicentity_crossreference_aud ADD COLUMN genomicentity_id bigint; +ALTER TABLE goterm_aud ADD COLUMN id bigint; +ALTER TABLE hpterm_aud ADD COLUMN id bigint; +ALTER TABLE informationcontententity_aud ADD COLUMN id bigint; +ALTER TABLE materm_aud ADD COLUMN id bigint; +ALTER TABLE miterm_aud ADD COLUMN id bigint; +ALTER TABLE mmoterm_aud ADD COLUMN id bigint; +ALTER TABLE mmusdvterm_aud ADD COLUMN id bigint; +ALTER TABLE modterm_aud ADD COLUMN id bigint; +ALTER TABLE molecule_aud ADD COLUMN id bigint; +ALTER TABLE mpathterm_aud ADD COLUMN id bigint; +ALTER TABLE mpterm_aud ADD COLUMN id bigint; +ALTER TABLE ncbitaxonterm_aud ADD COLUMN id bigint; +ALTER TABLE note_reference_aud ADD COLUMN references_id bigint; +ALTER TABLE obiterm_aud ADD COLUMN id bigint; +ALTER TABLE ontologyterm_aud ADD COLUMN id bigint; +ALTER TABLE ontologyterm_crossreference_aud ADD COLUMN ontologyterm_id bigint; +ALTER TABLE ontologyterm_definitionurls_aud ADD COLUMN ontologyterm_id bigint; +ALTER TABLE ontologyterm_isa_ancestor_descendant_aud ADD COLUMN isadescendants_id bigint; +ALTER TABLE ontologyterm_isa_ancestor_descendant_aud ADD COLUMN isaancestors_id bigint; +ALTER TABLE ontologyterm_isa_parent_children_aud ADD COLUMN isachildren_id bigint; +ALTER TABLE ontologyterm_isa_parent_children_aud ADD COLUMN isaparents_id bigint; +ALTER TABLE ontologyterm_secondaryidentifiers_aud ADD COLUMN ontologyterm_id bigint; +ALTER TABLE ontologyterm_subsets_aud ADD COLUMN ontologyterm_id bigint; +ALTER TABLE ontologyterm_synonym_aud ADD COLUMN ontologyterm_id bigint; +ALTER TABLE patoterm_aud ADD COLUMN id bigint; +ALTER TABLE phenotypeterm_aud ADD COLUMN id bigint; +ALTER TABLE pwterm_aud ADD COLUMN id bigint; +ALTER TABLE reference_aud ADD COLUMN id bigint; +ALTER TABLE reference_crossreference_aud ADD COLUMN reference_id bigint; +ALTER TABLE roterm_aud ADD COLUMN id bigint; +ALTER TABLE rsterm_aud ADD COLUMN id bigint; +ALTER TABLE singlereferenceassociation_aud ADD COLUMN singlereference_id bigint; +ALTER TABLE slotannotation_informationcontententity_aud ADD COLUMN evidence_id bigint; +ALTER TABLE soterm_aud ADD COLUMN id bigint; +ALTER TABLE species_aud ADD COLUMN taxon_id bigint; +ALTER TABLE stageterm_aud ADD COLUMN id bigint; +ALTER TABLE uberonterm_aud ADD COLUMN id bigint; +ALTER TABLE variant_aud ADD COLUMN id bigint; +ALTER TABLE variant_aud ADD COLUMN varianttype_id bigint; +ALTER TABLE variant_aud ADD COLUMN sourcegeneralconsequence_id bigint; +ALTER TABLE variant_note_aud ADD COLUMN variant_id bigint; +ALTER TABLE vtterm_aud ADD COLUMN id bigint; +ALTER TABLE wbbtterm_aud ADD COLUMN id bigint; +ALTER TABLE wblsterm_aud ADD COLUMN id bigint; +ALTER TABLE wbphenotypeterm_aud ADD COLUMN id bigint; +ALTER TABLE xbaterm_aud ADD COLUMN id bigint; +ALTER TABLE xbedterm_aud ADD COLUMN id bigint; +ALTER TABLE xbsterm_aud ADD COLUMN id bigint; +ALTER TABLE xcoterm_aud ADD COLUMN id bigint; +ALTER TABLE xpoterm_aud ADD COLUMN id bigint; +ALTER TABLE xsmoterm_aud ADD COLUMN id bigint; +ALTER TABLE zecoterm_aud ADD COLUMN id bigint; +ALTER TABLE zfaterm_aud ADD COLUMN id bigint; +ALTER TABLE zfsterm_aud ADD COLUMN id bigint; + +-- Move data around + +SET session_replication_role = 'replica'; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'association', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM association; + +INSERT INTO auditedobject (tablename, id, old_curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'biologicalentity', nextval('auditedobject_seq'), curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM biologicalentity; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'bulkload', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM bulkload; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'bulkloadfile', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM bulkloadfile; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'bulkloadfileexception', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM bulkloadfileexception; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'bulkloadfilehistory', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM bulkloadfilehistory; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'bulkloadgroup', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM bulkloadgroup; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'conditionrelation', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM conditionrelation; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'crossreference', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM crossreference; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'dataprovider', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM dataprovider; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'experimentalcondition', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM experimentalcondition; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'genetogeneorthology', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM genetogeneorthology; + +INSERT INTO auditedobject (tablename, id, old_curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'informationcontententity', nextval('auditedobject_seq'), curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM informationcontententity; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'note', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM note; + +INSERT INTO auditedobject (tablename, id, old_curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'ontologyterm', nextval('auditedobject_seq'), curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM ontologyterm; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'organization', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM organization; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'person', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM person; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'personsetting', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM personsetting; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'reagent', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM reagent; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'resourcedescriptor', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM resourcedescriptor; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'resourcedescriptorpage', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM resourcedescriptorpage; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'slotannotation', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM slotannotation; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'species', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM species; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'synonym', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM synonym; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'vocabulary', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM vocabulary; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'vocabularyterm', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM vocabularyterm; + +INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT 'vocabularytermset', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM vocabularytermset; + +CREATE INDEX old_id_index ON auditedobject USING btree (old_id, tablename); +CREATE INDEX old_curie_index ON auditedobject USING btree (old_curie, tablename); + +UPDATE affectedgenomicmodel t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE affectedgenomicmodel t SET subtype_id = a.id FROM auditedobject a WHERE t.subtype_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE agmdiseaseannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE agmdiseaseannotation t SET inferredallele_id = a.id FROM auditedobject a WHERE t.inferredallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE agmdiseaseannotation t SET assertedallele_id = a.id FROM auditedobject a WHERE t.assertedallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE agmdiseaseannotation t SET inferredgene_id = a.id FROM auditedobject a WHERE t.inferredgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE agmdiseaseannotation t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE agmdiseaseannotation_gene t SET agmdiseaseannotation_id = a.id FROM auditedobject a WHERE t.agmdiseaseannotation_id = a.old_id AND a.tablename = 'association'; +UPDATE agmdiseaseannotation_gene t SET assertedgenes_id = a.id FROM auditedobject a WHERE t.assertedgenes_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allele t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allele t SET incollection_id = a.id FROM auditedobject a WHERE t.incollection_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE allele_note t SET allele_id = a.id FROM auditedobject a WHERE t.allele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allele_note t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; +UPDATE allele_reference t SET allele_id = a.id FROM auditedobject a WHERE t.allele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allele_reference t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE alleledatabasestatusslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE alleledatabasestatusslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE alleledatabasestatusslotannotation t SET databasestatus_id = a.id FROM auditedobject a WHERE t.databasestatus_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE allelediseaseannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE allelediseaseannotation t SET inferredgene_id = a.id FROM auditedobject a WHERE t.inferredgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelediseaseannotation t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelediseaseannotation_gene t SET allelediseaseannotation_id = a.id FROM auditedobject a WHERE t.allelediseaseannotation_id = a.old_id AND a.tablename = 'association'; +UPDATE allelediseaseannotation_gene t SET assertedgenes_id = a.id FROM auditedobject a WHERE t.assertedgenes_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelefullnameslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelefullnameslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelefunctionalimpactslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelefunctionalimpactslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelefunctionalimpactslotannotation t SET phenotypeterm_id = a.id FROM auditedobject a WHERE t.phenotypeterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE allelefunctionalimpactslotannotation_vocabularyterm t SET allelefunctionalimpactslotannotation_id = a.id FROM auditedobject a WHERE t.allelefunctionalimpactslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelefunctionalimpactslotannotation_vocabularyterm t SET functionalimpacts_id = a.id FROM auditedobject a WHERE t.functionalimpacts_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE allelegeneassociation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE allelegeneassociation t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelegeneassociation t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelegenomicentityassociation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE allelegenomicentityassociation t SET evidencecode_id = a.id FROM auditedobject a WHERE t.evidencecode_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE allelegenomicentityassociation t SET relatednote_id = a.id FROM auditedobject a WHERE t.relatednote_id = a.old_id AND a.tablename = 'note'; +UPDATE allelegenomicentityassociation t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE allelegermlinetransmissionstatusslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelegermlinetransmissionstatusslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelegermlinetransmissionstatusslotannotation t SET germlinetransmissionstatus_id = a.id FROM auditedobject a WHERE t.germlinetransmissionstatus_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE alleleinheritancemodeslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE alleleinheritancemodeslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE alleleinheritancemodeslotannotation t SET inheritancemode_id = a.id FROM auditedobject a WHERE t.inheritancemode_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE alleleinheritancemodeslotannotation t SET phenotypeterm_id = a.id FROM auditedobject a WHERE t.phenotypeterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE allelemutationtypeslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelemutationtypeslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelemutationtypeslotannotation_soterm t SET allelemutationtypeslotannotation_id = a.id FROM auditedobject a WHERE t.allelemutationtypeslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelemutationtypeslotannotation_soterm t SET mutationtypes_id = a.id FROM auditedobject a WHERE t.mutationtypes_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE allelenomenclatureeventslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelenomenclatureeventslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelenomenclatureeventslotannotation t SET nomenclatureevent_id = a.id FROM auditedobject a WHERE t.nomenclatureevent_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE allelesecondaryidslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelesecondaryidslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelesymbolslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelesymbolslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelesynonymslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelesynonymslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE alliancemember t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'organization'; +UPDATE anatomicalterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE annotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE annotation t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; +UPDATE annotation_conditionrelation t SET annotation_id = a.id FROM auditedobject a WHERE t.annotation_id = a.old_id AND a.tablename = 'association'; +UPDATE annotation_conditionrelation t SET conditionrelations_id = a.id FROM auditedobject a WHERE t.conditionrelations_id = a.old_id AND a.tablename = 'conditionrelation'; +UPDATE annotation_note t SET annotation_id = a.id FROM auditedobject a WHERE t.annotation_id = a.old_id AND a.tablename = 'association'; +UPDATE annotation_note t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; +UPDATE apoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE association t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE atpterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE biologicalentity t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE biologicalentity t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE bspoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE bulkfmsload t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +UPDATE bulkload t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +UPDATE bulkload t SET group_id = a.id FROM auditedobject a WHERE t.group_id = a.old_id AND a.tablename = 'bulkloadgroup'; +UPDATE bulkloadfile t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfile'; +UPDATE bulkloadfile t SET bulkload_id = a.id FROM auditedobject a WHERE t.bulkload_id = a.old_id AND a.tablename = 'bulkload'; +UPDATE bulkloadfileexception t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfileexception'; +UPDATE bulkloadfileexception t SET bulkloadfilehistory_id = a.id FROM auditedobject a WHERE t.bulkloadfilehistory_id = a.old_id AND a.tablename = 'bulkloadfilehistory'; +UPDATE bulkloadfilehistory t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfilehistory'; +UPDATE bulkloadfilehistory t SET bulkloadfile_id = a.id FROM auditedobject a WHERE t.bulkloadfile_id = a.old_id AND a.tablename = 'bulkloadfile'; +UPDATE bulkloadgroup t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadgroup'; +UPDATE bulkmanualload t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +UPDATE bulkscheduledload t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +UPDATE bulkurlload t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +UPDATE chebiterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE chemicalterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE clterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE cmoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE conditionrelation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'conditionrelation'; +UPDATE conditionrelation t SET conditionrelationtype_id = a.id FROM auditedobject a WHERE t.conditionrelationtype_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE conditionrelation t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE conditionrelation_experimentalcondition t SET conditionrelation_id = a.id FROM auditedobject a WHERE t.conditionrelation_id = a.old_id AND a.tablename = 'conditionrelation'; +UPDATE conditionrelation_experimentalcondition t SET conditions_id = a.id FROM auditedobject a WHERE t.conditions_id = a.old_id AND a.tablename = 'experimentalcondition'; +UPDATE construct t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'reagent'; +UPDATE construct_reference t SET construct_id = a.id FROM auditedobject a WHERE t.construct_id = a.old_id AND a.tablename = 'reagent'; +UPDATE construct_reference t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE constructcomponentslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE constructcomponentslotannotation t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; +UPDATE constructcomponentslotannotation t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE constructcomponentslotannotation t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE constructcomponentslotannotation_note t SET constructcomponentslotannotation_id = a.id FROM auditedobject a WHERE t.constructcomponentslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE constructcomponentslotannotation_note t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; +UPDATE constructfullnameslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE constructfullnameslotannotation t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; +UPDATE constructgenomicentityassociation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE constructgenomicentityassociation t SET subject_id = a.id FROM auditedobject a WHERE t.subject_id = a.old_id AND a.tablename = 'reagent'; +UPDATE constructgenomicentityassociation t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE constructgenomicentityassociation t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE constructgenomicentityassociation_note t SET constructgenomicentityassociation_id = a.id FROM auditedobject a WHERE t.constructgenomicentityassociation_id = a.old_id AND a.tablename = 'association'; +UPDATE constructgenomicentityassociation_note t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; +UPDATE constructsymbolslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE constructsymbolslotannotation t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; +UPDATE constructsynonymslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE constructsynonymslotannotation t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; +UPDATE crossreference t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'crossreference'; +UPDATE crossreference t SET resourcedescriptorpage_id = a.id FROM auditedobject a WHERE t.resourcedescriptorpage_id = a.old_id AND a.tablename = 'resourcedescriptorpage'; +UPDATE daoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE dataprovider t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'dataprovider'; +UPDATE dataprovider t SET sourceorganization_id = a.id FROM auditedobject a WHERE t.sourceorganization_id = a.old_id AND a.tablename = 'organization'; +UPDATE dataprovider t SET crossreference_id = a.id FROM auditedobject a WHERE t.crossreference_id = a.old_id AND a.tablename = 'crossreference'; +UPDATE diseaseannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE diseaseannotation t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE diseaseannotation t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE diseaseannotation t SET diseasegeneticmodifierrelation_id = a.id FROM auditedobject a WHERE t.diseasegeneticmodifierrelation_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE diseaseannotation t SET annotationtype_id = a.id FROM auditedobject a WHERE t.annotationtype_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE diseaseannotation t SET geneticsex_id = a.id FROM auditedobject a WHERE t.geneticsex_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE diseaseannotation t SET secondarydataprovider_id = a.id FROM auditedobject a WHERE t.secondarydataprovider_id = a.old_id AND a.tablename = 'dataprovider'; +UPDATE diseaseannotation_biologicalentity t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; +UPDATE diseaseannotation_biologicalentity t SET diseasegeneticmodifiers_id = a.id FROM auditedobject a WHERE t.diseasegeneticmodifiers_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE diseaseannotation_ecoterm t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; +UPDATE diseaseannotation_ecoterm t SET evidencecodes_id = a.id FROM auditedobject a WHERE t.evidencecodes_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE diseaseannotation_gene t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; +UPDATE diseaseannotation_gene t SET with_id = a.id FROM auditedobject a WHERE t.with_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE diseaseannotation_vocabularyterm t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; +UPDATE diseaseannotation_vocabularyterm t SET diseasequalifiers_id = a.id FROM auditedobject a WHERE t.diseasequalifiers_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE doterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE dpoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE ecoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE emapaterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE evidenceassociation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE evidenceassociation_informationcontententity t SET evidenceassociation_id = a.id FROM auditedobject a WHERE t.evidenceassociation_id = a.old_id AND a.tablename = 'association'; +UPDATE evidenceassociation_informationcontententity t SET evidence_id = a.id FROM auditedobject a WHERE t.evidence_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE experimentalcondition t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'experimentalcondition'; +UPDATE experimentalcondition t SET conditionanatomy_id = a.id FROM auditedobject a WHERE t.conditionanatomy_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE experimentalcondition t SET conditionchemical_id = a.id FROM auditedobject a WHERE t.conditionchemical_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE experimentalcondition t SET conditionclass_id = a.id FROM auditedobject a WHERE t.conditionclass_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE experimentalcondition t SET conditiongeneontology_id = a.id FROM auditedobject a WHERE t.conditiongeneontology_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE experimentalcondition t SET conditionid_id = a.id FROM auditedobject a WHERE t.conditionid_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE experimentalcondition t SET conditiontaxon_id = a.id FROM auditedobject a WHERE t.conditiontaxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE experimentalconditionontologyterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE fbdvterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE gene t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE gene t SET genetype_id = a.id FROM auditedobject a WHERE t.genetype_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE genediseaseannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE genediseaseannotation t SET sgdstrainbackground_id = a.id FROM auditedobject a WHERE t.sgdstrainbackground_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genediseaseannotation t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genefullnameslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE genefullnameslotannotation t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genesecondaryidslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE genesecondaryidslotannotation t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genesymbolslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE genesymbolslotannotation t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genesynonymslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE genesynonymslotannotation t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genesystematicnameslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE genesystematicnameslotannotation t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genetogeneorthology t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; +UPDATE genetogeneorthology t SET subjectgene_id = a.id FROM auditedobject a WHERE t.subjectgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genetogeneorthology t SET objectgene_id = a.id FROM auditedobject a WHERE t.objectgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genetogeneorthologycurated t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; +UPDATE genetogeneorthologycurated t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE genetogeneorthologycurated t SET evidencecode_id = a.id FROM auditedobject a WHERE t.evidencecode_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE genetogeneorthologygenerated t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; +UPDATE genetogeneorthologygenerated t SET isbestscore_id = a.id FROM auditedobject a WHERE t.isbestscore_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE genetogeneorthologygenerated t SET isbestscorereverse_id = a.id FROM auditedobject a WHERE t.isbestscorereverse_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE genetogeneorthologygenerated t SET confidence_id = a.id FROM auditedobject a WHERE t.confidence_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE genetogeneorthologygenerated_predictionmethodsmatched t SET genetogeneorthologygenerated_id = a.id FROM auditedobject a WHERE t.genetogeneorthologygenerated_id = a.old_id AND a.tablename = 'genetogeneorthology'; +UPDATE genetogeneorthologygenerated_predictionmethodsmatched t SET predictionmethodsmatched_id = a.id FROM auditedobject a WHERE t.predictionmethodsmatched_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE genetogeneorthologygenerated_predictionmethodsnotcalled t SET genetogeneorthologygenerated_id = a.id FROM auditedobject a WHERE t.genetogeneorthologygenerated_id = a.old_id AND a.tablename = 'genetogeneorthology'; +UPDATE genetogeneorthologygenerated_predictionmethodsnotcalled t SET predictionmethodsnotcalled_id = a.id FROM auditedobject a WHERE t.predictionmethodsnotcalled_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE genetogeneorthologygenerated_predictionmethodsnotmatched t SET genetogeneorthologygenerated_id = a.id FROM auditedobject a WHERE t.genetogeneorthologygenerated_id = a.old_id AND a.tablename = 'genetogeneorthology'; +UPDATE genetogeneorthologygenerated_predictionmethodsnotmatched t SET predictionmethodsnotmatched_id = a.id FROM auditedobject a WHERE t.predictionmethodsnotmatched_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE genomicentity t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genomicentity_crossreference t SET genomicentity_id = a.id FROM auditedobject a WHERE t.genomicentity_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genomicentity_crossreference t SET crossreferences_id = a.id FROM auditedobject a WHERE t.crossreferences_id = a.old_id AND a.tablename = 'crossreference'; +UPDATE goterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE hpterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE informationcontententity t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE materm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE miterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE mmoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE mmusdvterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE modterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE molecule t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE mpathterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE mpterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE nameslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE nameslotannotation t SET nametype_id = a.id FROM auditedobject a WHERE t.nametype_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE nameslotannotation t SET synonymscope_id = a.id FROM auditedobject a WHERE t.synonymscope_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE ncbitaxonterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE note t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'note'; +UPDATE note t SET notetype_id = a.id FROM auditedobject a WHERE t.notetype_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE note_reference t SET note_id = a.id FROM auditedobject a WHERE t.note_id = a.old_id AND a.tablename = 'note'; +UPDATE note_reference t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE obiterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE ontologyterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE ontologyterm_crossreference t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE ontologyterm_crossreference t SET crossreferences_id = a.id FROM auditedobject a WHERE t.crossreferences_id = a.old_id AND a.tablename = 'crossreference'; +UPDATE ontologyterm_definitionurls t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE ontologyterm_isa_ancestor_descendant t SET isadescendants_id = a.id FROM auditedobject a WHERE t.isadescendants_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE ontologyterm_isa_ancestor_descendant t SET isaancestors_id = a.id FROM auditedobject a WHERE t.isaancestors_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE ontologyterm_isa_parent_children t SET isachildren_id = a.id FROM auditedobject a WHERE t.isachildren_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE ontologyterm_isa_parent_children t SET isaparents_id = a.id FROM auditedobject a WHERE t.isaparents_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE ontologyterm_secondaryidentifiers t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE ontologyterm_subsets t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE ontologyterm_synonym t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE ontologyterm_synonym t SET synonyms_id = a.id FROM auditedobject a WHERE t.synonyms_id = a.old_id AND a.tablename = 'ontologyterm'; +UPDATE organization t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'organization'; +UPDATE organization t SET homepageresourcedescriptorpage_id = a.id FROM auditedobject a WHERE t.homepageresourcedescriptorpage_id = a.old_id AND a.tablename = 'resourcedescriptorpage'; +UPDATE patoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE person t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'person'; +UPDATE person t SET alliancemember_id = a.id FROM auditedobject a WHERE t.alliancemember_id = a.old_id AND a.tablename = 'organization'; +UPDATE person_emails t SET person_id = a.id FROM auditedobject a WHERE t.person_id = a.old_id AND a.tablename = 'person'; +UPDATE person_oldemails t SET person_id = a.id FROM auditedobject a WHERE t.person_id = a.old_id AND a.tablename = 'person'; +UPDATE personsetting t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'personsetting'; +UPDATE phenotypeterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE pwterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE reagent t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'reagent'; +UPDATE reagent t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; +UPDATE reagent_secondaryidentifiers t SET reagent_id = a.id FROM auditedobject a WHERE t.reagent_id = a.old_id AND a.tablename = 'reagent'; +UPDATE reference t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE reference_crossreference t SET reference_id = a.id FROM auditedobject a WHERE t.reference_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE reference_crossreference t SET crossreferences_id = a.id FROM auditedobject a WHERE t.crossreferences_id = a.old_id AND a.tablename = 'crossreference'; +UPDATE resourcedescriptor t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'resourcedescriptor'; +UPDATE resourcedescriptor_synonyms t SET resourcedescriptor_id = a.id FROM auditedobject a WHERE t.resourcedescriptor_id = a.old_id AND a.tablename = 'resourcedescriptor'; +UPDATE resourcedescriptorpage t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'resourcedescriptorpage'; +UPDATE resourcedescriptorpage t SET resourcedescriptor_id = a.id FROM auditedobject a WHERE t.resourcedescriptor_id = a.old_id AND a.tablename = 'resourcedescriptor'; +UPDATE roterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE rsterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE secondaryidslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE singlereferenceassociation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE singlereferenceassociation t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE slotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE slotannotation_informationcontententity t SET slotannotation_id = a.id FROM auditedobject a WHERE t.slotannotation_id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE slotannotation_informationcontententity t SET evidence_id = a.id FROM auditedobject a WHERE t.evidence_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE soterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE species t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'species'; +UPDATE species t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE species_commonnames t SET species_id = a.id FROM auditedobject a WHERE t.species_id = a.old_id AND a.tablename = 'species'; +UPDATE stageterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE synonym t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'synonym'; +UPDATE uberonterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE variant t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE variant t SET varianttype_id = a.id FROM auditedobject a WHERE t.varianttype_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE variant t SET sourcegeneralconsequence_id = a.id FROM auditedobject a WHERE t.sourcegeneralconsequence_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE variant t SET variantstatus_id = a.id FROM auditedobject a WHERE t.variantstatus_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE variant_note t SET variant_id = a.id FROM auditedobject a WHERE t.variant_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE variant_note t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; +UPDATE vocabulary t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabulary'; +UPDATE vocabularyterm t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE vocabularyterm t SET vocabulary_id = a.id FROM auditedobject a WHERE t.vocabulary_id = a.old_id AND a.tablename = 'vocabulary'; +UPDATE vocabularyterm_synonyms t SET vocabularyterm_id = a.id FROM auditedobject a WHERE t.vocabularyterm_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE vocabularytermset t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabularytermset'; +UPDATE vocabularytermset t SET vocabularytermsetvocabulary_id = a.id FROM auditedobject a WHERE t.vocabularytermsetvocabulary_id = a.old_id AND a.tablename = 'vocabulary'; +UPDATE vocabularytermset_vocabularyterm t SET vocabularytermsets_id = a.id FROM auditedobject a WHERE t.vocabularytermsets_id = a.old_id AND a.tablename = 'vocabularytermset'; +UPDATE vocabularytermset_vocabularyterm t SET memberterms_id = a.id FROM auditedobject a WHERE t.memberterms_id = a.old_id AND a.tablename = 'vocabularyterm';; +UPDATE vtterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE wbbtterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE wblsterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE wbphenotypeterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE xbaterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE xbedterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE xbsterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE xcoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE xpoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE xsmoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE zecoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE zfaterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE zfsterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; + +INSERT INTO submittedobject (id, modentityid, dataprovider_id) SELECT id, curie, dataprovider_id FROM biologicalentity; +INSERT INTO submittedobject (id, modentityid, modinternalid, dataprovider_id) SELECT id, modentityid, modinternalid, dataprovider_id FROM reagent; + +INSERT INTO curieobject (id) SELECT id FROM submittedobject; +INSERT INTO curieobject (id, curie) SELECT id, curie FROM ontologyterm; +INSERT INTO curieobject (id, curie) SELECT id, curie FROM informationcontententity; + +SET session_replication_role = 'origin'; -- Add constraints and indexes +ALTER TABLE auditedobject ADD CONSTRAINT auditedobject_createdby_id_fk FOREIGN KEY (createdby_id) REFERENCES person (id); +ALTER TABLE auditedobject ADD CONSTRAINT auditedobject_updatedby_id_fk FOREIGN KEY (updatedby_id) REFERENCES person (id); +CREATE INDEX auditedobject_createdby_index ON auditedobject USING btree (createdby_id); +CREATE INDEX auditedobject_updatedby_index ON auditedobject USING btree (updatedby_id); + +ALTER TABLE auditedobject_aud ADD CONSTRAINT auditedobject_aud_rev_fk FOREIGN KEY (rev) REFERENCES revinfo (rev); + +ALTER TABLE curieobject ADD CONSTRAINT curieobject_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +CREATE INDEX curieobject_curie_index ON curieobject USING btree (curie); +ALTER TABLE curieobject ADD CONSTRAINT curieobject_curie_uk UNIQUE (curie); + +ALTER TABLE curieobject_aud ADD CONSTRAINT curieobject_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); + +ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); +ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_dataprovider_id_fk FOREIGN KEY (dataprovider_id) REFERENCES dataprovider (id); +CREATE INDEX submittedobject_modentityid_index ON submittedobject USING btree (modentityid); +CREATE INDEX submittedobject_modinternalid_index ON submittedobject USING btree (modinternalid); +CREATE INDEX submittedobject_dataprovider_index ON submittedobject USING btree (dataprovider_id); +ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_modentityid_uk UNIQUE (modentityid); +ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_modinternalid_uk UNIQUE (modinternalid); + +ALTER TABLE submittedobject_aud ADD CONSTRAINT submittedobject_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES curieobject_aud (id, rev); + +ALTER TABLE affectedgenomicmodel ADD CONSTRAINT affectedgenomicmodel_pkey PRIMARY KEY (id); +ALTER TABLE affectedgenomicmodel_aud ADD CONSTRAINT affectedgenomicmodel_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE allele ADD CONSTRAINT allele_pkey PRIMARY KEY (id); +ALTER TABLE allele_aud ADD CONSTRAINT allele_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE allele_note_aud ADD CONSTRAINT allele_note_aud_pkey PRIMARY KEY (allele_id, relatednotes_id, rev); +ALTER TABLE allele_reference_aud ADD CONSTRAINT allele_reference_aud_pkey PRIMARY KEY (allele_id, references_id, rev); +ALTER TABLE anatomicalterm ADD CONSTRAINT anatomicalterm_pkey PRIMARY KEY (id); +ALTER TABLE anatomicalterm_aud ADD CONSTRAINT anatomicalterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE apoterm ADD CONSTRAINT apoterm_pkey PRIMARY KEY (id); +ALTER TABLE apoterm_aud ADD CONSTRAINT apoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE atpterm ADD CONSTRAINT atpterm_pkey PRIMARY KEY (id); +ALTER TABLE atpterm_aud ADD CONSTRAINT atpterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_pkey PRIMARY KEY (id); +ALTER TABLE biologicalentity_aud ADD CONSTRAINT biologicalentity_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE bspoterm ADD CONSTRAINT bspoterm_pkey PRIMARY KEY (id); +ALTER TABLE bspoterm_aud ADD CONSTRAINT bspoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE chebiterm ADD CONSTRAINT chebiterm_pkey PRIMARY KEY (id); +ALTER TABLE chebiterm_aud ADD CONSTRAINT chebiterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE chemicalterm ADD CONSTRAINT chemicalterm_pkey PRIMARY KEY (id); +ALTER TABLE chemicalterm_aud ADD CONSTRAINT chemicalterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE clterm ADD CONSTRAINT clterm_pkey PRIMARY KEY (id); +ALTER TABLE clterm_aud ADD CONSTRAINT clterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE cmoterm ADD CONSTRAINT cmoterm_pkey PRIMARY KEY (id); +ALTER TABLE cmoterm_aud ADD CONSTRAINT cmoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE daoterm ADD CONSTRAINT daoterm_pkey PRIMARY KEY (id); +ALTER TABLE daoterm_aud ADD CONSTRAINT daoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE doterm ADD CONSTRAINT doterm_pkey PRIMARY KEY (id); +ALTER TABLE doterm_aud ADD CONSTRAINT doterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE dpoterm ADD CONSTRAINT dpoterm_pkey PRIMARY KEY (id); +ALTER TABLE dpoterm_aud ADD CONSTRAINT dpoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE ecoterm ADD CONSTRAINT ecoterm_pkey PRIMARY KEY (id); +ALTER TABLE ecoterm_aud ADD CONSTRAINT ecoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE emapaterm ADD CONSTRAINT emapaterm_pkey PRIMARY KEY (id); +ALTER TABLE emapaterm_aud ADD CONSTRAINT emapaterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE experimentalconditionontologyterm ADD CONSTRAINT experimentalconditionontologyterm_pkey PRIMARY KEY (id); +ALTER TABLE experimentalconditionontologyterm_aud ADD CONSTRAINT experimentalconditionontologyterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE fbdvterm ADD CONSTRAINT fbdvterm_pkey PRIMARY KEY (id); +ALTER TABLE fbdvterm_aud ADD CONSTRAINT fbdvterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE gene ADD CONSTRAINT gene_pkey PRIMARY KEY (id); +ALTER TABLE gene_aud ADD CONSTRAINT gene_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE genomicentity ADD CONSTRAINT genomicentity_pkey PRIMARY KEY (id); +ALTER TABLE genomicentity_aud ADD CONSTRAINT genomicentity_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE goterm ADD CONSTRAINT goterm_pkey PRIMARY KEY (id); +ALTER TABLE goterm_aud ADD CONSTRAINT goterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE hpterm ADD CONSTRAINT hpterm_pkey PRIMARY KEY (id); +ALTER TABLE hpterm_aud ADD CONSTRAINT hpterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_pkey PRIMARY KEY (id); +ALTER TABLE informationcontententity_aud ADD CONSTRAINT informationcontententity_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE materm ADD CONSTRAINT materm_pkey PRIMARY KEY (id); +ALTER TABLE materm_aud ADD CONSTRAINT materm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE miterm ADD CONSTRAINT miterm_pkey PRIMARY KEY (id); +ALTER TABLE miterm_aud ADD CONSTRAINT miterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_pkey PRIMARY KEY (id); +ALTER TABLE mmoterm_aud ADD CONSTRAINT mmoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE mmusdvterm ADD CONSTRAINT mmusdvterm_pkey PRIMARY KEY (id); +ALTER TABLE mmusdvterm_aud ADD CONSTRAINT mmusdvterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE modterm ADD CONSTRAINT modterm_pkey PRIMARY KEY (id); +ALTER TABLE modterm_aud ADD CONSTRAINT modterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE molecule ADD CONSTRAINT molecule_pkey PRIMARY KEY (id); +ALTER TABLE molecule_aud ADD CONSTRAINT molecule_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE mpathterm ADD CONSTRAINT mpathterm_pkey PRIMARY KEY (id); +ALTER TABLE mpathterm_aud ADD CONSTRAINT mpathterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE mpterm ADD CONSTRAINT mpterm_pkey PRIMARY KEY (id); +ALTER TABLE mpterm_aud ADD CONSTRAINT mpterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_pkey PRIMARY KEY (id); +ALTER TABLE ncbitaxonterm_aud ADD CONSTRAINT ncbitaxonterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE obiterm ADD CONSTRAINT obiterm_pkey PRIMARY KEY (id); +ALTER TABLE obiterm_aud ADD CONSTRAINT obiterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_pkey PRIMARY KEY (id); +ALTER TABLE ontologyterm_aud ADD CONSTRAINT ontologyterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_pkey PRIMARY KEY (isachildren_id, isaparents_id); +ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_pkey PRIMARY KEY (isadescendants_id, isaancestors_id); +ALTER TABLE patoterm ADD CONSTRAINT patoterm_pkey PRIMARY KEY (id); +ALTER TABLE patoterm_aud ADD CONSTRAINT patoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE phenotypeterm ADD CONSTRAINT phenotypeterm_pkey PRIMARY KEY (id); +ALTER TABLE phenotypeterm_aud ADD CONSTRAINT phenotypeterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE pwterm ADD CONSTRAINT pwterm_pkey PRIMARY KEY (id); +ALTER TABLE pwterm_aud ADD CONSTRAINT pwterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE reference ADD CONSTRAINT reference_pkey PRIMARY KEY (id); +ALTER TABLE reference_aud ADD CONSTRAINT reference_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE roterm ADD CONSTRAINT roterm_pkey PRIMARY KEY (id); +ALTER TABLE roterm_aud ADD CONSTRAINT roterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE rsterm ADD CONSTRAINT rsterm_pkey PRIMARY KEY (id); +ALTER TABLE rsterm_aud ADD CONSTRAINT rsterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE soterm ADD CONSTRAINT soterm_pkey PRIMARY KEY (id); +ALTER TABLE soterm_aud ADD CONSTRAINT soterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE stageterm ADD CONSTRAINT stageterm_pkey PRIMARY KEY (id); +ALTER TABLE stageterm_aud ADD CONSTRAINT stageterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE uberonterm ADD CONSTRAINT uberonterm_pkey PRIMARY KEY (id); +ALTER TABLE uberonterm_aud ADD CONSTRAINT uberonterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE variant ADD CONSTRAINT variant_pkey PRIMARY KEY (id); +ALTER TABLE variant_aud ADD CONSTRAINT variant_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE vtterm ADD CONSTRAINT vtterm_pkey PRIMARY KEY (id); +ALTER TABLE vtterm_aud ADD CONSTRAINT vtterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE wbbtterm ADD CONSTRAINT wbbtterm_pkey PRIMARY KEY (id); +ALTER TABLE wbbtterm_aud ADD CONSTRAINT wbbtterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE wblsterm ADD CONSTRAINT wblsterm_pkey PRIMARY KEY (id); +ALTER TABLE wblsterm_aud ADD CONSTRAINT wblsterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE wbphenotypeterm ADD CONSTRAINT wbphenotypeterm_pkey PRIMARY KEY (id); +ALTER TABLE wbphenotypeterm_aud ADD CONSTRAINT wbphenotypeterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE xbaterm ADD CONSTRAINT xbaterm_pkey PRIMARY KEY (id); +ALTER TABLE xbaterm_aud ADD CONSTRAINT xbaterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE xbedterm ADD CONSTRAINT xbedterm_pkey PRIMARY KEY (id); +ALTER TABLE xbedterm_aud ADD CONSTRAINT xbedterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE xbsterm ADD CONSTRAINT xbsterm_pkey PRIMARY KEY (id); +ALTER TABLE xbsterm_aud ADD CONSTRAINT xbsterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE xcoterm ADD CONSTRAINT xcoterm_pkey PRIMARY KEY (id); +ALTER TABLE xcoterm_aud ADD CONSTRAINT xcoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE xpoterm ADD CONSTRAINT xpoterm_pkey PRIMARY KEY (id); +ALTER TABLE xpoterm_aud ADD CONSTRAINT xpoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE xsmoterm ADD CONSTRAINT xsmoterm_pkey PRIMARY KEY (id); +ALTER TABLE xsmoterm_aud ADD CONSTRAINT xsmoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE zecoterm ADD CONSTRAINT zecoterm_pkey PRIMARY KEY (id); +ALTER TABLE zecoterm_aud ADD CONSTRAINT zecoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_pkey PRIMARY KEY (id); +ALTER TABLE zfaterm_aud ADD CONSTRAINT zfaterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_pkey PRIMARY KEY (id); +ALTER TABLE zfsterm_aud ADD CONSTRAINT zfsterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE affectedgenomicmodel ADD PRIMARY KEY (id); ALTER TABLE affectedgenomicmodel ADD CONSTRAINT affectedgenomicmodel_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); - -ALTER TABLE affectedgenomicmodel_aud ADD PRIMARY KEY (id, rev); ALTER TABLE affectedgenomicmodel_aud ADD CONSTRAINT affectedgenomicmodel_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); - -ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_subject_id_fk (subject_id) REFERENCES affectedgenomicmodel (id); -ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_assertedallele_id_fk (assertedallele_id) REFERENCES allele (id); -ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredallele_id_fk (inferredallele_id) REFERENCES allele (id); -ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredgene_id_fk (inferredgene_id) REFERENCES gene (id); - -ALTER TABLE agmdiseaseannotation_gene ADD CONSTRAINT agmdiseaseannotation_gene_assertedgenes_id_fk (assertedgenes_id) REFERENCES gene (id); - -ALTER TABLE allele ADD PRIMARY KEY (id); +ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES affectedgenomicmodel (id); +ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_assertedallele_id_fk FOREIGN KEY (assertedallele_id) REFERENCES allele (id); +ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredallele_id_fk FOREIGN KEY (inferredallele_id) REFERENCES allele (id); +ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id); +ALTER TABLE agmdiseaseannotation_gene ADD CONSTRAINT agmdiseaseannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); ALTER TABLE allele ADD CONSTRAINT allele_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); - -ALTER TABLE allele_aud ADD PRIMARY KEY (id, rev); ALTER TABLE allele_aud ADD CONSTRAINT allele_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); - ALTER TABLE allele_note ADD CONSTRAINT allele_note_allele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id); CREATE INDEX allele_note_allele_index ON allele_note USING btree (allele_id); - -ALTER TABLE allele_note_aud ADD PRIMARY KEY (allele_id, relatednotes_id, rev); - ALTER TABLE allele_reference ADD CONSTRAINT allele_reference_allele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id); ALTER TABLE allele_reference ADD CONSTRAINT allele_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); CREATE INDEX allele_reference_allele_index ON allele_reference USING btree (allele_id); CREATE INDEX allele_reference_references_index ON allele_reference USING btree (references_id); CREATE INDEX allele_reference_allele_references_index ON allele_reference USING btree (allele_id, references_id); - -ALTER TABLE allele_reference_aud ADD PRIMARY KEY (allele_id, references_id, rev); - -ALTER TABLE alleledatabasestatusslotannotation ADD CONSTRAINT alleledatabasestatus_singleallele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id); -CREATE INDEX alleledatabasestatus_singleallele_index ON alleledatabasestatusslotannotation USING btree (allele_id); - +ALTER TABLE alleledatabasestatusslotannotation ADD CONSTRAINT alleledatabasestatus_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX alleledatabasestatus_singleallele_index ON alleledatabasestatusslotannotation USING btree (singleallele_id); ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannoation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES allele (id); ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id); CREATE INDEX allelediseaseannotation_inferredgene_index ON allelediseaseannotation USING btree (inferredgene_id); CREATE INDEX allelediseaseannotation_subject_index ON allelediseaseannotation USING btree (subject_id); - -ALTER TABLE allelediseaseannotation_gene ADD CONSTRAINT allelediseaseannotation_gene_assertedgenes_id_fk; +ALTER TABLE allelediseaseannotation_gene ADD CONSTRAINT allelediseaseannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); CREATE INDEX allelediseaseannotationgene_assertedgenes_index ON allelediseaseannotation_gene USING btree (assertedgenes_id); - -CREATE INDEX allelefullname_singleallele_index ON allelefullnameslotannotation USING btree (allele_id); - +CREATE INDEX allelefullname_singleallele_index ON allelefullnameslotannotation USING btree (singleallele_id); ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctionalimpactslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctionalimpactslotannotation_phenotypeterm_id_fk FOREIGN KEY (phenotypeterm_id) REFERENCES phenotypeterm (id); CREATE INDEX allelefunctionalimpact_singleallele_index ON allelefunctionalimpactslotannotation USING btree (singleallele_id); CREATE INDEX allelefunctionalimpact_phenotypeterm_index ON allelefunctionalimpactslotannotation USING btree (phenotypeterm_id); - ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_object_id_fk FOREIGN KEY (object_id) REFERENCES gene (id); ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES allele (id); CREATE INDEX allelegeneassociation_object_index ON allelegeneassociation USING btree (object_id); CREATE INDEX allelegeneassociation_subject_index ON allelegeneassociation USING btree (subject_id); - ALTER TABLE allelegenomicentityassociation ADD CONSTRAINT allelegenomicentityassociation_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES ecoterm (id); - ALTER TABLE allelegermlinetransmissionstatusslotannotation ADD CONSTRAINT allelegermlinetransmissionstatus_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); CREATE INDEX allelegermlinetransmissionstatus_singleallele_index ON allelegermlinetransmissionstatusslotannotation USING btree (singleallele_id); - ALTER TABLE alleleinheritancemodeslotannotation ADD CONSTRAINT alleleinheritancemode_phenotypeterm_id_fk FOREIGN KEY (phenotypeterm_id) REFERENCES phenotypeterm (id); ALTER TABLE alleleinheritancemodeslotannotation ADD CONSTRAINT alleleinheritancemode_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); CREATE INDEX alleleinheritancemode_phenotypeterm_index ON alleleinheritancemodeslotannotation USING btree (phenotypeterm_id); CREATE INDEX alleleinheritancemode_singleallele_index ON alleleinheritancemodeslotannotation USING btree (singleallele_id); - ALTER TABLE allelemutationtypeslotannotation ADD CONSTRAINT allelemutationtype_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); CREATE INDEX allelemutationtype_singleallele_index ON allelemutationtypeslotannotation USING btree (singleallele_id); - ALTER TABLE allelemutationtypeslotannotation_soterm ADD CONSTRAINT allelemutationtypesa_soterm_mutationtypes_id_fk FOREIGN KEY (mutationtypes_id) REFERENCES soterm (id); CREATE INDEX allelemutationtypesa_soterm_mutationtypes_index ON allelemutationtypeslotannotation_soterm USING btree (mutationtypes_id); - ALTER TABLE allelenomenclatureeventslotannotation ADD CONSTRAINT allelenomenclatureeventslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); CREATE INDEX allelenomenclatureevent_singleallele_index ON allelenomenclatureeventslotannotation USING btree (singleallele_id); - ALTER TABLE allelesecondaryidslotannotation ADD CONSTRAINT allelesecondaryidslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); CREATE INDEX allelesecondaryid_singleallele_index ON allelesecondaryidslotannotation USING btree (singleallele_id); - ALTER TABLE allelesymbolslotannotation ADD CONSTRAINT allelesymbolslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); CREATE INDEX allelesymbol_singleallele_index ON allelesymbolslotannotation USING btree (singleallele_id); - ALTER TABLE allelesynonymslotannotation ADD CONSTRAINT allelesynonymslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); CREATE INDEX allelesynonym_singleallele_index ON allelesynonymslotannotation USING btree (singleallele_id); - -ALTER TABLE anatomicalterm ADD PRIMARY KEY (id); ALTER TABLE anatomicalterm ADD CONSTRAINT anatomicalterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE anatomicalterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE anatomicalterm_aud ADD CONSTRAINT anatomicalterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - -ALTER TABLE apoterm ADD PRIMARY KEY (id); +ALTER TABLE anatomicalterm_aud ADD CONSTRAINT anatomicalterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE apoterm ADD CONSTRAINT apoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); - -ALTER TABLE apoterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE apoterm_aud ADD CONSTRAINT apoterm_aud_id_rev_fk (id, rev) REFERENCES phenotypeterm_aud (id, rev); - -ALTER TABLE atpterm ADD PRIMARY KEY (id); +ALTER TABLE apoterm_aud ADD CONSTRAINT apoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); ALTER TABLE atpterm ADD CONSTRAINT atpterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE atpterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE atpterm_aud ADD CONSTRAINT atpterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - -ALTER TABLE biologicalentity ADD PRIMARY KEY (id); +ALTER TABLE atpterm_aud ADD CONSTRAINT atpterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_id_fk FOREIGN KEY (id) REFERENCES submittedobject (id); ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); CREATE INDEX biologicalentity_taxon_index ON biologicalentity USING btree (taxon_id); - -ALTER TABLE biologicalentity_aud ADD PRIMARY KEY (id, rev); ALTER TABLE biologicalentity_aud ADD CONSTRAINT biologicalentity_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES submittedobject_aud (id, rev); - -ALTER TABLE bspoterm ADD PRIMARY KEY (id); ALTER TABLE bspoterm ADD CONSTRAINT bspoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE bspoterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE bspoterm_aud ADD CONSTRAINT bspoterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - +ALTER TABLE bspoterm_aud ADD CONSTRAINT bspoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE bulkload ADD CONSTRAINT bulkload_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - -ALTER TABLE bulkload_aud ADD CONSTRAINT bulkload_aud_id_rev_fk (id, rev) REFRENCES auditedobject_aud (id, rev); - +ALTER TABLE bulkload_aud ADD CONSTRAINT bulkload_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE bulkloadfile ADD CONSTRAINT bulkloadfile_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - -ALTER TABLE bulkloadfile_aud ADD CONSTRAINT bulkloadfile_aud_id_rev_fk (id, rev) REFRENCES auditedobject_aud (id, rev); - +ALTER TABLE bulkloadfile_aud ADD CONSTRAINT bulkloadfile_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE bulkloadfileexception ADD CONSTRAINT bulkloadfileexception_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - -ALTER TABLE bulkloadfileexception_aud ADD CONSTRAINT bulkloadfileexception_aud_id_rev_fk (id, rev) REFRENCES auditedobject_aud (id, rev); - +ALTER TABLE bulkloadfileexception_aud ADD CONSTRAINT bulkloadfileexception_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE bulkloadfilehistory ADD CONSTRAINT bulkloadfilehistory_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - -ALTER TABLE bulkloadfilehistory_aud ADD CONSTRAINT bulkloadfilehistory_aud_id_rev_fk (id, rev) REFRENCES auditedobject_aud (id, rev); - +ALTER TABLE bulkloadfilehistory_aud ADD CONSTRAINT bulkloadfilehistory_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE bulkloadgroup ADD CONSTRAINT bulkloadgroup_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - -ALTER TABLE bulkloadgroup_aud ADD CONSTRAINT bulkloadgroup_aud_id_rev_fk (id, rev) REFRENCES auditedobject_aud (id, rev); - -ALTER TABLE chebiterm ADD PRIMARY KEY (id); +ALTER TABLE bulkloadgroup_aud ADD CONSTRAINT bulkloadgroup_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE chebiterm ADD CONSTRAINT chebiterm_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); - -ALTER TABLE chebiterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE chebiterm_aud ADD CONSTRAINT chebiterm_aud_id_rev_fk (id, rev) REFERENCES chemicalterm_aud (id, rev); - -ALTER TABLE chemicalterm ADD PRIMARY KEY (id); +ALTER TABLE chebiterm_aud ADD CONSTRAINT chebiterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES chemicalterm_aud (id, rev); ALTER TABLE chemicalterm ADD CONSTRAINT chemicalterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE chemicalterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE chemicalterm_aud ADD CONSTRAINT chemicalterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - -ALTER TABLE clterm ADD PRIMARY KEY (id); +ALTER TABLE chemicalterm_aud ADD CONSTRAINT chemicalterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE clterm ADD CONSTRAINT clterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); - -ALTER TABLE clterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE clterm_aud ADD CONSTRAINT clterm_aud_id_rev_fk (id, rev) REFERENCES anatomicalterm_aud (id, rev); - -ALTER TABLE cmoterm ADD PRIMARY KEY (id); +ALTER TABLE clterm_aud ADD CONSTRAINT clterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); ALTER TABLE cmoterm ADD CONSTRAINT cmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE cmoterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE cmoterm_aud ADD CONSTRAINT cmoterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - +ALTER TABLE cmoterm_aud ADD CONSTRAINT cmoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE conditionrelation ADD CONSTRAINT conditionrelation_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); ALTER TABLE conditionrelation ADD CONSTRAINT conditionrelation_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); - ALTER TABLE conditionrelation_aud ADD CONSTRAINT conditionrelation_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); - ALTER TABLE construct_reference ADD CONSTRAINT construct_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); CREATE INDEX construct_reference_references_index ON construct_reference USING btree (references_id); - ALTER TABLE constructcomponentslotannotation ADD CONSTRAINT constructcomponentslotannotation_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); CREATE INDEX constructcomponentslotannotation_taxon_index ON constructcomponentslotannotation USING btree (taxon_id); - -ALTER TABLE constructgenomicentityassociation ADD CONSTRAINT constructgenomicentityassociation_object_id_fk FOREIGN KEY (genomicentity_id) REFERENCES genomicentity (id); +ALTER TABLE constructgenomicentityassociation ADD CONSTRAINT constructgenomicentityassociation_object_id_fk FOREIGN KEY (object_id) REFERENCES genomicentity (id); CREATE INDEX constructgenomicentityassociation_object_index ON constructgenomicentityassociation USING btree (object_id); - ALTER TABLE crossreference ADD CONSTRAINT crossreference_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - ALTER TABLE crossreference_aud ADD CONSTRAINT crossreference_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); - ALTER TABLE curationreport ADD CONSTRAINT curationreport_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - ALTER TABLE curationreport_aud ADD CONSTRAINT curationreport_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); - ALTER TABLE curationreportgroup ADD CONSTRAINT curationreportgroup_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - ALTER TABLE curationreportgroup_aud ADD CONSTRAINT curationreportgroup_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); - ALTER TABLE curationreporthistory ADD CONSTRAINT curationreporthistory_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - ALTER TABLE curationreportgroup_aud ADD CONSTRAINT curationreporthistory_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); - -ALTER TABLE daoterm ADD PRIMARY KEY (id); ALTER TABLE daoterm ADD CONSTRAINT daoterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); - -ALTER TABLE daoterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE daoterm_aud ADD CONSTRAINT daoterm_aud_id_rev_fk (id, rev) REFERENCES anatomicalterm_aud (id, rev); - +ALTER TABLE daoterm_aud ADD CONSTRAINT daoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); ALTER TABLE dataprovider ADD CONSTRAINT dataprovider_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - ALTER TABLE dataprovider_aud ADD CONSTRAINT dataprovider_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); - -ALTER TABLE diseaseannotation ADD CONSTRINAT diseaseannotation_object_id_fk FOREIGN KEY (object_id) REFERENCES doterm (id); +ALTER TABLE diseaseannotation ADD CONSTRAINT diseaseannotation_object_id_fk FOREIGN KEY (object_id) REFERENCES doterm (id); CREATE INDEX diseaseannotation_object_index ON diseaseannotation USING btree (object_id); - ALTER TABLE diseaseannotation_biologicalentity ADD CONSTRAINT diseaseannotation_biologicalentity_dgm_id_fk FOREIGN KEY (diseasegeneticmodifiers_id) REFERENCES biologicalentity (id); CREATE INDEX diseaseannotation_biologicalentity_dgms_index ON diseaseannotation_biologicalentity USING btree (diseasegeneticmodifiers_id); - ALTER TABLE diseaseannotation_ecoterm ADD CONSTRAINT diseaseannotation_ecoterm_evidencecodes_id_fk FOREIGN KEY (evidencecodes_id) REFERENCES ecoterm (id); CREATE INDEX diseaseannotation_ecoterm_evidencecodes_index ON diseaseannotation_ecoterm USING btree (evidencecodes_id); - ALTER TABLE diseaseannotation_gene ADD CONSTRAINT diseaseannotation_gene_with_id_fk FOREIGN KEY (with_id) REFERENCES gene (id); CREATE INDEX diseaseannotation_gene_with_index ON diseaseannotation_gene USING btree (with_id); - -ALTER TABLE doterm ADD PRIMARY KEY (id); ALTER TABLE doterm ADD CONSTRAINT doterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE doterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE doterm_aud ADD CONSTRAINT doterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - -ALTER TABLE dpoterm ADD PRIMARY KEY (id); +ALTER TABLE doterm_aud ADD CONSTRAINT doterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE dpoterm ADD CONSTRAINT dpoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); - -ALTER TABLE dpoterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE dpoterm_aud ADD CONSTRAINT dpoterm_aud_id_rev_fk (id, rev) REFERENCES phenotypeterm_aud (id, rev); - -ALTER TABLE ecoterm ADD PRIMARY KEY (id); +ALTER TABLE dpoterm_aud ADD CONSTRAINT dpoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); ALTER TABLE ecoterm ADD CONSTRAINT ecoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE ecoterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE ecoterm_aud ADD CONSTRAINT ecoterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - -ALTER TABLE emapaterm ADD PRIMARY KEY (id); +ALTER TABLE ecoterm_aud ADD CONSTRAINT ecoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE emapaterm ADD CONSTRAINT emapaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); - -ALTER TABLE emapaterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE emapaterm_aud ADD CONSTRAINT emapaterm_aud_id_rev_fk (id, rev) REFERENCES anatomicalterm_aud (id, rev); - +ALTER TABLE emapaterm_aud ADD CONSTRAINT emapaterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); ALTER TABLE evidenceassociation_informationcontententity ADD CONSTRAINT evidenceassociation_infocontent_evidence_id_fk FOREIGN KEY (evidence_id) REFERENCES informationcontententity (id); CREATE INDEX evidenceassociation_infocontent_evidence_index ON evidenceassociation_informationcontententity USING btree (evidence_id); - ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionchemical_id_fk FOREIGN KEY (conditionchemical_id) REFERENCES chemicalterm (id); ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionid_id_fk FOREIGN KEY (conditionid_id) REFERENCES experimentalconditionontologyterm (id); -ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditiontaxon_id_fk FOREIGN KEY (conditiontaxon_id) REFERENCES ncbitaxontermterm (id); +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditiontaxon_id_fk FOREIGN KEY (conditiontaxon_id) REFERENCES ncbitaxonterm (id); ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditiongeneontology_id_fk FOREIGN KEY (conditiongeneontology_id) REFERENCES goterm (id); ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionclass_id_fk FOREIGN KEY (conditionclass_id) REFERENCES zecoterm (id); ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionanatomy_id_fk FOREIGN KEY (conditionanatomy_id) REFERENCES anatomicalterm (id); - -ALTER TABLE experimentalconditionontologyterm ADD PRIMARY KEY (id); ALTER TABLE experimentalconditionontologyterm ADD CONSTRAINT experimentalconditionontologyterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE experimentalconditionontologyterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE experimentalconditionontologyterm_aud ADD CONSTRAINT experimentalconditionontologyterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - -ALTER TABLE fbdvterm ADD PRIMARY KEY (id); +ALTER TABLE experimentalconditionontologyterm_aud ADD CONSTRAINT experimentalconditionontologyterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE fbdvterm ADD CONSTRAINT fbdvterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); - -ALTER TABLE fbdvterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE fbdvterm_aud ADD CONSTRAINT fbdvterm_aud_id_rev_fk (id, rev) REFERENCES stageterm_aud (id, rev); - -ALTER TABLE gene ADD PRIMARY KEY (id); +ALTER TABLE fbdvterm_aud ADD CONSTRAINT fbdvterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); ALTER TABLE gene ADD CONSTRAINT gene_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); ALTER TABLE gene ADD CONSTRAINT gene_genetype_id_fk FOREIGN KEY (genetype_id) REFERENCES soterm (id); CREATE INDEX gene_genetype_index ON gene USING btree (genetype_id); - -ALTER TABLE gene_aud ADD PRIMARY_KEY (id, rev); ALTER TABLE gene_aud ADD CONSTRAINT gene_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); - ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES gene (id); -ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_sgdstrainbackground_id_fk (sgdstrainbackground_id) REFERENCES affectedgenomicmodel (id); - -ALTER TABLE genefullnameslotannotation ADD CONSTRAINT genefullnameslotannotation_singlegene_id_fk (singlegene_id) REFERENCES gene (id); +ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_sgdstrainbackground_id_fk FOREIGN KEY (sgdstrainbackground_id) REFERENCES affectedgenomicmodel (id); +ALTER TABLE genefullnameslotannotation ADD CONSTRAINT genefullnameslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); CREATE INDEX genefullname_singlegene_index ON genefullnameslotannotation USING btree (singlegene_id); - -ALTER TABLE genesecondaryidslotannotation ADD CONSTRAINT genesecondaryidslotannotation_singlegene_id_fk (singlegene_id) REFERENCES gene (id); +ALTER TABLE genesecondaryidslotannotation ADD CONSTRAINT genesecondaryidslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); CREATE INDEX genesecondaryid_singlegene_index ON genesecondaryidslotannotation USING btree (singlegene_id); - -ALTER TABLE genesymbolslotannotation ADD CONSTRAINT genesymbolslotannotation_singlegene_id_fk (singlegene_id) REFERENCES gene (id); +ALTER TABLE genesymbolslotannotation ADD CONSTRAINT genesymbolslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); CREATE INDEX genesymbol_singlegene_index ON genesymbolslotannotation USING btree (singlegene_id); - -ALTER TABLE genesynonymslotannotation ADD CONSTRAINT genesynonymslotannotation_singlegene_id_fk (singlegene_id) REFERENCES gene (id); +ALTER TABLE genesynonymslotannotation ADD CONSTRAINT genesynonymslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); CREATE INDEX genesynonym_singlegene_index ON genesynonymslotannotation USING btree (singlegene_id); - -ALTER TABLE genesystematicnameslotannotation ADD CONSTRAINT genesystematicnameslotannotation_singlegene_id_fk (singlegene_id) REFERENCES gene (id); +ALTER TABLE genesystematicnameslotannotation ADD CONSTRAINT genesystematicnameslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); CREATE INDEX genesystematicname_singlegene_index ON genesystematicnameslotannotation USING btree (singlegene_id); - ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_object_id_fk FOREIGN KEY (object_id) REFERENCES gene (id); -ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_subject_id_fk FOREIGN KEY (subject_id) REFERENCES gene (id); -CREATE INDEX genetogeneorthology_object_index ON genetogeneorthology USING btree (object_id); -CREATE INDEX genetogeneorthology_subject_index ON genetogeneorthology USING btree (subject_id); - +ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_objectgene_id_fk FOREIGN KEY (objectgene_id) REFERENCES gene (id); +ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_subjectgene_id_fk FOREIGN KEY (subjectgene_id) REFERENCES gene (id); +CREATE INDEX genetogeneorthology_object_index ON genetogeneorthology USING btree (objectgene_id); +CREATE INDEX genetogeneorthology_subject_index ON genetogeneorthology USING btree (subjectgene_id); ALTER TABLE genetogeneorthologycurated ADD CONSTRAINT genetogeneorthologycurated_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES ecoterm (id); ALTER TABLE genetogeneorthologycurated ADD CONSTRAINT genetogeneorthologycurated_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); CREATE INDEX genetogeneorthologycurated_evidencecode_index ON genetogeneorthologycurated USING btree (evidencecode_id); CREATE INDEX genetogeneorthologycurated_singlereference_index ON genetogeneorthologycurated USING btree (singlereference_id); - -ALTER TABLE genomicentity ADD PRIMARY KEY (id); ALTER TABLE genomicentity ADD CONSTRAINT genomicentity_id_fk FOREIGN KEY (id) REFERENCES biologicalentity (id); - -ALTER TABLE genomicentity_aud ADD PRIMARY_KEY (id, rev); ALTER TABLE genomicentity_aud ADD CONSTRAINT genomicentity_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES biologicalentity_aud (id, rev); - ALTER TABLE genomicentity_crossreference ADD CONSTRAINT genomicentitycrossreference_genomicentity_id_fk FOREIGN KEY (genomicentity_id) REFERENCES genomicentity (id); CREATE INDEX genomicentity_crossreference_ge_xref_index ON genomicentity_crossreference USING btree (genomicentity_id, crossreferences_id); CREATE INDEX genomicentity_crossreference_genomicentity_index ON genomicentity_crossreference USING btree (genomicentity_id); - -ALTER TABLE goterm ADD PRIMARY KEY (id); ALTER TABLE goterm ADD CONSTRAINT goterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE goterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE goterm_aud ADD CONSTRAINT goterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - -ALTER TABLE hpterm ADD PRIMARY KEY (id); +ALTER TABLE goterm_aud ADD CONSTRAINT goterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE hpterm ADD CONSTRAINT hpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); - -ALTER TABLE hpterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE hpterm_aud ADD CONSTRAINT hpterm_aud_id_rev_fk (id, rev) REFERENCES phenotypeterm_aud (id, rev); - -ALTER TABLE materm ADD PRIMARY KEY (id); +ALTER TABLE hpterm_aud ADD CONSTRAINT hpterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); +ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); +ALTER TABLE informationcontententity_aud ADD CONSTRAINT informationcontententity_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES curieobject_aud (id, rev); ALTER TABLE materm ADD CONSTRAINT materm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); - -ALTER TABLE materm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE materm_aud ADD CONSTRAINT materm_aud_id_rev_fk (id, rev) REFERENCES anatomicalterm_aud (id, rev); - -ALTER TABLE miterm ADD PRIMARY KEY (id); +ALTER TABLE materm_aud ADD CONSTRAINT materm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); ALTER TABLE miterm ADD CONSTRAINT miterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE miterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE miterm_aud ADD CONSTRAINT miterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - -ALTER TABLE mmoterm ADD PRIMARY KEY (id); +ALTER TABLE miterm_aud ADD CONSTRAINT miterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE mmoterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE mmoterm_aud ADD CONSTRAINT mmoterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - -ALTER TABLE mmusdvterm ADD PRIMARY KEY (id); +ALTER TABLE mmoterm_aud ADD CONSTRAINT mmoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE mmusdvterm ADD CONSTRAINT mmusdvterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); - -ALTER TABLE mmusdvterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE mmusdvterm_aud ADD CONSTRAINT mmusdvterm_aud_id_rev_fk (id, rev) REFERENCES stageterm_aud (id, rev); - -ALTER TABLE modterm ADD PRIMARY KEY (id); +ALTER TABLE mmusdvterm_aud ADD CONSTRAINT mmusdvterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); ALTER TABLE modterm ADD CONSTRAINT modterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE modterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE modterm_aud ADD CONSTRAINT modterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - -ALTER TABLE molecule ADD PRIMARY KEY (id); +ALTER TABLE modterm_aud ADD CONSTRAINT modterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE molecule ADD CONSTRAINT molecule_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); - -ALTER TABLE molecule_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE molecule_aud ADD CONSTRAINT molecule_aud_id_rev_fk (id, rev) REFERENCES chemicalterm_aud (id, rev); - -ALTER TABLE mpathterm ADD PRIMARY KEY (id); +ALTER TABLE molecule_aud ADD CONSTRAINT molecule_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES chemicalterm_aud (id, rev); ALTER TABLE mpathterm ADD CONSTRAINT mpathterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE mpathterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE mpathterm_aud ADD CONSTRAINT mpathterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - -ALTER TABLE mpterm ADD PRIMARY KEY (id); +ALTER TABLE mpathterm_aud ADD CONSTRAINT mpathterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE mpterm ADD CONSTRAINT mpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); - -ALTER TABLE mpterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE mpterm_aud ADD CONSTRAINT mpterm_aud_id_rev_fk (id, rev) REFERENCES phenotypeterm_aud (id, rev); - -ALTER TABLE ncbitaxonterm ADD PRIMARY KEY (id); +ALTER TABLE mpterm_aud ADD CONSTRAINT mpterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE ncbitaxonterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE ncbitaxonterm_aud ADD CONSTRAINT ncbitaxonterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - +ALTER TABLE ncbitaxonterm_aud ADD CONSTRAINT ncbitaxonterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE note ADD CONSTRAINT note_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - -ALTER TABLE note_aud ADD CONSTRAINT note_aud_id_rev_fk (id, rev) REFRENCES auditedobject_aud (id, rev); - +ALTER TABLE note_aud ADD CONSTRAINT note_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE note_reference ADD CONSTRAINT note_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); CREATE INDEX note_reference_references_index ON note_reference USING btree (references_id); - -ALTER TABLE obiterm ADD PRIMARY KEY (id); ALTER TABLE obiterm ADD CONSTRAINT obiterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE obiterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE obiterm_aud ADD CONSTRAINT obiterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - -ALTER TABLE ontologyterm ADD PRIMARY KEY (id); +ALTER TABLE obiterm_aud ADD CONSTRAINT obiterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); - -ALTER TABLE ontologyterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE ontologyterm_aud ADD CONSTRAINT ontologyterm_aud_id_rev_fk (id, rev) REFERENCES curieobject_aud (id, rev); - +ALTER TABLE ontologyterm_aud ADD CONSTRAINT ontologyterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES curieobject_aud (id, rev); ALTER TABLE ontologyterm_crossreference ADD CONSTRAINT ontologyterm_crossreference_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); CREATE INDEX ontologyterm_crossreference_ontologyterm_index ON ontologyterm_crossreference USING btree (ontologyterm_id); - ALTER TABLE ontologyterm_definitionurls ADD CONSTRAINT ontologyterm_definitionurls_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); CREATE INDEX ontologyterm_definitionurls_ontologyterm_index ON ontologyterm_definitionurls USING btree (ontologyterm_id); - -ALTER TABLE ontologyterm_isa_ancestor_descendant ADD PRIMARY KEY (isadescendants_id, isaancestors_id); ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_isaancestors_id_fk FOREIGN KEY (isaancestors_id) REFERENCES ontologyterm(id); ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_isadescendants_id_fk FOREIGN KEY (isadescendants_id) REFERENCES ontologyterm(id); CREATE INDEX ontologyterm_isa_ancestor_descendant_isaancestors_index ON ontologyterm_isa_ancestor_descendant USING btree (isaancestors_id); CREATE INDEX ontologyterm_isa_ancestor_descendant_isadescendants_index ON ontologyterm_isa_ancestor_descendant USING btree (isadescendants_id); - -ALTER TABLE ontologyterm_isa_parent_children ADD PRIMARY KEY (isachildren_id, isaparents_id); ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_isachildren_id_fk FOREIGN KEY (isachildren_id) REFERENCES ontologyterm (id); ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_isaparents_id_fk FOREIGN KEY (isaparents_id) REFERENCES ontologyterm (id); CREATE INDEX ontologyterm_isa_parent_children_isachildren_index ON ontologyterm_isa_parent_children USING btree (isachildren_id); CREATE INDEX ontologyterm_isa_parent_children_isaparents_index ON ontologyterm_isa_parent_children USING btree (isaparents_id); - ALTER TABLE ontologyterm_secondaryidentifiers ADD CONSTRAINT ontologyterm_secondaryidentifiers_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); CREATE INDEX ontologyterm_secondaryidentifiers_ontologyterm_index ON ontologyterm_secondaryidentifiers USING btree (ontologyterm_id); - ALTER TABLE ontologyterm_subsets ADD CONSTRAINT ontologyterm_subsets_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); CREATE INDEX ontologyterm_subsets_ontologyterm_index ON ontologyterm_subsets USING btree (ontologyterm_id); - ALTER TABLE ontologyterm_synonym ADD CONSTRAINT ontologyterm_synonym_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); CREATE INDEX ontologyterm_synonym_ontologyterm_index ON ontologyterm_synonym USING btree (ontologyterm_id); - ALTER TABLE organization ADD CONSTRAINT organization_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - -ALTER TABLE organization_aud ADD CONSTRAINT organization_aud_id_rev_fk (id, rev) REFERENCES auditedobject_aud (id, rev); - -ALTER TABLE patoterm ADD PRIMARY KEY (id); +ALTER TABLE organization_aud ADD CONSTRAINT organization_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE patoterm ADD CONSTRAINT patoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE patoterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE patoterm_aud ADD CONSTRAINT patoterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - +ALTER TABLE patoterm_aud ADD CONSTRAINT patoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE person ADD CONSTRAINT person_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - -ALTER TABLE person_aud ADD CONSTRAINT person_aud_id_rev_fk (id, rev) REFERENCES auditedobject_aud (id, rev); - -ALTER TABLE phenotypeterm ADD PRIMARY KEY (id); +ALTER TABLE person_aud ADD CONSTRAINT person_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE phenotypeterm ADD CONSTRAINT phenotypeterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE phenotypeterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE phenotypeterm_aud ADD CONSTRAINT phenotypeterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - -ALTER TABLE pwterm ADD PRIMARY KEY (id); +ALTER TABLE phenotypeterm_aud ADD CONSTRAINT phenotypeterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE pwterm ADD CONSTRAINT pwterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); - -ALTER TABLE pwterm_aud ADD PRIMARY KEY (id, rev); -ALTER TABLE pwterm_aud ADD CONSTRAINT pwterm_aud_id_rev_fk (id, rev) REFERENCES ontologyterm_aud (id, rev); - +ALTER TABLE pwterm_aud ADD CONSTRAINT pwterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE reagent ADD CONSTRAINT reagent_id_fk FOREIGN KEY (id) REFERENCES submittedobject (id); - -ALTER TABLE reagent_aud ADD PRIMARY KEY (id, rev); ALTER TABLE reagent_aud ADD CONSTRAINT reagent_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES submittedobject_aud (id, rev); - -ALTER TABLE reference ADD PRIMARY KEY (id); ALTER TABLE reference ADD CONSTRAINT reference_id_fk FOREIGN KEY (id) REFERENCES informationcontententity (id); - -ALTER TABLE reference_aud ADD PRIMARY KEY (id, rev); ALTER TABLE reference_aud ADD CONSTRAINT reference_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES informationcontententity_aud (id, rev); - ALTER TABLE reference_crossreference ADD CONSTRAINT reference_crossreference_reference_id_fk FOREIGN KEY (reference_id) REFERENCES reference (id); CREATE INDEX reference_crossreference_reference_index ON reference_crossreference USING btree (reference_id); - ALTER TABLE resourcedescriptor ADD CONSTRAINT resourcedescriptor_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - -ALTER TABLE resourcedescriptor_aud ADD CONSTRAINT resourcedescriptor_aud_id_rev_fk (id, rev) REFERENCES auditedobject_aud (id, rev); - +ALTER TABLE resourcedescriptor_aud ADD CONSTRAINT resourcedescriptor_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE resourcedescriptorpage ADD CONSTRAINT resourcedescriptorpage_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); - -ALTER TABLE resourcedescriptorpage_aud ADD CONSTRAINT resourcedescriptorpage_aud_id_rev_fk (id, rev) REFERENCES auditedobject_aud (id, rev); \ No newline at end of file +ALTER TABLE resourcedescriptorpage_aud ADD CONSTRAINT resourcedescriptorpage_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE roterm ADD CONSTRAINT roterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE roterm_aud ADD CONSTRAINT roterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE rsterm ADD CONSTRAINT rsterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE rsterm_aud ADD CONSTRAINT rsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE singlereferenceassociation ADD CONSTRAINT singlereferenceassociation_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); +CREATE INDEX singlereferenceassociation_singlereference_index ON singlereferenceassociation USING btree (singlereference_id); +ALTER TABLE slotannotation ADD CONSTRAINT slotannotation_id_fk FOREIGN KEY (id) REFERENCES auditedobject(id); +ALTER TABLE slotannotation_aud ADD CONSTRAINT slotannotation_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE slotannotation_informationcontententity ADD CONSTRAINT slotannotation_informationcontententity_evidence_id_fk FOREIGN KEY (evidence_id) REFERENCES informationcontententity (id); +CREATE INDEX slotannotation_informationcontententity_evidence_index ON slotannotation_informationcontententity USING btree (evidence_id); +ALTER TABLE soterm ADD CONSTRAINT soterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE soterm_aud ADD CONSTRAINT soterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE species ADD CONSTRAINT species_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE species ADD CONSTRAINT species_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); +ALTER TABLE species_aud ADD CONSTRAINT species_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE stageterm ADD CONSTRAINT stageterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE stageterm_aud ADD CONSTRAINT stageterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE synonym_aud ADD CONSTRAINT synonym_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE uberonterm ADD CONSTRAINT uberonterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); +ALTER TABLE uberonterm_aud ADD CONSTRAINT uberonterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); +ALTER TABLE variant ADD CONSTRAINT variant_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); +ALTER TABLE variant ADD CONSTRAINT variant_sourcegeneralconsequence_id_fk FOREIGN KEY (sourcegeneralconsequence_id) REFERENCES soterm (id); +ALTER TABLE variant ADD CONSTRAINT variant_varianttype_id_fk FOREIGN KEY (varianttype_id) REFERENCES soterm (id); +CREATE INDEX variant_sourcegeneralconsequence_index ON variant USING btree (sourcegeneralconsequence_id); +CREATE INDEX variant_varianttype_index ON variant USING btree (varianttype_id); +ALTER TABLE variant_aud ADD CONSTRAINT variant_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); +ALTER TABLE variant_note ADD CONSTRAINT variant_note_variant_id_fk FOREIGN KEY (variant_id) REFERENCES variant (id); +CREATE INDEX variant_note_variant_index ON variant_note USING btree (variant_id); +ALTER TABLE vocabulary ADD CONSTRAINT vocabulary_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE vocabulary_aud ADD CONSTRAINT vocabulary_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE vocabularyterm ADD CONSTRAINT vocabularyterm_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE vocabularyterm_aud ADD CONSTRAINT vocabularyterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE vocabularytermset ADD CONSTRAINT vocabularytermset_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE vocabularytermset_aud ADD CONSTRAINT vocabularytermset_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE vtterm ADD CONSTRAINT vtterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE vtterm_aud ADD CONSTRAINT vtterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE wbbtterm ADD CONSTRAINT wbbtterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); +ALTER TABLE wbbtterm_aud ADD CONSTRAINT wbbtterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); +ALTER TABLE wblsterm ADD CONSTRAINT wblsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); +ALTER TABLE wblsterm_aud ADD CONSTRAINT wblsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); +ALTER TABLE wbphenotypeterm ADD CONSTRAINT wbphenotypeterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); +ALTER TABLE wbphenotypeterm_aud ADD CONSTRAINT wbphenotypeterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); +ALTER TABLE xbaterm ADD CONSTRAINT xbaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); +ALTER TABLE xbaterm_aud ADD CONSTRAINT xbaterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); +ALTER TABLE xbedterm ADD CONSTRAINT xbedterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE xbedterm_aud ADD CONSTRAINT xbedterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE xbsterm ADD CONSTRAINT xbsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); +ALTER TABLE xbsterm_aud ADD CONSTRAINT xbsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); +ALTER TABLE xcoterm ADD CONSTRAINT xcoterm_id_fk FOREIGN KEY (id) REFERENCES experimentalconditionontologyterm (id); +ALTER TABLE xcoterm_aud ADD CONSTRAINT xcoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES experimentalconditionontologyterm_aud (id, rev); +ALTER TABLE xpoterm ADD CONSTRAINT xpoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); +ALTER TABLE xpoterm_aud ADD CONSTRAINT xpoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); +ALTER TABLE xsmoterm ADD CONSTRAINT xsmoterm_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); +ALTER TABLE xsmoterm_aud ADD CONSTRAINT xsmoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES chemicalterm_aud (id, rev); +ALTER TABLE zecoterm ADD CONSTRAINT zecoterm_id_fk FOREIGN KEY (id) REFERENCES experimentalconditionontologyterm (id); +ALTER TABLE zecoterm_aud ADD CONSTRAINT zecoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES experimentalconditionontologyterm_aud (id, rev); +ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); +ALTER TABLE zfaterm_aud ADD CONSTRAINT zfaterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); +ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); +ALTER TABLE zfsterm_aud ADD CONSTRAINT zfsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); + +-- Remove old columns + +ALTER TABLE affectedgenomicmodel DROP COLUMN curie; +ALTER TABLE agmdiseaseannotation DROP COLUMN inferredallele_curie; +ALTER TABLE agmdiseaseannotation DROP COLUMN inferredgene_curie; +ALTER TABLE agmdiseaseannotation DROP COLUMN assertedallele_curie; +ALTER TABLE agmdiseaseannotation DROP COLUMN subject_curie; +ALTER TABLE agmdiseaseannotation_gene DROP COLUMN assertedgenes_curie; +ALTER TABLE allele DROP COLUMN curie; +ALTER TABLE allele_note DROP COLUMN allele_curie; +ALTER TABLE allele_reference DROP COLUMN allele_curie; +ALTER TABLE allele_reference DROP COLUMN references_curie; +ALTER TABLE alleledatabasestatusslotannotation DROP COLUMN singleallele_curie; +ALTER TABLE allelediseaseannotation DROP COLUMN inferredgene_curie; +ALTER TABLE allelediseaseannotation DROP COLUMN subject_curie; +ALTER TABLE allelediseaseannotation_gene DROP COLUMN assertedgenes_curie; +ALTER TABLE allelefullnameslotannotation DROP COLUMN singleallele_curie; +ALTER TABLE allelefunctionalimpactslotannotation DROP COLUMN singleallele_curie; +ALTER TABLE allelefunctionalimpactslotannotation DROP COLUMN phenotypeterm_curie; +ALTER TABLE allelegeneassociation DROP COLUMN subject_curie; +ALTER TABLE allelegeneassociation DROP COLUMN object_curie; +ALTER TABLE allelegenomicentityassociation DROP COLUMN evidencecode_curie; +ALTER TABLE allelegermlinetransmissionstatusslotannotation DROP COLUMN singleallele_curie; +ALTER TABLE alleleinheritancemodeslotannotation DROP COLUMN singleallele_curie; +ALTER TABLE alleleinheritancemodeslotannotation DROP COLUMN phenotypeterm_curie; +ALTER TABLE allelemutationtypeslotannotation DROP COLUMN singleallele_curie; +ALTER TABLE allelemutationtypeslotannotation_soterm DROP COLUMN mutationtypes_curie; +ALTER TABLE allelenomenclatureeventslotannotation DROP COLUMN singleallele_curie; +ALTER TABLE allelesecondaryidslotannotation DROP COLUMN singleallele_curie; +ALTER TABLE allelesymbolslotannotation DROP COLUMN singleallele_curie; +ALTER TABLE allelesynonymslotannotation DROP COLUMN singleallele_curie; +ALTER TABLE anatomicalterm DROP COLUMN curie; +ALTER TABLE apoterm DROP COLUMN curie; +ALTER TABLE atpterm DROP COLUMN curie; +ALTER TABLE biologicalentity DROP COLUMN curie; +ALTER TABLE biologicalentity DROP COLUMN taxon_curie; +ALTER TABLE bspoterm DROP COLUMN curie; +ALTER TABLE chebiterm DROP COLUMN curie; +ALTER TABLE chemicalterm DROP COLUMN curie; +ALTER TABLE clterm DROP COLUMN curie; +ALTER TABLE cmoterm DROP COLUMN curie; +ALTER TABLE conditionrelation DROP COLUMN singlereference_curie; +ALTER TABLE construct_reference DROP COLUMN references_curie; +ALTER TABLE constructcomponentslotannotation DROP COLUMN taxon_curie; +ALTER TABLE constructgenomicentityassociation DROP COLUMN object_curie; +ALTER TABLE daoterm DROP COLUMN curie; +ALTER TABLE diseaseannotation DROP COLUMN object_curie; +ALTER TABLE diseaseannotation_biologicalentity DROP COLUMN diseasegeneticmodifiers_curie; +ALTER TABLE diseaseannotation_ecoterm DROP COLUMN evidencecodes_curie; +ALTER TABLE diseaseannotation_gene DROP COLUMN with_curie; +ALTER TABLE doterm DROP COLUMN curie; +ALTER TABLE dpoterm DROP COLUMN curie; +ALTER TABLE ecoterm DROP COLUMN curie; +ALTER TABLE emapaterm DROP COLUMN curie; +ALTER TABLE evidenceassociation_informationcontententity DROP COLUMN evidence_curie; +ALTER TABLE experimentalcondition DROP COLUMN conditionanatomy_curie; +ALTER TABLE experimentalcondition DROP COLUMN conditionchemical_curie; +ALTER TABLE experimentalcondition DROP COLUMN conditionclass_curie; +ALTER TABLE experimentalcondition DROP COLUMN conditiongeneontology_curie; +ALTER TABLE experimentalcondition DROP COLUMN conditionid_curie; +ALTER TABLE experimentalcondition DROP COLUMN conditiontaxon_curie; +ALTER TABLE experimentalconditionontologyterm DROP COLUMN curie; +ALTER TABLE fbdvterm DROP COLUMN curie; +ALTER TABLE gene DROP COLUMN curie; +ALTER TABLE gene DROP COLUMN genetype_curie; +ALTER TABLE genediseaseannotation DROP COLUMN sgdstrainbackground_curie; +ALTER TABLE genediseaseannotation DROP COLUMN subject_curie; +ALTER TABLE genefullnameslotannotation DROP COLUMN singlegene_curie; +ALTER TABLE genesecondaryidslotannotation DROP COLUMN singlegene_curie; +ALTER TABLE genesymbolslotannotation DROP COLUMN singlegene_curie; +ALTER TABLE genesynonymslotannotation DROP COLUMN singlegene_curie; +ALTER TABLE genesystematicnameslotannotation DROP COLUMN singlegene_curie; +ALTER TABLE genetogeneorthology DROP COLUMN subjectgene_curie; +ALTER TABLE genetogeneorthology DROP COLUMN objectgene_curie; +ALTER TABLE genetogeneorthologycurated DROP COLUMN singlereference_curie; +ALTER TABLE genetogeneorthologycurated DROP COLUMN evidencecode_curie; +ALTER TABLE genomicentity DROP COLUMN curie; +ALTER TABLE genomicentity_crossreference DROP COLUMN genomicentity_curie; +ALTER TABLE goterm DROP COLUMN curie; +ALTER TABLE hpterm DROP COLUMN curie; +ALTER TABLE informationcontententity DROP COLUMN curie; +ALTER TABLE materm DROP COLUMN curie; +ALTER TABLE miterm DROP COLUMN curie; +ALTER TABLE mmoterm DROP COLUMN curie; +ALTER TABLE mmusdvterm DROP COLUMN curie; +ALTER TABLE modterm DROP COLUMN curie; +ALTER TABLE molecule DROP COLUMN curie; +ALTER TABLE mpathterm DROP COLUMN curie; +ALTER TABLE mpterm DROP COLUMN curie; +ALTER TABLE ncbitaxonterm DROP COLUMN curie; +ALTER TABLE note_reference DROP COLUMN references_curie; +ALTER TABLE obiterm DROP COLUMN curie; +ALTER TABLE ontologyterm DROP COLUMN curie; +ALTER TABLE ontologyterm_crossreference DROP COLUMN ontologyterm_curie; +ALTER TABLE ontologyterm_definitionurls DROP COLUMN ontologyterm_curie; +ALTER TABLE ontologyterm_isa_ancestor_descendant DROP COLUMN isadescendants_curie; +ALTER TABLE ontologyterm_isa_ancestor_descendant DROP COLUMN isaancestors_curie; +ALTER TABLE ontologyterm_isa_parent_children DROP COLUMN isachildren_curie; +ALTER TABLE ontologyterm_isa_parent_children DROP COLUMN isaparents_curie; +ALTER TABLE ontologyterm_secondaryidentifiers DROP COLUMN ontologyterm_curie; +ALTER TABLE ontologyterm_subsets DROP COLUMN ontologyterm_curie; +ALTER TABLE ontologyterm_synonym DROP COLUMN ontologyterm_curie; +ALTER TABLE patoterm DROP COLUMN curie; +ALTER TABLE phenotypeterm DROP COLUMN curie; +ALTER TABLE pwterm DROP COLUMN curie; +ALTER TABLE reference DROP COLUMN curie; +ALTER TABLE reference_crossreference DROP COLUMN reference_curie; +ALTER TABLE roterm DROP COLUMN curie; +ALTER TABLE rsterm DROP COLUMN curie; +ALTER TABLE singlereferenceassociation DROP COLUMN singlereference_curie; +ALTER TABLE slotannotation_informationcontententity DROP COLUMN evidence_curie; +ALTER TABLE soterm DROP COLUMN curie; +ALTER TABLE species DROP COLUMN taxon_curie; +ALTER TABLE stageterm DROP COLUMN curie; +ALTER TABLE uberonterm DROP COLUMN curie; +ALTER TABLE variant DROP COLUMN curie; +ALTER TABLE variant DROP COLUMN varianttype_curie; +ALTER TABLE variant DROP COLUMN sourcegeneralconsequence_curie; +ALTER TABLE variant_note DROP COLUMN variant_curie; +ALTER TABLE vtterm DROP COLUMN curie; +ALTER TABLE wbbtterm DROP COLUMN curie; +ALTER TABLE wblsterm DROP COLUMN curie; +ALTER TABLE wbphenotypeterm DROP COLUMN curie; +ALTER TABLE xbaterm DROP COLUMN curie; +ALTER TABLE xbedterm DROP COLUMN curie; +ALTER TABLE xbsterm DROP COLUMN curie; +ALTER TABLE xcoterm DROP COLUMN curie; +ALTER TABLE xpoterm DROP COLUMN curie; +ALTER TABLE xsmoterm DROP COLUMN curie; +ALTER TABLE zecoterm DROP COLUMN curie; +ALTER TABLE zfaterm DROP COLUMN curie; +ALTER TABLE zfsterm DROP COLUMN curie; + +ALTER TABLE affectedgenomicmodel_aud DROP COLUMN curie; +ALTER TABLE agmdiseaseannotation_aud DROP COLUMN inferredallele_curie; +ALTER TABLE agmdiseaseannotation_aud DROP COLUMN inferredgene_curie; +ALTER TABLE agmdiseaseannotation_aud DROP COLUMN assertedallele_curie; +ALTER TABLE agmdiseaseannotation_aud DROP COLUMN subject_curie; +ALTER TABLE agmdiseaseannotation_gene_aud DROP COLUMN assertedgenes_curie; +ALTER TABLE allele_aud DROP COLUMN curie; +ALTER TABLE allele_note_aud DROP COLUMN allele_curie; +ALTER TABLE allele_reference_aud DROP COLUMN allele_curie; +ALTER TABLE allele_reference_aud DROP COLUMN references_curie; +ALTER TABLE alleledatabasestatusslotannotation_aud DROP COLUMN singleallele_curie; +ALTER TABLE allelediseaseannotation_aud DROP COLUMN inferredgene_curie; +ALTER TABLE allelediseaseannotation_aud DROP COLUMN subject_curie; +ALTER TABLE allelediseaseannotation_gene_aud DROP COLUMN assertedgenes_curie; +ALTER TABLE allelefullnameslotannotation_aud DROP COLUMN singleallele_curie; +ALTER TABLE allelefunctionalimpactslotannotation_aud DROP COLUMN singleallele_curie; +ALTER TABLE allelefunctionalimpactslotannotation_aud DROP COLUMN phenotypeterm_curie; +ALTER TABLE allelegeneassociation_aud DROP COLUMN subject_curie; +ALTER TABLE allelegeneassociation_aud DROP COLUMN object_curie; +ALTER TABLE allelegenomicentityassociation_aud DROP COLUMN evidencecode_curie; +ALTER TABLE allelegermlinetransmissionstatusslotannotation_aud DROP COLUMN singleallele_curie; +ALTER TABLE alleleinheritancemodeslotannotation_aud DROP COLUMN singleallele_curie; +ALTER TABLE alleleinheritancemodeslotannotation_aud DROP COLUMN phenotypeterm_curie; +ALTER TABLE allelemutationtypeslotannotation_aud DROP COLUMN singleallele_curie; +ALTER TABLE allelemutationtypeslotannotation_soterm_aud DROP COLUMN mutationtypes_curie; +ALTER TABLE allelenomenclatureeventslotannotation_aud DROP COLUMN singleallele_curie; +ALTER TABLE allelesecondaryidslotannotation_aud DROP COLUMN singleallele_curie; +ALTER TABLE allelesymbolslotannotation_aud DROP COLUMN singleallele_curie; +ALTER TABLE allelesynonymslotannotation_aud DROP COLUMN singleallele_curie; +ALTER TABLE anatomicalterm_aud DROP COLUMN curie; +ALTER TABLE apoterm_aud DROP COLUMN curie; +ALTER TABLE atpterm_aud DROP COLUMN curie; +ALTER TABLE biologicalentity_aud DROP COLUMN curie; +ALTER TABLE biologicalentity_aud DROP COLUMN taxon_curie; +ALTER TABLE bspoterm_aud DROP COLUMN curie; +ALTER TABLE chebiterm_aud DROP COLUMN curie; +ALTER TABLE chemicalterm_aud DROP COLUMN curie; +ALTER TABLE clterm_aud DROP COLUMN curie; +ALTER TABLE cmoterm_aud DROP COLUMN curie; +ALTER TABLE conditionrelation_aud DROP COLUMN singlereference_curie; +ALTER TABLE construct_reference_aud DROP COLUMN references_curie; +ALTER TABLE constructcomponentslotannotation_aud DROP COLUMN taxon_curie; +ALTER TABLE constructgenomicentityassociation_aud DROP COLUMN object_curie; +ALTER TABLE daoterm_aud DROP COLUMN curie; +ALTER TABLE diseaseannotation_aud DROP COLUMN object_curie; +ALTER TABLE diseaseannotation_biologicalentity_aud DROP COLUMN diseasegeneticmodifiers_curie; +ALTER TABLE diseaseannotation_ecoterm_aud DROP COLUMN evidencecodes_curie; +ALTER TABLE diseaseannotation_gene_aud DROP COLUMN with_curie; +ALTER TABLE doterm_aud DROP COLUMN curie; +ALTER TABLE dpoterm_aud DROP COLUMN curie; +ALTER TABLE ecoterm_aud DROP COLUMN curie; +ALTER TABLE emapaterm_aud DROP COLUMN curie; +ALTER TABLE evidenceassociation_informationcontententity_aud DROP COLUMN evidence_curie; +ALTER TABLE experimentalcondition_aud DROP COLUMN conditionanatomy_curie; +ALTER TABLE experimentalcondition_aud DROP COLUMN conditionchemical_curie; +ALTER TABLE experimentalcondition_aud DROP COLUMN conditionclass_curie; +ALTER TABLE experimentalcondition_aud DROP COLUMN conditiongeneontology_curie; +ALTER TABLE experimentalcondition_aud DROP COLUMN conditionid_curie; +ALTER TABLE experimentalcondition_aud DROP COLUMN conditiontaxon_curie; +ALTER TABLE experimentalconditionontologyterm_aud DROP COLUMN curie; +ALTER TABLE fbdvterm_aud DROP COLUMN curie; +ALTER TABLE gene_aud DROP COLUMN curie; +ALTER TABLE gene_aud DROP COLUMN genetype_curie; +ALTER TABLE genediseaseannotation_aud DROP COLUMN sgdstrainbackground_curie; +ALTER TABLE genediseaseannotation_aud DROP COLUMN subject_curie; +ALTER TABLE genefullnameslotannotation_aud DROP COLUMN singlegene_curie; +ALTER TABLE genesecondaryidslotannotation_aud DROP COLUMN singlegene_curie; +ALTER TABLE genesymbolslotannotation_aud DROP COLUMN singlegene_curie; +ALTER TABLE genesynonymslotannotation_aud DROP COLUMN singlegene_curie; +ALTER TABLE genesystematicnameslotannotation_aud DROP COLUMN singlegene_curie; +ALTER TABLE genetogeneorthology_aud DROP COLUMN subjectgene_curie; +ALTER TABLE genetogeneorthology_aud DROP COLUMN objectgene_curie; +ALTER TABLE genetogeneorthologycurated_aud DROP COLUMN singlereference_curie; +ALTER TABLE genetogeneorthologycurated_aud DROP COLUMN evidencecode_curie; +ALTER TABLE genomicentity_aud DROP COLUMN curie; +ALTER TABLE genomicentity_crossreference_aud DROP COLUMN genomicentity_curie; +ALTER TABLE goterm_aud DROP COLUMN curie; +ALTER TABLE hpterm_aud DROP COLUMN curie; +ALTER TABLE informationcontententity_aud DROP COLUMN curie; +ALTER TABLE materm_aud DROP COLUMN curie; +ALTER TABLE miterm_aud DROP COLUMN curie; +ALTER TABLE mmoterm_aud DROP COLUMN curie; +ALTER TABLE mmusdvterm_aud DROP COLUMN curie; +ALTER TABLE modterm_aud DROP COLUMN curie; +ALTER TABLE molecule_aud DROP COLUMN curie; +ALTER TABLE mpathterm_aud DROP COLUMN curie; +ALTER TABLE mpterm_aud DROP COLUMN curie; +ALTER TABLE ncbitaxonterm_aud DROP COLUMN curie; +ALTER TABLE note_reference_aud DROP COLUMN references_curie; +ALTER TABLE obiterm_aud DROP COLUMN curie; +ALTER TABLE ontologyterm_aud DROP COLUMN curie; +ALTER TABLE ontologyterm_crossreference_aud DROP COLUMN ontologyterm_curie; +ALTER TABLE ontologyterm_definitionurls_aud DROP COLUMN ontologyterm_curie; +ALTER TABLE ontologyterm_isa_ancestor_descendant_aud DROP COLUMN isadescendants_curie; +ALTER TABLE ontologyterm_isa_ancestor_descendant_aud DROP COLUMN isaancestors_curie; +ALTER TABLE ontologyterm_isa_parent_children_aud DROP COLUMN isachildren_curie; +ALTER TABLE ontologyterm_isa_parent_children_aud DROP COLUMN isaparents_curie; +ALTER TABLE ontologyterm_secondaryidentifiers_aud DROP COLUMN ontologyterm_curie; +ALTER TABLE ontologyterm_subsets_aud DROP COLUMN ontologyterm_curie; +ALTER TABLE ontologyterm_synonym_aud DROP COLUMN ontologyterm_curie; +ALTER TABLE patoterm_aud DROP COLUMN curie; +ALTER TABLE phenotypeterm_aud DROP COLUMN curie; +ALTER TABLE pwterm_aud DROP COLUMN curie; +ALTER TABLE reference_aud DROP COLUMN curie; +ALTER TABLE reference_crossreference_aud DROP COLUMN reference_curie; +ALTER TABLE roterm_aud DROP COLUMN curie; +ALTER TABLE rsterm_aud DROP COLUMN curie; +ALTER TABLE singlereferenceassociation_aud DROP COLUMN singlereference_curie; +ALTER TABLE slotannotation_informationcontententity_aud DROP COLUMN evidence_curie; +ALTER TABLE soterm_aud DROP COLUMN curie; +ALTER TABLE species_aud DROP COLUMN taxon_curie; +ALTER TABLE stageterm_aud DROP COLUMN curie; +ALTER TABLE uberonterm_aud DROP COLUMN curie; +ALTER TABLE variant_aud DROP COLUMN curie; +ALTER TABLE variant_aud DROP COLUMN varianttype_curie; +ALTER TABLE variant_aud DROP COLUMN sourcegeneralconsequence_curie; +ALTER TABLE variant_note_aud DROP COLUMN variant_curie; +ALTER TABLE vtterm_aud DROP COLUMN curie; +ALTER TABLE wbbtterm_aud DROP COLUMN curie; +ALTER TABLE wblsterm_aud DROP COLUMN curie; +ALTER TABLE wbphenotypeterm_aud DROP COLUMN curie; +ALTER TABLE xbaterm_aud DROP COLUMN curie; +ALTER TABLE xbedterm_aud DROP COLUMN curie; +ALTER TABLE xbsterm_aud DROP COLUMN curie; +ALTER TABLE xcoterm_aud DROP COLUMN curie; +ALTER TABLE xpoterm_aud DROP COLUMN curie; +ALTER TABLE xsmoterm_aud DROP COLUMN curie; +ALTER TABLE zecoterm_aud DROP COLUMN curie; +ALTER TABLE zfaterm_aud DROP COLUMN curie; +ALTER TABLE zfsterm_aud DROP COLUMN curie; + +ALTER TABLE auditedobject DROP COLUMN old_id; +ALTER TABLE auditedobject DROP COLUMN old_curie; +ALTER TABLE auditedobject DROP COLUMN tablename; + +DROP SEQUENCE association_seq; +DROP SEQUENCE bulkload_seq; +DROP SEQUENCE bulkloadfile_seq; +DROP SEQUENCE bulkloadfileexception_seq; +DROP SEQUENCE bulkloadfilehistory_seq; +DROP SEQUENCE bulkloadgroup_seq; +DROP SEQUENCE conditionrelation_seq; +DROP SEQUENCE crossreference_seq; +DROP SEQUENCE curationreport_seq; +DROP SEQUENCE curationreportgroup_seq; +DROP SEQUENCE curationreporthistory_seq; +DROP SEQUENCE dataprovider_seq; +DROP SEQUENCE experimentalcondition_seq; +DROP SEQUENCE genetogeneorthology_seq; +DROP SEQUENCE note_seq; +DROP SEQUENCE organization_seq; +DROP SEQUENCE person_seq; +DROP SEQUENCE personsetting_seq; +DROP SEQUENCE reagent_seq; +DROP SEQUENCE resourcedescriptor_seq; +DROP SEQUENCE resourcedescriptorpage_seq; +DROP SEQUENCE slotannotation_seq; +DROP SEQUENCE species_seq; +DROP SEQUENCE synonym_seq; +DROP SEQUENCE vocabulary_seq; +DROP SEQUENCE vocabularyterm_seq; +DROP SEQUENCE vocabularytermset_seq; \ No newline at end of file diff --git a/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java b/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java index d27b9b5ef..cd9553523 100644 --- a/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java @@ -674,7 +674,7 @@ public ConditionRelation getConditionRelation(Long id) { public Construct getConstruct(String identifier) { ObjectResponse res = RestAssured.given(). when(). - get("/api/construct/findBy/" + identifier). + get("/api/construct/" + identifier). then(). statusCode(200). extract().body().as(getObjectResponseTypeRefConstruct()); diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/ConstructBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/ConstructBulkUploadITCase.java index dc23c2524..cd1c37a06 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/ConstructBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/ConstructBulkUploadITCase.java @@ -57,7 +57,7 @@ public void init() { private final String constructBulkPostEndpoint = "/api/construct/bulk/WB/constructs"; private final String constructBulkPostEndpointRGD = "/api/construct/bulk/RGD/constructs"; - private final String constructGetEndpoint = "/api/construct/findBy/"; + private final String constructGetEndpoint = "/api/construct/"; private final String constructTestFilePath = "src/test/resources/bulk/05_construct/"; private void loadRequiredEntities() throws Exception { diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java index 536ce3297..2a5456a94 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java @@ -8,6 +8,8 @@ import java.time.OffsetDateTime; import org.alliancegenome.curation_api.base.BaseITCase; +import org.alliancegenome.curation_api.model.entities.Allele; +import org.alliancegenome.curation_api.model.entities.Gene; import org.alliancegenome.curation_api.model.entities.Vocabulary; import org.alliancegenome.curation_api.resources.TestContainerResource; import org.junit.jupiter.api.BeforeEach; @@ -33,6 +35,8 @@ @Order(101) public class AlleleGeneAssociationBulkUploadITCase extends BaseITCase { + private Allele allele; + private Gene gene; private String alleleCurie = "ALLELETEST:Allele0001"; private String relationName = "is_allele_of"; private String geneCurie = "GENETEST:Gene0001"; @@ -61,6 +65,8 @@ private void loadRequiredEntities() throws Exception { Vocabulary noteTypeVocab = getVocabulary("note_type"); createVocabularyTerm(noteTypeVocab, noteType2, false); addVocabularyTermToSet("allele_genomic_entity_association_note_type", noteType2, noteTypeVocab, false); + allele = getAllele(alleleCurie); + gene = getGene(geneCurie); } @Test @@ -72,7 +78,7 @@ public void alleleGeneAssociationBulkUploadCheckFields() throws Exception { RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?alleleCurie=" + alleleCurie + "&relationName=" + relationName + "&geneCurie=" + geneCurie). + get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "?geneId=" + gene.getId()). then(). statusCode(200). body("entity.relation.name", is(relationName)). @@ -127,7 +133,7 @@ public void alleleGeneAssociationBulkUploadUpdateCheckFields() throws Exception RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?alleleCurie=" + alleleCurie + "&relationName=" + relationName + "&geneCurie=" + geneCurie). + get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "?geneId=" + gene.getId()). then(). statusCode(200). body("entity.relation.name", is(relationName)). @@ -207,7 +213,7 @@ public void alleleGeneAssociationBulkUploadUpdateMissingNonRequiredFieldsLevel1( RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?alleleCurie=" + alleleCurie + "&relationName=" + relationName + "&geneCurie=" + geneCurie). + get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "?geneId=" + gene.getId()). then(). statusCode(200). body("entity", not(hasKey("createdBy"))). @@ -225,7 +231,7 @@ public void alleleGeneAssociationBulkUploadUpdateMissingNonRequiredFieldsLevel2( RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?alleleCurie=" + alleleCurie + "&relationName=" + relationName + "&geneCurie=" + geneCurie). + get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "?geneId=" + gene.getId()). then(). statusCode(200). body("entity.relatedNote", not(hasKey("createdBy"))). @@ -241,7 +247,7 @@ public void alleleGeneAssociationBulkUploadUpdateEmptyNonRequiredFieldsLevel2() RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?alleleCurie=" + alleleCurie + "&relationName=" + relationName + "&geneCurie=" + geneCurie). + get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "?geneId=" + gene.getId()). then(). statusCode(200). body("entity", not(hasKey("createdBy"))). diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java index f415d2d61..eaf0b5e32 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java @@ -8,6 +8,8 @@ import java.time.OffsetDateTime; import org.alliancegenome.curation_api.base.BaseITCase; +import org.alliancegenome.curation_api.model.entities.Gene; +import org.alliancegenome.curation_api.model.entities.Vocabulary; import org.alliancegenome.curation_api.resources.TestContainerResource; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -40,6 +42,7 @@ public class ConstructGenomicEntityAssociationBulkUploadITCase extends BaseITCas private String noteType = "comment"; private String noteType2 = "test_construct_component_summary"; private Long constructId; + private Gene gene; @BeforeEach public void init() { @@ -55,16 +58,21 @@ public void init() { private final String constructGetEndpoint = "/api/construct/findBy/"; private final String geneGetEndpoint = "/api/gene/"; + private void loadRequiredEntities() throws Exception { + gene = getGene(geneCurie); + constructId = getConstruct(constructModEntityId).getId(); + } + @Test @Order(1) public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exception { - constructId = getConstruct(constructModEntityId).getId(); + loadRequiredEntities(); checkSuccessfulBulkLoad(constructGenomicEntityAssociationBulkPostEndpoint, constructGenomicEntityAssociationTestFilePath + "AF_01_all_fields.json"); RestAssured.given(). when(). - get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityCurie=" + geneCurie). + get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). then(). statusCode(200). body("entity.relation.name", is(relationName)). @@ -117,7 +125,7 @@ public void constructGenomicEntityAssociationBulkUploadUpdateCheckFields() throw RestAssured.given(). when(). - get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityCurie=" + geneCurie). + get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). then(). statusCode(200). body("entity.relation.name", is(relationName)). @@ -195,7 +203,7 @@ public void constructGenomicEntityAssociationBulkUploadUpdateMissingNonRequiredF RestAssured.given(). when(). - get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityCurie=" + geneCurie). + get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). then(). statusCode(200). body("entity", not(hasKey("createdBy"))). @@ -212,7 +220,7 @@ public void constructGenomicEntityAssociationBulkUploadUpdateMissingNonRequiredF RestAssured.given(). when(). - get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityCurie=" + geneCurie). + get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). then(). statusCode(200). body("entity.relatedNotes[0]", not(hasKey("createdBy"))). @@ -228,7 +236,7 @@ public void constructGenomicEntityAssociationBulkUploadUpdateEmptyNonRequiredFie RestAssured.given(). when(). - get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityCurie=" + geneCurie). + get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). then(). statusCode(200). body("entity", not(hasKey("createdBy"))). From 10084318d44c5256caef0a3f7bf106e974973753 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 19 Dec 2023 19:30:49 +0000 Subject: [PATCH 010/159] Tweaks --- .../curation_api/dao/base/CurieObjectDAO.java | 20 ------------ .../dao/base/SubmittedObjectDAO.java | 31 ------------------- .../bridges/BiologicalEntityTypeBridge.java | 2 +- .../entities/InformationContentEntity.java | 2 ++ .../validation/ConstructValidator.java | 2 +- .../v0.30.0.1__linkml_v2.0.0_update.sql | 6 ++-- .../AffectedGenomicModelITCase.java | 6 ++-- .../crud/controllers/AlleleITCase.java | 8 ++--- .../crud/controllers/ConstructITCase.java | 6 ++-- 9 files changed, 16 insertions(+), 67 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/dao/base/CurieObjectDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/base/CurieObjectDAO.java index 77107b5f8..bb0e1e5ee 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/base/CurieObjectDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/base/CurieObjectDAO.java @@ -1,9 +1,6 @@ package org.alliancegenome.curation_api.dao.base; import org.alliancegenome.curation_api.model.entities.base.CurieObject; -import org.alliancegenome.curation_api.response.SearchResponse; - -import io.quarkus.logging.Log; public class CurieObjectDAO extends BaseSQLDAO { @@ -12,21 +9,4 @@ protected CurieObjectDAO(Class myClass) { super(myClass); } - public E findByCurie(String curie) { - Log.debug("SqlDAO: findByCurie: " + curie + " " + myClass); - if (curie != null) { - SearchResponse response = findByField("curie", curie); - if (response == null || response.getSingleResult() == null) { - Log.debug("Entity Not Found: " + curie); - return null; - } - E entity = response.getSingleResult(); - Log.debug("Entity Found: " + entity); - return entity; - } else { - Log.debug("Input Param is null: " + curie); - return null; - } - } - } diff --git a/src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java index 5351fc743..e1b65c07a 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java @@ -1,9 +1,6 @@ package org.alliancegenome.curation_api.dao.base; import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; -import org.alliancegenome.curation_api.response.SearchResponse; - -import io.quarkus.logging.Log; public class SubmittedObjectDAO extends CurieObjectDAO { @@ -12,32 +9,4 @@ protected SubmittedObjectDAO(Class myClass) { super(myClass); } - public E findByIdentifierString(String id) { - Log.debug("SqlDAO: findByIdentifierString: " + id + " " + myClass); - if (id != null) { - SearchResponse response = null; - if (id.startsWith("AGRKB:")) { - response = findByField("curie", id); - } else { - if (response == null || response.getSingleResult() == null) { - response = findByField("modEntityId", id); - if (response == null || response.getSingleResult() == null) - response = findByField("modInternalId", id); - } - } - - if (response == null || response.getSingleResult() == null) { - Log.debug("Entity Not Found: " + id); - return null; - } - - E entity = response.getSingleResult(); - Log.debug("Entity Found: " + entity); - return entity; - } else { - Log.debug("Input Param is null: " + id); - return null; - } - } - } diff --git a/src/main/java/org/alliancegenome/curation_api/model/bridges/BiologicalEntityTypeBridge.java b/src/main/java/org/alliancegenome/curation_api/model/bridges/BiologicalEntityTypeBridge.java index 1e1f5b318..b4058a168 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/bridges/BiologicalEntityTypeBridge.java +++ b/src/main/java/org/alliancegenome/curation_api/model/bridges/BiologicalEntityTypeBridge.java @@ -21,7 +21,7 @@ public class BiologicalEntityTypeBridge implements TypeBinder { @Override public void bind(TypeBindingContext context) { - context.dependencies().use("curie").use("taxon"); + context.dependencies().useRootOnly(); IndexSchemaElement schemaElement = context.indexSchemaElement(); diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java index c5628f0ff..b5b1e4b7f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java @@ -6,6 +6,7 @@ import org.alliancegenome.curation_api.model.entities.base.CurieObject; import org.hibernate.envers.Audited; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonSubTypes; import jakarta.persistence.Entity; @@ -19,6 +20,7 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@JsonIgnoreProperties(ignoreUnknown = true) @ToString(callSuper = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Reference.class, name = "Reference") }) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ConstructValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ConstructValidator.java index d630ea3b9..a62d515ec 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ConstructValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ConstructValidator.java @@ -293,7 +293,7 @@ private List validateConstructGenomicEntityAs response.addErrorMessages(field, ix, geaResponse.getErrorMessages()); } else { gea = geaResponse.getEntity(); - gea.setSubjectConstruct(dbEntity); + gea.setSubject(dbEntity); validatedAssociations.add(gea); } } diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index 32c348780..a0fd38aad 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -531,7 +531,7 @@ CREATE TABLE submittedobject_aud ( PRIMARY KEY (id, rev) ); -CREATE SEQUENCE auditedobject_seq START WITH 1 INCREMENT BY 50 NO MINVALUE NO MAXVALUE CACHE 1; +CREATE SEQUENCE auditedobject_seq START WITH 200250000 INCREMENT BY 50 NO MINVALUE NO MAXVALUE CACHE 1; -- Add id equivalents of curie columns @@ -1033,7 +1033,7 @@ UPDATE dataprovider t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id A UPDATE dataprovider t SET sourceorganization_id = a.id FROM auditedobject a WHERE t.sourceorganization_id = a.old_id AND a.tablename = 'organization'; UPDATE dataprovider t SET crossreference_id = a.id FROM auditedobject a WHERE t.crossreference_id = a.old_id AND a.tablename = 'crossreference'; UPDATE diseaseannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -UPDATE diseaseannotation t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE diseaseannotation t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE diseaseannotation t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE diseaseannotation t SET diseasegeneticmodifierrelation_id = a.id FROM auditedobject a WHERE t.diseasegeneticmodifierrelation_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE diseaseannotation t SET annotationtype_id = a.id FROM auditedobject a WHERE t.annotationtype_id = a.old_id AND a.tablename = 'vocabularyterm'; @@ -1128,7 +1128,7 @@ UPDATE ontologyterm_isa_parent_children t SET isaparents_id = a.id FROM auditedo UPDATE ontologyterm_secondaryidentifiers t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE ontologyterm_subsets t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE ontologyterm_synonym t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ontologyterm_synonym t SET synonyms_id = a.id FROM auditedobject a WHERE t.synonyms_id = a.old_id AND a.tablename = 'ontologyterm'; +UPDATE ontologyterm_synonym t SET synonyms_id = a.id FROM auditedobject a WHERE t.synonyms_id = a.old_id AND a.tablename = 'synonym'; UPDATE organization t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'organization'; UPDATE organization t SET homepageresourcedescriptorpage_id = a.id FROM auditedobject a WHERE t.homepageresourcedescriptorpage_id = a.old_id AND a.tablename = 'resourcedescriptorpage'; UPDATE patoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AffectedGenomicModelITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AffectedGenomicModelITCase.java index 5724f2637..cb1ec519d 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AffectedGenomicModelITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AffectedGenomicModelITCase.java @@ -158,7 +158,7 @@ public void createAGMWithMissingRequiredFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.modInternalID", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")). + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")). body("errorMessages.taxon", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.subtype", is(ValidationConstants.REQUIRED_MESSAGE)); } @@ -177,7 +177,7 @@ public void editAGMWithMissingModEntityId() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.modInternalID", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); } @Test @@ -234,7 +234,7 @@ public void editAGMWithEmptyModEntityId() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.modInternalID", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); } @Test diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java index ba03f8daf..47661590f 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java @@ -127,7 +127,6 @@ public class AlleleITCase extends BaseITCase { private DataProvider obsoleteDataProvider; private Organization nonPersistedOrganization; private Gene gene; - private Gene gene2; private VocabularyTerm geneAssociationRelation; @@ -204,7 +203,6 @@ private void loadRequiredEntities() { nonPersistedOrganization.setAbbreviation("INV"); VocabularyTerm symbolNameType = getVocabularyTerm(nameTypeVocabulary, "nomenclature_symbol"); gene = createGene("TEST:AssociatedGene1", "NCBITaxon:6239", false, symbolNameType); - gene2 = createGene("TEST:AssociatedGene2", "NCBITaxon:6239", false, symbolNameType); Vocabulary relationVocabulary = getVocabulary(VocabularyConstants.ALLELE_RELATION_VOCABULARY); geneAssociationRelation = getVocabularyTerm(relationVocabulary, "is_allele_of"); @@ -1455,7 +1453,7 @@ public void updateAlleleDetailWithNewAssociations() { Allele allele = getAllele(ALLELE); AlleleGeneAssociation geneAssociation = new AlleleGeneAssociation(); - geneAssociation.setObjectGene(gene); + geneAssociation.setObject(gene); geneAssociation.setRelation(geneAssociationRelation); allele.setAlleleGeneAssociations(List.of(geneAssociation)); @@ -1473,7 +1471,7 @@ public void updateAlleleDetailWithNewAssociations() { then(). statusCode(200). body("entity", hasKey("alleleGeneAssociations")). - body("entity.alleleGeneAssociations[0].objectGene.curie", is(gene.getCurie())); + body("entity.alleleGeneAssociations[0].object.modEntityId", is(gene.getModEntityId())); } @Test @@ -1505,7 +1503,7 @@ public void updateAlleleDetailWithInvalidAssociations() { Allele allele = getAllele(ALLELE); AlleleGeneAssociation geneAssociation = new AlleleGeneAssociation(); - geneAssociation.setObjectGene(gene); + geneAssociation.setObject(gene); geneAssociation.setRelation(dominantInheritanceMode); allele.setAlleleGeneAssociations(List.of(geneAssociation)); diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java index 94a519c21..de47931a6 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java @@ -924,7 +924,7 @@ public void updateConstructWithNewAssociations() { Construct construct = getConstruct(CONSTRUCT); ConstructGenomicEntityAssociation geAssociation = new ConstructGenomicEntityAssociation(); - geAssociation.setObjectGenomicEntity(gene); + geAssociation.setObject(gene); geAssociation.setRelation(geAssociationRelation); construct.setConstructGenomicEntityAssociations(List.of(geAssociation)); @@ -942,7 +942,7 @@ public void updateConstructWithNewAssociations() { then(). statusCode(200). body("entity", hasKey("constructGenomicEntityAssociations")). - body("entity.constructGenomicEntityAssociations[0].objectGenomicEntity.curie", is(gene.getCurie())); + body("entity.constructGenomicEntityAssociations[0].object.modEntityId", is(gene.getModEntityId())); } @Test @@ -974,7 +974,7 @@ public void updateConstructWithInvalidAssociations() { Construct construct = getConstruct(CONSTRUCT); ConstructGenomicEntityAssociation geneAssociation = new ConstructGenomicEntityAssociation(); - geneAssociation.setObjectGenomicEntity(gene); + geneAssociation.setObject(gene); geneAssociation.setRelation(systematicNameType); construct.setConstructGenomicEntityAssociations(List.of(geneAssociation)); From 4ce94f9b5711ec90fed26591de36f00e8a59a380 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Wed, 20 Dec 2023 15:56:35 +0000 Subject: [PATCH 011/159] Random changes --- .../crud/BiologicalEntityCrudController.java | 5 +- .../GeneDiseaseAnnotationCrudController.java | 1 + .../dao/base/SubmittedObjectDAO.java | 2 +- .../AgmDiseaseAnnotationExecutor.java | 3 + .../AlleleDiseaseAnnotationExecutor.java | 3 + .../GeneDiseaseAnnotationExecutor.java | 5 +- .../AlleleGeneAssociationExecutor.java | 3 + ...tructGenomicEntityAssociationExecutor.java | 3 + .../model/entities/Annotation.java | 7 +- .../model/entities/Association.java | 8 + .../model/entities/BiologicalEntity.java | 2 +- .../model/entities/EvidenceAssociation.java | 9 + .../model/entities/Organization.java | 4 + .../curation_api/model/entities/Reagent.java | 5 +- .../AlleleGenomicEntityAssociation.java | 5 + .../model/entities/base/AuditedObject.java | 50 ++++ .../model/entities/base/CurieObject.java | 7 + .../model/entities/base/SubmittedObject.java | 6 + .../entities/base/UniqueIdAuditedObject.java | 9 + .../entities/ontology/AnatomicalTerm.java | 15 +- .../model/entities/ontology/ChemicalTerm.java | 9 + .../ExperimentalConditionOntologyTerm.java | 8 + .../model/entities/ontology/OntologyTerm.java | 30 +++ .../entities/ontology/PhenotypeTerm.java | 12 + .../model/entities/ontology/StageTerm.java | 11 + .../orthology/GeneToGeneOrthology.java | 7 + .../base/SubmittedObjectCrudService.java | 3 +- .../dto/DiseaseAnnotationDTOValidator.java | 14 -- .../GeneDiseaseAnnotationDTOValidator.java | 15 -- .../v0.30.0.1__linkml_v2.0.0_update.sql | 229 ++++++++++++++++++ 30 files changed, 450 insertions(+), 40 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/BiologicalEntityCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/BiologicalEntityCrudController.java index 5784bddcd..f6e8d7171 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/BiologicalEntityCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/BiologicalEntityCrudController.java @@ -1,9 +1,10 @@ package org.alliancegenome.curation_api.controllers.crud; -import org.alliancegenome.curation_api.controllers.base.CurieObjectCrudController; +import org.alliancegenome.curation_api.controllers.base.SubmittedObjectCrudController; import org.alliancegenome.curation_api.dao.BiologicalEntityDAO; import org.alliancegenome.curation_api.interfaces.crud.BiologicalEntityCrudInterface; import org.alliancegenome.curation_api.model.entities.BiologicalEntity; +import org.alliancegenome.curation_api.model.ingest.dto.BiologicalEntityDTO; import org.alliancegenome.curation_api.services.BiologicalEntityService; import jakarta.annotation.PostConstruct; @@ -11,7 +12,7 @@ import jakarta.inject.Inject; @RequestScoped -public class BiologicalEntityCrudController extends CurieObjectCrudController implements BiologicalEntityCrudInterface { +public class BiologicalEntityCrudController extends SubmittedObjectCrudController implements BiologicalEntityCrudInterface { @Inject BiologicalEntityService biologicalEntityService; diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneDiseaseAnnotationCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneDiseaseAnnotationCrudController.java index 4bdb7471e..12008feff 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneDiseaseAnnotationCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneDiseaseAnnotationCrudController.java @@ -36,6 +36,7 @@ public APIResponse updateGeneDiseaseAnnotations(String dataProvider, List get(String identifierString) { return geneDiseaseAnnotationService.get(identifierString); } diff --git a/src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java index e1b65c07a..fe50be496 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java @@ -2,7 +2,7 @@ import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; -public class SubmittedObjectDAO extends CurieObjectDAO { +public class SubmittedObjectDAO extends BaseSQLDAO { protected SubmittedObjectDAO(Class myClass) { diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java index aaf7bcdbe..f39433108 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java @@ -20,6 +20,7 @@ import org.alliancegenome.curation_api.services.DiseaseAnnotationService; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; +import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import lombok.extern.jbosslog.JBossLog; @@ -92,9 +93,11 @@ public void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataPro idsAdded.add(annotation.getId()); } } catch (ObjectUpdateException e) { + Log.info("EXCEPTION 1: " + e.getData()); history.incrementFailed(); addException(history, e.getData()); } catch (Exception e) { + Log.info("EXCEPTION 2: " + e.getLocalizedMessage()); history.incrementFailed(); addException(history, new ObjectUpdateExceptionData(annotationDTO, e.getMessage(), e.getStackTrace())); } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java index d98fc6f4e..6e6f2e173 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java @@ -20,6 +20,7 @@ import org.alliancegenome.curation_api.services.DiseaseAnnotationService; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; +import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import lombok.extern.jbosslog.JBossLog; @@ -92,9 +93,11 @@ public void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataPro idsAdded.add(annotation.getId()); } } catch (ObjectUpdateException e) { + Log.info("EXCEPTION 1: " + e.getData()); history.incrementFailed(); addException(history, e.getData()); } catch (Exception e) { + Log.info("EXCEPTION 2: " + e.getLocalizedMessage()); history.incrementFailed(); addException(history, new ObjectUpdateExceptionData(annotationDTO, e.getMessage(), e.getStackTrace())); } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java index 9e0ab2faf..616da075e 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java @@ -92,13 +92,12 @@ public void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataPro if(idsAdded != null) { idsAdded.add(annotation.getId()); } - Log.info("SAVING"); } catch (ObjectUpdateException e) { - Log.info("ERROR:" + e.getData()); + Log.info("EXCEPTION 1: " + e.getData()); history.incrementFailed(); addException(history, e.getData()); } catch (Exception e) { - Log.info("ERROR2:" + e.getMessage()); + Log.info("EXCEPTION 2: " + e.getLocalizedMessage()); history.incrementFailed(); addException(history, new ObjectUpdateExceptionData(annotationDTO, e.getMessage(), e.getStackTrace())); } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/alleleAssociations/AlleleGeneAssociationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/alleleAssociations/AlleleGeneAssociationExecutor.java index 3014a6a83..3710b6f7e 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/alleleAssociations/AlleleGeneAssociationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/alleleAssociations/AlleleGeneAssociationExecutor.java @@ -19,6 +19,7 @@ import org.alliancegenome.curation_api.services.associations.alleleAssociations.AlleleGeneAssociationService; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; +import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import lombok.extern.jbosslog.JBossLog; @@ -87,9 +88,11 @@ public void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataPro idsAdded.add(association.getId()); } } catch (ObjectUpdateException e) { + Log.info("EXCEPTION 1: " + e.getData()); history.incrementFailed(); addException(history, e.getData()); } catch (Exception e) { + Log.info("EXCEPTION 2: " + e.getLocalizedMessage()); history.incrementFailed(); addException(history, new ObjectUpdateExceptionData(associationDTO, e.getMessage(), e.getStackTrace())); } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/constructAssociations/ConstructGenomicEntityAssociationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/constructAssociations/ConstructGenomicEntityAssociationExecutor.java index 9a4957dba..a275dbbc3 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/constructAssociations/ConstructGenomicEntityAssociationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/constructAssociations/ConstructGenomicEntityAssociationExecutor.java @@ -20,6 +20,7 @@ import org.alliancegenome.curation_api.services.associations.constructAssociations.ConstructGenomicEntityAssociationService; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; +import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import lombok.extern.jbosslog.JBossLog; @@ -90,9 +91,11 @@ public void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataPro idsAdded.add(association.getId()); } } catch (ObjectUpdateException e) { + Log.info("EXCEPTION 1: " + e.getData()); history.incrementFailed(); addException(history, e.getData()); } catch (Exception e) { + Log.info("EXCEPTION 2: " + e.getLocalizedMessage()); history.incrementFailed(); addException(history, new ObjectUpdateExceptionData(associationDTO, e.getMessage(), e.getStackTrace())); } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java index 837f5f6a4..bb61ab8cf 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java @@ -19,6 +19,8 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.CascadeType; @@ -35,6 +37,10 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = DiseaseAnnotation.class, name = "DiseaseAnnotation") +}) @Audited @Entity @Data @@ -42,7 +48,6 @@ @ToString(callSuper = true) @Schema(name = "annotation", description = "POJO that represents an annotation") @AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) - @Table( indexes = { @Index(name = "annotation_curie_index", columnList = "curie"), diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java index bf67de042..36b7efd85 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java @@ -6,11 +6,19 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.envers.Audited; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + import jakarta.persistence.Entity; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = SingleReferenceAssociation.class, name = "SingleReferenceAssociation"), + @JsonSubTypes.Type(value = EvidenceAssociation.class, name = "EvidenceAssociation") +}) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java index 077c7bb84..c7aeffc9b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java @@ -27,7 +27,7 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonSubTypes({ @JsonSubTypes.Type(value = AffectedGenomicModel.class, name = "AffectedGenomicModel"), @JsonSubTypes.Type(value = Allele.class, name = "Allele"), - @JsonSubTypes.Type(value = Gene.class, name = "Gene") }) + @JsonSubTypes.Type(value = Gene.class, name = "Gene"), @JsonSubTypes.Type(value = Variant.class, name = "Variant") }) @Audited @Entity @TypeBinding(binder = @TypeBinderRef(type = BiologicalEntityTypeBridge.class)) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java index 229b02993..a04d02b03 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java @@ -4,6 +4,8 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; +import org.alliancegenome.curation_api.model.entities.associations.alleleAssociations.AlleleGenomicEntityAssociation; +import org.alliancegenome.curation_api.model.entities.associations.constructAssociations.ConstructGenomicEntityAssociation; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.envers.Audited; @@ -11,6 +13,8 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; @@ -22,6 +26,11 @@ import lombok.Data; import lombok.EqualsAndHashCode; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = AlleleGenomicEntityAssociation.class, name = "AlleleGenomicEntityAssociation"), + @JsonSubTypes.Type(value = ConstructGenomicEntityAssociation.class, name = "ConstructGenomicEntityAssociation") +}) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java index ec1d9cdda..7d4575f54 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java @@ -13,6 +13,8 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; @@ -26,6 +28,8 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ @JsonSubTypes.Type(value = AllianceMember.class, name = "AllianceMember") }) @Data @Entity @Audited diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java index 6e1fc7f32..3bc14fe3d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java @@ -14,6 +14,8 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; @@ -26,6 +28,8 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ @JsonSubTypes.Type(value = Construct.class, name = "Construct") }) @Audited @Entity @Data @@ -33,7 +37,6 @@ @ToString(callSuper = true) @Schema(name = "reagent", description = "POJO that represents a reagent") @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SubmittedObject.class }) - @Table(indexes = { @Index(name = "reagent_uniqueId_index", columnList = "uniqueId") }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java index 83a29e466..7f40bf75d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java @@ -4,6 +4,7 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.EvidenceAssociation; import org.alliancegenome.curation_api.model.entities.Note; +import org.alliancegenome.curation_api.model.entities.SingleReferenceAssociation; import org.alliancegenome.curation_api.model.entities.VocabularyTerm; import org.alliancegenome.curation_api.model.entities.ontology.ECOTerm; import org.alliancegenome.curation_api.view.View; @@ -13,6 +14,8 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.CascadeType; @@ -25,6 +28,8 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ @JsonSubTypes.Type(value = AlleleGeneAssociation.class, name = "AlleleGeneAssociation") }) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java index 70aa1860e..f6063aa35 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java @@ -6,7 +6,29 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.bridges.BooleanValueBridge; import org.alliancegenome.curation_api.model.bridges.OffsetDateTimeValueBridge; +import org.alliancegenome.curation_api.model.entities.Association; +import org.alliancegenome.curation_api.model.entities.ConditionRelation; +import org.alliancegenome.curation_api.model.entities.CrossReference; +import org.alliancegenome.curation_api.model.entities.DataProvider; +import org.alliancegenome.curation_api.model.entities.ExperimentalCondition; +import org.alliancegenome.curation_api.model.entities.Note; +import org.alliancegenome.curation_api.model.entities.Organization; import org.alliancegenome.curation_api.model.entities.Person; +import org.alliancegenome.curation_api.model.entities.PersonSetting; +import org.alliancegenome.curation_api.model.entities.ResourceDescriptor; +import org.alliancegenome.curation_api.model.entities.ResourceDescriptorPage; +import org.alliancegenome.curation_api.model.entities.Species; +import org.alliancegenome.curation_api.model.entities.Synonym; +import org.alliancegenome.curation_api.model.entities.Vocabulary; +import org.alliancegenome.curation_api.model.entities.VocabularyTerm; +import org.alliancegenome.curation_api.model.entities.VocabularyTermSet; +import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoad; +import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFile; +import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFileException; +import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFileHistory; +import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadGroup; +import org.alliancegenome.curation_api.model.entities.orthology.GeneToGeneOrthology; +import org.alliancegenome.curation_api.model.entities.slotAnnotations.SlotAnnotation; import org.alliancegenome.curation_api.view.View; import org.alliancegenome.curation_api.view.View.VocabularyTermSetView; import org.hibernate.annotations.CreationTimestamp; @@ -26,6 +48,8 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; @@ -42,6 +66,32 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = Association.class, name = "Association"), + @JsonSubTypes.Type(value = BulkLoad.class, name = "BulkLoad"), + @JsonSubTypes.Type(value = BulkLoadFile.class, name = "BulkLoadFile"), + @JsonSubTypes.Type(value = BulkLoadFileException.class, name = "BulkLoadFileException"), + @JsonSubTypes.Type(value = BulkLoadFileHistory.class, name = "BulkLoadFileHistory"), + @JsonSubTypes.Type(value = BulkLoadGroup.class, name = "BulkLoadGroup"), + @JsonSubTypes.Type(value = CrossReference.class, name = "CrossReference"), + @JsonSubTypes.Type(value = CurieObject.class, name = "CurieObject"), + @JsonSubTypes.Type(value = DataProvider.class, name = "DataProvider"), + @JsonSubTypes.Type(value = GeneToGeneOrthology.class, name = "GeneToGeneOrthology"), + @JsonSubTypes.Type(value = Note.class, name = "Note"), + @JsonSubTypes.Type(value = Organization.class, name = "Organization"), + @JsonSubTypes.Type(value = Person.class, name = "Person"), + @JsonSubTypes.Type(value = PersonSetting.class, name = "PersonSetting"), + @JsonSubTypes.Type(value = ResourceDescriptor.class, name = "ResourceDescriptor"), + @JsonSubTypes.Type(value = ResourceDescriptorPage.class, name = "ResourceDescriptorPage"), + @JsonSubTypes.Type(value = SlotAnnotation.class, name = "SlotAnnotation"), + @JsonSubTypes.Type(value = Species.class, name = "Species"), + @JsonSubTypes.Type(value = Synonym.class, name = "Synonym"), + @JsonSubTypes.Type(value = UniqueIdAuditedObject.class, name = "UniqueIdAuditedObject"), + @JsonSubTypes.Type(value = Vocabulary.class, name = "Vocabulary"), + @JsonSubTypes.Type(value = VocabularyTerm.class, name = "VocabularyTerm"), + @JsonSubTypes.Type(value = VocabularyTermSet.class, name = "VocabularyTermSet"), +}) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @Audited diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java index b294656bd..7dc5db139 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java @@ -2,6 +2,8 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; +import org.alliancegenome.curation_api.model.entities.InformationContentEntity; +import org.alliancegenome.curation_api.model.entities.ontology.OntologyTerm; import org.alliancegenome.curation_api.view.View; import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; @@ -10,6 +12,8 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; @@ -20,6 +24,9 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ @JsonSubTypes.Type(value = SubmittedObject.class, name = "SubmittedObject"), @JsonSubTypes.Type(value = OntologyTerm.class, name = "OntologyTerm"), + @JsonSubTypes.Type(value = InformationContentEntity.class, name = "InformationContentEntity")}) @Data @EqualsAndHashCode(callSuper = true) @Audited diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java index 4c829363a..c2998f713 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java @@ -2,7 +2,9 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; +import org.alliancegenome.curation_api.model.entities.BiologicalEntity; import org.alliancegenome.curation_api.model.entities.DataProvider; +import org.alliancegenome.curation_api.model.entities.Reagent; import org.alliancegenome.curation_api.view.View; import org.apache.commons.lang3.StringUtils; import org.hibernate.annotations.Fetch; @@ -18,6 +20,8 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; @@ -30,6 +34,8 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ @JsonSubTypes.Type(value = BiologicalEntity.class, name = "BiologicalEntity"), @JsonSubTypes.Type(value = Reagent.class, name = "Reagent") }) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/UniqueIdAuditedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/UniqueIdAuditedObject.java index 7b9620646..58c85ead6 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/UniqueIdAuditedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/UniqueIdAuditedObject.java @@ -1,5 +1,7 @@ package org.alliancegenome.curation_api.model.entities.base; +import org.alliancegenome.curation_api.model.entities.ConditionRelation; +import org.alliancegenome.curation_api.model.entities.ExperimentalCondition; import org.alliancegenome.curation_api.view.View; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; @@ -7,6 +9,8 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; @@ -15,6 +19,11 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = ConditionRelation.class, name = "ConditionRelation"), + @JsonSubTypes.Type(value = ExperimentalCondition.class, name = "ExperimentalCondition") +}) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @MappedSuperclass diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java index 705239791..16266a160 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java @@ -4,6 +4,9 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.hibernate.envers.Audited; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + import jakarta.persistence.Entity; import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; @@ -11,7 +14,17 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = WBBTTerm.class, name = "WBBTTerm"), + @JsonSubTypes.Type(value = CLTerm.class, name = "CLTerm"), + @JsonSubTypes.Type(value = DAOTerm.class, name = "DAOTerm"), + @JsonSubTypes.Type(value = MATerm.class, name = "MATerm"), + @JsonSubTypes.Type(value = EMAPATerm.class, name = "EMAPATerm"), + @JsonSubTypes.Type(value = UBERONTerm.class, name = "UBERONTerm"), + @JsonSubTypes.Type(value = XBATerm.class, name = "XBATerm"), + @JsonSubTypes.Type(value = ZFATerm.class, name = "ZFATerm") +})@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java index 564fbf73b..56e9b2d09 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java @@ -2,6 +2,7 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; +import org.alliancegenome.curation_api.model.entities.Molecule; import org.alliancegenome.curation_api.view.View; import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; @@ -10,6 +11,8 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; @@ -20,6 +23,12 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = CHEBITerm.class, name = "CHEBITerm"), + @JsonSubTypes.Type(value = XSMOTerm.class, name = "XSMOTerm"), + @JsonSubTypes.Type(value = Molecule.class, name = "Molecule") +}) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java index 29195df3b..db5acf932 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java @@ -4,6 +4,9 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.hibernate.envers.Audited; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + import jakarta.persistence.Entity; import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; @@ -11,6 +14,11 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = ZECOTerm.class, name = "ZECOTerm"), + @JsonSubTypes.Type(value = XCOTerm.class, name = "XCOTerm") +}) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java index 5015338c6..3bbddc26f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java @@ -6,6 +6,7 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; +import org.alliancegenome.curation_api.model.entities.Association; import org.alliancegenome.curation_api.model.entities.CrossReference; import org.alliancegenome.curation_api.model.entities.Synonym; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; @@ -21,6 +22,8 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; @@ -35,6 +38,33 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = AnatomicalTerm.class, name = "AnatomicalTerm"), + @JsonSubTypes.Type(value = ATPTerm.class, name = "ATPTerm"), + @JsonSubTypes.Type(value = BSPOTerm.class, name = "BSPOTerm"), + @JsonSubTypes.Type(value = ChemicalTerm.class, name = "ChemicalTerm"), + @JsonSubTypes.Type(value = CMOTerm.class, name = "CMOTerm"), + @JsonSubTypes.Type(value = DOTerm.class, name = "DOTerm"), + @JsonSubTypes.Type(value = ECOTerm.class, name = "ECOTerm"), + @JsonSubTypes.Type(value = ExperimentalConditionOntologyTerm.class, name = "ExperimentalConditionOntologyTerm"), + @JsonSubTypes.Type(value = GOTerm.class, name = "GOTerm"), + @JsonSubTypes.Type(value = MITerm.class, name = "MITerm"), + @JsonSubTypes.Type(value = MMOTerm.class, name = "MMOTerm"), + @JsonSubTypes.Type(value = MODTerm.class, name = "MODTerm"), + @JsonSubTypes.Type(value = MPATHTerm.class, name = "MPATHTerm"), + @JsonSubTypes.Type(value = NCBITaxonTerm.class, name = "NCBITaxonTerm"), + @JsonSubTypes.Type(value = OBITerm.class, name = "OBITerm"), + @JsonSubTypes.Type(value = PATOTerm.class, name = "PATOTerm"), + @JsonSubTypes.Type(value = PhenotypeTerm.class, name = "PhenotypeTerm"), + @JsonSubTypes.Type(value = PWTerm.class, name = "PWTerm"), + @JsonSubTypes.Type(value = ROTerm.class, name = "ROTerm"), + @JsonSubTypes.Type(value = RSTerm.class, name = "RSTerm"), + @JsonSubTypes.Type(value = SOTerm.class, name = "SOTerm"), + @JsonSubTypes.Type(value = StageTerm.class, name = "StageTerm"), + @JsonSubTypes.Type(value = VTTerm.class, name = "VTTerm"), + @JsonSubTypes.Type(value = XBEDTerm.class, name = "XBEDTerm") +}) @Audited @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java index f068cdf0a..e58f6b9a0 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java @@ -4,6 +4,9 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.hibernate.envers.Audited; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + import jakarta.persistence.Entity; import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; @@ -11,6 +14,15 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = APOTerm.class, name = "APOTerm"), + @JsonSubTypes.Type(value = WBPhenotypeTerm.class, name = "WBPhenotypeTerm"), + @JsonSubTypes.Type(value = DPOTerm.class, name = "DPOTerm"), + @JsonSubTypes.Type(value = HPTerm.class, name = "HPTerm"), + @JsonSubTypes.Type(value = MPTerm.class, name = "MPTerm"), + @JsonSubTypes.Type(value = XPOTerm.class, name = "XPOTerm") +}) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java index a2ded9c71..eaeaf771c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java @@ -4,6 +4,9 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.hibernate.envers.Audited; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + import jakarta.persistence.Entity; import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; @@ -11,6 +14,14 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = WBLSTerm.class, name = "WBLSTerm"), + @JsonSubTypes.Type(value = FBDVTerm.class, name = "FBDVTerm"), + @JsonSubTypes.Type(value = MMUSDVTerm.class, name = "MMUSDVTerm"), + @JsonSubTypes.Type(value = XBSTerm.class, name = "XBSTerm"), + @JsonSubTypes.Type(value = ZFSTerm.class, name = "ZFSTerm") +}) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java index 03da3ca56..c58ad5bb1 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java @@ -11,6 +11,8 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; @@ -23,6 +25,11 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ + @JsonSubTypes.Type(value = GeneToGeneOrthologyCurated.class, name = "GeneToGeneOrthologyCurated"), + @JsonSubTypes.Type(value = GeneToGeneOrthologyGenerated.class, name = "GeneToGeneOrthologyGenerated") +}) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java b/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java index dab6cee55..94076c055 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java @@ -42,8 +42,9 @@ public E findByIdentifierString(String id) { } else { if (response == null || response.getSingleResult() == null) { response = findByField("modEntityId", id); - if (response == null || response.getSingleResult() == null) + if (response == null || response.getSingleResult() == null) { response = findByField("modInternalId", id); + } } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java index c3a9c5d83..f5ec45aea 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java @@ -25,7 +25,6 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -53,7 +52,6 @@ public ObjectRespo ObjectResponse daResponse = validateAnnotationDTO(annotation, dto, VocabularyConstants.DISEASE_ANNOTATION_NOTE_TYPES_VOCABULARY_TERM_SET); annotation = daResponse.getEntity(); - Log.info("GOT HERE 10a"); if (StringUtils.isBlank(dto.getDoTermCurie())) { daResponse.addErrorMessage("do_term_curie", ValidationConstants.REQUIRED_MESSAGE); } else { @@ -63,7 +61,6 @@ public ObjectRespo annotation.setObject(disease); } - Log.info("GOT HERE 10b"); if (CollectionUtils.isEmpty(dto.getEvidenceCodeCuries())) { daResponse.addErrorMessage("evidence_code_curies", ValidationConstants.REQUIRED_MESSAGE); } else { @@ -81,14 +78,12 @@ public ObjectRespo annotation.setEvidenceCodes(ecoTerms); } - Log.info("GOT HERE 10c"); if (dto.getNegated() != null) { annotation.setNegated(dto.getNegated()); } else { annotation.setNegated(false); } - Log.info("GOT HERE 10d"); if (CollectionUtils.isNotEmpty(dto.getWithGeneIdentifiers())) { List withGenes = new ArrayList<>(); for (String withIdentifier : dto.getWithGeneIdentifiers()) { @@ -108,7 +103,6 @@ public ObjectRespo annotation.setWith(null); } - Log.info("GOT HERE 10e"); DataProvider secondaryDataProvider = null; if (dto.getSecondaryDataProviderDto() != null) { ObjectResponse dpResponse = dataProviderDtoValidator.validateDataProviderDTO(dto.getSecondaryDataProviderDto(), annotation.getSecondaryDataProvider()); @@ -120,7 +114,6 @@ public ObjectRespo } annotation.setSecondaryDataProvider(secondaryDataProvider); - Log.info("GOT HERE 10f"); if (CollectionUtils.isNotEmpty(dto.getDiseaseQualifierNames())) { List diseaseQualifiers = new ArrayList<>(); for (String qualifier : dto.getDiseaseQualifierNames()) { @@ -136,30 +129,25 @@ public ObjectRespo annotation.setDiseaseQualifiers(null); } - Log.info("GOT HERE 10g"); if (CollectionUtils.isNotEmpty(dto.getDiseaseGeneticModifierIdentifiers()) || StringUtils.isNotBlank(dto.getDiseaseGeneticModifierRelationName())) { if (CollectionUtils.isEmpty(dto.getDiseaseGeneticModifierIdentifiers())) { daResponse.addErrorMessage("disease_genetic_modifier_relation_name", ValidationConstants.DEPENDENCY_MESSAGE_PREFIX + "disease_genetic_modifier_identifiers"); } else if (StringUtils.isBlank(dto.getDiseaseGeneticModifierRelationName())) { daResponse.addErrorMessage("disease_genetic_modifier_identifiers", ValidationConstants.DEPENDENCY_MESSAGE_PREFIX + "disease_genetic_modifier_relation_name"); } else { - Log.info("GOT HERE 10ga"); VocabularyTerm diseaseGeneticModifierRelation = vocabularyTermService.getTermInVocabulary(VocabularyConstants.DISEASE_GENETIC_MODIFIER_RELATION_VOCABULARY, dto.getDiseaseGeneticModifierRelationName()).getEntity(); if (diseaseGeneticModifierRelation == null) daResponse.addErrorMessage("disease_genetic_modifier_relation_name", ValidationConstants.INVALID_MESSAGE + " (" + dto.getDiseaseGeneticModifierRelationName() + ")"); List diseaseGeneticModifiers = new ArrayList<>(); for (String modifierIdentifier : dto.getDiseaseGeneticModifierIdentifiers()) { - Log.info("GOT HERE 10gb"); BiologicalEntity diseaseGeneticModifier = biologicalEntityService.findByIdentifierString(modifierIdentifier); if (diseaseGeneticModifier == null) { daResponse.addErrorMessage("disease_genetic_modifier_identifiers", ValidationConstants.INVALID_MESSAGE + " (" + modifierIdentifier + ")"); } else { - Log.info("GOT HERE 10gc"); diseaseGeneticModifiers.add(diseaseGeneticModifier); } } - Log.info("GOT HERE 10gd"); annotation.setDiseaseGeneticModifiers(diseaseGeneticModifiers); annotation.setDiseaseGeneticModifierRelation(diseaseGeneticModifierRelation); } @@ -168,7 +156,6 @@ public ObjectRespo annotation.setDiseaseGeneticModifierRelation(null); } - Log.info("GOT HERE 10h"); VocabularyTerm annotationType = null; if (StringUtils.isNotBlank(dto.getAnnotationTypeName())) { annotationType = vocabularyTermService.getTermInVocabulary(VocabularyConstants.ANNOTATION_TYPE_VOCABULARY, dto.getAnnotationTypeName()).getEntity(); @@ -177,7 +164,6 @@ public ObjectRespo } annotation.setAnnotationType(annotationType); - Log.info("GOT HERE 10i"); VocabularyTerm geneticSex = null; if (StringUtils.isNotBlank(dto.getGeneticSexName())) { geneticSex = vocabularyTermService.getTermInVocabulary(VocabularyConstants.GENETIC_SEX_VOCABULARY, dto.getGeneticSexName()).getEntity(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java index 6d44a2a07..6267c01a9 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java @@ -20,7 +20,6 @@ import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; import org.apache.commons.lang3.StringUtils; -import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -41,31 +40,21 @@ public class GeneDiseaseAnnotationDTOValidator extends DiseaseAnnotationDTOValid public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotationDTO dto, BackendBulkDataProvider dataProvider) throws ObjectValidationException { GeneDiseaseAnnotation annotation = new GeneDiseaseAnnotation(); Gene gene; - Log.info("GOT HERE 1"); ObjectResponse gdaResponse = new ObjectResponse(); - Log.info("GOT HERE 2"); ObjectResponse refResponse = validateReference(annotation, dto); - - Log.info("GOT HERE 3"); gdaResponse.addErrorMessages(refResponse.getErrorMessages()); Reference validatedReference = refResponse.getEntity().getSingleReference(); - Log.info("GOT HERE 4"); String refCurie = validatedReference == null ? null : validatedReference.getCurie(); - Log.info("GOT HERE 5"); if (StringUtils.isBlank(dto.getGeneIdentifier())) { gdaResponse.addErrorMessage("gene_identifier", ValidationConstants.REQUIRED_MESSAGE); } else { - - Log.info("GOT HERE 6"); gene = geneService.findByIdentifierString(dto.getGeneIdentifier()); if (gene == null) { gdaResponse.addErrorMessage("gene_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGeneIdentifier() + ")"); } else { - - Log.info("GOT HERE 7"); String annotationId; String identifyingField; String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getGeneIdentifier(), refCurie); @@ -83,7 +72,6 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat identifyingField = "uniqueId"; } - Log.info("GOT HERE 8"); SearchResponse annotationList = geneDiseaseAnnotationDAO.findByField(identifyingField, annotationId); if (annotationList != null && annotationList.getResults().size() > 0) { annotation = annotationList.getResults().get(0); @@ -98,7 +86,6 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat } } - Log.info("GOT HERE 9"); annotation.setSingleReference(validatedReference); AffectedGenomicModel sgdStrainBackground = null; @@ -110,12 +97,10 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat } annotation.setSgdStrainBackground(sgdStrainBackground); - Log.info("GOT HERE 10"); ObjectResponse daResponse = validateDiseaseAnnotationDTO(annotation, dto); annotation = daResponse.getEntity(); gdaResponse.addErrorMessages(daResponse.getErrorMessages()); - Log.info("GOT HERE 11"); if (StringUtils.isNotEmpty(dto.getDiseaseRelationName())) { VocabularyTerm diseaseRelation = vocabularyTermService.getTermInVocabularyTermSet(VocabularyConstants.GENE_DISEASE_RELATION_VOCABULARY_TERM_SET, dto.getDiseaseRelationName()).getEntity(); if (diseaseRelation == null) diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index a0fd38aad..24e136d6b 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -912,6 +912,9 @@ INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, da CREATE INDEX old_id_index ON auditedobject USING btree (old_id, tablename); CREATE INDEX old_curie_index ON auditedobject USING btree (old_curie, tablename); +UPDATE auditedobject t SET createdby_id = a.id FROM auditedobject a WHERE t.createdby_id = a.old_id AND a.tablename = 'person'; +UPDATE auditedobject t SET updatedby_id = a.id FROM auditedobject a WHERE t.updatedby_id = a.old_id AND a.tablename = 'person'; + UPDATE affectedgenomicmodel t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE affectedgenomicmodel t SET subtype_id = a.id FROM auditedobject a WHERE t.subtype_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE agmdiseaseannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; @@ -1668,20 +1671,101 @@ ALTER TABLE allelesecondaryidslotannotation DROP COLUMN singleallele_curie; ALTER TABLE allelesymbolslotannotation DROP COLUMN singleallele_curie; ALTER TABLE allelesynonymslotannotation DROP COLUMN singleallele_curie; ALTER TABLE anatomicalterm DROP COLUMN curie; +ALTER TABLE association DROP COLUMN createdby_id; +ALTER TABLE association DROP COLUMN updatedby_id; +ALTER TABLE association DROP COLUMN datecreated; +ALTER TABLE association DROP COLUMN dateupdated; +ALTER TABLE association DROP COLUMN dbdatecreated; +ALTER TABLE association DROP COLUMN dbdateupdated; +ALTER TABLE association DROP COLUMN internal; +ALTER TABLE association DROP COLUMN obsolete; ALTER TABLE apoterm DROP COLUMN curie; ALTER TABLE atpterm DROP COLUMN curie; ALTER TABLE biologicalentity DROP COLUMN curie; ALTER TABLE biologicalentity DROP COLUMN taxon_curie; +ALTER TABLE biologicalentity DROP COLUMN dataprovider_id; +ALTER TABLE biologicalentity DROP COLUMN createdby_id; +ALTER TABLE biologicalentity DROP COLUMN updatedby_id; +ALTER TABLE biologicalentity DROP COLUMN datecreated; +ALTER TABLE biologicalentity DROP COLUMN dateupdated; +ALTER TABLE biologicalentity DROP COLUMN dbdatecreated; +ALTER TABLE biologicalentity DROP COLUMN dbdateupdated; +ALTER TABLE biologicalentity DROP COLUMN internal; +ALTER TABLE biologicalentity DROP COLUMN obsolete; +ALTER TABLE bulkload DROP COLUMN createdby_id; +ALTER TABLE bulkload DROP COLUMN updatedby_id; +ALTER TABLE bulkload DROP COLUMN datecreated; +ALTER TABLE bulkload DROP COLUMN dateupdated; +ALTER TABLE bulkload DROP COLUMN dbdatecreated; +ALTER TABLE bulkload DROP COLUMN dbdateupdated; +ALTER TABLE bulkload DROP COLUMN internal; +ALTER TABLE bulkload DROP COLUMN obsolete; +ALTER TABLE bulkloadfile DROP COLUMN createdby_id; +ALTER TABLE bulkloadfile DROP COLUMN updatedby_id; +ALTER TABLE bulkloadfile DROP COLUMN datecreated; +ALTER TABLE bulkloadfile DROP COLUMN dateupdated; +ALTER TABLE bulkloadfile DROP COLUMN dbdatecreated; +ALTER TABLE bulkloadfile DROP COLUMN dbdateupdated; +ALTER TABLE bulkloadfile DROP COLUMN internal; +ALTER TABLE bulkloadfile DROP COLUMN obsolete; +ALTER TABLE bulkloadfileexception DROP COLUMN createdby_id; +ALTER TABLE bulkloadfileexception DROP COLUMN updatedby_id; +ALTER TABLE bulkloadfileexception DROP COLUMN datecreated; +ALTER TABLE bulkloadfileexception DROP COLUMN dateupdated; +ALTER TABLE bulkloadfileexception DROP COLUMN dbdatecreated; +ALTER TABLE bulkloadfileexception DROP COLUMN dbdateupdated; +ALTER TABLE bulkloadfileexception DROP COLUMN internal; +ALTER TABLE bulkloadfileexception DROP COLUMN obsolete; +ALTER TABLE bulkloadfilehistory DROP COLUMN createdby_id; +ALTER TABLE bulkloadfilehistory DROP COLUMN updatedby_id; +ALTER TABLE bulkloadfilehistory DROP COLUMN datecreated; +ALTER TABLE bulkloadfilehistory DROP COLUMN dateupdated; +ALTER TABLE bulkloadfilehistory DROP COLUMN dbdatecreated; +ALTER TABLE bulkloadfilehistory DROP COLUMN dbdateupdated; +ALTER TABLE bulkloadfilehistory DROP COLUMN internal; +ALTER TABLE bulkloadfilehistory DROP COLUMN obsolete; +ALTER TABLE bulkloadgroup DROP COLUMN createdby_id; +ALTER TABLE bulkloadgroup DROP COLUMN updatedby_id; +ALTER TABLE bulkloadgroup DROP COLUMN datecreated; +ALTER TABLE bulkloadgroup DROP COLUMN dateupdated; +ALTER TABLE bulkloadgroup DROP COLUMN dbdatecreated; +ALTER TABLE bulkloadgroup DROP COLUMN dbdateupdated; +ALTER TABLE bulkloadgroup DROP COLUMN internal; +ALTER TABLE bulkloadgroup DROP COLUMN obsolete; ALTER TABLE bspoterm DROP COLUMN curie; ALTER TABLE chebiterm DROP COLUMN curie; ALTER TABLE chemicalterm DROP COLUMN curie; ALTER TABLE clterm DROP COLUMN curie; ALTER TABLE cmoterm DROP COLUMN curie; ALTER TABLE conditionrelation DROP COLUMN singlereference_curie; +ALTER TABLE conditionrelation DROP COLUMN createdby_id; +ALTER TABLE conditionrelation DROP COLUMN updatedby_id; +ALTER TABLE conditionrelation DROP COLUMN datecreated; +ALTER TABLE conditionrelation DROP COLUMN dateupdated; +ALTER TABLE conditionrelation DROP COLUMN dbdatecreated; +ALTER TABLE conditionrelation DROP COLUMN dbdateupdated; +ALTER TABLE conditionrelation DROP COLUMN internal; +ALTER TABLE conditionrelation DROP COLUMN obsolete; ALTER TABLE construct_reference DROP COLUMN references_curie; ALTER TABLE constructcomponentslotannotation DROP COLUMN taxon_curie; ALTER TABLE constructgenomicentityassociation DROP COLUMN object_curie; +ALTER TABLE crossreference DROP COLUMN createdby_id; +ALTER TABLE crossreference DROP COLUMN updatedby_id; +ALTER TABLE crossreference DROP COLUMN datecreated; +ALTER TABLE crossreference DROP COLUMN dateupdated; +ALTER TABLE crossreference DROP COLUMN dbdatecreated; +ALTER TABLE crossreference DROP COLUMN dbdateupdated; +ALTER TABLE crossreference DROP COLUMN internal; +ALTER TABLE crossreference DROP COLUMN obsolete; ALTER TABLE daoterm DROP COLUMN curie; +ALTER TABLE dataprovider DROP COLUMN createdby_id; +ALTER TABLE dataprovider DROP COLUMN updatedby_id; +ALTER TABLE dataprovider DROP COLUMN datecreated; +ALTER TABLE dataprovider DROP COLUMN dateupdated; +ALTER TABLE dataprovider DROP COLUMN dbdatecreated; +ALTER TABLE dataprovider DROP COLUMN dbdateupdated; +ALTER TABLE dataprovider DROP COLUMN internal; +ALTER TABLE dataprovider DROP COLUMN obsolete; ALTER TABLE diseaseannotation DROP COLUMN object_curie; ALTER TABLE diseaseannotation_biologicalentity DROP COLUMN diseasegeneticmodifiers_curie; ALTER TABLE diseaseannotation_ecoterm DROP COLUMN evidencecodes_curie; @@ -1697,6 +1781,14 @@ ALTER TABLE experimentalcondition DROP COLUMN conditionclass_curie; ALTER TABLE experimentalcondition DROP COLUMN conditiongeneontology_curie; ALTER TABLE experimentalcondition DROP COLUMN conditionid_curie; ALTER TABLE experimentalcondition DROP COLUMN conditiontaxon_curie; +ALTER TABLE experimentalcondition DROP COLUMN createdby_id; +ALTER TABLE experimentalcondition DROP COLUMN updatedby_id; +ALTER TABLE experimentalcondition DROP COLUMN datecreated; +ALTER TABLE experimentalcondition DROP COLUMN dateupdated; +ALTER TABLE experimentalcondition DROP COLUMN dbdatecreated; +ALTER TABLE experimentalcondition DROP COLUMN dbdateupdated; +ALTER TABLE experimentalcondition DROP COLUMN internal; +ALTER TABLE experimentalcondition DROP COLUMN obsolete; ALTER TABLE experimentalconditionontologyterm DROP COLUMN curie; ALTER TABLE fbdvterm DROP COLUMN curie; ALTER TABLE gene DROP COLUMN curie; @@ -1714,9 +1806,25 @@ ALTER TABLE genetogeneorthologycurated DROP COLUMN singlereference_curie; ALTER TABLE genetogeneorthologycurated DROP COLUMN evidencecode_curie; ALTER TABLE genomicentity DROP COLUMN curie; ALTER TABLE genomicentity_crossreference DROP COLUMN genomicentity_curie; +ALTER TABLE genetogeneorthology DROP COLUMN createdby_id; +ALTER TABLE genetogeneorthology DROP COLUMN updatedby_id; +ALTER TABLE genetogeneorthology DROP COLUMN datecreated; +ALTER TABLE genetogeneorthology DROP COLUMN dateupdated; +ALTER TABLE genetogeneorthology DROP COLUMN dbdatecreated; +ALTER TABLE genetogeneorthology DROP COLUMN dbdateupdated; +ALTER TABLE genetogeneorthology DROP COLUMN internal; +ALTER TABLE genetogeneorthology DROP COLUMN obsolete; ALTER TABLE goterm DROP COLUMN curie; ALTER TABLE hpterm DROP COLUMN curie; ALTER TABLE informationcontententity DROP COLUMN curie; +ALTER TABLE informationcontententity DROP COLUMN createdby_id; +ALTER TABLE informationcontententity DROP COLUMN updatedby_id; +ALTER TABLE informationcontententity DROP COLUMN datecreated; +ALTER TABLE informationcontententity DROP COLUMN dateupdated; +ALTER TABLE informationcontententity DROP COLUMN dbdatecreated; +ALTER TABLE informationcontententity DROP COLUMN dbdateupdated; +ALTER TABLE informationcontententity DROP COLUMN internal; +ALTER TABLE informationcontententity DROP COLUMN obsolete; ALTER TABLE materm DROP COLUMN curie; ALTER TABLE miterm DROP COLUMN curie; ALTER TABLE mmoterm DROP COLUMN curie; @@ -1726,9 +1834,25 @@ ALTER TABLE molecule DROP COLUMN curie; ALTER TABLE mpathterm DROP COLUMN curie; ALTER TABLE mpterm DROP COLUMN curie; ALTER TABLE ncbitaxonterm DROP COLUMN curie; +ALTER TABLE note DROP COLUMN createdby_id; +ALTER TABLE note DROP COLUMN updatedby_id; +ALTER TABLE note DROP COLUMN datecreated; +ALTER TABLE note DROP COLUMN dateupdated; +ALTER TABLE note DROP COLUMN dbdatecreated; +ALTER TABLE note DROP COLUMN dbdateupdated; +ALTER TABLE note DROP COLUMN internal; +ALTER TABLE note DROP COLUMN obsolete; ALTER TABLE note_reference DROP COLUMN references_curie; ALTER TABLE obiterm DROP COLUMN curie; ALTER TABLE ontologyterm DROP COLUMN curie; +ALTER TABLE ontologyterm DROP COLUMN createdby_id; +ALTER TABLE ontologyterm DROP COLUMN updatedby_id; +ALTER TABLE ontologyterm DROP COLUMN datecreated; +ALTER TABLE ontologyterm DROP COLUMN dateupdated; +ALTER TABLE ontologyterm DROP COLUMN dbdatecreated; +ALTER TABLE ontologyterm DROP COLUMN dbdateupdated; +ALTER TABLE ontologyterm DROP COLUMN internal; +ALTER TABLE ontologyterm DROP COLUMN obsolete; ALTER TABLE ontologyterm_crossreference DROP COLUMN ontologyterm_curie; ALTER TABLE ontologyterm_definitionurls DROP COLUMN ontologyterm_curie; ALTER TABLE ontologyterm_isa_ancestor_descendant DROP COLUMN isadescendants_curie; @@ -1738,23 +1862,123 @@ ALTER TABLE ontologyterm_isa_parent_children DROP COLUMN isaparents_curie; ALTER TABLE ontologyterm_secondaryidentifiers DROP COLUMN ontologyterm_curie; ALTER TABLE ontologyterm_subsets DROP COLUMN ontologyterm_curie; ALTER TABLE ontologyterm_synonym DROP COLUMN ontologyterm_curie; +ALTER TABLE organization DROP COLUMN createdby_id; +ALTER TABLE organization DROP COLUMN updatedby_id; +ALTER TABLE organization DROP COLUMN datecreated; +ALTER TABLE organization DROP COLUMN dateupdated; +ALTER TABLE organization DROP COLUMN dbdatecreated; +ALTER TABLE organization DROP COLUMN dbdateupdated; +ALTER TABLE organization DROP COLUMN internal; +ALTER TABLE organization DROP COLUMN obsolete; ALTER TABLE patoterm DROP COLUMN curie; ALTER TABLE phenotypeterm DROP COLUMN curie; +ALTER TABLE person DROP COLUMN createdby_id; +ALTER TABLE person DROP COLUMN updatedby_id; +ALTER TABLE person DROP COLUMN datecreated; +ALTER TABLE person DROP COLUMN dateupdated; +ALTER TABLE person DROP COLUMN dbdatecreated; +ALTER TABLE person DROP COLUMN dbdateupdated; +ALTER TABLE person DROP COLUMN internal; +ALTER TABLE person DROP COLUMN obsolete; +ALTER TABLE personsetting DROP COLUMN createdby_id; +ALTER TABLE personsetting DROP COLUMN updatedby_id; +ALTER TABLE personsetting DROP COLUMN datecreated; +ALTER TABLE personsetting DROP COLUMN dateupdated; +ALTER TABLE personsetting DROP COLUMN dbdatecreated; +ALTER TABLE personsetting DROP COLUMN dbdateupdated; +ALTER TABLE personsetting DROP COLUMN internal; +ALTER TABLE personsetting DROP COLUMN obsolete; ALTER TABLE pwterm DROP COLUMN curie; +ALTER TABLE reagent DROP COLUMN curie; +ALTER TABLE reagent DROP COLUMN modentityid; +ALTER TABLE reagent DROP COLUMN modinternalid; +ALTER TABLE reagent DROP COLUMN dataprovider_id; +ALTER TABLE reagent DROP COLUMN createdby_id; +ALTER TABLE reagent DROP COLUMN updatedby_id; +ALTER TABLE reagent DROP COLUMN datecreated; +ALTER TABLE reagent DROP COLUMN dateupdated; +ALTER TABLE reagent DROP COLUMN dbdatecreated; +ALTER TABLE reagent DROP COLUMN dbdateupdated; +ALTER TABLE reagent DROP COLUMN internal; +ALTER TABLE reagent DROP COLUMN obsolete; ALTER TABLE reference DROP COLUMN curie; ALTER TABLE reference_crossreference DROP COLUMN reference_curie; +ALTER TABLE resourcedescriptor DROP COLUMN createdby_id; +ALTER TABLE resourcedescriptor DROP COLUMN updatedby_id; +ALTER TABLE resourcedescriptor DROP COLUMN datecreated; +ALTER TABLE resourcedescriptor DROP COLUMN dateupdated; +ALTER TABLE resourcedescriptor DROP COLUMN dbdatecreated; +ALTER TABLE resourcedescriptor DROP COLUMN dbdateupdated; +ALTER TABLE resourcedescriptor DROP COLUMN internal; +ALTER TABLE resourcedescriptor DROP COLUMN obsolete; +ALTER TABLE resourcedescriptorpage DROP COLUMN createdby_id; +ALTER TABLE resourcedescriptorpage DROP COLUMN updatedby_id; +ALTER TABLE resourcedescriptorpage DROP COLUMN datecreated; +ALTER TABLE resourcedescriptorpage DROP COLUMN dateupdated; +ALTER TABLE resourcedescriptorpage DROP COLUMN dbdatecreated; +ALTER TABLE resourcedescriptorpage DROP COLUMN dbdateupdated; +ALTER TABLE resourcedescriptorpage DROP COLUMN internal; +ALTER TABLE resourcedescriptorpage DROP COLUMN obsolete; ALTER TABLE roterm DROP COLUMN curie; ALTER TABLE rsterm DROP COLUMN curie; ALTER TABLE singlereferenceassociation DROP COLUMN singlereference_curie; +ALTER TABLE slotannotation DROP COLUMN createdby_id; +ALTER TABLE slotannotation DROP COLUMN updatedby_id; +ALTER TABLE slotannotation DROP COLUMN datecreated; +ALTER TABLE slotannotation DROP COLUMN dateupdated; +ALTER TABLE slotannotation DROP COLUMN dbdatecreated; +ALTER TABLE slotannotation DROP COLUMN dbdateupdated; +ALTER TABLE slotannotation DROP COLUMN internal; +ALTER TABLE slotannotation DROP COLUMN obsolete; ALTER TABLE slotannotation_informationcontententity DROP COLUMN evidence_curie; ALTER TABLE soterm DROP COLUMN curie; ALTER TABLE species DROP COLUMN taxon_curie; +ALTER TABLE species DROP COLUMN createdby_id; +ALTER TABLE species DROP COLUMN updatedby_id; +ALTER TABLE species DROP COLUMN datecreated; +ALTER TABLE species DROP COLUMN dateupdated; +ALTER TABLE species DROP COLUMN dbdatecreated; +ALTER TABLE species DROP COLUMN dbdateupdated; +ALTER TABLE species DROP COLUMN internal; +ALTER TABLE species DROP COLUMN obsolete; ALTER TABLE stageterm DROP COLUMN curie; +ALTER TABLE synonym DROP COLUMN createdby_id; +ALTER TABLE synonym DROP COLUMN updatedby_id; +ALTER TABLE synonym DROP COLUMN datecreated; +ALTER TABLE synonym DROP COLUMN dateupdated; +ALTER TABLE synonym DROP COLUMN dbdatecreated; +ALTER TABLE synonym DROP COLUMN dbdateupdated; +ALTER TABLE synonym DROP COLUMN internal; +ALTER TABLE synonym DROP COLUMN obsolete; ALTER TABLE uberonterm DROP COLUMN curie; ALTER TABLE variant DROP COLUMN curie; ALTER TABLE variant DROP COLUMN varianttype_curie; ALTER TABLE variant DROP COLUMN sourcegeneralconsequence_curie; ALTER TABLE variant_note DROP COLUMN variant_curie; +ALTER TABLE vocabulary DROP COLUMN createdby_id; +ALTER TABLE vocabulary DROP COLUMN updatedby_id; +ALTER TABLE vocabulary DROP COLUMN datecreated; +ALTER TABLE vocabulary DROP COLUMN dateupdated; +ALTER TABLE vocabulary DROP COLUMN dbdatecreated; +ALTER TABLE vocabulary DROP COLUMN dbdateupdated; +ALTER TABLE vocabulary DROP COLUMN internal; +ALTER TABLE vocabulary DROP COLUMN obsolete; +ALTER TABLE vocabularyterm DROP COLUMN createdby_id; +ALTER TABLE vocabularyterm DROP COLUMN updatedby_id; +ALTER TABLE vocabularyterm DROP COLUMN datecreated; +ALTER TABLE vocabularyterm DROP COLUMN dateupdated; +ALTER TABLE vocabularyterm DROP COLUMN dbdatecreated; +ALTER TABLE vocabularyterm DROP COLUMN dbdateupdated; +ALTER TABLE vocabularyterm DROP COLUMN internal; +ALTER TABLE vocabularyterm DROP COLUMN obsolete; +ALTER TABLE vocabularytermset DROP COLUMN createdby_id; +ALTER TABLE vocabularytermset DROP COLUMN updatedby_id; +ALTER TABLE vocabularytermset DROP COLUMN datecreated; +ALTER TABLE vocabularytermset DROP COLUMN dateupdated; +ALTER TABLE vocabularytermset DROP COLUMN dbdatecreated; +ALTER TABLE vocabularytermset DROP COLUMN dbdateupdated; +ALTER TABLE vocabularytermset DROP COLUMN internal; +ALTER TABLE vocabularytermset DROP COLUMN obsolete; ALTER TABLE vtterm DROP COLUMN curie; ALTER TABLE wbbtterm DROP COLUMN curie; ALTER TABLE wblsterm DROP COLUMN curie; @@ -1803,6 +2027,7 @@ ALTER TABLE apoterm_aud DROP COLUMN curie; ALTER TABLE atpterm_aud DROP COLUMN curie; ALTER TABLE biologicalentity_aud DROP COLUMN curie; ALTER TABLE biologicalentity_aud DROP COLUMN taxon_curie; +ALTER TABLE biologicalentity_aud DROP COLUMN dataprovider_id; ALTER TABLE bspoterm_aud DROP COLUMN curie; ALTER TABLE chebiterm_aud DROP COLUMN curie; ALTER TABLE chemicalterm_aud DROP COLUMN curie; @@ -1872,6 +2097,10 @@ ALTER TABLE ontologyterm_synonym_aud DROP COLUMN ontologyterm_curie; ALTER TABLE patoterm_aud DROP COLUMN curie; ALTER TABLE phenotypeterm_aud DROP COLUMN curie; ALTER TABLE pwterm_aud DROP COLUMN curie; +ALTER TABLE reagent_aud DROP COLUMN curie; +ALTER TABLE reagent_aud DROP COLUMN modentityid; +ALTER TABLE reagent_aud DROP COLUMN modinternalid; +ALTER TABLE reagent_aud DROP COLUMN dataprovider_id; ALTER TABLE reference_aud DROP COLUMN curie; ALTER TABLE reference_crossreference_aud DROP COLUMN reference_curie; ALTER TABLE roterm_aud DROP COLUMN curie; From c4f8e5a0eb4151b30b6db06a833c3744842562d1 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 21 Dec 2023 12:11:00 +0000 Subject: [PATCH 012/159] Some fixes and logging --- .../slotAnnotations/NameSlotAnnotation.java | 1 - .../SecondaryIdSlotAnnotation.java | 1 - .../slotAnnotations/SlotAnnotation.java | 1 - .../DiseaseAnnotationUniqueIdHelper.java | 3 +- .../AGMDiseaseAnnotationValidator.java | 2 + .../AlleleDiseaseAnnotationValidator.java | 2 + .../services/validation/AlleleValidator.java | 38 +++++++++---------- .../ConditionRelationValidator.java | 2 + .../ExperimentalConditionValidator.java | 2 + .../GeneDiseaseAnnotationValidator.java | 2 + .../dto/AnnotationDTOValidator.java | 2 +- .../crud/controllers/ConstructITCase.java | 36 ++++++++++++------ .../crud/controllers/VariantITCase.java | 8 ++-- .../AlleleGeneAssociationITCase.java | 4 +- 14 files changed, 62 insertions(+), 42 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/NameSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/NameSlotAnnotation.java index 2bb5abb5d..279d25e67 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/NameSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/NameSlotAnnotation.java @@ -33,7 +33,6 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotation.class }) @Schema(name = "NameSlotAnnotation", description = "POJO representing a name slot annotation") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SecondaryIdSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SecondaryIdSlotAnnotation.java index 4b437ac2d..6a55f1b32 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SecondaryIdSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SecondaryIdSlotAnnotation.java @@ -24,7 +24,6 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.7.2", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotation.class }) @Schema(name = "SecondaryIdSlotAnnotation", description = "POJO representing a scondary ID slot annotation") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java index 4f0aa4c4b..23658c5f4 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java @@ -29,7 +29,6 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @Schema(name = "SlotAnnotation", description = "POJO that represents a SlotAnnotation") @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java index fc9b6399b..1c81cd155 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java @@ -64,7 +64,8 @@ public static String getDiseaseAnnotationUniqueId(DiseaseAnnotationDTO annotatio uniqueId.addList(annotationDTO.getConditionRelationDtos().stream().map(conditionDTO -> { UniqueIdGeneratorHelper gen = new UniqueIdGeneratorHelper(); gen.add(conditionDTO.getConditionRelationTypeName()); - gen.add(conditionDTO.getConditionDtos().stream().map(DiseaseAnnotationUniqueIdHelper::getExperimentalConditionUniqueId).collect(Collectors.joining(DELIMITER))); + if (CollectionUtils.isNotEmpty(conditionDTO.getConditionDtos())) + gen.add(conditionDTO.getConditionDtos().stream().map(DiseaseAnnotationUniqueIdHelper::getExperimentalConditionUniqueId).collect(Collectors.joining(DELIMITER))); return gen.getUniqueId(); }).collect(Collectors.toList())); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java index 0e268678d..9de72aac8 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java @@ -21,6 +21,7 @@ import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -93,6 +94,7 @@ public AGMDiseaseAnnotation validateAnnotation(AGMDiseaseAnnotation uiEntity, AG dbEntity = (AGMDiseaseAnnotation) validateCommonDiseaseAnnotationFields(uiEntity, dbEntity); if (response.hasErrors()) { + Log.info("ERROR: " + response.getErrorMessages()); response.setErrorMessage(errorMessage); throw new ApiErrorException(response); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java index 1500236c4..a9fa57e96 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java @@ -19,6 +19,7 @@ import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -82,6 +83,7 @@ public AlleleDiseaseAnnotation validateAnnotation(AlleleDiseaseAnnotation uiEnti dbEntity = (AlleleDiseaseAnnotation) validateCommonDiseaseAnnotationFields(uiEntity, dbEntity); if (response.hasErrors()) { + Log.info("ERROR: " + response.getErrorMessages()); response.setErrorMessage(errorMessage); throw new ApiErrorException(response); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java index 81d93a1f4..53bec6591 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java @@ -152,13 +152,13 @@ public Allele validateAllele(Allele uiEntity, Allele dbEntity, Boolean updateAll AlleleFullNameSlotAnnotation fullName = validateAlleleFullName(uiEntity, dbEntity); AlleleGermlineTransmissionStatusSlotAnnotation germlineTransmissionStatus = validateAlleleGermlineTransmissionStatus(uiEntity, dbEntity); AlleleDatabaseStatusSlotAnnotation databaseStatus = validateAlleleDatabaseStatus(uiEntity, dbEntity); - List nomenclatureEvents = validateAlleleNomenclatureEvents(uiEntity, dbEntity); List synonyms = validateAlleleSynonyms(uiEntity, dbEntity); List secondaryIds = validateAlleleSecondaryIds(uiEntity, dbEntity); - List mutationTypes = validateAlleleMutationTypes(uiEntity, dbEntity); List inheritanceModes = validateAlleleInheritanceModes(uiEntity, dbEntity); List functionalImpacts = validateAlleleFunctionalImpacts(uiEntity, dbEntity); - + List mutationTypes = validateAlleleMutationTypes(uiEntity, dbEntity); + List nomenclatureEvents = validateAlleleNomenclatureEvents(uiEntity, dbEntity); + List geneAssociations = null; if (updateAllAssociations) { // This should contain logic for all fields only returned in AlleleDetailView geneAssociations = validateAlleleGeneAssociations(uiEntity, dbEntity); @@ -189,14 +189,6 @@ public Allele validateAllele(Allele uiEntity, Allele dbEntity, Boolean updateAll databaseStatus.setSingleAllele(dbEntity); dbEntity.setAlleleDatabaseStatus(databaseStatus); - if (dbEntity.getAlleleNomenclatureEvents() != null) - dbEntity.getAlleleNomenclatureEvents().clear(); - if (nomenclatureEvents != null) { - if (dbEntity.getAlleleNomenclatureEvents() == null) - dbEntity.setAlleleNomenclatureEvents(new ArrayList<>()); - dbEntity.getAlleleNomenclatureEvents().addAll(nomenclatureEvents); - } - if (dbEntity.getAlleleSynonyms() != null) dbEntity.getAlleleSynonyms().clear(); if (synonyms != null) { @@ -213,14 +205,6 @@ public Allele validateAllele(Allele uiEntity, Allele dbEntity, Boolean updateAll dbEntity.getAlleleSecondaryIds().addAll(secondaryIds); } - if (dbEntity.getAlleleMutationTypes() != null) - dbEntity.getAlleleMutationTypes().clear(); - if (mutationTypes != null) { - if (dbEntity.getAlleleMutationTypes() == null) - dbEntity.setAlleleMutationTypes(new ArrayList<>()); - dbEntity.getAlleleMutationTypes().addAll(mutationTypes); - } - if (dbEntity.getAlleleInheritanceModes() != null) dbEntity.getAlleleInheritanceModes().clear(); if (inheritanceModes != null) { @@ -237,6 +221,22 @@ public Allele validateAllele(Allele uiEntity, Allele dbEntity, Boolean updateAll dbEntity.getAlleleFunctionalImpacts().addAll(functionalImpacts); } + if (dbEntity.getAlleleMutationTypes() != null) + dbEntity.getAlleleMutationTypes().clear(); + if (mutationTypes != null) { + if (dbEntity.getAlleleMutationTypes() == null) + dbEntity.setAlleleMutationTypes(new ArrayList<>()); + dbEntity.getAlleleMutationTypes().addAll(mutationTypes); + } + + if (dbEntity.getAlleleNomenclatureEvents() != null) + dbEntity.getAlleleNomenclatureEvents().clear(); + if (nomenclatureEvents != null) { + if (dbEntity.getAlleleNomenclatureEvents() == null) + dbEntity.setAlleleNomenclatureEvents(new ArrayList<>()); + dbEntity.getAlleleNomenclatureEvents().addAll(nomenclatureEvents); + } + if (updateAllAssociations) { // This should contain logic for all fields only returned in AlleleDetailView if (dbEntity.getAlleleGeneAssociations() != null) dbEntity.getAlleleGeneAssociations().clear(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java index 222cb6688..91394d407 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java @@ -24,6 +24,7 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -116,6 +117,7 @@ public ConditionRelation validateConditionRelation(ConditionRelation uiEntity, C if (response.hasErrors()) { if (throwError) { + Log.info("ERROR: " + response.getErrorMessages()); response.setErrorMessage(errorMessage); throw new ApiErrorException(response); } else { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java index 4c749a112..c91a60a76 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java @@ -25,6 +25,7 @@ import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.lang3.ObjectUtils; +import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -117,6 +118,7 @@ public ExperimentalCondition validateExperimentalCondition(ExperimentalCondition if (response.hasErrors()) { response.setErrorMessage(errorMessage); + Log.info("ERROR: " + response.getErrorMessages()); throw new ApiErrorException(response); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java index e56f61001..173506cce 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java @@ -14,6 +14,7 @@ import org.alliancegenome.curation_api.services.VocabularyTermService; import org.apache.commons.lang3.ObjectUtils; +import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -75,6 +76,7 @@ public GeneDiseaseAnnotation validateAnnotation(GeneDiseaseAnnotation uiEntity, if (response.hasErrors()) { response.setErrorMessage(errorMessage); + Log.info("ERROR: " + response.getErrorMessages()); throw new ApiErrorException(response); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AnnotationDTOValidator.java index eb2429177..f69d876fa 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AnnotationDTOValidator.java @@ -108,7 +108,7 @@ public ObjectResponse validat List relations = new ArrayList<>(); for (ConditionRelationDTO conditionRelationDTO : dto.getConditionRelationDtos()) { if (StringUtils.isNotBlank(conditionRelationDTO.getHandle())) { - if (!conditionRelationDTO.getReferenceCurie().equals(dto.getReferenceCurie())) { + if (!StringUtils.equals(conditionRelationDTO.getReferenceCurie(), dto.getReferenceCurie())) { annotResponse.addErrorMessage("condition_relation_dtos - reference_curie", ValidationConstants.INVALID_MESSAGE + " (" + conditionRelationDTO.getReferenceCurie() + ")"); } } diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java index de47931a6..7d3a4bdbb 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java @@ -164,7 +164,7 @@ public void createValidConstruct() { RestAssured.given(). when(). - get("/api/construct/findBy/" + CONSTRUCT). + get("/api/construct/" + CONSTRUCT). then(). statusCode(200). body("entity.modEntityId", is(CONSTRUCT)). @@ -270,7 +270,7 @@ public void editConstruct() { RestAssured.given(). when(). - get("/api/construct/findBy/" + CONSTRUCT). + get("/api/construct/" + CONSTRUCT). then(). statusCode(200). body("entity.modEntityId", is(CONSTRUCT)). @@ -329,7 +329,8 @@ public void createConstructWithMissingRequiredFieldsLevel1() { post("/api/construct"). then(). statusCode(400). - body("errorMessages", is(aMapWithSize(1))). + body("errorMessages", is(aMapWithSize(2))). + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")). body("errorMessages.constructSymbol", is(ValidationConstants.REQUIRED_MESSAGE)); } @@ -339,6 +340,7 @@ public void editConstructWithMissingRequiredFieldsLevel1() { Construct construct = getConstruct(CONSTRUCT); construct.setConstructSymbol(null); construct.setDataProvider(null); + construct.setModEntityId(null); RestAssured.given(). contentType("application/json"). @@ -347,8 +349,9 @@ public void editConstructWithMissingRequiredFieldsLevel1() { put("/api/construct"). then(). statusCode(400). - body("errorMessages", is(aMapWithSize(2))). + body("errorMessages", is(aMapWithSize(3))). body("errorMessages.constructSymbol", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")). body("errorMessages.dataProvider", is(ValidationConstants.REQUIRED_MESSAGE)); } @@ -357,6 +360,7 @@ public void editConstructWithMissingRequiredFieldsLevel1() { public void createConstructWithMissingRequiredFieldsLevel2() { Construct construct = new Construct(); construct.setDataProvider(dataProvider); + construct.setModEntityId("Construct:0005"); ConstructComponentSlotAnnotation invalidComponent = new ConstructComponentSlotAnnotation(); ConstructSymbolSlotAnnotation invalidSymbol = new ConstructSymbolSlotAnnotation(); @@ -443,6 +447,7 @@ public void editConstructWithMissingRequiredFieldsLevel2() { public void createConstructWithEmptyRequiredFields() { Construct construct = new Construct(); + construct.setModInternalId(""); construct.setDataProvider(dataProvider); ConstructComponentSlotAnnotation invalidComponent = createConstructComponentSlotAnnotation(isRegulatedByRelation, List.of(reference), "", taxon, "C. elegans", List.of(relatedNote)); construct.setConstructComponents(List.of(invalidComponent)); @@ -459,7 +464,8 @@ public void createConstructWithEmptyRequiredFields() { post("/api/construct"). then(). statusCode(400). - body("errorMessages", is(aMapWithSize(4))). + body("errorMessages", is(aMapWithSize(5))). + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")). body("errorMessages.constructSymbol", is(String.join(" | ", List.of( "displayText - " + ValidationConstants.REQUIRED_MESSAGE, "formatText - " + ValidationConstants.REQUIRED_MESSAGE)))). @@ -476,6 +482,8 @@ public void createConstructWithEmptyRequiredFields() { @Order(8) public void editConstructWithEmptyRequiredFields() { Construct construct = getConstruct(CONSTRUCT); + construct.setModEntityId(""); + construct.setModInternalId(""); ConstructComponentSlotAnnotation component = construct.getConstructComponents().get(0); component.setComponentSymbol(""); construct.setConstructComponents(List.of(component)); @@ -496,7 +504,8 @@ public void editConstructWithEmptyRequiredFields() { put("/api/construct"). then(). statusCode(400). - body("errorMessages", is(aMapWithSize(4))). + body("errorMessages", is(aMapWithSize(5))). + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")). body("errorMessages.constructSymbol", is(String.join(" | ", List.of( "displayText - " + ValidationConstants.REQUIRED_MESSAGE, "formatText - " + ValidationConstants.REQUIRED_MESSAGE)))). @@ -533,7 +542,7 @@ public void createConstructWithInvalidFields() { Construct construct = new Construct(); - construct.setModEntityId(CONSTRUCT); + construct.setModEntityId("Construct:0009"); construct.setReferences(List.of(nonPersistedReference)); construct.setDateCreated(datetime); construct.setDataProvider(invalidDataProvider); @@ -662,7 +671,7 @@ public void createConstructWithObsoleteFields() { ConstructSynonymSlotAnnotation obsoleteSynonym = createConstructSynonymSlotAnnotation(List.of(obsoleteReference), "Test synonym", obsoleteNameType, obsoleteSynonymScope, "https://test.org"); Construct construct = new Construct(); - construct.setModEntityId(CONSTRUCT); + construct.setModEntityId("Construct:0011"); construct.setReferences(List.of(obsoleteReference)); construct.setDateCreated(datetime); construct.setDataProvider(obsoleteDataProvider); @@ -803,7 +812,7 @@ public void editConstructWithNullNonRequiredFieldsLevel2() { RestAssured.given(). when(). - get("/api/construct/findBy/" + CONSTRUCT). + get("/api/construct/" + CONSTRUCT). then(). statusCode(200). body("entity", hasKey("constructComponents")). @@ -844,7 +853,7 @@ public void editConstructWithNullNonRequiredFieldsLevel1() { RestAssured.given(). when(). - get("/api/construct/findBy/" + CONSTRUCT). + get("/api/construct/" + CONSTRUCT). then(). statusCode(200). body("entity", not(hasKey("constructComponents"))). @@ -860,6 +869,7 @@ public void createConstructWithOnlyRequiredFieldsLevel1() { Construct construct = new Construct(); construct.setConstructSymbol(constructSymbol); construct.setDataProvider(dataProvider); + construct.setModEntityId("Construct:0015"); RestAssured.given(). contentType("application/json"). @@ -876,6 +886,7 @@ public void createConstructWithOnlyRequiredFieldsLevel2() { Construct construct = new Construct(); construct.setConstructSymbol(constructSymbol); construct.setDataProvider(dataProvider); + construct.setModEntityId("Construct:0016"); ConstructComponentSlotAnnotation minimalComponent = createConstructComponentSlotAnnotation(isRegulatedByRelation, null, "minimalCmp", null, null, null); ConstructSymbolSlotAnnotation minimalConstructSymbol = createConstructSymbolSlotAnnotation(null, "Test symbol", symbolNameType, null, null); @@ -902,6 +913,7 @@ public void createConstructWithDuplicateNote() { Construct construct = new Construct(); construct.setConstructSymbol(constructSymbol); construct.setDataProvider(dataProvider); + construct.setModEntityId("Construct:0017"); ConstructComponentSlotAnnotation component = createConstructComponentSlotAnnotation(isRegulatedByRelation, null, "dnCmp", null, null, List.of(relatedNote, relatedNote)); construct.setConstructComponents(List.of(component)); @@ -938,7 +950,7 @@ public void updateConstructWithNewAssociations() { RestAssured.given(). when(). - get("/api/construct/findBy/" + CONSTRUCT). + get("/api/construct/" + CONSTRUCT). then(). statusCode(200). body("entity", hasKey("constructGenomicEntityAssociations")). @@ -962,7 +974,7 @@ public void updateConstructRemoveAssociations() { RestAssured.given(). when(). - get("/api/construct/findBy/" + CONSTRUCT). + get("/api/construct/" + CONSTRUCT). then(). statusCode(200). body("entity", not(hasKey("constructGenomicEntityAssociations"))); diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/VariantITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/VariantITCase.java index 6e5881685..89433bf2a 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/VariantITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/VariantITCase.java @@ -215,7 +215,7 @@ public void createVariantWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")). + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")). body("errorMessages.taxon", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.variantType", is(ValidationConstants.REQUIRED_MESSAGE)); } @@ -234,7 +234,7 @@ public void editVariantWithMissingModEntityId() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); } @Test @@ -273,7 +273,7 @@ public void createVariantWithEmptyRequiredFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); } @Test @@ -290,7 +290,7 @@ public void editVariantWithEmptyModEntityId() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); } @Test diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java index 1b3a1c8e3..24f5fd302 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java @@ -137,7 +137,7 @@ public void createValidAlleleGeneAssociation() { RestAssured.given(). when(). - get(alleleGetEndpoint + allele.getCurie()). + get(alleleGetEndpoint + allele.getModEntityId()). then(). statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). @@ -147,7 +147,7 @@ public void createValidAlleleGeneAssociation() { RestAssured.given(). when(). - get(geneGetEndpoint + gene.getCurie()). + get(geneGetEndpoint + gene.getModEntityId()). then(). statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). From 416c5b0d8dec21c3e3a70bd205c680e8307b02b1 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 21 Dec 2023 16:47:40 +0000 Subject: [PATCH 013/159] Validation updates --- .../AGMDiseaseAnnotationValidator.java | 23 +++++++---- .../AlleleDiseaseAnnotationValidator.java | 14 +++++-- .../DiseaseAnnotationValidator.java | 20 ++++++--- .../ExperimentalConditionValidator.java | 41 +++++++++++-------- .../GeneDiseaseAnnotationValidator.java | 12 ++++-- .../services/validation/GeneValidator.java | 11 +++-- .../services/validation/VariantValidator.java | 17 ++++---- .../AlleleGeneAssociationValidator.java | 12 ++++-- ...leleGenomicEntityAssociationValidator.java | 7 +++- ...ructGenomicEntityAssociationValidator.java | 8 +++- .../SlotAnnotationValidator.java | 23 +++++++---- ...nctionalImpactSlotAnnotationValidator.java | 7 +++- ...leMutationTypeSlotAnnotationValidator.java | 4 +- .../v0.30.0.1__linkml_v2.0.0_update.sql | 1 + 14 files changed, 127 insertions(+), 73 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java index 9de72aac8..0e701b1ca 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java @@ -19,7 +19,6 @@ import org.alliancegenome.curation_api.services.VocabularyTermService; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; @@ -103,12 +102,14 @@ public AGMDiseaseAnnotation validateAnnotation(AGMDiseaseAnnotation uiEntity, AG } private AffectedGenomicModel validateSubject(AGMDiseaseAnnotation uiEntity, AGMDiseaseAnnotation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getSubject()) || uiEntity.getSubject().getId() == null) { + if (ObjectUtils.isEmpty(uiEntity.getSubject())) { addMessageResponse("subject", ValidationConstants.REQUIRED_MESSAGE); return null; } - AffectedGenomicModel subjectEntity = affectedGenomicModelDAO.find(uiEntity.getSubject().getId()); + AffectedGenomicModel subjectEntity = null; + if (uiEntity.getSubject().getId() != null) + subjectEntity = affectedGenomicModelDAO.find(uiEntity.getSubject().getId()); if (subjectEntity == null) { addMessageResponse("subject", ValidationConstants.INVALID_MESSAGE); return null; @@ -127,7 +128,9 @@ private Gene validateInferredGene(AGMDiseaseAnnotation uiEntity, AGMDiseaseAnnot if (uiEntity.getInferredGene() == null) return null; - Gene inferredGene = geneDAO.find(uiEntity.getInferredGene().getId()); + Gene inferredGene = null; + if (uiEntity.getInferredGene().getId() != null) + inferredGene = geneDAO.find(uiEntity.getInferredGene().getId()); if (inferredGene == null) { addMessageResponse("inferredGene", ValidationConstants.INVALID_MESSAGE); return null; @@ -150,7 +153,9 @@ private List validateAssertedGenes(AGMDiseaseAnnotation uiEntity, AGMDisea if (CollectionUtils.isNotEmpty(dbEntity.getAssertedGenes())) previousIds = dbEntity.getAssertedGenes().stream().map(Gene::getId).collect(Collectors.toList()); for (Gene gene : uiEntity.getAssertedGenes()) { - Gene assertedGene = geneDAO.find(gene.getId()); + Gene assertedGene = null; + if (gene.getId() != null) + assertedGene = geneDAO.find(gene.getId()); if (assertedGene == null) { addMessageResponse("assertedGenes", ValidationConstants.INVALID_MESSAGE); return null; @@ -169,7 +174,9 @@ private Allele validateInferredAllele(AGMDiseaseAnnotation uiEntity, AGMDiseaseA if (uiEntity.getInferredAllele() == null) return null; - Allele inferredAllele = alleleDAO.find(uiEntity.getInferredAllele().getId()); + Allele inferredAllele = null; + if (uiEntity.getInferredAllele().getId() != null) + inferredAllele = alleleDAO.find(uiEntity.getInferredAllele().getId()); if (inferredAllele == null) { addMessageResponse("inferredAllele", ValidationConstants.INVALID_MESSAGE); return null; @@ -187,7 +194,9 @@ private Allele validateAssertedAllele(AGMDiseaseAnnotation uiEntity, AGMDiseaseA if (uiEntity.getAssertedAllele() == null) return null; - Allele assertedAllele = alleleDAO.find(uiEntity.getAssertedAllele().getId()); + Allele assertedAllele = null; + if (uiEntity.getAssertedAllele().getId() != null) + assertedAllele = alleleDAO.find(uiEntity.getAssertedAllele().getId()); if (assertedAllele == null) { addMessageResponse("assertedAllele", ValidationConstants.INVALID_MESSAGE); return null; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java index a9fa57e96..112e8483a 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java @@ -92,12 +92,14 @@ public AlleleDiseaseAnnotation validateAnnotation(AlleleDiseaseAnnotation uiEnti } private Allele validateSubject(AlleleDiseaseAnnotation uiEntity, AlleleDiseaseAnnotation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getSubject()) || uiEntity.getSubject().getId() == null) { + if (ObjectUtils.isEmpty(uiEntity.getSubject())) { addMessageResponse("subject", ValidationConstants.REQUIRED_MESSAGE); return null; } - Allele subjectEntity = alleleDAO.find(uiEntity.getSubject().getId()); + Allele subjectEntity = null; + if (uiEntity.getSubject().getId() != null) + subjectEntity = alleleDAO.find(uiEntity.getSubject().getId()); if (subjectEntity == null) { addMessageResponse("subject", ValidationConstants.INVALID_MESSAGE); return null; @@ -115,7 +117,9 @@ private Gene validateInferredGene(AlleleDiseaseAnnotation uiEntity, AlleleDiseas if (uiEntity.getInferredGene() == null) return null; - Gene inferredGene = geneDAO.find(uiEntity.getInferredGene().getId()); + Gene inferredGene = null; + if (uiEntity.getInferredGene().getId() != null) + inferredGene = geneDAO.find(uiEntity.getInferredGene().getId()); if (inferredGene == null) { addMessageResponse("inferredGene", ValidationConstants.INVALID_MESSAGE); return null; @@ -138,7 +142,9 @@ private List validateAssertedGenes(AlleleDiseaseAnnotation uiEntity, Allel if (CollectionUtils.isNotEmpty(dbEntity.getAssertedGenes())) previousIds = dbEntity.getAssertedGenes().stream().map(Gene::getId).collect(Collectors.toList()); for (Gene gene : uiEntity.getAssertedGenes()) { - Gene assertedGene = geneDAO.find(gene.getId()); + Gene assertedGene = null; + if (gene.getId() != null) + assertedGene = geneDAO.find(gene.getId()); if (assertedGene == null) { addMessageResponse("assertedGenes", ValidationConstants.INVALID_MESSAGE); return null; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java index 27dcb2043..0a10ec584 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java @@ -51,11 +51,14 @@ public class DiseaseAnnotationValidator extends AnnotationValidator { public DOTerm validateObject(DiseaseAnnotation uiEntity, DiseaseAnnotation dbEntity) { String field = "object"; - if (ObjectUtils.isEmpty(uiEntity.getObject()) || uiEntity.getObject().getId() == null) { + if (ObjectUtils.isEmpty(uiEntity.getObject())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } - DOTerm diseaseTerm = doTermDAO.find(uiEntity.getObject().getId()); + + DOTerm diseaseTerm = null; + if (uiEntity.getObject().getId() != null) + diseaseTerm = doTermDAO.find(uiEntity.getObject().getId()); if (diseaseTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; @@ -99,7 +102,9 @@ public List validateEvidenceCodes(DiseaseAnnotation uiEntity, DiseaseAn if (CollectionUtils.isNotEmpty(dbEntity.getEvidenceCodes())) previousIds = dbEntity.getEvidenceCodes().stream().map(ECOTerm::getId).collect(Collectors.toList()); for (ECOTerm ec : uiEntity.getEvidenceCodes()) { - ECOTerm evidenceCode = ecoTermDAO.find(ec.getId()); + ECOTerm evidenceCode = null; + if (ec.getId() != null) + evidenceCode = ecoTermDAO.find(ec.getId()); if (evidenceCode == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; @@ -126,7 +131,9 @@ public List validateWith(DiseaseAnnotation uiEntity, DiseaseAnnotation dbE if (CollectionUtils.isNotEmpty(dbEntity.getWith())) previousIds = dbEntity.getWith().stream().map(Gene::getId).collect(Collectors.toList()); for (Gene wg : uiEntity.getWith()) { - Gene withGene = geneDAO.find(wg.getId()); + Gene withGene = null; + if (wg.getId() != null) + withGene = geneDAO.find(wg.getId()); if (withGene == null || withGene.getModEntityId() == null || !withGene.getModEntityId().startsWith("HGNC:")) { addMessageResponse("with", ValidationConstants.INVALID_MESSAGE); return null; @@ -187,8 +194,9 @@ public List validateDiseaseGeneticModifiers(DiseaseAnnotation if (CollectionUtils.isNotEmpty(dbEntity.getDiseaseGeneticModifiers())) previousIds = dbEntity.getDiseaseGeneticModifiers().stream().map(BiologicalEntity::getId).collect(Collectors.toList()); for (BiologicalEntity modifier : uiEntity.getDiseaseGeneticModifiers()) { - BiologicalEntity diseaseGeneticModifier = biologicalEntityDAO.find(modifier.getId()); - + BiologicalEntity diseaseGeneticModifier = null; + if (modifier.getId() != null) + diseaseGeneticModifier = biologicalEntityDAO.find(modifier.getId()); if (diseaseGeneticModifier == null) { addMessageResponse("diseaseGeneticModifiers", ValidationConstants.INVALID_MESSAGE); return null; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java index c91a60a76..b9e48d028 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java @@ -127,11 +127,13 @@ public ExperimentalCondition validateExperimentalCondition(ExperimentalCondition public ZECOTerm validateConditionClass(ExperimentalCondition uiEntity, ExperimentalCondition dbEntity) { String field = "conditionClass"; - if (ObjectUtils.isEmpty(uiEntity.getConditionClass()) || uiEntity.getConditionClass().getId() == null) { + if (ObjectUtils.isEmpty(uiEntity.getConditionClass())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } - ZECOTerm zecoTerm = zecoTermDAO.find(uiEntity.getConditionClass().getId()); + ZECOTerm zecoTerm = null; + if (uiEntity.getConditionClass().getId() != null) + zecoTerm = zecoTermDAO.find(uiEntity.getConditionClass().getId()); if (zecoTerm == null || zecoTerm.getSubsets().isEmpty() || !zecoTerm.getSubsets().contains(OntologyConstants.ZECO_AGR_SLIM_SUBSET)) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; @@ -144,10 +146,11 @@ public ZECOTerm validateConditionClass(ExperimentalCondition uiEntity, Experimen public ExperimentalConditionOntologyTerm validateConditionId(ExperimentalCondition uiEntity, ExperimentalCondition dbEntity) { String field = "conditionId"; - if (ObjectUtils.isEmpty(uiEntity.getConditionId()) || uiEntity.getConditionId().getId() == null) { + if (ObjectUtils.isEmpty(uiEntity.getConditionId())) return null; - } - ExperimentalConditionOntologyTerm ecOntologyTerm = ecOntologyTermDAO.find(uiEntity.getConditionId().getId()); + ExperimentalConditionOntologyTerm ecOntologyTerm = null; + if (uiEntity.getConditionId().getId() != null) + ecOntologyTerm = ecOntologyTermDAO.find(uiEntity.getConditionId().getId()); if (ecOntologyTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; @@ -160,10 +163,11 @@ public ExperimentalConditionOntologyTerm validateConditionId(ExperimentalConditi public GOTerm validateConditionGeneOntology(ExperimentalCondition uiEntity, ExperimentalCondition dbEntity) { String field = "conditionGeneOntology"; - if (ObjectUtils.isEmpty(uiEntity.getConditionGeneOntology()) || uiEntity.getConditionGeneOntology().getId() == null) { + if (ObjectUtils.isEmpty(uiEntity.getConditionGeneOntology())) return null; - } - GOTerm goTerm = goTermDAO.find(uiEntity.getConditionGeneOntology().getId()); + GOTerm goTerm = null; + if (uiEntity.getConditionGeneOntology().getId() != null) + goTerm = goTermDAO.find(uiEntity.getConditionGeneOntology().getId()); if (goTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; @@ -176,10 +180,11 @@ public GOTerm validateConditionGeneOntology(ExperimentalCondition uiEntity, Expe public AnatomicalTerm validateConditionAnatomy(ExperimentalCondition uiEntity, ExperimentalCondition dbEntity) { String field = "conditionAnatomy"; - if (ObjectUtils.isEmpty(uiEntity.getConditionAnatomy()) || uiEntity.getConditionAnatomy().getId() == null) { + if (ObjectUtils.isEmpty(uiEntity.getConditionAnatomy())) return null; - } - AnatomicalTerm anatomicalTerm = anatomicalTermDAO.find(uiEntity.getConditionAnatomy().getId()); + AnatomicalTerm anatomicalTerm = null; + if (uiEntity.getConditionAnatomy().getId() != null) + anatomicalTerm = anatomicalTermDAO.find(uiEntity.getConditionAnatomy().getId()); if (anatomicalTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; @@ -192,10 +197,11 @@ public AnatomicalTerm validateConditionAnatomy(ExperimentalCondition uiEntity, E public ChemicalTerm validateConditionChemical(ExperimentalCondition uiEntity, ExperimentalCondition dbEntity) { String field = "conditionChemical"; - if (ObjectUtils.isEmpty(uiEntity.getConditionChemical()) || uiEntity.getConditionChemical().getId() == null) { + if (ObjectUtils.isEmpty(uiEntity.getConditionChemical())) return null; - } - ChemicalTerm chemicalTerm = chemicalTermDAO.find(uiEntity.getConditionChemical().getId()); + ChemicalTerm chemicalTerm = null; + if (uiEntity.getConditionChemical().getId() != null) + chemicalTerm = chemicalTermDAO.find(uiEntity.getConditionChemical().getId()); if (chemicalTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; @@ -208,10 +214,11 @@ public ChemicalTerm validateConditionChemical(ExperimentalCondition uiEntity, Ex public NCBITaxonTerm validateConditionTaxon(ExperimentalCondition uiEntity, ExperimentalCondition dbEntity) { String field = "conditionTaxon"; - if (ObjectUtils.isEmpty(uiEntity.getConditionTaxon()) || uiEntity.getConditionTaxon().getId() == null) { + if (ObjectUtils.isEmpty(uiEntity.getConditionTaxon())) return null; - } - NCBITaxonTerm taxonTerm = ncbiTaxonTermDAO.find(uiEntity.getConditionTaxon().getId()); + NCBITaxonTerm taxonTerm = null; + if (uiEntity.getConditionTaxon().getId() != null) + taxonTerm = ncbiTaxonTermDAO.find(uiEntity.getConditionTaxon().getId()); if (taxonTerm == null) { taxonTerm = ncbiTaxonTermService.downloadAndSave(uiEntity.getConditionTaxon().getCurie()); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java index 173506cce..b44ccebd3 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java @@ -84,12 +84,14 @@ public GeneDiseaseAnnotation validateAnnotation(GeneDiseaseAnnotation uiEntity, } private Gene validateSubject(GeneDiseaseAnnotation uiEntity, GeneDiseaseAnnotation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getSubject()) || uiEntity.getSubject().getId() == null) { + if (ObjectUtils.isEmpty(uiEntity.getSubject())) { addMessageResponse("subject", ValidationConstants.REQUIRED_MESSAGE); return null; } - Gene subjectEntity = geneDAO.find(uiEntity.getSubject().getId()); + Gene subjectEntity = null; + if (uiEntity.getSubject().getId() != null) + subjectEntity = geneDAO.find(uiEntity.getSubject().getId()); if (subjectEntity == null) { addMessageResponse("subject", ValidationConstants.INVALID_MESSAGE); return null; @@ -127,10 +129,12 @@ private VocabularyTerm validateDiseaseRelation(GeneDiseaseAnnotation uiEntity, G } private AffectedGenomicModel validateSgdStrainBackground(GeneDiseaseAnnotation uiEntity, GeneDiseaseAnnotation dbEntity) { - if (uiEntity.getSgdStrainBackground() == null || uiEntity.getSgdStrainBackground().getId() == null) + if (ObjectUtils.isEmpty(uiEntity.getSgdStrainBackground())) return null; - AffectedGenomicModel sgdStrainBackground = agmDAO.find(uiEntity.getSgdStrainBackground().getId()); + AffectedGenomicModel sgdStrainBackground = null; + if (uiEntity.getSgdStrainBackground().getId() != null) + sgdStrainBackground = agmDAO.find(uiEntity.getSgdStrainBackground().getId()); if (sgdStrainBackground == null || !sgdStrainBackground.getTaxon().getName().startsWith("Saccharomyces cerevisiae")) { addMessageResponse("sgdStrainBackground", ValidationConstants.INVALID_MESSAGE); return null; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneValidator.java index ed479d0b6..f576d7f5b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneValidator.java @@ -2,17 +2,13 @@ import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.dao.CrossReferenceDAO; import org.alliancegenome.curation_api.dao.GeneDAO; import org.alliancegenome.curation_api.dao.ontology.SoTermDAO; import org.alliancegenome.curation_api.exceptions.ApiErrorException; -import org.alliancegenome.curation_api.model.entities.CrossReference; -import org.alliancegenome.curation_api.model.entities.DataProvider; import org.alliancegenome.curation_api.model.entities.Gene; -import org.alliancegenome.curation_api.model.entities.ontology.NCBITaxonTerm; import org.alliancegenome.curation_api.model.entities.ontology.SOTerm; import org.alliancegenome.curation_api.model.entities.slotAnnotations.geneSlotAnnotations.GeneFullNameSlotAnnotation; import org.alliancegenome.curation_api.model.entities.slotAnnotations.geneSlotAnnotations.GeneSecondaryIdSlotAnnotation; @@ -26,6 +22,7 @@ import org.alliancegenome.curation_api.services.validation.slotAnnotations.geneSlotAnnotations.GeneSynonymSlotAnnotationValidator; import org.alliancegenome.curation_api.services.validation.slotAnnotations.geneSlotAnnotations.GeneSystematicNameSlotAnnotationValidator; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -138,10 +135,12 @@ private Gene validateGene(Gene uiEntity, Gene dbEntity) { } private SOTerm validateGeneType(Gene uiEntity, Gene dbEntity) { - if (uiEntity.getGeneType() == null) + if (ObjectUtils.isEmpty(uiEntity.getGeneType())) return null; - SOTerm soTerm = soTermDAO.find(uiEntity.getGeneType().getId()); + SOTerm soTerm = null; + if (uiEntity.getGeneType().getId() != null) + soTerm = soTermDAO.find(uiEntity.getGeneType().getId()); if (soTerm == null) { addMessageResponse("geneType", ValidationConstants.INVALID_MESSAGE); return null; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/VariantValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/VariantValidator.java index 3c653003c..8cc46272f 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/VariantValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/VariantValidator.java @@ -6,7 +6,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import java.util.stream.Collectors; import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.constants.VocabularyConstants; @@ -14,19 +13,15 @@ import org.alliancegenome.curation_api.dao.VariantDAO; import org.alliancegenome.curation_api.dao.ontology.SoTermDAO; import org.alliancegenome.curation_api.exceptions.ApiErrorException; -import org.alliancegenome.curation_api.model.entities.CrossReference; -import org.alliancegenome.curation_api.model.entities.DataProvider; import org.alliancegenome.curation_api.model.entities.Note; import org.alliancegenome.curation_api.model.entities.Variant; import org.alliancegenome.curation_api.model.entities.VocabularyTerm; -import org.alliancegenome.curation_api.model.entities.ontology.NCBITaxonTerm; import org.alliancegenome.curation_api.model.entities.ontology.SOTerm; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.helpers.notes.NoteIdentityHelper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -113,11 +108,13 @@ public Variant validateVariant(Variant uiEntity, Variant dbEntity) { public SOTerm validateVariantType(Variant uiEntity, Variant dbEntity) { String field = "variantType"; - if (ObjectUtils.isEmpty(uiEntity.getVariantType()) || uiEntity.getVariantType().getId() == null) { + if (ObjectUtils.isEmpty(uiEntity.getVariantType())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } - SOTerm variantType = soTermDAO.find(uiEntity.getVariantType().getId()); + SOTerm variantType = null; + if (uiEntity.getVariantType().getId() != null) + variantType = soTermDAO.find(uiEntity.getVariantType().getId()); if (variantType == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; @@ -149,10 +146,12 @@ private VocabularyTerm validateVariantStatus(Variant uiEntity, Variant dbEntity) public SOTerm validateSourceGeneralConsequence(Variant uiEntity, Variant dbEntity) { String field = "sourceGeneralConsequence"; - if (ObjectUtils.isEmpty(uiEntity.getSourceGeneralConsequence()) || uiEntity.getSourceGeneralConsequence().getId() == null) + if (ObjectUtils.isEmpty(uiEntity.getSourceGeneralConsequence())) return null; - SOTerm sourceGeneralConsequence = soTermDAO.find(uiEntity.getSourceGeneralConsequence().getId()); + SOTerm sourceGeneralConsequence = null; + if (uiEntity.getSourceGeneralConsequence().getId() != null) + sourceGeneralConsequence = soTermDAO.find(uiEntity.getSourceGeneralConsequence().getId()); if (sourceGeneralConsequence == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java index 2b5669f86..069b6922e 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java @@ -79,12 +79,14 @@ public AlleleGeneAssociation validateAlleleGeneAssociation(AlleleGeneAssociation private Allele validateSubject(AlleleGeneAssociation uiEntity, AlleleGeneAssociation dbEntity) { String field = "subject"; - if (ObjectUtils.isEmpty(uiEntity.getSubject()) || uiEntity.getSubject().getId() == null) { + if (ObjectUtils.isEmpty(uiEntity.getSubject())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } - Allele subjectEntity = alleleDAO.find(uiEntity.getSubject().getId()); + Allele subjectEntity = null; + if (uiEntity.getSubject().getId() != null) + subjectEntity = alleleDAO.find(uiEntity.getSubject().getId()); if (subjectEntity == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; @@ -100,12 +102,14 @@ private Allele validateSubject(AlleleGeneAssociation uiEntity, AlleleGeneAssocia } private Gene validateObject(AlleleGeneAssociation uiEntity, AlleleGeneAssociation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getObject()) || uiEntity.getObject().getId() == null) { + if (ObjectUtils.isEmpty(uiEntity.getObject())) { addMessageResponse("object", ValidationConstants.REQUIRED_MESSAGE); return null; } - Gene objectEntity = geneDAO.find(uiEntity.getObject().getId()); + Gene objectEntity = null; + if (uiEntity.getObject().getId() != null) + objectEntity = geneDAO.find(uiEntity.getObject().getId()); if (objectEntity == null) { addMessageResponse("object", ValidationConstants.INVALID_MESSAGE); return null; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGenomicEntityAssociationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGenomicEntityAssociationValidator.java index b4bebac3a..087888fd3 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGenomicEntityAssociationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGenomicEntityAssociationValidator.java @@ -12,6 +12,7 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.validation.NoteValidator; import org.alliancegenome.curation_api.services.validation.associations.EvidenceAssociationValidator; +import org.apache.commons.lang3.ObjectUtils; import jakarta.inject.Inject; @@ -28,10 +29,12 @@ public class AlleleGenomicEntityAssociationValidator validateEvidence(E uiEntity, E dbEntity) { public Allele validateSingleAllele(Allele uiAllele, Allele dbAllele) { String field = "singleAllele"; - if (uiAllele == null || uiAllele.getId() == null) { + if (ObjectUtils.isEmpty(uiAllele)) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } - Allele allele = alleleDAO.find(uiAllele.getId()); + Allele allele = null; + if (uiAllele.getId() != null) + allele = alleleDAO.find(uiAllele.getId()); if (allele == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; @@ -86,11 +86,14 @@ public Allele validateSingleAllele(Allele uiAllele, Allele dbAllele) { public Construct validateSingleConstruct(Construct uiConstruct, Construct dbConstruct) { String field = "singleConstruct"; - if (uiConstruct == null || uiConstruct.getId() == null) { + if (ObjectUtils.isEmpty(uiConstruct)) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); + return null; } - Construct construct = constructDAO.find(uiConstruct.getId()); + Construct construct = null; + if (uiConstruct.getId() != null) + construct = constructDAO.find(uiConstruct.getId()); if (construct == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; @@ -105,12 +108,14 @@ public Construct validateSingleConstruct(Construct uiConstruct, Construct dbCons public Gene validateSingleGene(Gene uiGene, Gene dbGene) { String field = "singleGene"; - if (uiGene == null || uiGene.getId() == null) { + if (ObjectUtils.isEmpty(uiGene)) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } - Gene gene = geneDAO.find(uiGene.getId()); + Gene gene = null; + if (uiGene.getId() != null) + gene = geneDAO.find(uiGene.getId()); if (gene == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationValidator.java index 28c0a619b..870712926 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationValidator.java @@ -16,6 +16,7 @@ import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.validation.slotAnnotations.SlotAnnotationValidator; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -110,10 +111,12 @@ private List validateFunctionalImpacts(AlleleFunctionalImpactSlo public PhenotypeTerm validatePhenotypeTerm(AlleleFunctionalImpactSlotAnnotation uiEntity, AlleleFunctionalImpactSlotAnnotation dbEntity) { String field = "phenotypeTerm"; - if (uiEntity.getPhenotypeTerm() == null) + if (ObjectUtils.isEmpty(uiEntity.getPhenotypeTerm())) return null; - PhenotypeTerm phenotypeTerm = phenotypeTermDAO.find(uiEntity.getPhenotypeTerm().getId()); + PhenotypeTerm phenotypeTerm = null; + if (uiEntity.getPhenotypeTerm().getId() != null) + phenotypeTerm = phenotypeTermDAO.find(uiEntity.getPhenotypeTerm().getId()); if (phenotypeTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotationValidator.java index dbfde8702..6c62852f1 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotationValidator.java @@ -85,7 +85,9 @@ private List validateMutationTypes(AlleleMutationTypeSlotAnnotation uiEn if (CollectionUtils.isNotEmpty(dbEntity.getMutationTypes())) previousIds = dbEntity.getMutationTypes().stream().map(SOTerm::getId).collect(Collectors.toList()); for (SOTerm mt : uiEntity.getMutationTypes()) { - SOTerm mutationType = soTermDAO.find(mt.getId()); + SOTerm mutationType = null; + if (mt.getId() != null) + mutationType = soTermDAO.find(mt.getId()); if (mutationType == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index 24e136d6b..f308d5c85 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -985,6 +985,7 @@ UPDATE association t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AN UPDATE atpterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE biologicalentity t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE biologicalentity t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE biologicalentity t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; UPDATE bspoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE bulkfmsload t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; UPDATE bulkload t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; From 844106370fcbf5fa8cac7ddb8be5a7a2449ea947 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 21 Dec 2023 16:56:15 +0000 Subject: [PATCH 014/159] Another validation update --- .../AlleleInheritanceModeSlotAnnotationValidator.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationValidator.java index 51790886b..08fee1c78 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationValidator.java @@ -12,6 +12,7 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.validation.slotAnnotations.SlotAnnotationValidator; +import org.apache.commons.lang3.ObjectUtils; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -103,10 +104,12 @@ private VocabularyTerm validateInheritanceMode(AlleleInheritanceModeSlotAnnotati public PhenotypeTerm validatePhenotypeTerm(AlleleInheritanceModeSlotAnnotation uiEntity, AlleleInheritanceModeSlotAnnotation dbEntity) { String field = "phenotypeTerm"; - if (uiEntity.getPhenotypeTerm() == null) + if (ObjectUtils.isEmpty(uiEntity.getPhenotypeTerm())) return null; - PhenotypeTerm phenotypeTerm = phenotypeTermDAO.find(uiEntity.getPhenotypeTerm().getId()); + PhenotypeTerm phenotypeTerm = null; + if (uiEntity.getPhenotypeTerm().getId() != null) + phenotypeTerm = phenotypeTermDAO.find(uiEntity.getPhenotypeTerm().getId()); if (phenotypeTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; From fcdb60d5deb4f1725d53b2b525fe7a140c552952 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 21 Dec 2023 18:11:32 +0000 Subject: [PATCH 015/159] Fix DA cleanup logic and bulk load search --- .../services/AGMDiseaseAnnotationService.java | 2 +- .../AlleleDiseaseAnnotationService.java | 2 +- .../GeneDiseaseAnnotationService.java | 2 +- .../dto/AGMDiseaseAnnotationDTOValidator.java | 37 +++++++++--------- .../AlleleDiseaseAnnotationDTOValidator.java | 37 +++++++++--------- .../validation/dto/ConstructDTOValidator.java | 38 ++++++++++--------- .../GeneDiseaseAnnotationDTOValidator.java | 37 +++++++++--------- .../validation/dto/VariantDTOValidator.java | 3 +- 8 files changed, 86 insertions(+), 72 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/services/AGMDiseaseAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/AGMDiseaseAnnotationService.java index 380b71b25..fe07c38ab 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/AGMDiseaseAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/AGMDiseaseAnnotationService.java @@ -96,7 +96,7 @@ public ObjectResponse delete(Long id) { public List getAnnotationIdsByDataProvider(BackendBulkDataProvider dataProvider) { Map params = new HashMap<>(); - params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider.sourceOrganization); + params.put(EntityFieldConstants.SUBJECT_DATA_PROVIDER, dataProvider.sourceOrganization); if(StringUtils.equals(dataProvider.sourceOrganization, "RGD")) params.put(EntityFieldConstants.SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); List annotationIds = agmDiseaseAnnotationDAO.findFilteredIds(params); diff --git a/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java index 7bae67ed6..8cbd44b9c 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java @@ -92,7 +92,7 @@ public ObjectResponse delete(Long id) { public List getAnnotationIdsByDataProvider(BackendBulkDataProvider dataProvider) { Map params = new HashMap<>(); - params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider.sourceOrganization); + params.put(EntityFieldConstants.SUBJECT_DATA_PROVIDER, dataProvider.sourceOrganization); if(StringUtils.equals(dataProvider.sourceOrganization, "RGD")) params.put(EntityFieldConstants.SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); List annotationIds = alleleDiseaseAnnotationDAO.findFilteredIds(params); diff --git a/src/main/java/org/alliancegenome/curation_api/services/GeneDiseaseAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/GeneDiseaseAnnotationService.java index b8c2318f5..e7f65567b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/GeneDiseaseAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/GeneDiseaseAnnotationService.java @@ -93,7 +93,7 @@ public ObjectResponse delete(Long id) { public List getAnnotationIdsByDataProvider(BackendBulkDataProvider dataProvider) { Map params = new HashMap<>(); - params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider.sourceOrganization); + params.put(EntityFieldConstants.SUBJECT_DATA_PROVIDER, dataProvider.sourceOrganization); if(StringUtils.equals(dataProvider.sourceOrganization, "RGD")) params.put(EntityFieldConstants.SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); List annotationIds = geneDiseaseAnnotationDAO.findFilteredIds(params); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java index b5b2bb369..d2b690a2a 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java @@ -62,26 +62,29 @@ public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotation if (agm == null) { adaResponse.addErrorMessage("agm_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAgmIdentifier() + ")"); } else { - String annotationId; - String identifyingField; String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getAgmIdentifier(), refCurie); - + SearchResponse annotationList; + Boolean annotationFound = false; if (StringUtils.isNotBlank(dto.getModEntityId())) { - annotationId = dto.getModEntityId(); - annotation.setModEntityId(annotationId); - identifyingField = "modEntityId"; - } else if (StringUtils.isNotBlank(dto.getModInternalId())) { - annotationId = dto.getModInternalId(); - annotation.setModInternalId(annotationId); - identifyingField = "modInternalId"; - } else { - annotationId = uniqueId; - identifyingField = "uniqueId"; + annotationList = agmDiseaseAnnotationDAO.findByField("modEntityId", dto.getModEntityId()); + if (annotationList != null && annotationList.getSingleResult() != null) { + annotation = annotationList.getSingleResult(); + annotationFound = true; + } } - - SearchResponse annotationList = agmDiseaseAnnotationDAO.findByField(identifyingField, annotationId); - if (annotationList != null && annotationList.getResults().size() > 0) { - annotation = annotationList.getResults().get(0); + annotation.setModEntityId(dto.getModEntityId()); + if (!annotationFound && StringUtils.isNotBlank(dto.getModInternalId())) { + annotationList = agmDiseaseAnnotationDAO.findByField("modInternalId", dto.getModInternalId()); + if (annotationList != null && annotationList.getSingleResult() != null) { + annotation = annotationList.getSingleResult(); + annotationFound = true; + } + } + annotation.setModInternalId(dto.getModInternalId()); + if (!annotationFound){ + annotationList = agmDiseaseAnnotationDAO.findByField("uniqueId", uniqueId); + if (annotationList != null && annotationList.getSingleResult() != null) + annotation = annotationList.getSingleResult(); } annotation.setUniqueId(uniqueId); annotation.setSubject(agm); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java index 958e863ec..6f179cc78 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java @@ -56,26 +56,29 @@ public AlleleDiseaseAnnotation validateAlleleDiseaseAnnotationDTO(AlleleDiseaseA if (allele == null) { adaResponse.addErrorMessage("allele_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAlleleIdentifier() + ")"); } else { - String annotationId; - String identifyingField; String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getAlleleIdentifier(), refCurie); - + SearchResponse annotationList; + Boolean annotationFound = false; if (StringUtils.isNotBlank(dto.getModEntityId())) { - annotationId = dto.getModEntityId(); - annotation.setModEntityId(annotationId); - identifyingField = "modEntityId"; - } else if (StringUtils.isNotBlank(dto.getModInternalId())) { - annotationId = dto.getModInternalId(); - annotation.setModInternalId(annotationId); - identifyingField = "modInternalId"; - } else { - annotationId = uniqueId; - identifyingField = "uniqueId"; + annotationList = alleleDiseaseAnnotationDAO.findByField("modEntityId", dto.getModEntityId()); + if (annotationList != null && annotationList.getSingleResult() != null) { + annotation = annotationList.getSingleResult(); + annotationFound = true; + } } - - SearchResponse annotationList = alleleDiseaseAnnotationDAO.findByField(identifyingField, annotationId); - if (annotationList != null && annotationList.getResults().size() > 0) { - annotation = annotationList.getResults().get(0); + annotation.setModEntityId(dto.getModEntityId()); + if (!annotationFound && StringUtils.isNotBlank(dto.getModInternalId())) { + annotationList = alleleDiseaseAnnotationDAO.findByField("modInternalId", dto.getModInternalId()); + if (annotationList != null && annotationList.getSingleResult() != null) { + annotation = annotationList.getSingleResult(); + annotationFound = true; + } + } + annotation.setModInternalId(dto.getModInternalId()); + if (!annotationFound){ + annotationList = alleleDiseaseAnnotationDAO.findByField("uniqueId", uniqueId); + if (annotationList != null && annotationList.getSingleResult() != null) + annotation = annotationList.getSingleResult(); } annotation.setUniqueId(uniqueId); annotation.setSubject(allele); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConstructDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConstructDTOValidator.java index 909002d4f..d38fbfbc7 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConstructDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConstructDTOValidator.java @@ -10,6 +10,7 @@ import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; import org.alliancegenome.curation_api.model.entities.Construct; +import org.alliancegenome.curation_api.model.entities.GeneDiseaseAnnotation; import org.alliancegenome.curation_api.model.entities.Reference; import org.alliancegenome.curation_api.model.entities.slotAnnotations.constructSlotAnnotations.ConstructComponentSlotAnnotation; import org.alliancegenome.curation_api.model.entities.slotAnnotations.constructSlotAnnotations.ConstructFullNameSlotAnnotation; @@ -55,26 +56,29 @@ public class ConstructDTOValidator extends ReagentDTOValidator { public Construct validateConstructDTO(ConstructDTO dto, BackendBulkDataProvider dataProvider) throws ObjectValidationException { Construct construct = new Construct(); - String constructId; - String identifyingField; String uniqueId = ConstructUniqueIdHelper.getConstructUniqueId(dto); - + SearchResponse constructList; + Boolean annotationFound = false; if (StringUtils.isNotBlank(dto.getModEntityId())) { - constructId = dto.getModEntityId(); - construct.setModEntityId(constructId); - identifyingField = "modEntityId"; - } else if (StringUtils.isNotBlank(dto.getModInternalId())) { - constructId = dto.getModInternalId(); - construct.setModInternalId(constructId); - identifyingField = "modInternalId"; - } else { - constructId = uniqueId; - identifyingField = "uniqueId"; + constructList = constructDAO.findByField("modEntityId", dto.getModEntityId()); + if (constructList != null && constructList.getSingleResult() != null) { + construct = constructList.getSingleResult(); + annotationFound = true; + } } - - SearchResponse constructList = constructDAO.findByField(identifyingField, constructId); - if (constructList != null && constructList.getResults().size() > 0) { - construct = constructList.getResults().get(0); + construct.setModEntityId(dto.getModEntityId()); + if (!annotationFound && StringUtils.isNotBlank(dto.getModInternalId())) { + constructList = constructDAO.findByField("modInternalId", dto.getModInternalId()); + if (constructList != null && constructList.getSingleResult() != null) { + construct = constructList.getSingleResult(); + annotationFound = true; + } + } + construct.setModInternalId(dto.getModInternalId()); + if (!annotationFound){ + constructList = constructDAO.findByField("uniqueId", uniqueId); + if (constructList != null && constructList.getSingleResult() != null) + construct = constructList.getSingleResult(); } construct.setUniqueId(uniqueId); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java index 6267c01a9..d6eeafcd5 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java @@ -55,26 +55,29 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat if (gene == null) { gdaResponse.addErrorMessage("gene_identifier", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGeneIdentifier() + ")"); } else { - String annotationId; - String identifyingField; String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getGeneIdentifier(), refCurie); - + SearchResponse annotationList; + Boolean annotationFound = false; if (StringUtils.isNotBlank(dto.getModEntityId())) { - annotationId = dto.getModEntityId(); - annotation.setModEntityId(annotationId); - identifyingField = "modEntityId"; - } else if (StringUtils.isNotBlank(dto.getModInternalId())) { - annotationId = dto.getModInternalId(); - annotation.setModInternalId(annotationId); - identifyingField = "modInternalId"; - } else { - annotationId = uniqueId; - identifyingField = "uniqueId"; + annotationList = geneDiseaseAnnotationDAO.findByField("modEntityId", dto.getModEntityId()); + if (annotationList != null && annotationList.getSingleResult() != null) { + annotation = annotationList.getSingleResult(); + annotationFound = true; + } } - - SearchResponse annotationList = geneDiseaseAnnotationDAO.findByField(identifyingField, annotationId); - if (annotationList != null && annotationList.getResults().size() > 0) { - annotation = annotationList.getResults().get(0); + annotation.setModEntityId(dto.getModEntityId()); + if (!annotationFound && StringUtils.isNotBlank(dto.getModInternalId())) { + annotationList = geneDiseaseAnnotationDAO.findByField("modInternalId", dto.getModInternalId()); + if (annotationList != null && annotationList.getSingleResult() != null) { + annotation = annotationList.getSingleResult(); + annotationFound = true; + } + } + annotation.setModInternalId(dto.getModInternalId()); + if (!annotationFound){ + annotationList = geneDiseaseAnnotationDAO.findByField("uniqueId", uniqueId); + if (annotationList != null && annotationList.getSingleResult() != null) + annotation = annotationList.getSingleResult(); } annotation.setUniqueId(uniqueId); annotation.setSubject(gene); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java index 42cf8ac68..2833f55fa 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java @@ -52,7 +52,8 @@ public Variant validateVariantDTO(VariantDTO dto, BackendBulkDataProvider dataPr SearchResponse response = variantDAO.findByField("modEntityId", dto.getModEntityId()); if (response != null && response.getSingleResult() != null) variant = response.getSingleResult(); - } else { + } + if (variant == null) { if (StringUtils.isBlank(dto.getModInternalId())) { variantResponse.addErrorMessage("modInternalId", ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId"); } else { From 2ecdf67a7012738e3159b7c4b64e9539f4e3df73 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 21 Dec 2023 20:22:46 +0000 Subject: [PATCH 016/159] Fix NPE --- .../services/ResourceDescriptorService.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorService.java b/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorService.java index 26b734dec..8c44230f4 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorService.java @@ -70,17 +70,22 @@ public void removeNonUpdatedResourceDescriptors(List rdNamesBefore, List public ObjectResponse getByPrefix(String prefix) { ResourceDescriptor rd = null; - + SearchResponse rdResponse = null; if(prefixRequest != null) { if(prefixCacheMap.containsKey(prefix)) { rd = prefixCacheMap.get(prefix); } else { Log.debug("RD not cached, caching rd: (" + prefix + ")"); - rd = resourceDescriptorDAO.findByField("prefix", prefix).getSingleResult(); - prefixCacheMap.put(prefix, rd); + rdResponse = resourceDescriptorDAO.findByField("prefix", prefix); + if (rdResponse != null && rdResponse.getSingleResult() != null) { + rd = rdResponse.getSingleResult(); + prefixCacheMap.put(prefix, rd); + } } } else { - rd = resourceDescriptorDAO.findByField("prefix", prefix).getSingleResult(); + rdResponse = resourceDescriptorDAO.findByField("prefix", prefix); + if (rdResponse != null && rdResponse.getSingleResult() != null) + rd = rdResponse.getSingleResult(); prefixRequest = new Date(); } From 4932f37d97d4a38872cd75c2ee81285a21993040 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 2 Jan 2024 11:49:15 +0000 Subject: [PATCH 017/159] Remove subtypes --- .../model/entities/BiologicalEntity.java | 2 +- .../model/entities/PersonSetting.java | 3 - .../model/entities/base/AuditedObject.java | 50 - .../model/entities/base/CurieObject.java | 7 - .../model/entities/base/SubmittedObject.java | 6 - .../entities/base/UniqueIdAuditedObject.java | 9 - .../model/entities/bulkloads/BulkLoad.java | 6 - .../entities/ontology/AnatomicalTerm.java | 15 +- .../model/entities/ontology/ChemicalTerm.java | 9 - .../ExperimentalConditionOntologyTerm.java | 8 - .../model/entities/ontology/OntologyTerm.java | 31 - .../entities/ontology/PhenotypeTerm.java | 12 - .../model/entities/ontology/StageTerm.java | 11 - .../orthology/GeneToGeneOrthology.java | 7 - .../ExperimentalConditionService.java | 2 +- .../validation/dto/VariantDTOValidator.java | 3 +- .../v0.30.0.1__linkml_v2.0.0_update.sql | 1345 +++++++++++------ .../curation_api/base/BaseITCase.java | 113 +- .../crud/controllers/AlleleITCase.java | 8 +- 19 files changed, 965 insertions(+), 682 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java index c7aeffc9b..4e4692c56 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java @@ -32,7 +32,7 @@ @Entity @TypeBinding(binder = @TypeBinderRef(type = BiologicalEntityTypeBridge.class)) @Data -@EqualsAndHashCode(callSuper = true) +@EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SubmittedObject.class }) @Table(indexes = { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java b/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java index 7fe700b74..d5cea6943 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java @@ -10,10 +10,8 @@ import org.hibernate.envers.Audited; import org.hibernate.type.SqlTypes; -import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonView; -import com.fasterxml.jackson.annotation.ObjectIdGenerators; import jakarta.persistence.Entity; import jakarta.persistence.Index; @@ -30,7 +28,6 @@ @ToString(callSuper = true, exclude = "person") @JsonIgnoreProperties(ignoreUnknown = true) @AGRCurationSchemaVersion(min = "1.3.2", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id") @Table(indexes = { @Index(name = "personsetting_person_index", columnList = "person_id"), @Index(name = "personsetting_settingskey_index", columnList = "settingskey") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java index f6063aa35..70aa1860e 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java @@ -6,29 +6,7 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.bridges.BooleanValueBridge; import org.alliancegenome.curation_api.model.bridges.OffsetDateTimeValueBridge; -import org.alliancegenome.curation_api.model.entities.Association; -import org.alliancegenome.curation_api.model.entities.ConditionRelation; -import org.alliancegenome.curation_api.model.entities.CrossReference; -import org.alliancegenome.curation_api.model.entities.DataProvider; -import org.alliancegenome.curation_api.model.entities.ExperimentalCondition; -import org.alliancegenome.curation_api.model.entities.Note; -import org.alliancegenome.curation_api.model.entities.Organization; import org.alliancegenome.curation_api.model.entities.Person; -import org.alliancegenome.curation_api.model.entities.PersonSetting; -import org.alliancegenome.curation_api.model.entities.ResourceDescriptor; -import org.alliancegenome.curation_api.model.entities.ResourceDescriptorPage; -import org.alliancegenome.curation_api.model.entities.Species; -import org.alliancegenome.curation_api.model.entities.Synonym; -import org.alliancegenome.curation_api.model.entities.Vocabulary; -import org.alliancegenome.curation_api.model.entities.VocabularyTerm; -import org.alliancegenome.curation_api.model.entities.VocabularyTermSet; -import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoad; -import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFile; -import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFileException; -import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFileHistory; -import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadGroup; -import org.alliancegenome.curation_api.model.entities.orthology.GeneToGeneOrthology; -import org.alliancegenome.curation_api.model.entities.slotAnnotations.SlotAnnotation; import org.alliancegenome.curation_api.view.View; import org.alliancegenome.curation_api.view.View.VocabularyTermSetView; import org.hibernate.annotations.CreationTimestamp; @@ -48,8 +26,6 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; @@ -66,32 +42,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = Association.class, name = "Association"), - @JsonSubTypes.Type(value = BulkLoad.class, name = "BulkLoad"), - @JsonSubTypes.Type(value = BulkLoadFile.class, name = "BulkLoadFile"), - @JsonSubTypes.Type(value = BulkLoadFileException.class, name = "BulkLoadFileException"), - @JsonSubTypes.Type(value = BulkLoadFileHistory.class, name = "BulkLoadFileHistory"), - @JsonSubTypes.Type(value = BulkLoadGroup.class, name = "BulkLoadGroup"), - @JsonSubTypes.Type(value = CrossReference.class, name = "CrossReference"), - @JsonSubTypes.Type(value = CurieObject.class, name = "CurieObject"), - @JsonSubTypes.Type(value = DataProvider.class, name = "DataProvider"), - @JsonSubTypes.Type(value = GeneToGeneOrthology.class, name = "GeneToGeneOrthology"), - @JsonSubTypes.Type(value = Note.class, name = "Note"), - @JsonSubTypes.Type(value = Organization.class, name = "Organization"), - @JsonSubTypes.Type(value = Person.class, name = "Person"), - @JsonSubTypes.Type(value = PersonSetting.class, name = "PersonSetting"), - @JsonSubTypes.Type(value = ResourceDescriptor.class, name = "ResourceDescriptor"), - @JsonSubTypes.Type(value = ResourceDescriptorPage.class, name = "ResourceDescriptorPage"), - @JsonSubTypes.Type(value = SlotAnnotation.class, name = "SlotAnnotation"), - @JsonSubTypes.Type(value = Species.class, name = "Species"), - @JsonSubTypes.Type(value = Synonym.class, name = "Synonym"), - @JsonSubTypes.Type(value = UniqueIdAuditedObject.class, name = "UniqueIdAuditedObject"), - @JsonSubTypes.Type(value = Vocabulary.class, name = "Vocabulary"), - @JsonSubTypes.Type(value = VocabularyTerm.class, name = "VocabularyTerm"), - @JsonSubTypes.Type(value = VocabularyTermSet.class, name = "VocabularyTermSet"), -}) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @Audited diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java index 7dc5db139..b294656bd 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java @@ -2,8 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.alliancegenome.curation_api.model.entities.InformationContentEntity; -import org.alliancegenome.curation_api.model.entities.ontology.OntologyTerm; import org.alliancegenome.curation_api.view.View; import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; @@ -12,8 +10,6 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; @@ -24,9 +20,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ @JsonSubTypes.Type(value = SubmittedObject.class, name = "SubmittedObject"), @JsonSubTypes.Type(value = OntologyTerm.class, name = "OntologyTerm"), - @JsonSubTypes.Type(value = InformationContentEntity.class, name = "InformationContentEntity")}) @Data @EqualsAndHashCode(callSuper = true) @Audited diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java index c2998f713..4c829363a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java @@ -2,9 +2,7 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.alliancegenome.curation_api.model.entities.BiologicalEntity; import org.alliancegenome.curation_api.model.entities.DataProvider; -import org.alliancegenome.curation_api.model.entities.Reagent; import org.alliancegenome.curation_api.view.View; import org.apache.commons.lang3.StringUtils; import org.hibernate.annotations.Fetch; @@ -20,8 +18,6 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; @@ -34,8 +30,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ @JsonSubTypes.Type(value = BiologicalEntity.class, name = "BiologicalEntity"), @JsonSubTypes.Type(value = Reagent.class, name = "Reagent") }) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/UniqueIdAuditedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/UniqueIdAuditedObject.java index 58c85ead6..7b9620646 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/UniqueIdAuditedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/UniqueIdAuditedObject.java @@ -1,7 +1,5 @@ package org.alliancegenome.curation_api.model.entities.base; -import org.alliancegenome.curation_api.model.entities.ConditionRelation; -import org.alliancegenome.curation_api.model.entities.ExperimentalCondition; import org.alliancegenome.curation_api.view.View; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; @@ -9,8 +7,6 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; @@ -19,11 +15,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = ConditionRelation.class, name = "ConditionRelation"), - @JsonSubTypes.Type(value = ExperimentalCondition.class, name = "ExperimentalCondition") -}) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @MappedSuperclass diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java index 01ed6887d..d950ff73c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java @@ -11,9 +11,6 @@ import org.alliancegenome.curation_api.view.View; import org.hibernate.envers.Audited; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonSubTypes.Type; -import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; @@ -30,9 +27,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ @Type(value = BulkFMSLoad.class, name = "BulkFMSLoad"), @Type(value = BulkURLLoad.class, name = "BulkURLLoad"), @Type(value = BulkManualLoad.class, name = "BulkManualLoad") }) - @Audited @Entity @Inheritance(strategy = InheritanceType.JOINED) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java index 16266a160..705239791 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java @@ -4,9 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.hibernate.envers.Audited; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - import jakarta.persistence.Entity; import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; @@ -14,17 +11,7 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = WBBTTerm.class, name = "WBBTTerm"), - @JsonSubTypes.Type(value = CLTerm.class, name = "CLTerm"), - @JsonSubTypes.Type(value = DAOTerm.class, name = "DAOTerm"), - @JsonSubTypes.Type(value = MATerm.class, name = "MATerm"), - @JsonSubTypes.Type(value = EMAPATerm.class, name = "EMAPATerm"), - @JsonSubTypes.Type(value = UBERONTerm.class, name = "UBERONTerm"), - @JsonSubTypes.Type(value = XBATerm.class, name = "XBATerm"), - @JsonSubTypes.Type(value = ZFATerm.class, name = "ZFATerm") -})@Audited +@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java index 56e9b2d09..564fbf73b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.alliancegenome.curation_api.model.entities.Molecule; import org.alliancegenome.curation_api.view.View; import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; @@ -11,8 +10,6 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; @@ -23,12 +20,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = CHEBITerm.class, name = "CHEBITerm"), - @JsonSubTypes.Type(value = XSMOTerm.class, name = "XSMOTerm"), - @JsonSubTypes.Type(value = Molecule.class, name = "Molecule") -}) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java index db5acf932..29195df3b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java @@ -4,9 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.hibernate.envers.Audited; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - import jakarta.persistence.Entity; import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; @@ -14,11 +11,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = ZECOTerm.class, name = "ZECOTerm"), - @JsonSubTypes.Type(value = XCOTerm.class, name = "XCOTerm") -}) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java index 3bbddc26f..90b78ca9d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.alliancegenome.curation_api.model.entities.Association; import org.alliancegenome.curation_api.model.entities.CrossReference; import org.alliancegenome.curation_api.model.entities.Synonym; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; @@ -22,8 +21,6 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; @@ -32,39 +29,11 @@ import jakarta.persistence.Index; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; -import jakarta.persistence.Table; import jakarta.persistence.Transient; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = AnatomicalTerm.class, name = "AnatomicalTerm"), - @JsonSubTypes.Type(value = ATPTerm.class, name = "ATPTerm"), - @JsonSubTypes.Type(value = BSPOTerm.class, name = "BSPOTerm"), - @JsonSubTypes.Type(value = ChemicalTerm.class, name = "ChemicalTerm"), - @JsonSubTypes.Type(value = CMOTerm.class, name = "CMOTerm"), - @JsonSubTypes.Type(value = DOTerm.class, name = "DOTerm"), - @JsonSubTypes.Type(value = ECOTerm.class, name = "ECOTerm"), - @JsonSubTypes.Type(value = ExperimentalConditionOntologyTerm.class, name = "ExperimentalConditionOntologyTerm"), - @JsonSubTypes.Type(value = GOTerm.class, name = "GOTerm"), - @JsonSubTypes.Type(value = MITerm.class, name = "MITerm"), - @JsonSubTypes.Type(value = MMOTerm.class, name = "MMOTerm"), - @JsonSubTypes.Type(value = MODTerm.class, name = "MODTerm"), - @JsonSubTypes.Type(value = MPATHTerm.class, name = "MPATHTerm"), - @JsonSubTypes.Type(value = NCBITaxonTerm.class, name = "NCBITaxonTerm"), - @JsonSubTypes.Type(value = OBITerm.class, name = "OBITerm"), - @JsonSubTypes.Type(value = PATOTerm.class, name = "PATOTerm"), - @JsonSubTypes.Type(value = PhenotypeTerm.class, name = "PhenotypeTerm"), - @JsonSubTypes.Type(value = PWTerm.class, name = "PWTerm"), - @JsonSubTypes.Type(value = ROTerm.class, name = "ROTerm"), - @JsonSubTypes.Type(value = RSTerm.class, name = "RSTerm"), - @JsonSubTypes.Type(value = SOTerm.class, name = "SOTerm"), - @JsonSubTypes.Type(value = StageTerm.class, name = "StageTerm"), - @JsonSubTypes.Type(value = VTTerm.class, name = "VTTerm"), - @JsonSubTypes.Type(value = XBEDTerm.class, name = "XBEDTerm") -}) @Audited @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java index e58f6b9a0..f068cdf0a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java @@ -4,9 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.hibernate.envers.Audited; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - import jakarta.persistence.Entity; import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; @@ -14,15 +11,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = APOTerm.class, name = "APOTerm"), - @JsonSubTypes.Type(value = WBPhenotypeTerm.class, name = "WBPhenotypeTerm"), - @JsonSubTypes.Type(value = DPOTerm.class, name = "DPOTerm"), - @JsonSubTypes.Type(value = HPTerm.class, name = "HPTerm"), - @JsonSubTypes.Type(value = MPTerm.class, name = "MPTerm"), - @JsonSubTypes.Type(value = XPOTerm.class, name = "XPOTerm") -}) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java index eaeaf771c..a2ded9c71 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java @@ -4,9 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.hibernate.envers.Audited; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - import jakarta.persistence.Entity; import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; @@ -14,14 +11,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = WBLSTerm.class, name = "WBLSTerm"), - @JsonSubTypes.Type(value = FBDVTerm.class, name = "FBDVTerm"), - @JsonSubTypes.Type(value = MMUSDVTerm.class, name = "MMUSDVTerm"), - @JsonSubTypes.Type(value = XBSTerm.class, name = "XBSTerm"), - @JsonSubTypes.Type(value = ZFSTerm.class, name = "ZFSTerm") -}) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java index c58ad5bb1..03da3ca56 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java @@ -11,8 +11,6 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; @@ -25,11 +23,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = GeneToGeneOrthologyCurated.class, name = "GeneToGeneOrthologyCurated"), - @JsonSubTypes.Type(value = GeneToGeneOrthologyGenerated.class, name = "GeneToGeneOrthologyGenerated") -}) @Audited @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/services/ExperimentalConditionService.java b/src/main/java/org/alliancegenome/curation_api/services/ExperimentalConditionService.java index 60f5eb407..be99e2579 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ExperimentalConditionService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ExperimentalConditionService.java @@ -41,7 +41,7 @@ public ObjectResponse update(ExperimentalCondition uiEnti @Transactional public ObjectResponse create(ExperimentalCondition uiEntity) { ExperimentalCondition dbEntity = experimentalConditionValidator.validateExperimentalConditionCreate(uiEntity); - return new ObjectResponse<>(experimentalConditionDAO.persist(dbEntity)); + return new ObjectResponse<>(experimentalConditionDAO.persist(dbEntity)); } public void deleteUnusedExperiments() { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java index 2833f55fa..e766abde6 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java @@ -55,7 +55,8 @@ public Variant validateVariantDTO(VariantDTO dto, BackendBulkDataProvider dataPr } if (variant == null) { if (StringUtils.isBlank(dto.getModInternalId())) { - variantResponse.addErrorMessage("modInternalId", ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId"); + if (StringUtils.isBlank(dto.getModEntityId())) + variantResponse.addErrorMessage("modInternalId", ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId"); } else { SearchResponse response = variantDAO.findByField("modInternalId", dto.getModInternalId()); if (response != null && response.getSingleResult() != null) diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index f308d5c85..c198e1f62 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -281,6 +281,7 @@ ALTER TABLE organization_aud DROP CONSTRAINT organization_aud_rev_fk; ALTER TABLE patoterm DROP CONSTRAINT patoterm_curie_fk; ALTER TABLE patoterm_aud DROP CONSTRAINT patoterm_aud_curie_rev_fk; ALTER TABLE person_aud DROP CONSTRAINT fkqbm2y5o4elhanxeq26reu73yd; +ALTER TABLE personsetting_aud DROP CONSTRAINT fkq0ul02mp3963koe1p6sntqc8e; ALTER TABLE phenotypeterm DROP CONSTRAINT fk4ymq8h2kdhq6ix6sfb4q4fn7a; ALTER TABLE phenotypeterm_aud DROP CONSTRAINT fksap791c8unrey4xnqcydm8kv1; ALTER TABLE pwterm DROP CONSTRAINT pwterm_curie_fk; @@ -533,6 +534,34 @@ CREATE TABLE submittedobject_aud ( CREATE SEQUENCE auditedobject_seq START WITH 200250000 INCREMENT BY 50 NO MINVALUE NO MAXVALUE CACHE 1; +DROP SEQUENCE association_seq; +DROP SEQUENCE bulkload_seq; +DROP SEQUENCE bulkloadfile_seq; +DROP SEQUENCE bulkloadfileexception_seq; +DROP SEQUENCE bulkloadfilehistory_seq; +DROP SEQUENCE bulkloadgroup_seq; +DROP SEQUENCE conditionrelation_seq; +DROP SEQUENCE crossreference_seq; +DROP SEQUENCE curationreport_seq; +DROP SEQUENCE curationreportgroup_seq; +DROP SEQUENCE curationreporthistory_seq; +DROP SEQUENCE dataprovider_seq; +DROP SEQUENCE experimentalcondition_seq; +DROP SEQUENCE genetogeneorthology_seq; +DROP SEQUENCE note_seq; +DROP SEQUENCE organization_seq; +DROP SEQUENCE person_seq; +DROP SEQUENCE personsetting_seq; +DROP SEQUENCE reagent_seq; +DROP SEQUENCE resourcedescriptor_seq; +DROP SEQUENCE resourcedescriptorpage_seq; +DROP SEQUENCE slotannotation_seq; +DROP SEQUENCE species_seq; +DROP SEQUENCE synonym_seq; +DROP SEQUENCE vocabulary_seq; +DROP SEQUENCE vocabularyterm_seq; +DROP SEQUENCE vocabularytermset_seq; + -- Add id equivalents of curie columns ALTER TABLE affectedgenomicmodel ADD COLUMN id bigint; @@ -1203,445 +1232,6 @@ INSERT INTO curieobject (id) SELECT id FROM submittedobject; INSERT INTO curieobject (id, curie) SELECT id, curie FROM ontologyterm; INSERT INTO curieobject (id, curie) SELECT id, curie FROM informationcontententity; -SET session_replication_role = 'origin'; - --- Add constraints and indexes -ALTER TABLE auditedobject ADD CONSTRAINT auditedobject_createdby_id_fk FOREIGN KEY (createdby_id) REFERENCES person (id); -ALTER TABLE auditedobject ADD CONSTRAINT auditedobject_updatedby_id_fk FOREIGN KEY (updatedby_id) REFERENCES person (id); -CREATE INDEX auditedobject_createdby_index ON auditedobject USING btree (createdby_id); -CREATE INDEX auditedobject_updatedby_index ON auditedobject USING btree (updatedby_id); - -ALTER TABLE auditedobject_aud ADD CONSTRAINT auditedobject_aud_rev_fk FOREIGN KEY (rev) REFERENCES revinfo (rev); - -ALTER TABLE curieobject ADD CONSTRAINT curieobject_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -CREATE INDEX curieobject_curie_index ON curieobject USING btree (curie); -ALTER TABLE curieobject ADD CONSTRAINT curieobject_curie_uk UNIQUE (curie); - -ALTER TABLE curieobject_aud ADD CONSTRAINT curieobject_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); - -ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); -ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_dataprovider_id_fk FOREIGN KEY (dataprovider_id) REFERENCES dataprovider (id); -CREATE INDEX submittedobject_modentityid_index ON submittedobject USING btree (modentityid); -CREATE INDEX submittedobject_modinternalid_index ON submittedobject USING btree (modinternalid); -CREATE INDEX submittedobject_dataprovider_index ON submittedobject USING btree (dataprovider_id); -ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_modentityid_uk UNIQUE (modentityid); -ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_modinternalid_uk UNIQUE (modinternalid); - -ALTER TABLE submittedobject_aud ADD CONSTRAINT submittedobject_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES curieobject_aud (id, rev); - -ALTER TABLE affectedgenomicmodel ADD CONSTRAINT affectedgenomicmodel_pkey PRIMARY KEY (id); -ALTER TABLE affectedgenomicmodel_aud ADD CONSTRAINT affectedgenomicmodel_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE allele ADD CONSTRAINT allele_pkey PRIMARY KEY (id); -ALTER TABLE allele_aud ADD CONSTRAINT allele_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE allele_note_aud ADD CONSTRAINT allele_note_aud_pkey PRIMARY KEY (allele_id, relatednotes_id, rev); -ALTER TABLE allele_reference_aud ADD CONSTRAINT allele_reference_aud_pkey PRIMARY KEY (allele_id, references_id, rev); -ALTER TABLE anatomicalterm ADD CONSTRAINT anatomicalterm_pkey PRIMARY KEY (id); -ALTER TABLE anatomicalterm_aud ADD CONSTRAINT anatomicalterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE apoterm ADD CONSTRAINT apoterm_pkey PRIMARY KEY (id); -ALTER TABLE apoterm_aud ADD CONSTRAINT apoterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE atpterm ADD CONSTRAINT atpterm_pkey PRIMARY KEY (id); -ALTER TABLE atpterm_aud ADD CONSTRAINT atpterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_pkey PRIMARY KEY (id); -ALTER TABLE biologicalentity_aud ADD CONSTRAINT biologicalentity_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE bspoterm ADD CONSTRAINT bspoterm_pkey PRIMARY KEY (id); -ALTER TABLE bspoterm_aud ADD CONSTRAINT bspoterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE chebiterm ADD CONSTRAINT chebiterm_pkey PRIMARY KEY (id); -ALTER TABLE chebiterm_aud ADD CONSTRAINT chebiterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE chemicalterm ADD CONSTRAINT chemicalterm_pkey PRIMARY KEY (id); -ALTER TABLE chemicalterm_aud ADD CONSTRAINT chemicalterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE clterm ADD CONSTRAINT clterm_pkey PRIMARY KEY (id); -ALTER TABLE clterm_aud ADD CONSTRAINT clterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE cmoterm ADD CONSTRAINT cmoterm_pkey PRIMARY KEY (id); -ALTER TABLE cmoterm_aud ADD CONSTRAINT cmoterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE daoterm ADD CONSTRAINT daoterm_pkey PRIMARY KEY (id); -ALTER TABLE daoterm_aud ADD CONSTRAINT daoterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE doterm ADD CONSTRAINT doterm_pkey PRIMARY KEY (id); -ALTER TABLE doterm_aud ADD CONSTRAINT doterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE dpoterm ADD CONSTRAINT dpoterm_pkey PRIMARY KEY (id); -ALTER TABLE dpoterm_aud ADD CONSTRAINT dpoterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE ecoterm ADD CONSTRAINT ecoterm_pkey PRIMARY KEY (id); -ALTER TABLE ecoterm_aud ADD CONSTRAINT ecoterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE emapaterm ADD CONSTRAINT emapaterm_pkey PRIMARY KEY (id); -ALTER TABLE emapaterm_aud ADD CONSTRAINT emapaterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE experimentalconditionontologyterm ADD CONSTRAINT experimentalconditionontologyterm_pkey PRIMARY KEY (id); -ALTER TABLE experimentalconditionontologyterm_aud ADD CONSTRAINT experimentalconditionontologyterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE fbdvterm ADD CONSTRAINT fbdvterm_pkey PRIMARY KEY (id); -ALTER TABLE fbdvterm_aud ADD CONSTRAINT fbdvterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE gene ADD CONSTRAINT gene_pkey PRIMARY KEY (id); -ALTER TABLE gene_aud ADD CONSTRAINT gene_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE genomicentity ADD CONSTRAINT genomicentity_pkey PRIMARY KEY (id); -ALTER TABLE genomicentity_aud ADD CONSTRAINT genomicentity_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE goterm ADD CONSTRAINT goterm_pkey PRIMARY KEY (id); -ALTER TABLE goterm_aud ADD CONSTRAINT goterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE hpterm ADD CONSTRAINT hpterm_pkey PRIMARY KEY (id); -ALTER TABLE hpterm_aud ADD CONSTRAINT hpterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_pkey PRIMARY KEY (id); -ALTER TABLE informationcontententity_aud ADD CONSTRAINT informationcontententity_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE materm ADD CONSTRAINT materm_pkey PRIMARY KEY (id); -ALTER TABLE materm_aud ADD CONSTRAINT materm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE miterm ADD CONSTRAINT miterm_pkey PRIMARY KEY (id); -ALTER TABLE miterm_aud ADD CONSTRAINT miterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_pkey PRIMARY KEY (id); -ALTER TABLE mmoterm_aud ADD CONSTRAINT mmoterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE mmusdvterm ADD CONSTRAINT mmusdvterm_pkey PRIMARY KEY (id); -ALTER TABLE mmusdvterm_aud ADD CONSTRAINT mmusdvterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE modterm ADD CONSTRAINT modterm_pkey PRIMARY KEY (id); -ALTER TABLE modterm_aud ADD CONSTRAINT modterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE molecule ADD CONSTRAINT molecule_pkey PRIMARY KEY (id); -ALTER TABLE molecule_aud ADD CONSTRAINT molecule_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE mpathterm ADD CONSTRAINT mpathterm_pkey PRIMARY KEY (id); -ALTER TABLE mpathterm_aud ADD CONSTRAINT mpathterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE mpterm ADD CONSTRAINT mpterm_pkey PRIMARY KEY (id); -ALTER TABLE mpterm_aud ADD CONSTRAINT mpterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_pkey PRIMARY KEY (id); -ALTER TABLE ncbitaxonterm_aud ADD CONSTRAINT ncbitaxonterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE obiterm ADD CONSTRAINT obiterm_pkey PRIMARY KEY (id); -ALTER TABLE obiterm_aud ADD CONSTRAINT obiterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_pkey PRIMARY KEY (id); -ALTER TABLE ontologyterm_aud ADD CONSTRAINT ontologyterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_pkey PRIMARY KEY (isachildren_id, isaparents_id); -ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_pkey PRIMARY KEY (isadescendants_id, isaancestors_id); -ALTER TABLE patoterm ADD CONSTRAINT patoterm_pkey PRIMARY KEY (id); -ALTER TABLE patoterm_aud ADD CONSTRAINT patoterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE phenotypeterm ADD CONSTRAINT phenotypeterm_pkey PRIMARY KEY (id); -ALTER TABLE phenotypeterm_aud ADD CONSTRAINT phenotypeterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE pwterm ADD CONSTRAINT pwterm_pkey PRIMARY KEY (id); -ALTER TABLE pwterm_aud ADD CONSTRAINT pwterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE reference ADD CONSTRAINT reference_pkey PRIMARY KEY (id); -ALTER TABLE reference_aud ADD CONSTRAINT reference_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE roterm ADD CONSTRAINT roterm_pkey PRIMARY KEY (id); -ALTER TABLE roterm_aud ADD CONSTRAINT roterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE rsterm ADD CONSTRAINT rsterm_pkey PRIMARY KEY (id); -ALTER TABLE rsterm_aud ADD CONSTRAINT rsterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE soterm ADD CONSTRAINT soterm_pkey PRIMARY KEY (id); -ALTER TABLE soterm_aud ADD CONSTRAINT soterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE stageterm ADD CONSTRAINT stageterm_pkey PRIMARY KEY (id); -ALTER TABLE stageterm_aud ADD CONSTRAINT stageterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE uberonterm ADD CONSTRAINT uberonterm_pkey PRIMARY KEY (id); -ALTER TABLE uberonterm_aud ADD CONSTRAINT uberonterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE variant ADD CONSTRAINT variant_pkey PRIMARY KEY (id); -ALTER TABLE variant_aud ADD CONSTRAINT variant_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE vtterm ADD CONSTRAINT vtterm_pkey PRIMARY KEY (id); -ALTER TABLE vtterm_aud ADD CONSTRAINT vtterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE wbbtterm ADD CONSTRAINT wbbtterm_pkey PRIMARY KEY (id); -ALTER TABLE wbbtterm_aud ADD CONSTRAINT wbbtterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE wblsterm ADD CONSTRAINT wblsterm_pkey PRIMARY KEY (id); -ALTER TABLE wblsterm_aud ADD CONSTRAINT wblsterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE wbphenotypeterm ADD CONSTRAINT wbphenotypeterm_pkey PRIMARY KEY (id); -ALTER TABLE wbphenotypeterm_aud ADD CONSTRAINT wbphenotypeterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE xbaterm ADD CONSTRAINT xbaterm_pkey PRIMARY KEY (id); -ALTER TABLE xbaterm_aud ADD CONSTRAINT xbaterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE xbedterm ADD CONSTRAINT xbedterm_pkey PRIMARY KEY (id); -ALTER TABLE xbedterm_aud ADD CONSTRAINT xbedterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE xbsterm ADD CONSTRAINT xbsterm_pkey PRIMARY KEY (id); -ALTER TABLE xbsterm_aud ADD CONSTRAINT xbsterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE xcoterm ADD CONSTRAINT xcoterm_pkey PRIMARY KEY (id); -ALTER TABLE xcoterm_aud ADD CONSTRAINT xcoterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE xpoterm ADD CONSTRAINT xpoterm_pkey PRIMARY KEY (id); -ALTER TABLE xpoterm_aud ADD CONSTRAINT xpoterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE xsmoterm ADD CONSTRAINT xsmoterm_pkey PRIMARY KEY (id); -ALTER TABLE xsmoterm_aud ADD CONSTRAINT xsmoterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE zecoterm ADD CONSTRAINT zecoterm_pkey PRIMARY KEY (id); -ALTER TABLE zecoterm_aud ADD CONSTRAINT zecoterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_pkey PRIMARY KEY (id); -ALTER TABLE zfaterm_aud ADD CONSTRAINT zfaterm_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_pkey PRIMARY KEY (id); -ALTER TABLE zfsterm_aud ADD CONSTRAINT zfsterm_aud_pkey PRIMARY KEY (id, rev); - -ALTER TABLE affectedgenomicmodel ADD CONSTRAINT affectedgenomicmodel_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); -ALTER TABLE affectedgenomicmodel_aud ADD CONSTRAINT affectedgenomicmodel_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); -ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES affectedgenomicmodel (id); -ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_assertedallele_id_fk FOREIGN KEY (assertedallele_id) REFERENCES allele (id); -ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredallele_id_fk FOREIGN KEY (inferredallele_id) REFERENCES allele (id); -ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id); -ALTER TABLE agmdiseaseannotation_gene ADD CONSTRAINT agmdiseaseannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); -ALTER TABLE allele ADD CONSTRAINT allele_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); -ALTER TABLE allele_aud ADD CONSTRAINT allele_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); -ALTER TABLE allele_note ADD CONSTRAINT allele_note_allele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id); -CREATE INDEX allele_note_allele_index ON allele_note USING btree (allele_id); -ALTER TABLE allele_reference ADD CONSTRAINT allele_reference_allele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id); -ALTER TABLE allele_reference ADD CONSTRAINT allele_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); -CREATE INDEX allele_reference_allele_index ON allele_reference USING btree (allele_id); -CREATE INDEX allele_reference_references_index ON allele_reference USING btree (references_id); -CREATE INDEX allele_reference_allele_references_index ON allele_reference USING btree (allele_id, references_id); -ALTER TABLE alleledatabasestatusslotannotation ADD CONSTRAINT alleledatabasestatus_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); -CREATE INDEX alleledatabasestatus_singleallele_index ON alleledatabasestatusslotannotation USING btree (singleallele_id); -ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannoation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES allele (id); -ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id); -CREATE INDEX allelediseaseannotation_inferredgene_index ON allelediseaseannotation USING btree (inferredgene_id); -CREATE INDEX allelediseaseannotation_subject_index ON allelediseaseannotation USING btree (subject_id); -ALTER TABLE allelediseaseannotation_gene ADD CONSTRAINT allelediseaseannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); -CREATE INDEX allelediseaseannotationgene_assertedgenes_index ON allelediseaseannotation_gene USING btree (assertedgenes_id); -CREATE INDEX allelefullname_singleallele_index ON allelefullnameslotannotation USING btree (singleallele_id); -ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctionalimpactslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); -ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctionalimpactslotannotation_phenotypeterm_id_fk FOREIGN KEY (phenotypeterm_id) REFERENCES phenotypeterm (id); -CREATE INDEX allelefunctionalimpact_singleallele_index ON allelefunctionalimpactslotannotation USING btree (singleallele_id); -CREATE INDEX allelefunctionalimpact_phenotypeterm_index ON allelefunctionalimpactslotannotation USING btree (phenotypeterm_id); -ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_object_id_fk FOREIGN KEY (object_id) REFERENCES gene (id); -ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES allele (id); -CREATE INDEX allelegeneassociation_object_index ON allelegeneassociation USING btree (object_id); -CREATE INDEX allelegeneassociation_subject_index ON allelegeneassociation USING btree (subject_id); -ALTER TABLE allelegenomicentityassociation ADD CONSTRAINT allelegenomicentityassociation_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES ecoterm (id); -ALTER TABLE allelegermlinetransmissionstatusslotannotation ADD CONSTRAINT allelegermlinetransmissionstatus_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); -CREATE INDEX allelegermlinetransmissionstatus_singleallele_index ON allelegermlinetransmissionstatusslotannotation USING btree (singleallele_id); -ALTER TABLE alleleinheritancemodeslotannotation ADD CONSTRAINT alleleinheritancemode_phenotypeterm_id_fk FOREIGN KEY (phenotypeterm_id) REFERENCES phenotypeterm (id); -ALTER TABLE alleleinheritancemodeslotannotation ADD CONSTRAINT alleleinheritancemode_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); -CREATE INDEX alleleinheritancemode_phenotypeterm_index ON alleleinheritancemodeslotannotation USING btree (phenotypeterm_id); -CREATE INDEX alleleinheritancemode_singleallele_index ON alleleinheritancemodeslotannotation USING btree (singleallele_id); -ALTER TABLE allelemutationtypeslotannotation ADD CONSTRAINT allelemutationtype_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); -CREATE INDEX allelemutationtype_singleallele_index ON allelemutationtypeslotannotation USING btree (singleallele_id); -ALTER TABLE allelemutationtypeslotannotation_soterm ADD CONSTRAINT allelemutationtypesa_soterm_mutationtypes_id_fk FOREIGN KEY (mutationtypes_id) REFERENCES soterm (id); -CREATE INDEX allelemutationtypesa_soterm_mutationtypes_index ON allelemutationtypeslotannotation_soterm USING btree (mutationtypes_id); -ALTER TABLE allelenomenclatureeventslotannotation ADD CONSTRAINT allelenomenclatureeventslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); -CREATE INDEX allelenomenclatureevent_singleallele_index ON allelenomenclatureeventslotannotation USING btree (singleallele_id); -ALTER TABLE allelesecondaryidslotannotation ADD CONSTRAINT allelesecondaryidslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); -CREATE INDEX allelesecondaryid_singleallele_index ON allelesecondaryidslotannotation USING btree (singleallele_id); -ALTER TABLE allelesymbolslotannotation ADD CONSTRAINT allelesymbolslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); -CREATE INDEX allelesymbol_singleallele_index ON allelesymbolslotannotation USING btree (singleallele_id); -ALTER TABLE allelesynonymslotannotation ADD CONSTRAINT allelesynonymslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); -CREATE INDEX allelesynonym_singleallele_index ON allelesynonymslotannotation USING btree (singleallele_id); -ALTER TABLE anatomicalterm ADD CONSTRAINT anatomicalterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE anatomicalterm_aud ADD CONSTRAINT anatomicalterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE apoterm ADD CONSTRAINT apoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); -ALTER TABLE apoterm_aud ADD CONSTRAINT apoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); -ALTER TABLE atpterm ADD CONSTRAINT atpterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE atpterm_aud ADD CONSTRAINT atpterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_id_fk FOREIGN KEY (id) REFERENCES submittedobject (id); -ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); -CREATE INDEX biologicalentity_taxon_index ON biologicalentity USING btree (taxon_id); -ALTER TABLE biologicalentity_aud ADD CONSTRAINT biologicalentity_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES submittedobject_aud (id, rev); -ALTER TABLE bspoterm ADD CONSTRAINT bspoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE bspoterm_aud ADD CONSTRAINT bspoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE bulkload ADD CONSTRAINT bulkload_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE bulkload_aud ADD CONSTRAINT bulkload_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE bulkloadfile ADD CONSTRAINT bulkloadfile_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE bulkloadfile_aud ADD CONSTRAINT bulkloadfile_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE bulkloadfileexception ADD CONSTRAINT bulkloadfileexception_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE bulkloadfileexception_aud ADD CONSTRAINT bulkloadfileexception_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE bulkloadfilehistory ADD CONSTRAINT bulkloadfilehistory_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE bulkloadfilehistory_aud ADD CONSTRAINT bulkloadfilehistory_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE bulkloadgroup ADD CONSTRAINT bulkloadgroup_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE bulkloadgroup_aud ADD CONSTRAINT bulkloadgroup_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE chebiterm ADD CONSTRAINT chebiterm_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); -ALTER TABLE chebiterm_aud ADD CONSTRAINT chebiterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES chemicalterm_aud (id, rev); -ALTER TABLE chemicalterm ADD CONSTRAINT chemicalterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE chemicalterm_aud ADD CONSTRAINT chemicalterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE clterm ADD CONSTRAINT clterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE clterm_aud ADD CONSTRAINT clterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); -ALTER TABLE cmoterm ADD CONSTRAINT cmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE cmoterm_aud ADD CONSTRAINT cmoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE conditionrelation ADD CONSTRAINT conditionrelation_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE conditionrelation ADD CONSTRAINT conditionrelation_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); -ALTER TABLE conditionrelation_aud ADD CONSTRAINT conditionrelation_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE construct_reference ADD CONSTRAINT construct_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); -CREATE INDEX construct_reference_references_index ON construct_reference USING btree (references_id); -ALTER TABLE constructcomponentslotannotation ADD CONSTRAINT constructcomponentslotannotation_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); -CREATE INDEX constructcomponentslotannotation_taxon_index ON constructcomponentslotannotation USING btree (taxon_id); -ALTER TABLE constructgenomicentityassociation ADD CONSTRAINT constructgenomicentityassociation_object_id_fk FOREIGN KEY (object_id) REFERENCES genomicentity (id); -CREATE INDEX constructgenomicentityassociation_object_index ON constructgenomicentityassociation USING btree (object_id); -ALTER TABLE crossreference ADD CONSTRAINT crossreference_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE crossreference_aud ADD CONSTRAINT crossreference_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE curationreport ADD CONSTRAINT curationreport_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE curationreport_aud ADD CONSTRAINT curationreport_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE curationreportgroup ADD CONSTRAINT curationreportgroup_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE curationreportgroup_aud ADD CONSTRAINT curationreportgroup_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE curationreporthistory ADD CONSTRAINT curationreporthistory_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE curationreportgroup_aud ADD CONSTRAINT curationreporthistory_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE daoterm ADD CONSTRAINT daoterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE daoterm_aud ADD CONSTRAINT daoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); -ALTER TABLE dataprovider ADD CONSTRAINT dataprovider_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE dataprovider_aud ADD CONSTRAINT dataprovider_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE diseaseannotation ADD CONSTRAINT diseaseannotation_object_id_fk FOREIGN KEY (object_id) REFERENCES doterm (id); -CREATE INDEX diseaseannotation_object_index ON diseaseannotation USING btree (object_id); -ALTER TABLE diseaseannotation_biologicalentity ADD CONSTRAINT diseaseannotation_biologicalentity_dgm_id_fk FOREIGN KEY (diseasegeneticmodifiers_id) REFERENCES biologicalentity (id); -CREATE INDEX diseaseannotation_biologicalentity_dgms_index ON diseaseannotation_biologicalentity USING btree (diseasegeneticmodifiers_id); -ALTER TABLE diseaseannotation_ecoterm ADD CONSTRAINT diseaseannotation_ecoterm_evidencecodes_id_fk FOREIGN KEY (evidencecodes_id) REFERENCES ecoterm (id); -CREATE INDEX diseaseannotation_ecoterm_evidencecodes_index ON diseaseannotation_ecoterm USING btree (evidencecodes_id); -ALTER TABLE diseaseannotation_gene ADD CONSTRAINT diseaseannotation_gene_with_id_fk FOREIGN KEY (with_id) REFERENCES gene (id); -CREATE INDEX diseaseannotation_gene_with_index ON diseaseannotation_gene USING btree (with_id); -ALTER TABLE doterm ADD CONSTRAINT doterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE doterm_aud ADD CONSTRAINT doterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE dpoterm ADD CONSTRAINT dpoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); -ALTER TABLE dpoterm_aud ADD CONSTRAINT dpoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); -ALTER TABLE ecoterm ADD CONSTRAINT ecoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE ecoterm_aud ADD CONSTRAINT ecoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE emapaterm ADD CONSTRAINT emapaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE emapaterm_aud ADD CONSTRAINT emapaterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); -ALTER TABLE evidenceassociation_informationcontententity ADD CONSTRAINT evidenceassociation_infocontent_evidence_id_fk FOREIGN KEY (evidence_id) REFERENCES informationcontententity (id); -CREATE INDEX evidenceassociation_infocontent_evidence_index ON evidenceassociation_informationcontententity USING btree (evidence_id); -ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionchemical_id_fk FOREIGN KEY (conditionchemical_id) REFERENCES chemicalterm (id); -ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionid_id_fk FOREIGN KEY (conditionid_id) REFERENCES experimentalconditionontologyterm (id); -ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditiontaxon_id_fk FOREIGN KEY (conditiontaxon_id) REFERENCES ncbitaxonterm (id); -ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditiongeneontology_id_fk FOREIGN KEY (conditiongeneontology_id) REFERENCES goterm (id); -ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionclass_id_fk FOREIGN KEY (conditionclass_id) REFERENCES zecoterm (id); -ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionanatomy_id_fk FOREIGN KEY (conditionanatomy_id) REFERENCES anatomicalterm (id); -ALTER TABLE experimentalconditionontologyterm ADD CONSTRAINT experimentalconditionontologyterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE experimentalconditionontologyterm_aud ADD CONSTRAINT experimentalconditionontologyterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE fbdvterm ADD CONSTRAINT fbdvterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); -ALTER TABLE fbdvterm_aud ADD CONSTRAINT fbdvterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); -ALTER TABLE gene ADD CONSTRAINT gene_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); -ALTER TABLE gene ADD CONSTRAINT gene_genetype_id_fk FOREIGN KEY (genetype_id) REFERENCES soterm (id); -CREATE INDEX gene_genetype_index ON gene USING btree (genetype_id); -ALTER TABLE gene_aud ADD CONSTRAINT gene_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); -ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES gene (id); -ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_sgdstrainbackground_id_fk FOREIGN KEY (sgdstrainbackground_id) REFERENCES affectedgenomicmodel (id); -ALTER TABLE genefullnameslotannotation ADD CONSTRAINT genefullnameslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); -CREATE INDEX genefullname_singlegene_index ON genefullnameslotannotation USING btree (singlegene_id); -ALTER TABLE genesecondaryidslotannotation ADD CONSTRAINT genesecondaryidslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); -CREATE INDEX genesecondaryid_singlegene_index ON genesecondaryidslotannotation USING btree (singlegene_id); -ALTER TABLE genesymbolslotannotation ADD CONSTRAINT genesymbolslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); -CREATE INDEX genesymbol_singlegene_index ON genesymbolslotannotation USING btree (singlegene_id); -ALTER TABLE genesynonymslotannotation ADD CONSTRAINT genesynonymslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); -CREATE INDEX genesynonym_singlegene_index ON genesynonymslotannotation USING btree (singlegene_id); -ALTER TABLE genesystematicnameslotannotation ADD CONSTRAINT genesystematicnameslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); -CREATE INDEX genesystematicname_singlegene_index ON genesystematicnameslotannotation USING btree (singlegene_id); -ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_objectgene_id_fk FOREIGN KEY (objectgene_id) REFERENCES gene (id); -ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_subjectgene_id_fk FOREIGN KEY (subjectgene_id) REFERENCES gene (id); -CREATE INDEX genetogeneorthology_object_index ON genetogeneorthology USING btree (objectgene_id); -CREATE INDEX genetogeneorthology_subject_index ON genetogeneorthology USING btree (subjectgene_id); -ALTER TABLE genetogeneorthologycurated ADD CONSTRAINT genetogeneorthologycurated_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES ecoterm (id); -ALTER TABLE genetogeneorthologycurated ADD CONSTRAINT genetogeneorthologycurated_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); -CREATE INDEX genetogeneorthologycurated_evidencecode_index ON genetogeneorthologycurated USING btree (evidencecode_id); -CREATE INDEX genetogeneorthologycurated_singlereference_index ON genetogeneorthologycurated USING btree (singlereference_id); -ALTER TABLE genomicentity ADD CONSTRAINT genomicentity_id_fk FOREIGN KEY (id) REFERENCES biologicalentity (id); -ALTER TABLE genomicentity_aud ADD CONSTRAINT genomicentity_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES biologicalentity_aud (id, rev); -ALTER TABLE genomicentity_crossreference ADD CONSTRAINT genomicentitycrossreference_genomicentity_id_fk FOREIGN KEY (genomicentity_id) REFERENCES genomicentity (id); -CREATE INDEX genomicentity_crossreference_ge_xref_index ON genomicentity_crossreference USING btree (genomicentity_id, crossreferences_id); -CREATE INDEX genomicentity_crossreference_genomicentity_index ON genomicentity_crossreference USING btree (genomicentity_id); -ALTER TABLE goterm ADD CONSTRAINT goterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE goterm_aud ADD CONSTRAINT goterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE hpterm ADD CONSTRAINT hpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); -ALTER TABLE hpterm_aud ADD CONSTRAINT hpterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); -ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); -ALTER TABLE informationcontententity_aud ADD CONSTRAINT informationcontententity_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES curieobject_aud (id, rev); -ALTER TABLE materm ADD CONSTRAINT materm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE materm_aud ADD CONSTRAINT materm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); -ALTER TABLE miterm ADD CONSTRAINT miterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE miterm_aud ADD CONSTRAINT miterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE mmoterm_aud ADD CONSTRAINT mmoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE mmusdvterm ADD CONSTRAINT mmusdvterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); -ALTER TABLE mmusdvterm_aud ADD CONSTRAINT mmusdvterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); -ALTER TABLE modterm ADD CONSTRAINT modterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE modterm_aud ADD CONSTRAINT modterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE molecule ADD CONSTRAINT molecule_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); -ALTER TABLE molecule_aud ADD CONSTRAINT molecule_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES chemicalterm_aud (id, rev); -ALTER TABLE mpathterm ADD CONSTRAINT mpathterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE mpathterm_aud ADD CONSTRAINT mpathterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE mpterm ADD CONSTRAINT mpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); -ALTER TABLE mpterm_aud ADD CONSTRAINT mpterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); -ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE ncbitaxonterm_aud ADD CONSTRAINT ncbitaxonterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE note ADD CONSTRAINT note_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE note_aud ADD CONSTRAINT note_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE note_reference ADD CONSTRAINT note_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); -CREATE INDEX note_reference_references_index ON note_reference USING btree (references_id); -ALTER TABLE obiterm ADD CONSTRAINT obiterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE obiterm_aud ADD CONSTRAINT obiterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); -ALTER TABLE ontologyterm_aud ADD CONSTRAINT ontologyterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES curieobject_aud (id, rev); -ALTER TABLE ontologyterm_crossreference ADD CONSTRAINT ontologyterm_crossreference_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); -CREATE INDEX ontologyterm_crossreference_ontologyterm_index ON ontologyterm_crossreference USING btree (ontologyterm_id); -ALTER TABLE ontologyterm_definitionurls ADD CONSTRAINT ontologyterm_definitionurls_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); -CREATE INDEX ontologyterm_definitionurls_ontologyterm_index ON ontologyterm_definitionurls USING btree (ontologyterm_id); -ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_isaancestors_id_fk FOREIGN KEY (isaancestors_id) REFERENCES ontologyterm(id); -ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_isadescendants_id_fk FOREIGN KEY (isadescendants_id) REFERENCES ontologyterm(id); -CREATE INDEX ontologyterm_isa_ancestor_descendant_isaancestors_index ON ontologyterm_isa_ancestor_descendant USING btree (isaancestors_id); -CREATE INDEX ontologyterm_isa_ancestor_descendant_isadescendants_index ON ontologyterm_isa_ancestor_descendant USING btree (isadescendants_id); -ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_isachildren_id_fk FOREIGN KEY (isachildren_id) REFERENCES ontologyterm (id); -ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_isaparents_id_fk FOREIGN KEY (isaparents_id) REFERENCES ontologyterm (id); -CREATE INDEX ontologyterm_isa_parent_children_isachildren_index ON ontologyterm_isa_parent_children USING btree (isachildren_id); -CREATE INDEX ontologyterm_isa_parent_children_isaparents_index ON ontologyterm_isa_parent_children USING btree (isaparents_id); -ALTER TABLE ontologyterm_secondaryidentifiers ADD CONSTRAINT ontologyterm_secondaryidentifiers_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); -CREATE INDEX ontologyterm_secondaryidentifiers_ontologyterm_index ON ontologyterm_secondaryidentifiers USING btree (ontologyterm_id); -ALTER TABLE ontologyterm_subsets ADD CONSTRAINT ontologyterm_subsets_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); -CREATE INDEX ontologyterm_subsets_ontologyterm_index ON ontologyterm_subsets USING btree (ontologyterm_id); -ALTER TABLE ontologyterm_synonym ADD CONSTRAINT ontologyterm_synonym_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); -CREATE INDEX ontologyterm_synonym_ontologyterm_index ON ontologyterm_synonym USING btree (ontologyterm_id); -ALTER TABLE organization ADD CONSTRAINT organization_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE organization_aud ADD CONSTRAINT organization_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE patoterm ADD CONSTRAINT patoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE patoterm_aud ADD CONSTRAINT patoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE person ADD CONSTRAINT person_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE person_aud ADD CONSTRAINT person_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE phenotypeterm ADD CONSTRAINT phenotypeterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE phenotypeterm_aud ADD CONSTRAINT phenotypeterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE pwterm ADD CONSTRAINT pwterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE pwterm_aud ADD CONSTRAINT pwterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE reagent ADD CONSTRAINT reagent_id_fk FOREIGN KEY (id) REFERENCES submittedobject (id); -ALTER TABLE reagent_aud ADD CONSTRAINT reagent_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES submittedobject_aud (id, rev); -ALTER TABLE reference ADD CONSTRAINT reference_id_fk FOREIGN KEY (id) REFERENCES informationcontententity (id); -ALTER TABLE reference_aud ADD CONSTRAINT reference_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES informationcontententity_aud (id, rev); -ALTER TABLE reference_crossreference ADD CONSTRAINT reference_crossreference_reference_id_fk FOREIGN KEY (reference_id) REFERENCES reference (id); -CREATE INDEX reference_crossreference_reference_index ON reference_crossreference USING btree (reference_id); -ALTER TABLE resourcedescriptor ADD CONSTRAINT resourcedescriptor_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE resourcedescriptor_aud ADD CONSTRAINT resourcedescriptor_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE resourcedescriptorpage ADD CONSTRAINT resourcedescriptorpage_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE resourcedescriptorpage_aud ADD CONSTRAINT resourcedescriptorpage_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE roterm ADD CONSTRAINT roterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE roterm_aud ADD CONSTRAINT roterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE rsterm ADD CONSTRAINT rsterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE rsterm_aud ADD CONSTRAINT rsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE singlereferenceassociation ADD CONSTRAINT singlereferenceassociation_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); -CREATE INDEX singlereferenceassociation_singlereference_index ON singlereferenceassociation USING btree (singlereference_id); -ALTER TABLE slotannotation ADD CONSTRAINT slotannotation_id_fk FOREIGN KEY (id) REFERENCES auditedobject(id); -ALTER TABLE slotannotation_aud ADD CONSTRAINT slotannotation_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE slotannotation_informationcontententity ADD CONSTRAINT slotannotation_informationcontententity_evidence_id_fk FOREIGN KEY (evidence_id) REFERENCES informationcontententity (id); -CREATE INDEX slotannotation_informationcontententity_evidence_index ON slotannotation_informationcontententity USING btree (evidence_id); -ALTER TABLE soterm ADD CONSTRAINT soterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE soterm_aud ADD CONSTRAINT soterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE species ADD CONSTRAINT species_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE species ADD CONSTRAINT species_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); -ALTER TABLE species_aud ADD CONSTRAINT species_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE stageterm ADD CONSTRAINT stageterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE stageterm_aud ADD CONSTRAINT stageterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE synonym_aud ADD CONSTRAINT synonym_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE uberonterm ADD CONSTRAINT uberonterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE uberonterm_aud ADD CONSTRAINT uberonterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); -ALTER TABLE variant ADD CONSTRAINT variant_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); -ALTER TABLE variant ADD CONSTRAINT variant_sourcegeneralconsequence_id_fk FOREIGN KEY (sourcegeneralconsequence_id) REFERENCES soterm (id); -ALTER TABLE variant ADD CONSTRAINT variant_varianttype_id_fk FOREIGN KEY (varianttype_id) REFERENCES soterm (id); -CREATE INDEX variant_sourcegeneralconsequence_index ON variant USING btree (sourcegeneralconsequence_id); -CREATE INDEX variant_varianttype_index ON variant USING btree (varianttype_id); -ALTER TABLE variant_aud ADD CONSTRAINT variant_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); -ALTER TABLE variant_note ADD CONSTRAINT variant_note_variant_id_fk FOREIGN KEY (variant_id) REFERENCES variant (id); -CREATE INDEX variant_note_variant_index ON variant_note USING btree (variant_id); -ALTER TABLE vocabulary ADD CONSTRAINT vocabulary_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE vocabulary_aud ADD CONSTRAINT vocabulary_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE vocabularyterm ADD CONSTRAINT vocabularyterm_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE vocabularyterm_aud ADD CONSTRAINT vocabularyterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE vocabularytermset ADD CONSTRAINT vocabularytermset_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE vocabularytermset_aud ADD CONSTRAINT vocabularytermset_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); -ALTER TABLE vtterm ADD CONSTRAINT vtterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE vtterm_aud ADD CONSTRAINT vtterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE wbbtterm ADD CONSTRAINT wbbtterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE wbbtterm_aud ADD CONSTRAINT wbbtterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); -ALTER TABLE wblsterm ADD CONSTRAINT wblsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); -ALTER TABLE wblsterm_aud ADD CONSTRAINT wblsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); -ALTER TABLE wbphenotypeterm ADD CONSTRAINT wbphenotypeterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); -ALTER TABLE wbphenotypeterm_aud ADD CONSTRAINT wbphenotypeterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); -ALTER TABLE xbaterm ADD CONSTRAINT xbaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE xbaterm_aud ADD CONSTRAINT xbaterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); -ALTER TABLE xbedterm ADD CONSTRAINT xbedterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE xbedterm_aud ADD CONSTRAINT xbedterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE xbsterm ADD CONSTRAINT xbsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); -ALTER TABLE xbsterm_aud ADD CONSTRAINT xbsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); -ALTER TABLE xcoterm ADD CONSTRAINT xcoterm_id_fk FOREIGN KEY (id) REFERENCES experimentalconditionontologyterm (id); -ALTER TABLE xcoterm_aud ADD CONSTRAINT xcoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES experimentalconditionontologyterm_aud (id, rev); -ALTER TABLE xpoterm ADD CONSTRAINT xpoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); -ALTER TABLE xpoterm_aud ADD CONSTRAINT xpoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); -ALTER TABLE xsmoterm ADD CONSTRAINT xsmoterm_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); -ALTER TABLE xsmoterm_aud ADD CONSTRAINT xsmoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES chemicalterm_aud (id, rev); -ALTER TABLE zecoterm ADD CONSTRAINT zecoterm_id_fk FOREIGN KEY (id) REFERENCES experimentalconditionontologyterm (id); -ALTER TABLE zecoterm_aud ADD CONSTRAINT zecoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES experimentalconditionontologyterm_aud (id, rev); -ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE zfaterm_aud ADD CONSTRAINT zfaterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); -ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); -ALTER TABLE zfsterm_aud ADD CONSTRAINT zfsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); - --- Remove old columns - ALTER TABLE affectedgenomicmodel DROP COLUMN curie; ALTER TABLE agmdiseaseannotation DROP COLUMN inferredallele_curie; ALTER TABLE agmdiseaseannotation DROP COLUMN inferredgene_curie; @@ -1994,6 +1584,354 @@ ALTER TABLE zecoterm DROP COLUMN curie; ALTER TABLE zfaterm DROP COLUMN curie; ALTER TABLE zfsterm DROP COLUMN curie; +UPDATE affectedgenomicmodel_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; +DELETE FROM affectedgenomicmodel_aud WHERE id IS NULL; +UPDATE affectedgenomicmodel_aud t SET subtype_id = a.id FROM auditedobject a WHERE t.subtype_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE agmdiseaseannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE agmdiseaseannotation_aud t SET inferredallele_id = a.id FROM auditedobject a WHERE t.inferredallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE agmdiseaseannotation_aud t SET assertedallele_id = a.id FROM auditedobject a WHERE t.assertedallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE agmdiseaseannotation_aud t SET inferredgene_id = a.id FROM auditedobject a WHERE t.inferredgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE agmdiseaseannotation_aud t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE agmdiseaseannotation_gene_aud t SET agmdiseaseannotation_id = a.id FROM auditedobject a WHERE t.agmdiseaseannotation_id = a.old_id AND a.tablename = 'association'; +UPDATE agmdiseaseannotation_gene_aud t SET assertedgenes_id = a.id FROM auditedobject a WHERE t.assertedgenes_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allele_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; +DELETE FROM allele_aud WHERE id IS NULL; +UPDATE allele_aud t SET incollection_id = a.id FROM auditedobject a WHERE t.incollection_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE allele_note_aud t SET allele_id = a.id FROM auditedobject a WHERE t.allele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +DELETE FROM allele_note_aud WHERE allele_id IS NULL; +UPDATE allele_note_aud t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; +UPDATE allele_reference_aud t SET allele_id = a.id FROM auditedobject a WHERE t.allele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +DELETE FROM allele_reference_aud WHERE allele_id IS NULL; +UPDATE allele_reference_aud t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE alleledatabasestatusslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE alleledatabasestatusslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE alleledatabasestatusslotannotation_aud t SET databasestatus_id = a.id FROM auditedobject a WHERE t.databasestatus_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE allelediseaseannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE allelediseaseannotation_aud t SET inferredgene_id = a.id FROM auditedobject a WHERE t.inferredgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelediseaseannotation_aud t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelediseaseannotation_gene_aud t SET allelediseaseannotation_id = a.id FROM auditedobject a WHERE t.allelediseaseannotation_id = a.old_id AND a.tablename = 'association'; +UPDATE allelediseaseannotation_gene_aud t SET assertedgenes_id = a.id FROM auditedobject a WHERE t.assertedgenes_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelefullnameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelefullnameslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelefunctionalimpactslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelefunctionalimpactslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelefunctionalimpactslotannotation_aud t SET phenotypeterm_id = a.id FROM auditedobject a WHERE t.phenotypeterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE allelefunctionalimpactslotannotation_vocabularyterm_aud t SET allelefunctionalimpactslotannotation_id = a.id FROM auditedobject a WHERE t.allelefunctionalimpactslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelefunctionalimpactslotannotation_vocabularyterm_aud t SET functionalimpacts_id = a.id FROM auditedobject a WHERE t.functionalimpacts_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE allelegeneassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE allelegeneassociation_aud t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelegeneassociation_aud t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelegenomicentityassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE allelegenomicentityassociation_aud t SET evidencecode_id = a.id FROM auditedobject a WHERE t.evidencecode_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE allelegenomicentityassociation_aud t SET relatednote_id = a.id FROM auditedobject a WHERE t.relatednote_id = a.old_id AND a.tablename = 'note'; +UPDATE allelegenomicentityassociation_aud t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE allelegermlinetransmissionstatusslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelegermlinetransmissionstatusslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelegermlinetransmissionstatusslotannotation_aud t SET germlinetransmissionstatus_id = a.id FROM auditedobject a WHERE t.germlinetransmissionstatus_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE alleleinheritancemodeslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE alleleinheritancemodeslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE alleleinheritancemodeslotannotation_aud t SET inheritancemode_id = a.id FROM auditedobject a WHERE t.inheritancemode_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE alleleinheritancemodeslotannotation_aud t SET phenotypeterm_id = a.id FROM auditedobject a WHERE t.phenotypeterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE allelemutationtypeslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelemutationtypeslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelemutationtypeslotannotation_soterm_aud t SET allelemutationtypeslotannotation_id = a.id FROM auditedobject a WHERE t.allelemutationtypeslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelemutationtypeslotannotation_soterm_aud t SET mutationtypes_id = a.id FROM auditedobject a WHERE t.mutationtypes_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE allelenomenclatureeventslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelenomenclatureeventslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelenomenclatureeventslotannotation_aud t SET nomenclatureevent_id = a.id FROM auditedobject a WHERE t.nomenclatureevent_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE allelesecondaryidslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelesecondaryidslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelesymbolslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelesymbolslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE allelesynonymslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE allelesynonymslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE alliancemember_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'organization'; +UPDATE anatomicalterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM anatomicalterm_aud WHERE id IS NULL; +UPDATE annotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE annotation_aud t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; +UPDATE annotation_conditionrelation_aud t SET annotation_id = a.id FROM auditedobject a WHERE t.annotation_id = a.old_id AND a.tablename = 'association'; +UPDATE annotation_conditionrelation_aud t SET conditionrelations_id = a.id FROM auditedobject a WHERE t.conditionrelations_id = a.old_id AND a.tablename = 'conditionrelation'; +UPDATE annotation_note_aud t SET annotation_id = a.id FROM auditedobject a WHERE t.annotation_id = a.old_id AND a.tablename = 'association'; +UPDATE annotation_note_aud t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; +UPDATE apoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM apoterm_aud WHERE id IS NULL; +UPDATE association_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE atpterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM atpterm_aud WHERE id IS NULL; +UPDATE biologicalentity_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; +DELETE FROM biologicalentity_aud WHERE id IS NULL; +UPDATE biologicalentity_aud t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE biologicalentity_aud t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; +UPDATE bspoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM bspoterm_aud WHERE id IS NULL; +UPDATE bulkfmsload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +UPDATE bulkload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +UPDATE bulkload_aud t SET group_id = a.id FROM auditedobject a WHERE t.group_id = a.old_id AND a.tablename = 'bulkloadgroup'; +UPDATE bulkloadfile_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfile'; +UPDATE bulkloadfile_aud t SET bulkload_id = a.id FROM auditedobject a WHERE t.bulkload_id = a.old_id AND a.tablename = 'bulkload'; +UPDATE bulkloadfileexception_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfileexception'; +UPDATE bulkloadfileexception_aud t SET bulkloadfilehistory_id = a.id FROM auditedobject a WHERE t.bulkloadfilehistory_id = a.old_id AND a.tablename = 'bulkloadfilehistory'; +UPDATE bulkloadfilehistory_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfilehistory'; +UPDATE bulkloadfilehistory_aud t SET bulkloadfile_id = a.id FROM auditedobject a WHERE t.bulkloadfile_id = a.old_id AND a.tablename = 'bulkloadfile'; +UPDATE bulkloadgroup_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadgroup'; +UPDATE bulkmanualload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +UPDATE bulkscheduledload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +UPDATE bulkurlload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +UPDATE chebiterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM chebiterm_aud WHERE id IS NULL; +UPDATE chemicalterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM chemicalterm_aud WHERE id IS NULL; +UPDATE clterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM clterm_aud WHERE id IS NULL; +UPDATE cmoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM cmoterm_aud WHERE id IS NULL; +UPDATE conditionrelation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'conditionrelation'; +UPDATE conditionrelation_aud t SET conditionrelationtype_id = a.id FROM auditedobject a WHERE t.conditionrelationtype_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE conditionrelation_aud t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE conditionrelation_experimentalcondition_aud t SET conditionrelation_id = a.id FROM auditedobject a WHERE t.conditionrelation_id = a.old_id AND a.tablename = 'conditionrelation'; +UPDATE conditionrelation_experimentalcondition_aud t SET conditions_id = a.id FROM auditedobject a WHERE t.conditions_id = a.old_id AND a.tablename = 'experimentalcondition'; +UPDATE construct_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'reagent'; +UPDATE construct_reference_aud t SET construct_id = a.id FROM auditedobject a WHERE t.construct_id = a.old_id AND a.tablename = 'reagent'; +UPDATE construct_reference_aud t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE constructcomponentslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE constructcomponentslotannotation_aud t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; +UPDATE constructcomponentslotannotation_aud t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE constructcomponentslotannotation_aud t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE constructcomponentslotannotation_note_aud t SET constructcomponentslotannotation_id = a.id FROM auditedobject a WHERE t.constructcomponentslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE constructcomponentslotannotation_note_aud t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; +UPDATE constructfullnameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE constructfullnameslotannotation_aud t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; +UPDATE constructgenomicentityassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE constructgenomicentityassociation_aud t SET subject_id = a.id FROM auditedobject a WHERE t.subject_id = a.old_id AND a.tablename = 'reagent'; +UPDATE constructgenomicentityassociation_aud t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE constructgenomicentityassociation_aud t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE constructgenomicentityassociation_note_aud t SET constructgenomicentityassociation_id = a.id FROM auditedobject a WHERE t.constructgenomicentityassociation_id = a.old_id AND a.tablename = 'association'; +UPDATE constructgenomicentityassociation_note_aud t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; +UPDATE constructsymbolslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE constructsymbolslotannotation_aud t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; +UPDATE constructsynonymslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE constructsynonymslotannotation_aud t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; +UPDATE crossreference_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'crossreference'; +UPDATE crossreference_aud t SET resourcedescriptorpage_id = a.id FROM auditedobject a WHERE t.resourcedescriptorpage_id = a.old_id AND a.tablename = 'resourcedescriptorpage'; +UPDATE daoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM daoterm_aud WHERE id IS NULL; +UPDATE dataprovider_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'dataprovider'; +UPDATE dataprovider_aud t SET sourceorganization_id = a.id FROM auditedobject a WHERE t.sourceorganization_id = a.old_id AND a.tablename = 'organization'; +UPDATE dataprovider_aud t SET crossreference_id = a.id FROM auditedobject a WHERE t.crossreference_id = a.old_id AND a.tablename = 'crossreference'; +UPDATE diseaseannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE diseaseannotation_aud t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE diseaseannotation_aud t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE diseaseannotation_aud t SET diseasegeneticmodifierrelation_id = a.id FROM auditedobject a WHERE t.diseasegeneticmodifierrelation_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE diseaseannotation_aud t SET annotationtype_id = a.id FROM auditedobject a WHERE t.annotationtype_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE diseaseannotation_aud t SET geneticsex_id = a.id FROM auditedobject a WHERE t.geneticsex_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE diseaseannotation_aud t SET secondarydataprovider_id = a.id FROM auditedobject a WHERE t.secondarydataprovider_id = a.old_id AND a.tablename = 'dataprovider'; +UPDATE diseaseannotation_biologicalentity_aud t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; +UPDATE diseaseannotation_biologicalentity_aud t SET diseasegeneticmodifiers_id = a.id FROM auditedobject a WHERE t.diseasegeneticmodifiers_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE diseaseannotation_ecoterm_aud t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; +UPDATE diseaseannotation_ecoterm_aud t SET evidencecodes_id = a.id FROM auditedobject a WHERE t.evidencecodes_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE diseaseannotation_gene_aud t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; +UPDATE diseaseannotation_gene_aud t SET with_id = a.id FROM auditedobject a WHERE t.with_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE diseaseannotation_vocabularyterm_aud t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; +UPDATE diseaseannotation_vocabularyterm_aud t SET diseasequalifiers_id = a.id FROM auditedobject a WHERE t.diseasequalifiers_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE doterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM doterm_aud WHERE id IS NULL; +UPDATE dpoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM dpoterm_aud WHERE id IS NULL; +UPDATE ecoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM ecoterm_aud WHERE id IS NULL; +UPDATE emapaterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM emapaterm_aud WHERE id IS NULL; +UPDATE evidenceassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE evidenceassociation_informationcontententity_aud t SET evidenceassociation_id = a.id FROM auditedobject a WHERE t.evidenceassociation_id = a.old_id AND a.tablename = 'association'; +UPDATE evidenceassociation_informationcontententity_aud t SET evidence_id = a.id FROM auditedobject a WHERE t.evidence_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE experimentalcondition_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'experimentalcondition'; +UPDATE experimentalcondition_aud t SET conditionanatomy_id = a.id FROM auditedobject a WHERE t.conditionanatomy_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE experimentalcondition_aud t SET conditionchemical_id = a.id FROM auditedobject a WHERE t.conditionchemical_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE experimentalcondition_aud t SET conditionclass_id = a.id FROM auditedobject a WHERE t.conditionclass_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE experimentalcondition_aud t SET conditiongeneontology_id = a.id FROM auditedobject a WHERE t.conditiongeneontology_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE experimentalcondition_aud t SET conditionid_id = a.id FROM auditedobject a WHERE t.conditionid_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE experimentalcondition_aud t SET conditiontaxon_id = a.id FROM auditedobject a WHERE t.conditiontaxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE experimentalconditionontologyterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE fbdvterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM fbdvterm_aud WHERE id IS NULL; +UPDATE gene_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; +DELETE FROM gene_aud WHERE id IS NULL; +UPDATE gene_aud t SET genetype_id = a.id FROM auditedobject a WHERE t.genetype_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE genediseaseannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE genediseaseannotation_aud t SET sgdstrainbackground_id = a.id FROM auditedobject a WHERE t.sgdstrainbackground_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genediseaseannotation_aud t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genefullnameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE genefullnameslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genesecondaryidslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE genesecondaryidslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genesymbolslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE genesymbolslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genesynonymslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE genesynonymslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genesystematicnameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE genesystematicnameslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genetogeneorthology_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; +UPDATE genetogeneorthology_aud t SET subjectgene_id = a.id FROM auditedobject a WHERE t.subjectgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genetogeneorthology_aud t SET objectgene_id = a.id FROM auditedobject a WHERE t.objectgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; +UPDATE genetogeneorthologycurated_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; +UPDATE genetogeneorthologycurated_aud t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE genetogeneorthologycurated_aud t SET evidencecode_id = a.id FROM auditedobject a WHERE t.evidencecode_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE genetogeneorthologygenerated_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; +UPDATE genetogeneorthologygenerated_aud t SET isbestscore_id = a.id FROM auditedobject a WHERE t.isbestscore_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE genetogeneorthologygenerated_aud t SET isbestscorereverse_id = a.id FROM auditedobject a WHERE t.isbestscorereverse_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE genetogeneorthologygenerated_aud t SET confidence_id = a.id FROM auditedobject a WHERE t.confidence_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE genetogeneorthologygenerated_predictionmethodsmatched_aud t SET genetogeneorthologygenerated_id = a.id FROM auditedobject a WHERE t.genetogeneorthologygenerated_id = a.old_id AND a.tablename = 'genetogeneorthology'; +UPDATE genetogeneorthologygenerated_predictionmethodsmatched_aud t SET predictionmethodsmatched_id = a.id FROM auditedobject a WHERE t.predictionmethodsmatched_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE genetogeneorthologygenerated_predictionmethodsnotcalled_aud t SET genetogeneorthologygenerated_id = a.id FROM auditedobject a WHERE t.genetogeneorthologygenerated_id = a.old_id AND a.tablename = 'genetogeneorthology'; +UPDATE genetogeneorthologygenerated_predictionmethodsnotcalled_aud t SET predictionmethodsnotcalled_id = a.id FROM auditedobject a WHERE t.predictionmethodsnotcalled_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE genetogeneorthologygenerated_predictionmethodsnotmatched_aud t SET genetogeneorthologygenerated_id = a.id FROM auditedobject a WHERE t.genetogeneorthologygenerated_id = a.old_id AND a.tablename = 'genetogeneorthology'; +UPDATE genetogeneorthologygenerated_predictionmethodsnotmatched_aud t SET predictionmethodsnotmatched_id = a.id FROM auditedobject a WHERE t.predictionmethodsnotmatched_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE genomicentity_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; +DELETE FROM genomicentity_aud WHERE id IS NULL; +UPDATE genomicentity_crossreference_aud t SET genomicentity_id = a.id FROM auditedobject a WHERE t.genomicentity_curie = a.old_curie AND a.tablename = 'biologicalentity'; +DELETE FROM genomicentity_crossreference_aud WHERE genomicentity_id IS NULL; +UPDATE genomicentity_crossreference_aud t SET crossreferences_id = a.id FROM auditedobject a WHERE t.crossreferences_id = a.old_id AND a.tablename = 'crossreference'; +UPDATE goterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM goterm_aud WHERE id IS NULL; +UPDATE hpterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM hpterm_aud WHERE id IS NULL; +UPDATE informationcontententity_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'informationcontententity'; +DELETE FROM informationcontententity_aud WHERE id IS NULL; +UPDATE materm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM materm_aud WHERE id IS NULL; +UPDATE miterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM miterm_aud WHERE id IS NULL; +UPDATE mmoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM mmoterm_aud WHERE id IS NULL; +UPDATE mmusdvterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM mmusdvterm_aud WHERE id IS NULL; +UPDATE modterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM modterm_aud WHERE id IS NULL; +UPDATE molecule_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM molecule_aud WHERE id IS NULL; +UPDATE mpathterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM mpathterm_aud WHERE id IS NULL; +UPDATE mpterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM mpterm_aud WHERE id IS NULL; +UPDATE nameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE nameslotannotation_aud t SET nametype_id = a.id FROM auditedobject a WHERE t.nametype_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE nameslotannotation_aud t SET synonymscope_id = a.id FROM auditedobject a WHERE t.synonymscope_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE ncbitaxonterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM ncbitaxonterm_aud WHERE id IS NULL; +UPDATE note_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'note'; +UPDATE note_aud t SET notetype_id = a.id FROM auditedobject a WHERE t.notetype_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE note_reference_aud t SET note_id = a.id FROM auditedobject a WHERE t.note_id = a.old_id AND a.tablename = 'note'; +UPDATE note_reference_aud t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE obiterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM obiterm_aud WHERE id IS NULL; +UPDATE ontologyterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM ontologyterm_aud WHERE id IS NULL; +UPDATE ontologyterm_crossreference_aud t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM ontologyterm_crossreference_aud WHERE ontologyterm_id IS NULL; +UPDATE ontologyterm_crossreference_aud t SET crossreferences_id = a.id FROM auditedobject a WHERE t.crossreferences_id = a.old_id AND a.tablename = 'crossreference'; +UPDATE ontologyterm_definitionurls_aud t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM ontologyterm_definitionurls_aud WHERE ontologyterm_id IS NULL; +UPDATE ontologyterm_isa_ancestor_descendant_aud t SET isadescendants_id = a.id FROM auditedobject a WHERE t.isadescendants_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE ontologyterm_isa_ancestor_descendant_aud t SET isaancestors_id = a.id FROM auditedobject a WHERE t.isaancestors_curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM ontologyterm_isa_ancestor_descendant_aud WHERE isadescendants_id IS NULL OR isaancestors_id IS NULL; +UPDATE ontologyterm_isa_parent_children_aud t SET isachildren_id = a.id FROM auditedobject a WHERE t.isachildren_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE ontologyterm_isa_parent_children_aud t SET isaparents_id = a.id FROM auditedobject a WHERE t.isaparents_curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM ontologyterm_isa_parent_children_aud WHERE isachildren_id IS NULL OR isaparents_id IS NULL; +UPDATE ontologyterm_secondaryidentifiers_aud t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM ontologyterm_secondaryidentifiers_aud WHERE ontologyterm_id IS NULL; +UPDATE ontologyterm_subsets_aud t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM ontologyterm_subsets_aud WHERE ontologyterm_id IS NULL; +UPDATE ontologyterm_synonym_aud t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM ontologyterm_synonym_aud WHERE ontologyterm_id IS NULL; +UPDATE ontologyterm_synonym_aud t SET synonyms_id = a.id FROM auditedobject a WHERE t.synonyms_id = a.old_id AND a.tablename = 'synonym'; +UPDATE organization_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'organization'; +UPDATE organization_aud t SET homepageresourcedescriptorpage_id = a.id FROM auditedobject a WHERE t.homepageresourcedescriptorpage_id = a.old_id AND a.tablename = 'resourcedescriptorpage'; +UPDATE patoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM patoterm_aud WHERE id IS NULL; +UPDATE person_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'person'; +UPDATE person_aud t SET alliancemember_id = a.id FROM auditedobject a WHERE t.alliancemember_id = a.old_id AND a.tablename = 'organization'; +UPDATE person_emails_aud t SET person_id = a.id FROM auditedobject a WHERE t.person_id = a.old_id AND a.tablename = 'person'; +UPDATE person_oldemails_aud t SET person_id = a.id FROM auditedobject a WHERE t.person_id = a.old_id AND a.tablename = 'person'; +UPDATE personsetting_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'personsetting'; +UPDATE phenotypeterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE pwterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM pwterm_aud WHERE id IS NULL; +UPDATE reagent_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'reagent'; +UPDATE reagent_aud t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; +UPDATE reagent_secondaryidentifiers_aud t SET reagent_id = a.id FROM auditedobject a WHERE t.reagent_id = a.old_id AND a.tablename = 'reagent'; +UPDATE reference_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'informationcontententity'; +DELETE FROM reference_aud WHERE id IS NULL; +UPDATE reference_crossreference_aud t SET reference_id = a.id FROM auditedobject a WHERE t.reference_curie = a.old_curie AND a.tablename = 'informationcontententity'; +DELETE FROM reference_crossreference_aud WHERE reference_id IS NULL; +UPDATE reference_crossreference_aud t SET crossreferences_id = a.id FROM auditedobject a WHERE t.crossreferences_id = a.old_id AND a.tablename = 'crossreference'; +UPDATE resourcedescriptor_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'resourcedescriptor'; +UPDATE resourcedescriptor_synonyms_aud t SET resourcedescriptor_id = a.id FROM auditedobject a WHERE t.resourcedescriptor_id = a.old_id AND a.tablename = 'resourcedescriptor'; +UPDATE resourcedescriptorpage_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'resourcedescriptorpage'; +UPDATE resourcedescriptorpage_aud t SET resourcedescriptor_id = a.id FROM auditedobject a WHERE t.resourcedescriptor_id = a.old_id AND a.tablename = 'resourcedescriptor'; +UPDATE roterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM roterm_aud WHERE id IS NULL; +UPDATE rsterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM rsterm_aud WHERE id IS NULL; +UPDATE secondaryidslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE singlereferenceassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +UPDATE singlereferenceassociation_aud t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE slotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE slotannotation_informationcontententity_aud t SET slotannotation_id = a.id FROM auditedobject a WHERE t.slotannotation_id = a.old_id AND a.tablename = 'slotannotation'; +UPDATE slotannotation_informationcontententity_aud t SET evidence_id = a.id FROM auditedobject a WHERE t.evidence_curie = a.old_curie AND a.tablename = 'informationcontententity'; +UPDATE soterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM soterm_aud WHERE id IS NULL; +UPDATE species_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'species'; +UPDATE species_aud t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE species_commonnames_aud t SET species_id = a.id FROM auditedobject a WHERE t.species_id = a.old_id AND a.tablename = 'species'; +UPDATE stageterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM stageterm_aud WHERE id IS NULL; +UPDATE synonym_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'synonym'; +UPDATE uberonterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM uberonterm_aud WHERE id IS NULL; +UPDATE variant_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; +DELETE FROM variant_aud WHERE id IS NULL; +UPDATE variant_aud t SET varianttype_id = a.id FROM auditedobject a WHERE t.varianttype_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE variant_aud t SET sourcegeneralconsequence_id = a.id FROM auditedobject a WHERE t.sourcegeneralconsequence_curie = a.old_curie AND a.tablename = 'ontologyterm'; +UPDATE variant_aud t SET variantstatus_id = a.id FROM auditedobject a WHERE t.variantstatus_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE variant_note_aud t SET variant_id = a.id FROM auditedobject a WHERE t.variant_curie = a.old_curie AND a.tablename = 'biologicalentity'; +DELETE FROM variant_note_aud WHERE variant_id IS NULL; +UPDATE variant_note_aud t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; +UPDATE vocabulary_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabulary'; +UPDATE vocabularyterm_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE vocabularyterm_aud t SET vocabulary_id = a.id FROM auditedobject a WHERE t.vocabulary_id = a.old_id AND a.tablename = 'vocabulary'; +UPDATE vocabularyterm_synonyms_aud t SET vocabularyterm_id = a.id FROM auditedobject a WHERE t.vocabularyterm_id = a.old_id AND a.tablename = 'vocabularyterm'; +UPDATE vocabularytermset_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabularytermset'; +UPDATE vocabularytermset_aud t SET vocabularytermsetvocabulary_id = a.id FROM auditedobject a WHERE t.vocabularytermsetvocabulary_id = a.old_id AND a.tablename = 'vocabulary'; +UPDATE vocabularytermset_vocabularyterm_aud t SET vocabularytermsets_id = a.id FROM auditedobject a WHERE t.vocabularytermsets_id = a.old_id AND a.tablename = 'vocabularytermset'; +UPDATE vocabularytermset_vocabularyterm_aud t SET memberterms_id = a.id FROM auditedobject a WHERE t.memberterms_id = a.old_id AND a.tablename = 'vocabularyterm';; +UPDATE vtterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM vtterm_aud WHERE id IS NULL; +UPDATE wbbtterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM wbbtterm_aud WHERE id IS NULL; +UPDATE wblsterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM wblsterm_aud WHERE id IS NULL; +UPDATE wbphenotypeterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM wbphenotypeterm_aud WHERE id IS NULL; +UPDATE xbaterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM xbaterm_aud WHERE id IS NULL; +UPDATE xbedterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM xbedterm_aud WHERE id IS NULL; +UPDATE xbsterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM xbsterm_aud WHERE id IS NULL; +UPDATE xcoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM xcoterm_aud WHERE id IS NULL; +UPDATE xpoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM xpoterm_aud WHERE id IS NULL; +UPDATE xsmoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM xsmoterm_aud WHERE id IS NULL; +UPDATE zecoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM zecoterm_aud WHERE id IS NULL; +UPDATE zfaterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM zfaterm_aud WHERE id IS NULL; +UPDATE zfsterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM zfsterm_aud WHERE id IS NULL; + ALTER TABLE affectedgenomicmodel_aud DROP COLUMN curie; ALTER TABLE agmdiseaseannotation_aud DROP COLUMN inferredallele_curie; ALTER TABLE agmdiseaseannotation_aud DROP COLUMN inferredgene_curie; @@ -2134,30 +2072,505 @@ ALTER TABLE auditedobject DROP COLUMN old_id; ALTER TABLE auditedobject DROP COLUMN old_curie; ALTER TABLE auditedobject DROP COLUMN tablename; -DROP SEQUENCE association_seq; -DROP SEQUENCE bulkload_seq; -DROP SEQUENCE bulkloadfile_seq; -DROP SEQUENCE bulkloadfileexception_seq; -DROP SEQUENCE bulkloadfilehistory_seq; -DROP SEQUENCE bulkloadgroup_seq; -DROP SEQUENCE conditionrelation_seq; -DROP SEQUENCE crossreference_seq; -DROP SEQUENCE curationreport_seq; -DROP SEQUENCE curationreportgroup_seq; -DROP SEQUENCE curationreporthistory_seq; -DROP SEQUENCE dataprovider_seq; -DROP SEQUENCE experimentalcondition_seq; -DROP SEQUENCE genetogeneorthology_seq; -DROP SEQUENCE note_seq; -DROP SEQUENCE organization_seq; -DROP SEQUENCE person_seq; -DROP SEQUENCE personsetting_seq; -DROP SEQUENCE reagent_seq; -DROP SEQUENCE resourcedescriptor_seq; -DROP SEQUENCE resourcedescriptorpage_seq; -DROP SEQUENCE slotannotation_seq; -DROP SEQUENCE species_seq; -DROP SEQUENCE synonym_seq; -DROP SEQUENCE vocabulary_seq; -DROP SEQUENCE vocabularyterm_seq; -DROP SEQUENCE vocabularytermset_seq; \ No newline at end of file +ALTER TABLE association_aud DROP COLUMN revtype; +ALTER TABLE biologicalentity_aud DROP COLUMN revtype; +ALTER TABLE bulkload_aud DROP COLUMN revtype; +ALTER TABLE bulkloadfile_aud DROP COLUMN revtype; +ALTER TABLE bulkloadfileexception_aud DROP COLUMN revtype; +ALTER TABLE bulkloadfilehistory_aud DROP COLUMN revtype; +ALTER TABLE bulkloadgroup_aud DROP COLUMN revtype; +ALTER TABLE conditionrelation_aud DROP COLUMN revtype; +ALTER TABLE crossreference_aud DROP COLUMN revtype; +ALTER TABLE dataprovider_aud DROP COLUMN revtype; +ALTER TABLE experimentalcondition_aud DROP COLUMN revtype; +ALTER TABLE genetogeneorthology_aud DROP COLUMN revtype; +ALTER TABLE informationcontententity_aud DROP COLUMN revtype; +ALTER TABLE note_aud DROP COLUMN revtype; +ALTER TABLE ontologyterm_aud DROP COLUMN revtype; +ALTER TABLE organization_aud DROP COLUMN revtype; +ALTER TABLE person_aud DROP COLUMN revtype; +ALTER TABLE personsetting_aud DROP COLUMN revtype; +ALTER TABLE reagent_aud DROP COLUMN revtype; +ALTER TABLE resourcedescriptor_aud DROP COLUMN revtype; +ALTER TABLE resourcedescriptorpage_aud DROP COLUMN revtype; +ALTER TABLE slotannotation_aud DROP COLUMN revtype; +ALTER TABLE species_aud DROP COLUMN revtype; +ALTER TABLE synonym_aud DROP COLUMN revtype; +ALTER TABLE vocabulary_aud DROP COLUMN revtype; +ALTER TABLE vocabularyterm_aud DROP COLUMN revtype; +ALTER TABLE vocabularytermset_aud DROP COLUMN revtype; + +/* Stop here to test +INSERT INTO submittedobject_aud (id, rev) SELECT id, rev FROM biologicalentity_aud; +INSERT INTO submittedobject_aud (id, rev) SELECT id, rev FROM reagent_aud; + +INSERT INTO curieobject_aud (id, rev) SELECT id, rev FROM submittedobject_aud; +INSERT INTO curieobject_aud (id, rev) SELECT id, rev FROM ontologyterm_aud; +INSERT INTO curieobject_aud (id, rev) SELECT id, rev FROM informationcontententity_aud; + + +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM association_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM biologicalentity_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM bulkload_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM bulkloadfile_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM bulkloadfileexception_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM bulkloadfilehistory_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM bulkloadgroup_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM conditionrelation_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM crossreference_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM dataprovider_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM experimentalcondition_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM genetogeneorthology_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM informationcontententity_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM note_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM ontologyterm_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM organization_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM person_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM personsetting_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM reagent_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM resourcedescriptor_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM resourcedescriptorpage_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM slotannotation_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM species_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM synonym_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM vocabulary_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM vocabularyterm_aud; +INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM vocabularytermset_aud; + +SET session_replication_role = 'origin'; + +-- Add constraints and indexes +ALTER TABLE auditedobject ADD CONSTRAINT auditedobject_createdby_id_fk FOREIGN KEY (createdby_id) REFERENCES person (id); +ALTER TABLE auditedobject ADD CONSTRAINT auditedobject_updatedby_id_fk FOREIGN KEY (updatedby_id) REFERENCES person (id); +CREATE INDEX auditedobject_createdby_index ON auditedobject USING btree (createdby_id); +CREATE INDEX auditedobject_updatedby_index ON auditedobject USING btree (updatedby_id); + +ALTER TABLE auditedobject_aud ADD CONSTRAINT auditedobject_aud_rev_fk FOREIGN KEY (rev) REFERENCES revinfo (rev); + +ALTER TABLE curieobject ADD CONSTRAINT curieobject_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +CREATE INDEX curieobject_curie_index ON curieobject USING btree (curie); +ALTER TABLE curieobject ADD CONSTRAINT curieobject_curie_uk UNIQUE (curie); + +ALTER TABLE curieobject_aud ADD CONSTRAINT curieobject_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); + +ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); +ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_dataprovider_id_fk FOREIGN KEY (dataprovider_id) REFERENCES dataprovider (id); +CREATE INDEX submittedobject_modentityid_index ON submittedobject USING btree (modentityid); +CREATE INDEX submittedobject_modinternalid_index ON submittedobject USING btree (modinternalid); +CREATE INDEX submittedobject_dataprovider_index ON submittedobject USING btree (dataprovider_id); +ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_modentityid_uk UNIQUE (modentityid); +ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_modinternalid_uk UNIQUE (modinternalid); + +ALTER TABLE submittedobject_aud ADD CONSTRAINT submittedobject_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES curieobject_aud (id, rev); + +ALTER TABLE affectedgenomicmodel ADD CONSTRAINT affectedgenomicmodel_pkey PRIMARY KEY (id); +ALTER TABLE affectedgenomicmodel_aud ADD CONSTRAINT affectedgenomicmodel_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE allele ADD CONSTRAINT allele_pkey PRIMARY KEY (id); +ALTER TABLE allele_aud ADD CONSTRAINT allele_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE allele_note_aud ADD CONSTRAINT allele_note_aud_pkey PRIMARY KEY (allele_id, relatednotes_id, rev); +ALTER TABLE allele_reference_aud ADD CONSTRAINT allele_reference_aud_pkey PRIMARY KEY (allele_id, references_id, rev); +ALTER TABLE anatomicalterm ADD CONSTRAINT anatomicalterm_pkey PRIMARY KEY (id); +ALTER TABLE anatomicalterm_aud ADD CONSTRAINT anatomicalterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE apoterm ADD CONSTRAINT apoterm_pkey PRIMARY KEY (id); +ALTER TABLE apoterm_aud ADD CONSTRAINT apoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE atpterm ADD CONSTRAINT atpterm_pkey PRIMARY KEY (id); +ALTER TABLE atpterm_aud ADD CONSTRAINT atpterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_pkey PRIMARY KEY (id); +ALTER TABLE biologicalentity_aud ADD CONSTRAINT biologicalentity_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE bspoterm ADD CONSTRAINT bspoterm_pkey PRIMARY KEY (id); +ALTER TABLE bspoterm_aud ADD CONSTRAINT bspoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE chebiterm ADD CONSTRAINT chebiterm_pkey PRIMARY KEY (id); +ALTER TABLE chebiterm_aud ADD CONSTRAINT chebiterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE chemicalterm ADD CONSTRAINT chemicalterm_pkey PRIMARY KEY (id); +ALTER TABLE chemicalterm_aud ADD CONSTRAINT chemicalterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE clterm ADD CONSTRAINT clterm_pkey PRIMARY KEY (id); +ALTER TABLE clterm_aud ADD CONSTRAINT clterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE cmoterm ADD CONSTRAINT cmoterm_pkey PRIMARY KEY (id); +ALTER TABLE cmoterm_aud ADD CONSTRAINT cmoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE daoterm ADD CONSTRAINT daoterm_pkey PRIMARY KEY (id); +ALTER TABLE daoterm_aud ADD CONSTRAINT daoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE doterm ADD CONSTRAINT doterm_pkey PRIMARY KEY (id); +ALTER TABLE doterm_aud ADD CONSTRAINT doterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE dpoterm ADD CONSTRAINT dpoterm_pkey PRIMARY KEY (id); +ALTER TABLE dpoterm_aud ADD CONSTRAINT dpoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE ecoterm ADD CONSTRAINT ecoterm_pkey PRIMARY KEY (id); +ALTER TABLE ecoterm_aud ADD CONSTRAINT ecoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE emapaterm ADD CONSTRAINT emapaterm_pkey PRIMARY KEY (id); +ALTER TABLE emapaterm_aud ADD CONSTRAINT emapaterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE experimentalconditionontologyterm ADD CONSTRAINT experimentalconditionontologyterm_pkey PRIMARY KEY (id); +ALTER TABLE experimentalconditionontologyterm_aud ADD CONSTRAINT experimentalconditionontologyterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE fbdvterm ADD CONSTRAINT fbdvterm_pkey PRIMARY KEY (id); +ALTER TABLE fbdvterm_aud ADD CONSTRAINT fbdvterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE gene ADD CONSTRAINT gene_pkey PRIMARY KEY (id); +ALTER TABLE gene_aud ADD CONSTRAINT gene_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE genomicentity ADD CONSTRAINT genomicentity_pkey PRIMARY KEY (id); +ALTER TABLE genomicentity_aud ADD CONSTRAINT genomicentity_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE goterm ADD CONSTRAINT goterm_pkey PRIMARY KEY (id); +ALTER TABLE goterm_aud ADD CONSTRAINT goterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE hpterm ADD CONSTRAINT hpterm_pkey PRIMARY KEY (id); +ALTER TABLE hpterm_aud ADD CONSTRAINT hpterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_pkey PRIMARY KEY (id); +ALTER TABLE informationcontententity_aud ADD CONSTRAINT informationcontententity_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE materm ADD CONSTRAINT materm_pkey PRIMARY KEY (id); +ALTER TABLE materm_aud ADD CONSTRAINT materm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE miterm ADD CONSTRAINT miterm_pkey PRIMARY KEY (id); +ALTER TABLE miterm_aud ADD CONSTRAINT miterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_pkey PRIMARY KEY (id); +ALTER TABLE mmoterm_aud ADD CONSTRAINT mmoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE mmusdvterm ADD CONSTRAINT mmusdvterm_pkey PRIMARY KEY (id); +ALTER TABLE mmusdvterm_aud ADD CONSTRAINT mmusdvterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE modterm ADD CONSTRAINT modterm_pkey PRIMARY KEY (id); +ALTER TABLE modterm_aud ADD CONSTRAINT modterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE molecule ADD CONSTRAINT molecule_pkey PRIMARY KEY (id); +ALTER TABLE molecule_aud ADD CONSTRAINT molecule_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE mpathterm ADD CONSTRAINT mpathterm_pkey PRIMARY KEY (id); +ALTER TABLE mpathterm_aud ADD CONSTRAINT mpathterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE mpterm ADD CONSTRAINT mpterm_pkey PRIMARY KEY (id); +ALTER TABLE mpterm_aud ADD CONSTRAINT mpterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_pkey PRIMARY KEY (id); +ALTER TABLE ncbitaxonterm_aud ADD CONSTRAINT ncbitaxonterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE obiterm ADD CONSTRAINT obiterm_pkey PRIMARY KEY (id); +ALTER TABLE obiterm_aud ADD CONSTRAINT obiterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_pkey PRIMARY KEY (id); +ALTER TABLE ontologyterm_aud ADD CONSTRAINT ontologyterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_pkey PRIMARY KEY (isachildren_id, isaparents_id); +ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_pkey PRIMARY KEY (isadescendants_id, isaancestors_id); +ALTER TABLE patoterm ADD CONSTRAINT patoterm_pkey PRIMARY KEY (id); +ALTER TABLE patoterm_aud ADD CONSTRAINT patoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE phenotypeterm ADD CONSTRAINT phenotypeterm_pkey PRIMARY KEY (id); +ALTER TABLE phenotypeterm_aud ADD CONSTRAINT phenotypeterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE pwterm ADD CONSTRAINT pwterm_pkey PRIMARY KEY (id); +ALTER TABLE pwterm_aud ADD CONSTRAINT pwterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE reference ADD CONSTRAINT reference_pkey PRIMARY KEY (id); +ALTER TABLE reference_aud ADD CONSTRAINT reference_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE roterm ADD CONSTRAINT roterm_pkey PRIMARY KEY (id); +ALTER TABLE roterm_aud ADD CONSTRAINT roterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE rsterm ADD CONSTRAINT rsterm_pkey PRIMARY KEY (id); +ALTER TABLE rsterm_aud ADD CONSTRAINT rsterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE soterm ADD CONSTRAINT soterm_pkey PRIMARY KEY (id); +ALTER TABLE soterm_aud ADD CONSTRAINT soterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE stageterm ADD CONSTRAINT stageterm_pkey PRIMARY KEY (id); +ALTER TABLE stageterm_aud ADD CONSTRAINT stageterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE uberonterm ADD CONSTRAINT uberonterm_pkey PRIMARY KEY (id); +ALTER TABLE uberonterm_aud ADD CONSTRAINT uberonterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE variant ADD CONSTRAINT variant_pkey PRIMARY KEY (id); +ALTER TABLE variant_aud ADD CONSTRAINT variant_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE vtterm ADD CONSTRAINT vtterm_pkey PRIMARY KEY (id); +ALTER TABLE vtterm_aud ADD CONSTRAINT vtterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE wbbtterm ADD CONSTRAINT wbbtterm_pkey PRIMARY KEY (id); +ALTER TABLE wbbtterm_aud ADD CONSTRAINT wbbtterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE wblsterm ADD CONSTRAINT wblsterm_pkey PRIMARY KEY (id); +ALTER TABLE wblsterm_aud ADD CONSTRAINT wblsterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE wbphenotypeterm ADD CONSTRAINT wbphenotypeterm_pkey PRIMARY KEY (id); +ALTER TABLE wbphenotypeterm_aud ADD CONSTRAINT wbphenotypeterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE xbaterm ADD CONSTRAINT xbaterm_pkey PRIMARY KEY (id); +ALTER TABLE xbaterm_aud ADD CONSTRAINT xbaterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE xbedterm ADD CONSTRAINT xbedterm_pkey PRIMARY KEY (id); +ALTER TABLE xbedterm_aud ADD CONSTRAINT xbedterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE xbsterm ADD CONSTRAINT xbsterm_pkey PRIMARY KEY (id); +ALTER TABLE xbsterm_aud ADD CONSTRAINT xbsterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE xcoterm ADD CONSTRAINT xcoterm_pkey PRIMARY KEY (id); +ALTER TABLE xcoterm_aud ADD CONSTRAINT xcoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE xpoterm ADD CONSTRAINT xpoterm_pkey PRIMARY KEY (id); +ALTER TABLE xpoterm_aud ADD CONSTRAINT xpoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE xsmoterm ADD CONSTRAINT xsmoterm_pkey PRIMARY KEY (id); +ALTER TABLE xsmoterm_aud ADD CONSTRAINT xsmoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE zecoterm ADD CONSTRAINT zecoterm_pkey PRIMARY KEY (id); +ALTER TABLE zecoterm_aud ADD CONSTRAINT zecoterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_pkey PRIMARY KEY (id); +ALTER TABLE zfaterm_aud ADD CONSTRAINT zfaterm_aud_pkey PRIMARY KEY (id, rev); +ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_pkey PRIMARY KEY (id); +ALTER TABLE zfsterm_aud ADD CONSTRAINT zfsterm_aud_pkey PRIMARY KEY (id, rev); + +ALTER TABLE affectedgenomicmodel ADD CONSTRAINT affectedgenomicmodel_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); +ALTER TABLE affectedgenomicmodel_aud ADD CONSTRAINT affectedgenomicmodel_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); +ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES affectedgenomicmodel (id); +ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_assertedallele_id_fk FOREIGN KEY (assertedallele_id) REFERENCES allele (id); +ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredallele_id_fk FOREIGN KEY (inferredallele_id) REFERENCES allele (id); +ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id); +ALTER TABLE agmdiseaseannotation_gene ADD CONSTRAINT agmdiseaseannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); +ALTER TABLE allele ADD CONSTRAINT allele_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); +ALTER TABLE allele_aud ADD CONSTRAINT allele_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); +ALTER TABLE allele_note ADD CONSTRAINT allele_note_allele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id); +CREATE INDEX allele_note_allele_index ON allele_note USING btree (allele_id); +ALTER TABLE allele_reference ADD CONSTRAINT allele_reference_allele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id); +ALTER TABLE allele_reference ADD CONSTRAINT allele_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); +CREATE INDEX allele_reference_allele_index ON allele_reference USING btree (allele_id); +CREATE INDEX allele_reference_references_index ON allele_reference USING btree (references_id); +CREATE INDEX allele_reference_allele_references_index ON allele_reference USING btree (allele_id, references_id); +ALTER TABLE alleledatabasestatusslotannotation ADD CONSTRAINT alleledatabasestatus_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX alleledatabasestatus_singleallele_index ON alleledatabasestatusslotannotation USING btree (singleallele_id); +ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannoation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES allele (id); +ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id); +CREATE INDEX allelediseaseannotation_inferredgene_index ON allelediseaseannotation USING btree (inferredgene_id); +CREATE INDEX allelediseaseannotation_subject_index ON allelediseaseannotation USING btree (subject_id); +ALTER TABLE allelediseaseannotation_gene ADD CONSTRAINT allelediseaseannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); +CREATE INDEX allelediseaseannotationgene_assertedgenes_index ON allelediseaseannotation_gene USING btree (assertedgenes_id); +CREATE INDEX allelefullname_singleallele_index ON allelefullnameslotannotation USING btree (singleallele_id); +ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctionalimpactslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctionalimpactslotannotation_phenotypeterm_id_fk FOREIGN KEY (phenotypeterm_id) REFERENCES phenotypeterm (id); +CREATE INDEX allelefunctionalimpact_singleallele_index ON allelefunctionalimpactslotannotation USING btree (singleallele_id); +CREATE INDEX allelefunctionalimpact_phenotypeterm_index ON allelefunctionalimpactslotannotation USING btree (phenotypeterm_id); +ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_object_id_fk FOREIGN KEY (object_id) REFERENCES gene (id); +ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES allele (id); +CREATE INDEX allelegeneassociation_object_index ON allelegeneassociation USING btree (object_id); +CREATE INDEX allelegeneassociation_subject_index ON allelegeneassociation USING btree (subject_id); +ALTER TABLE allelegenomicentityassociation ADD CONSTRAINT allelegenomicentityassociation_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES ecoterm (id); +ALTER TABLE allelegermlinetransmissionstatusslotannotation ADD CONSTRAINT allelegermlinetransmissionstatus_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX allelegermlinetransmissionstatus_singleallele_index ON allelegermlinetransmissionstatusslotannotation USING btree (singleallele_id); +ALTER TABLE alleleinheritancemodeslotannotation ADD CONSTRAINT alleleinheritancemode_phenotypeterm_id_fk FOREIGN KEY (phenotypeterm_id) REFERENCES phenotypeterm (id); +ALTER TABLE alleleinheritancemodeslotannotation ADD CONSTRAINT alleleinheritancemode_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX alleleinheritancemode_phenotypeterm_index ON alleleinheritancemodeslotannotation USING btree (phenotypeterm_id); +CREATE INDEX alleleinheritancemode_singleallele_index ON alleleinheritancemodeslotannotation USING btree (singleallele_id); +ALTER TABLE allelemutationtypeslotannotation ADD CONSTRAINT allelemutationtype_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX allelemutationtype_singleallele_index ON allelemutationtypeslotannotation USING btree (singleallele_id); +ALTER TABLE allelemutationtypeslotannotation_soterm ADD CONSTRAINT allelemutationtypesa_soterm_mutationtypes_id_fk FOREIGN KEY (mutationtypes_id) REFERENCES soterm (id); +CREATE INDEX allelemutationtypesa_soterm_mutationtypes_index ON allelemutationtypeslotannotation_soterm USING btree (mutationtypes_id); +ALTER TABLE allelenomenclatureeventslotannotation ADD CONSTRAINT allelenomenclatureeventslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX allelenomenclatureevent_singleallele_index ON allelenomenclatureeventslotannotation USING btree (singleallele_id); +ALTER TABLE allelesecondaryidslotannotation ADD CONSTRAINT allelesecondaryidslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX allelesecondaryid_singleallele_index ON allelesecondaryidslotannotation USING btree (singleallele_id); +ALTER TABLE allelesymbolslotannotation ADD CONSTRAINT allelesymbolslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX allelesymbol_singleallele_index ON allelesymbolslotannotation USING btree (singleallele_id); +ALTER TABLE allelesynonymslotannotation ADD CONSTRAINT allelesynonymslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); +CREATE INDEX allelesynonym_singleallele_index ON allelesynonymslotannotation USING btree (singleallele_id); +ALTER TABLE anatomicalterm ADD CONSTRAINT anatomicalterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE anatomicalterm_aud ADD CONSTRAINT anatomicalterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE apoterm ADD CONSTRAINT apoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); +ALTER TABLE apoterm_aud ADD CONSTRAINT apoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); +ALTER TABLE atpterm ADD CONSTRAINT atpterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE atpterm_aud ADD CONSTRAINT atpterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_id_fk FOREIGN KEY (id) REFERENCES submittedobject (id); +ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); +CREATE INDEX biologicalentity_taxon_index ON biologicalentity USING btree (taxon_id); +ALTER TABLE biologicalentity_aud ADD CONSTRAINT biologicalentity_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES submittedobject_aud (id, rev); +ALTER TABLE bspoterm ADD CONSTRAINT bspoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE bspoterm_aud ADD CONSTRAINT bspoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE bulkload ADD CONSTRAINT bulkload_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE bulkload_aud ADD CONSTRAINT bulkload_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE bulkloadfile ADD CONSTRAINT bulkloadfile_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE bulkloadfile_aud ADD CONSTRAINT bulkloadfile_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE bulkloadfileexception ADD CONSTRAINT bulkloadfileexception_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE bulkloadfileexception_aud ADD CONSTRAINT bulkloadfileexception_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE bulkloadfilehistory ADD CONSTRAINT bulkloadfilehistory_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE bulkloadfilehistory_aud ADD CONSTRAINT bulkloadfilehistory_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE bulkloadgroup ADD CONSTRAINT bulkloadgroup_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE bulkloadgroup_aud ADD CONSTRAINT bulkloadgroup_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE chebiterm ADD CONSTRAINT chebiterm_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); +ALTER TABLE chebiterm_aud ADD CONSTRAINT chebiterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES chemicalterm_aud (id, rev); +ALTER TABLE chemicalterm ADD CONSTRAINT chemicalterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE chemicalterm_aud ADD CONSTRAINT chemicalterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE clterm ADD CONSTRAINT clterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); +ALTER TABLE clterm_aud ADD CONSTRAINT clterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); +ALTER TABLE cmoterm ADD CONSTRAINT cmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE cmoterm_aud ADD CONSTRAINT cmoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE conditionrelation ADD CONSTRAINT conditionrelation_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE conditionrelation ADD CONSTRAINT conditionrelation_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); +ALTER TABLE conditionrelation_aud ADD CONSTRAINT conditionrelation_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE construct_reference ADD CONSTRAINT construct_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); +CREATE INDEX construct_reference_references_index ON construct_reference USING btree (references_id); +ALTER TABLE constructcomponentslotannotation ADD CONSTRAINT constructcomponentslotannotation_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); +CREATE INDEX constructcomponentslotannotation_taxon_index ON constructcomponentslotannotation USING btree (taxon_id); +ALTER TABLE constructgenomicentityassociation ADD CONSTRAINT constructgenomicentityassociation_object_id_fk FOREIGN KEY (object_id) REFERENCES genomicentity (id); +CREATE INDEX constructgenomicentityassociation_object_index ON constructgenomicentityassociation USING btree (object_id); +ALTER TABLE crossreference ADD CONSTRAINT crossreference_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE crossreference_aud ADD CONSTRAINT crossreference_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE curationreport ADD CONSTRAINT curationreport_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE curationreport_aud ADD CONSTRAINT curationreport_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE curationreportgroup ADD CONSTRAINT curationreportgroup_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE curationreportgroup_aud ADD CONSTRAINT curationreportgroup_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE curationreporthistory ADD CONSTRAINT curationreporthistory_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE curationreportgroup_aud ADD CONSTRAINT curationreporthistory_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE daoterm ADD CONSTRAINT daoterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); +ALTER TABLE daoterm_aud ADD CONSTRAINT daoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); +ALTER TABLE dataprovider ADD CONSTRAINT dataprovider_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE dataprovider_aud ADD CONSTRAINT dataprovider_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE diseaseannotation ADD CONSTRAINT diseaseannotation_object_id_fk FOREIGN KEY (object_id) REFERENCES doterm (id); +CREATE INDEX diseaseannotation_object_index ON diseaseannotation USING btree (object_id); +ALTER TABLE diseaseannotation_biologicalentity ADD CONSTRAINT diseaseannotation_biologicalentity_dgm_id_fk FOREIGN KEY (diseasegeneticmodifiers_id) REFERENCES biologicalentity (id); +CREATE INDEX diseaseannotation_biologicalentity_dgms_index ON diseaseannotation_biologicalentity USING btree (diseasegeneticmodifiers_id); +ALTER TABLE diseaseannotation_ecoterm ADD CONSTRAINT diseaseannotation_ecoterm_evidencecodes_id_fk FOREIGN KEY (evidencecodes_id) REFERENCES ecoterm (id); +CREATE INDEX diseaseannotation_ecoterm_evidencecodes_index ON diseaseannotation_ecoterm USING btree (evidencecodes_id); +ALTER TABLE diseaseannotation_gene ADD CONSTRAINT diseaseannotation_gene_with_id_fk FOREIGN KEY (with_id) REFERENCES gene (id); +CREATE INDEX diseaseannotation_gene_with_index ON diseaseannotation_gene USING btree (with_id); +ALTER TABLE doterm ADD CONSTRAINT doterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE doterm_aud ADD CONSTRAINT doterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE dpoterm ADD CONSTRAINT dpoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); +ALTER TABLE dpoterm_aud ADD CONSTRAINT dpoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); +ALTER TABLE ecoterm ADD CONSTRAINT ecoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE ecoterm_aud ADD CONSTRAINT ecoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE emapaterm ADD CONSTRAINT emapaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); +ALTER TABLE emapaterm_aud ADD CONSTRAINT emapaterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); +ALTER TABLE evidenceassociation_informationcontententity ADD CONSTRAINT evidenceassociation_infocontent_evidence_id_fk FOREIGN KEY (evidence_id) REFERENCES informationcontententity (id); +CREATE INDEX evidenceassociation_infocontent_evidence_index ON evidenceassociation_informationcontententity USING btree (evidence_id); +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionchemical_id_fk FOREIGN KEY (conditionchemical_id) REFERENCES chemicalterm (id); +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionid_id_fk FOREIGN KEY (conditionid_id) REFERENCES experimentalconditionontologyterm (id); +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditiontaxon_id_fk FOREIGN KEY (conditiontaxon_id) REFERENCES ncbitaxonterm (id); +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditiongeneontology_id_fk FOREIGN KEY (conditiongeneontology_id) REFERENCES goterm (id); +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionclass_id_fk FOREIGN KEY (conditionclass_id) REFERENCES zecoterm (id); +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionanatomy_id_fk FOREIGN KEY (conditionanatomy_id) REFERENCES anatomicalterm (id); +ALTER TABLE experimentalconditionontologyterm ADD CONSTRAINT experimentalconditionontologyterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE experimentalconditionontologyterm_aud ADD CONSTRAINT experimentalconditionontologyterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE fbdvterm ADD CONSTRAINT fbdvterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); +ALTER TABLE fbdvterm_aud ADD CONSTRAINT fbdvterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); +ALTER TABLE gene ADD CONSTRAINT gene_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); +ALTER TABLE gene ADD CONSTRAINT gene_genetype_id_fk FOREIGN KEY (genetype_id) REFERENCES soterm (id); +CREATE INDEX gene_genetype_index ON gene USING btree (genetype_id); +ALTER TABLE gene_aud ADD CONSTRAINT gene_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); +ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES gene (id); +ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_sgdstrainbackground_id_fk FOREIGN KEY (sgdstrainbackground_id) REFERENCES affectedgenomicmodel (id); +ALTER TABLE genefullnameslotannotation ADD CONSTRAINT genefullnameslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); +CREATE INDEX genefullname_singlegene_index ON genefullnameslotannotation USING btree (singlegene_id); +ALTER TABLE genesecondaryidslotannotation ADD CONSTRAINT genesecondaryidslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); +CREATE INDEX genesecondaryid_singlegene_index ON genesecondaryidslotannotation USING btree (singlegene_id); +ALTER TABLE genesymbolslotannotation ADD CONSTRAINT genesymbolslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); +CREATE INDEX genesymbol_singlegene_index ON genesymbolslotannotation USING btree (singlegene_id); +ALTER TABLE genesynonymslotannotation ADD CONSTRAINT genesynonymslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); +CREATE INDEX genesynonym_singlegene_index ON genesynonymslotannotation USING btree (singlegene_id); +ALTER TABLE genesystematicnameslotannotation ADD CONSTRAINT genesystematicnameslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); +CREATE INDEX genesystematicname_singlegene_index ON genesystematicnameslotannotation USING btree (singlegene_id); +ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_objectgene_id_fk FOREIGN KEY (objectgene_id) REFERENCES gene (id); +ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_subjectgene_id_fk FOREIGN KEY (subjectgene_id) REFERENCES gene (id); +CREATE INDEX genetogeneorthology_object_index ON genetogeneorthology USING btree (objectgene_id); +CREATE INDEX genetogeneorthology_subject_index ON genetogeneorthology USING btree (subjectgene_id); +ALTER TABLE genetogeneorthologycurated ADD CONSTRAINT genetogeneorthologycurated_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES ecoterm (id); +ALTER TABLE genetogeneorthologycurated ADD CONSTRAINT genetogeneorthologycurated_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); +CREATE INDEX genetogeneorthologycurated_evidencecode_index ON genetogeneorthologycurated USING btree (evidencecode_id); +CREATE INDEX genetogeneorthologycurated_singlereference_index ON genetogeneorthologycurated USING btree (singlereference_id); +ALTER TABLE genomicentity ADD CONSTRAINT genomicentity_id_fk FOREIGN KEY (id) REFERENCES biologicalentity (id); +ALTER TABLE genomicentity_aud ADD CONSTRAINT genomicentity_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES biologicalentity_aud (id, rev); +ALTER TABLE genomicentity_crossreference ADD CONSTRAINT genomicentitycrossreference_genomicentity_id_fk FOREIGN KEY (genomicentity_id) REFERENCES genomicentity (id); +CREATE INDEX genomicentity_crossreference_ge_xref_index ON genomicentity_crossreference USING btree (genomicentity_id, crossreferences_id); +CREATE INDEX genomicentity_crossreference_genomicentity_index ON genomicentity_crossreference USING btree (genomicentity_id); +ALTER TABLE goterm ADD CONSTRAINT goterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE goterm_aud ADD CONSTRAINT goterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE hpterm ADD CONSTRAINT hpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); +ALTER TABLE hpterm_aud ADD CONSTRAINT hpterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); +ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); +ALTER TABLE informationcontententity_aud ADD CONSTRAINT informationcontententity_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES curieobject_aud (id, rev); +ALTER TABLE materm ADD CONSTRAINT materm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); +ALTER TABLE materm_aud ADD CONSTRAINT materm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); +ALTER TABLE miterm ADD CONSTRAINT miterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE miterm_aud ADD CONSTRAINT miterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE mmoterm_aud ADD CONSTRAINT mmoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE mmusdvterm ADD CONSTRAINT mmusdvterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); +ALTER TABLE mmusdvterm_aud ADD CONSTRAINT mmusdvterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); +ALTER TABLE modterm ADD CONSTRAINT modterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE modterm_aud ADD CONSTRAINT modterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE molecule ADD CONSTRAINT molecule_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); +ALTER TABLE molecule_aud ADD CONSTRAINT molecule_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES chemicalterm_aud (id, rev); +ALTER TABLE mpathterm ADD CONSTRAINT mpathterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE mpathterm_aud ADD CONSTRAINT mpathterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE mpterm ADD CONSTRAINT mpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); +ALTER TABLE mpterm_aud ADD CONSTRAINT mpterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); +ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE ncbitaxonterm_aud ADD CONSTRAINT ncbitaxonterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE note ADD CONSTRAINT note_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE note_aud ADD CONSTRAINT note_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE note_reference ADD CONSTRAINT note_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); +CREATE INDEX note_reference_references_index ON note_reference USING btree (references_id); +ALTER TABLE obiterm ADD CONSTRAINT obiterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE obiterm_aud ADD CONSTRAINT obiterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); +ALTER TABLE ontologyterm_aud ADD CONSTRAINT ontologyterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES curieobject_aud (id, rev); +ALTER TABLE ontologyterm_crossreference ADD CONSTRAINT ontologyterm_crossreference_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); +CREATE INDEX ontologyterm_crossreference_ontologyterm_index ON ontologyterm_crossreference USING btree (ontologyterm_id); +ALTER TABLE ontologyterm_definitionurls ADD CONSTRAINT ontologyterm_definitionurls_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); +CREATE INDEX ontologyterm_definitionurls_ontologyterm_index ON ontologyterm_definitionurls USING btree (ontologyterm_id); +ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_isaancestors_id_fk FOREIGN KEY (isaancestors_id) REFERENCES ontologyterm(id); +ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_isadescendants_id_fk FOREIGN KEY (isadescendants_id) REFERENCES ontologyterm(id); +CREATE INDEX ontologyterm_isa_ancestor_descendant_isaancestors_index ON ontologyterm_isa_ancestor_descendant USING btree (isaancestors_id); +CREATE INDEX ontologyterm_isa_ancestor_descendant_isadescendants_index ON ontologyterm_isa_ancestor_descendant USING btree (isadescendants_id); +ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_isachildren_id_fk FOREIGN KEY (isachildren_id) REFERENCES ontologyterm (id); +ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_isaparents_id_fk FOREIGN KEY (isaparents_id) REFERENCES ontologyterm (id); +CREATE INDEX ontologyterm_isa_parent_children_isachildren_index ON ontologyterm_isa_parent_children USING btree (isachildren_id); +CREATE INDEX ontologyterm_isa_parent_children_isaparents_index ON ontologyterm_isa_parent_children USING btree (isaparents_id); +ALTER TABLE ontologyterm_secondaryidentifiers ADD CONSTRAINT ontologyterm_secondaryidentifiers_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); +CREATE INDEX ontologyterm_secondaryidentifiers_ontologyterm_index ON ontologyterm_secondaryidentifiers USING btree (ontologyterm_id); +ALTER TABLE ontologyterm_subsets ADD CONSTRAINT ontologyterm_subsets_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); +CREATE INDEX ontologyterm_subsets_ontologyterm_index ON ontologyterm_subsets USING btree (ontologyterm_id); +ALTER TABLE ontologyterm_synonym ADD CONSTRAINT ontologyterm_synonym_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); +CREATE INDEX ontologyterm_synonym_ontologyterm_index ON ontologyterm_synonym USING btree (ontologyterm_id); +ALTER TABLE organization ADD CONSTRAINT organization_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE organization_aud ADD CONSTRAINT organization_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE patoterm ADD CONSTRAINT patoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE patoterm_aud ADD CONSTRAINT patoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE person ADD CONSTRAINT person_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE person_aud ADD CONSTRAINT person_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE phenotypeterm ADD CONSTRAINT phenotypeterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE phenotypeterm_aud ADD CONSTRAINT phenotypeterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE pwterm ADD CONSTRAINT pwterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE pwterm_aud ADD CONSTRAINT pwterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE reagent ADD CONSTRAINT reagent_id_fk FOREIGN KEY (id) REFERENCES submittedobject (id); +ALTER TABLE reagent_aud ADD CONSTRAINT reagent_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES submittedobject_aud (id, rev); +ALTER TABLE reference ADD CONSTRAINT reference_id_fk FOREIGN KEY (id) REFERENCES informationcontententity (id); +ALTER TABLE reference_aud ADD CONSTRAINT reference_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES informationcontententity_aud (id, rev); +ALTER TABLE reference_crossreference ADD CONSTRAINT reference_crossreference_reference_id_fk FOREIGN KEY (reference_id) REFERENCES reference (id); +CREATE INDEX reference_crossreference_reference_index ON reference_crossreference USING btree (reference_id); +ALTER TABLE resourcedescriptor ADD CONSTRAINT resourcedescriptor_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE resourcedescriptor_aud ADD CONSTRAINT resourcedescriptor_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE resourcedescriptorpage ADD CONSTRAINT resourcedescriptorpage_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE resourcedescriptorpage_aud ADD CONSTRAINT resourcedescriptorpage_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE roterm ADD CONSTRAINT roterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE roterm_aud ADD CONSTRAINT roterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE rsterm ADD CONSTRAINT rsterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE rsterm_aud ADD CONSTRAINT rsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE singlereferenceassociation ADD CONSTRAINT singlereferenceassociation_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); +CREATE INDEX singlereferenceassociation_singlereference_index ON singlereferenceassociation USING btree (singlereference_id); +ALTER TABLE slotannotation ADD CONSTRAINT slotannotation_id_fk FOREIGN KEY (id) REFERENCES auditedobject(id); +ALTER TABLE slotannotation_aud ADD CONSTRAINT slotannotation_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE slotannotation_informationcontententity ADD CONSTRAINT slotannotation_informationcontententity_evidence_id_fk FOREIGN KEY (evidence_id) REFERENCES informationcontententity (id); +CREATE INDEX slotannotation_informationcontententity_evidence_index ON slotannotation_informationcontententity USING btree (evidence_id); +ALTER TABLE soterm ADD CONSTRAINT soterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE soterm_aud ADD CONSTRAINT soterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE species ADD CONSTRAINT species_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE species ADD CONSTRAINT species_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); +ALTER TABLE species_aud ADD CONSTRAINT species_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE stageterm ADD CONSTRAINT stageterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE stageterm_aud ADD CONSTRAINT stageterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE synonym_aud ADD CONSTRAINT synonym_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE uberonterm ADD CONSTRAINT uberonterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); +ALTER TABLE uberonterm_aud ADD CONSTRAINT uberonterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); +ALTER TABLE variant ADD CONSTRAINT variant_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); +ALTER TABLE variant ADD CONSTRAINT variant_sourcegeneralconsequence_id_fk FOREIGN KEY (sourcegeneralconsequence_id) REFERENCES soterm (id); +ALTER TABLE variant ADD CONSTRAINT variant_varianttype_id_fk FOREIGN KEY (varianttype_id) REFERENCES soterm (id); +CREATE INDEX variant_sourcegeneralconsequence_index ON variant USING btree (sourcegeneralconsequence_id); +CREATE INDEX variant_varianttype_index ON variant USING btree (varianttype_id); +ALTER TABLE variant_aud ADD CONSTRAINT variant_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); +ALTER TABLE variant_note ADD CONSTRAINT variant_note_variant_id_fk FOREIGN KEY (variant_id) REFERENCES variant (id); +CREATE INDEX variant_note_variant_index ON variant_note USING btree (variant_id); +ALTER TABLE vocabulary ADD CONSTRAINT vocabulary_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE vocabulary_aud ADD CONSTRAINT vocabulary_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE vocabularyterm ADD CONSTRAINT vocabularyterm_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE vocabularyterm_aud ADD CONSTRAINT vocabularyterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE vocabularytermset ADD CONSTRAINT vocabularytermset_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); +ALTER TABLE vocabularytermset_aud ADD CONSTRAINT vocabularytermset_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); +ALTER TABLE vtterm ADD CONSTRAINT vtterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE vtterm_aud ADD CONSTRAINT vtterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE wbbtterm ADD CONSTRAINT wbbtterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); +ALTER TABLE wbbtterm_aud ADD CONSTRAINT wbbtterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); +ALTER TABLE wblsterm ADD CONSTRAINT wblsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); +ALTER TABLE wblsterm_aud ADD CONSTRAINT wblsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); +ALTER TABLE wbphenotypeterm ADD CONSTRAINT wbphenotypeterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); +ALTER TABLE wbphenotypeterm_aud ADD CONSTRAINT wbphenotypeterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); +ALTER TABLE xbaterm ADD CONSTRAINT xbaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); +ALTER TABLE xbaterm_aud ADD CONSTRAINT xbaterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); +ALTER TABLE xbedterm ADD CONSTRAINT xbedterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE xbedterm_aud ADD CONSTRAINT xbedterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); +ALTER TABLE xbsterm ADD CONSTRAINT xbsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); +ALTER TABLE xbsterm_aud ADD CONSTRAINT xbsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); +ALTER TABLE xcoterm ADD CONSTRAINT xcoterm_id_fk FOREIGN KEY (id) REFERENCES experimentalconditionontologyterm (id); +ALTER TABLE xcoterm_aud ADD CONSTRAINT xcoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES experimentalconditionontologyterm_aud (id, rev); +ALTER TABLE xpoterm ADD CONSTRAINT xpoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); +ALTER TABLE xpoterm_aud ADD CONSTRAINT xpoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); +ALTER TABLE xsmoterm ADD CONSTRAINT xsmoterm_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); +ALTER TABLE xsmoterm_aud ADD CONSTRAINT xsmoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES chemicalterm_aud (id, rev); +ALTER TABLE zecoterm ADD CONSTRAINT zecoterm_id_fk FOREIGN KEY (id) REFERENCES experimentalconditionontologyterm (id); +ALTER TABLE zecoterm_aud ADD CONSTRAINT zecoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES experimentalconditionontologyterm_aud (id, rev); +ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); +ALTER TABLE zfaterm_aud ADD CONSTRAINT zfaterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); +ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); +ALTER TABLE zfsterm_aud ADD CONSTRAINT zfsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); +*/ diff --git a/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java b/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java index cd9553523..9aae8f2b3 100644 --- a/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java @@ -132,14 +132,15 @@ public AffectedGenomicModel createAffectedGenomicModel(String modEntityId, Strin model.setName(name); model.setObsolete(obsolete); - RestAssured.given(). + ObjectResponse response = given(). contentType("application/json"). body(model). when(). post("/api/agm"). then(). - statusCode(200); - return model; + statusCode(200). + extract().body().as(getObjectResponseTypeRefAffectedGenomicModel()); + return response.getEntity(); } public Allele createAllele(String modEntityId, String taxonCurie, Boolean obsolete, VocabularyTerm symbolNameTerm) { @@ -156,14 +157,15 @@ public Allele createAllele(String modEntityId, String taxonCurie, Boolean obsole allele.setAlleleSymbol(symbol); - RestAssured.given(). + ObjectResponse response = given(). contentType("application/json"). body(allele). when(). post("/api/allele"). then(). - statusCode(200); - return allele; + statusCode(200). + extract().body().as(getObjectResponseTypeRefAllele()); + return response.getEntity(); } public BiologicalEntity createBiologicalEntity(String modEntityId, String taxonCurie) { @@ -171,15 +173,16 @@ public BiologicalEntity createBiologicalEntity(String modEntityId, String taxonC bioEntity.setModEntityId(modEntityId); bioEntity.setTaxon(getNCBITaxonTerm(taxonCurie)); - RestAssured.given(). + ObjectResponse response = given(). contentType("application/json"). body(bioEntity). when(). post("/api/biologicalentity"). then(). - statusCode(200); + statusCode(200). + extract().body().as(getObjectResponseTypeRefBiologicalEntity()); - return bioEntity; + return response.getEntity(); } public CHEBITerm createChebiTerm(String curie, String name, Boolean obsolete) { @@ -189,14 +192,15 @@ public CHEBITerm createChebiTerm(String curie, String name, Boolean obsolete) { chebiTerm.setName(name); chebiTerm.setSecondaryIdentifiers(List.of(curie + "secondary")); - RestAssured.given(). + ObjectResponse response = given(). contentType("application/json"). body(chebiTerm). when(). post("/api/chebiterm"). then(). - statusCode(200); - return chebiTerm; + statusCode(200). + extract().body().as(getObjectResponseTypeRefCHEBITerm()); + return response.getEntity(); } public ConditionRelation createConditionRelation(String handle, Reference reference, VocabularyTerm relationType, List conditions) { @@ -269,14 +273,15 @@ public DOTerm createDoTerm(String curie, Boolean obsolete) { doTerm.setObsolete(obsolete); doTerm.setSecondaryIdentifiers(List.of(curie + "secondary")); - RestAssured.given(). + ObjectResponse response = given(). contentType("application/json"). body(doTerm). when(). post("/api/doterm"). then(). - statusCode(200); - return doTerm; + statusCode(200). + extract().body().as(getObjectResponseTypeRefDOTerm()); + return response.getEntity(); } public ECOTerm createEcoTerm(String curie, String name, Boolean obsolete, Boolean inAgrSubset) { @@ -288,14 +293,15 @@ public ECOTerm createEcoTerm(String curie, String name, Boolean obsolete, Boolea if (inAgrSubset) ecoTerm.setSubsets(List.of(OntologyConstants.AGR_ECO_TERM_SUBSET)); - RestAssured.given(). + ObjectResponse response = given(). contentType("application/json"). body(ecoTerm). when(). post("/api/ecoterm"). then(). - statusCode(200); - return ecoTerm; + statusCode(200). + extract().body().as(getObjectResponseTypeRefECOTerm()); + return response.getEntity(); } public ExperimentalCondition createExperimentalCondition(String uniqueId, String conditionClassCurie, String conditionClassName) { @@ -328,14 +334,15 @@ public Gene createGene(String modEntityId, String taxonCurie, Boolean obsolete, gene.setGeneSymbol(symbol); - RestAssured.given(). + ObjectResponse response = given(). contentType("application/json"). body(gene). when(). post("/api/gene"). then(). - statusCode(200); - return gene; + statusCode(200). + extract().body().as(getObjectResponseTypeRefGene()); + return response.getEntity(); } public GOTerm createGoTerm(String curie, String name, Boolean obsolete) { @@ -345,14 +352,15 @@ public GOTerm createGoTerm(String curie, String name, Boolean obsolete) { goTerm.setName(name); goTerm.setSecondaryIdentifiers(List.of(curie + "secondary")); - RestAssured.given(). + ObjectResponse response = given(). contentType("application/json"). body(goTerm). when(). post("/api/goterm"). then(). - statusCode(200); - return goTerm; + statusCode(200). + extract().body().as(getObjectResponseTypeRefGOTerm()); + return response.getEntity(); } public MPTerm createMpTerm(String curie, Boolean obsolete) { @@ -362,14 +370,15 @@ public MPTerm createMpTerm(String curie, Boolean obsolete) { mpTerm.setName("Test MPTerm"); mpTerm.setSecondaryIdentifiers(List.of(curie + "secondary")); - RestAssured.given(). + ObjectResponse response = given(). contentType("application/json"). body(mpTerm). when(). post("/api/mpterm"). then(). - statusCode(200); - return mpTerm; + statusCode(200). + extract().body().as(getObjectResponseTypeRefMPTerm()); + return response.getEntity(); } public NCBITaxonTerm createNCBITaxonTerm(String curie, String name, Boolean obsolete) { @@ -577,14 +586,15 @@ public ZECOTerm createZecoTerm(String curie, String name, Boolean obsolete, Stri zecoTerm.setObsolete(obsolete); zecoTerm.setSecondaryIdentifiers(List.of(curie + "secondary")); - given(). + ObjectResponse response = given(). contentType("application/json"). body(zecoTerm). when(). post("/api/zecoterm"). then(). - statusCode(200); - return zecoTerm; + statusCode(200). + extract().body().as(getObjectResponseTypeRefZecoTerm()); + return response.getEntity(); } public ZFATerm createZfaTerm(String curie, Boolean obsolete) { @@ -594,14 +604,15 @@ public ZFATerm createZfaTerm(String curie, Boolean obsolete) { zfaTerm.setName("Test ZFATerm"); zfaTerm.setSecondaryIdentifiers(List.of(curie + "secondary")); - RestAssured.given(). + ObjectResponse response = given(). contentType("application/json"). body(zfaTerm). when(). post("/api/zfaterm"). then(). - statusCode(200); - return zfaTerm; + statusCode(200). + extract().body().as(getObjectResponseTypeRefZFATerm()); + return response.getEntity(); } public AffectedGenomicModel getAffectedGenomicModel(String identifier) { @@ -790,6 +801,16 @@ private TypeRef> getObjectResponseTypeRefA }; } + private TypeRef> getObjectResponseTypeRefBiologicalEntity() { + return new TypeRef>() { + }; + } + + private TypeRef> getObjectResponseTypeRefCHEBITerm() { + return new TypeRef>() { + }; + } + public TypeRef> getObjectResponseTypeRefConditionRelation() { return new TypeRef>() { }; @@ -814,6 +835,16 @@ private TypeRef> getObjectResponseTypeRefDataProvid }; } + private TypeRef> getObjectResponseTypeRefDOTerm() { + return new TypeRef>() { + }; + } + + private TypeRef> getObjectResponseTypeRefECOTerm() { + return new TypeRef>() { + }; + } + private TypeRef> getObjectResponseTypeRefExperimentalCondition() { return new TypeRef>() { }; @@ -828,6 +859,11 @@ private TypeRef> getObjectResponseTypeRefG }; } + private TypeRef> getObjectResponseTypeRefGOTerm() { + return new TypeRef>() { + }; + } + private TypeRef> getObjectResponseTypeRefLoggedInPerson() { return new TypeRef>() { }; @@ -888,6 +924,11 @@ private TypeRef> getObjectResponseTypeRefZecoTerm() { }; } + private TypeRef> getObjectResponseTypeRefZFATerm() { + return new TypeRef>() { + }; + } + public NCBITaxonTerm getNCBITaxonTerm(String curie) { ObjectResponse response = RestAssured.given(). when(). @@ -1127,9 +1168,9 @@ public void loadGene(String modEntityId, String taxonCurie, VocabularyTerm symbo statusCode(200); } - public void loadGenes(List curies, String taxonCurie, VocabularyTerm symbolNameTerm, DataProvider dataProvider) throws Exception { - for (String curie : curies) { - loadGene(curie, taxonCurie, symbolNameTerm, dataProvider); + public void loadGenes(List modEntityIds, String taxonCurie, VocabularyTerm symbolNameTerm, DataProvider dataProvider) throws Exception { + for (String modEntityId : modEntityIds) { + loadGene(modEntityId, taxonCurie, symbolNameTerm, dataProvider); } } diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java index 47661590f..177d4abee 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java @@ -468,7 +468,7 @@ public void createAlleleWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")). + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")). body("errorMessages.taxon", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.alleleSymbol", is(ValidationConstants.REQUIRED_MESSAGE)); } @@ -487,7 +487,7 @@ public void editAlleleWithMissingModEntityId() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); } @Test @@ -540,7 +540,7 @@ public void createAlleleWithEmptyRequiredFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); } @Test @@ -557,7 +557,7 @@ public void editAlleleWithEmptyModEntityId() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(1))). - body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modInternalId")); + body("errorMessages.modInternalId", is(ValidationConstants.REQUIRED_UNLESS_OTHER_FIELD_POPULATED_MESSAGE + "modEntityId")); } @Test From 3aeede6d7ff924b766167ebe28239533076e688f Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Wed, 3 Jan 2024 10:02:20 +0000 Subject: [PATCH 018/159] Fix migration --- .../v0.30.0.1__linkml_v2.0.0_update.sql | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index c198e1f62..a711b56d0 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -2072,35 +2072,6 @@ ALTER TABLE auditedobject DROP COLUMN old_id; ALTER TABLE auditedobject DROP COLUMN old_curie; ALTER TABLE auditedobject DROP COLUMN tablename; -ALTER TABLE association_aud DROP COLUMN revtype; -ALTER TABLE biologicalentity_aud DROP COLUMN revtype; -ALTER TABLE bulkload_aud DROP COLUMN revtype; -ALTER TABLE bulkloadfile_aud DROP COLUMN revtype; -ALTER TABLE bulkloadfileexception_aud DROP COLUMN revtype; -ALTER TABLE bulkloadfilehistory_aud DROP COLUMN revtype; -ALTER TABLE bulkloadgroup_aud DROP COLUMN revtype; -ALTER TABLE conditionrelation_aud DROP COLUMN revtype; -ALTER TABLE crossreference_aud DROP COLUMN revtype; -ALTER TABLE dataprovider_aud DROP COLUMN revtype; -ALTER TABLE experimentalcondition_aud DROP COLUMN revtype; -ALTER TABLE genetogeneorthology_aud DROP COLUMN revtype; -ALTER TABLE informationcontententity_aud DROP COLUMN revtype; -ALTER TABLE note_aud DROP COLUMN revtype; -ALTER TABLE ontologyterm_aud DROP COLUMN revtype; -ALTER TABLE organization_aud DROP COLUMN revtype; -ALTER TABLE person_aud DROP COLUMN revtype; -ALTER TABLE personsetting_aud DROP COLUMN revtype; -ALTER TABLE reagent_aud DROP COLUMN revtype; -ALTER TABLE resourcedescriptor_aud DROP COLUMN revtype; -ALTER TABLE resourcedescriptorpage_aud DROP COLUMN revtype; -ALTER TABLE slotannotation_aud DROP COLUMN revtype; -ALTER TABLE species_aud DROP COLUMN revtype; -ALTER TABLE synonym_aud DROP COLUMN revtype; -ALTER TABLE vocabulary_aud DROP COLUMN revtype; -ALTER TABLE vocabularyterm_aud DROP COLUMN revtype; -ALTER TABLE vocabularytermset_aud DROP COLUMN revtype; - -/* Stop here to test INSERT INTO submittedobject_aud (id, rev) SELECT id, rev FROM biologicalentity_aud; INSERT INTO submittedobject_aud (id, rev) SELECT id, rev FROM reagent_aud; @@ -2137,6 +2108,34 @@ INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM vo INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM vocabularyterm_aud; INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM vocabularytermset_aud; +ALTER TABLE association_aud DROP COLUMN revtype; +ALTER TABLE biologicalentity_aud DROP COLUMN revtype; +ALTER TABLE bulkload_aud DROP COLUMN revtype; +ALTER TABLE bulkloadfile_aud DROP COLUMN revtype; +ALTER TABLE bulkloadfileexception_aud DROP COLUMN revtype; +ALTER TABLE bulkloadfilehistory_aud DROP COLUMN revtype; +ALTER TABLE bulkloadgroup_aud DROP COLUMN revtype; +ALTER TABLE conditionrelation_aud DROP COLUMN revtype; +ALTER TABLE crossreference_aud DROP COLUMN revtype; +ALTER TABLE dataprovider_aud DROP COLUMN revtype; +ALTER TABLE experimentalcondition_aud DROP COLUMN revtype; +ALTER TABLE genetogeneorthology_aud DROP COLUMN revtype; +ALTER TABLE informationcontententity_aud DROP COLUMN revtype; +ALTER TABLE note_aud DROP COLUMN revtype; +ALTER TABLE ontologyterm_aud DROP COLUMN revtype; +ALTER TABLE organization_aud DROP COLUMN revtype; +ALTER TABLE person_aud DROP COLUMN revtype; +ALTER TABLE personsetting_aud DROP COLUMN revtype; +ALTER TABLE reagent_aud DROP COLUMN revtype; +ALTER TABLE resourcedescriptor_aud DROP COLUMN revtype; +ALTER TABLE resourcedescriptorpage_aud DROP COLUMN revtype; +ALTER TABLE slotannotation_aud DROP COLUMN revtype; +ALTER TABLE species_aud DROP COLUMN revtype; +ALTER TABLE synonym_aud DROP COLUMN revtype; +ALTER TABLE vocabulary_aud DROP COLUMN revtype; +ALTER TABLE vocabularyterm_aud DROP COLUMN revtype; +ALTER TABLE vocabularytermset_aud DROP COLUMN revtype; + SET session_replication_role = 'origin'; -- Add constraints and indexes @@ -2573,4 +2572,3 @@ ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_id_fk FOREIGN KEY (id) REFERENCES ana ALTER TABLE zfaterm_aud ADD CONSTRAINT zfaterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); ALTER TABLE zfsterm_aud ADD CONSTRAINT zfsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); -*/ From 1c5c1c1fa75fa1c7dc8b9bbccd86ed069a80df64 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Wed, 3 Jan 2024 13:05:41 +0000 Subject: [PATCH 019/159] Initial UI changes --- .../components/Actions/EntityDetailsAction.js | 8 +- .../SubjectAutocompleteTemplate.js | 14 +- .../src/components/Editors/GeneEditor.js | 7 +- .../AssertedAlleleAdditionalFieldData.js | 3 +- .../AssertedGenesAdditionalFieldData.js | 3 +- .../GeneticModifiersAdditionalFieldData.js | 9 +- .../SGDStrainBackgroundAdditionalFieldData.js | 3 +- .../FieldData/SubjectAdditionalFieldData.js | 9 +- .../FieldData/WithAdditionalFieldData.js | 3 +- .../GenericDataTable/GenericDataTable.js | 6 +- ...mTemplate.js => IdentifierFormTemplate.js} | 11 +- src/main/cliapp/src/constants/FilterFields.js | 24 ++- src/main/cliapp/src/constants/SortFields.js | 1 + .../AffectedGenomicModelTable.js | 21 ++- .../AffectedGenomicModelTable.test.js | 4 +- .../mockData/mockData.js | 6 +- .../allelesPage/AlleleDetailPage.js | 45 ++++-- .../containers/allelesPage/AllelesTable.js | 25 ++- .../__tests__/AllelesTable.test.js | 4 +- .../AlleleGeneAssociationsForm.js | 2 +- .../AlleleGeneAssociationsFormTable.js | 6 +- .../allelesPage/mockData/mockData.js | 6 +- .../DiseaseAnnotationsTable.js | 144 +++++++++--------- .../NewAnnotationForm.js | 12 +- .../src/containers/genesPage/GenesTable.js | 29 ++-- .../genesPage/__tests__/GenesTable.test.js | 4 +- .../containers/genesPage/mockData/mockData.js | 2 +- src/main/cliapp/src/utils/utils.js | 13 ++ .../GeneDiseaseAnnotationExecutor.java | 3 +- 29 files changed, 255 insertions(+), 172 deletions(-) rename src/main/cliapp/src/components/Templates/{CurieFormTemplate.js => IdentifierFormTemplate.js} (67%) diff --git a/src/main/cliapp/src/components/Actions/EntityDetailsAction.js b/src/main/cliapp/src/components/Actions/EntityDetailsAction.js index fd561558b..5bb0a271a 100644 --- a/src/main/cliapp/src/components/Actions/EntityDetailsAction.js +++ b/src/main/cliapp/src/components/Actions/EntityDetailsAction.js @@ -1,17 +1,17 @@ import { Link } from 'react-router-dom/cjs/react-router-dom.min'; import { Tooltip } from 'primereact/tooltip'; -export const EntityDetailsAction = ({ curie, disabled }) =>{ +export const EntityDetailsAction = ({ identifier, disabled }) =>{ const disabledClasses = disabled ? "pointer-events-none opacity-50" : ""; - if (!curie) return null; + if (!identifier) return null; return ( <> - + - + ); }; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Autocomplete/SubjectAutocompleteTemplate.js b/src/main/cliapp/src/components/Autocomplete/SubjectAutocompleteTemplate.js index 4eb6b04be..f5c3a7879 100644 --- a/src/main/cliapp/src/components/Autocomplete/SubjectAutocompleteTemplate.js +++ b/src/main/cliapp/src/components/Autocomplete/SubjectAutocompleteTemplate.js @@ -1,5 +1,5 @@ import React from 'react'; -import { onSelectionOver } from '../../utils/utils'; +import { onSelectionOver, getIdentifier } from '../../utils/utils'; export const SubjectAutocompleteTemplate = ({ item, setAutocompleteHoverItem, op, query }) => { @@ -7,37 +7,37 @@ export const SubjectAutocompleteTemplate = ({ item, setAutocompleteHoverItem, op return (
onSelectionOver(event, item, query, op, setAutocompleteHoverItem)} - dangerouslySetInnerHTML={{__html: item.geneSymbol.displayText + ' (' + item.curie + ') '}}/> + dangerouslySetInnerHTML={{__html: item.geneSymbol.displayText + ' (' + getIdentifier(item) + ') '}}/>
); } else if (item.alleleSymbol) { return (
-
onSelectionOver(event, item, query, op, setAutocompleteHoverItem)} dangerouslySetInnerHTML={{__html: item.alleleSymbol.displayText + ' (' + item.curie + ') '}}/> +
onSelectionOver(event, item, query, op, setAutocompleteHoverItem)} dangerouslySetInnerHTML={{__html: item.alleleSymbol.displayText + ' (' + getIdentifier(item) + ') '}}/>
); } else if (item.geneFullName) { return (
-
onSelectionOver(event, item, query, op, setAutocompleteHoverItem)} dangerouslySetInnerHTML={{__html: item.geneFullName.displayText + ' (' + item.curie + ') '}}/> +
onSelectionOver(event, item, query, op, setAutocompleteHoverItem)} dangerouslySetInnerHTML={{__html: item.geneFullName.displayText + ' (' + getIdentifier(item) + ') '}}/>
); } else if (item.alleleFullName) { return (
-
onSelectionOver(event, item, query, op, setAutocompleteHoverItem)} dangerouslySetInnerHTML={{__html: item.alleleFullName.displayText + ' (' + item.curie + ') '}}/> +
onSelectionOver(event, item, query, op, setAutocompleteHoverItem)} dangerouslySetInnerHTML={{__html: item.alleleFullName.displayText + ' (' + getIdentifier(item) + ') '}}/>
); } else if (item.name) { return (
-
onSelectionOver(event, item, query, op, setAutocompleteHoverItem)} dangerouslySetInnerHTML={{__html: item.name + ' (' + item.curie + ') '}}/> +
onSelectionOver(event, item, query, op, setAutocompleteHoverItem)} dangerouslySetInnerHTML={{__html: item.name + ' (' + getIdentifier(item) + ') '}}/>
); } else { return (
-
onSelectionOver(event, item, query, op, setAutocompleteHoverItem)} dangerouslySetInnerHTML={{__html: item.curie}}/> +
onSelectionOver(event, item, query, op, setAutocompleteHoverItem)} dangerouslySetInnerHTML={{__html: getIdentifier(item)}}/>
); }; diff --git a/src/main/cliapp/src/components/Editors/GeneEditor.js b/src/main/cliapp/src/components/Editors/GeneEditor.js index b86612aca..7fa73e97f 100644 --- a/src/main/cliapp/src/components/Editors/GeneEditor.js +++ b/src/main/cliapp/src/components/Editors/GeneEditor.js @@ -3,6 +3,7 @@ import { SearchService } from '../../service/SearchService'; import { autocompleteSearch, buildAutocompleteFilter } from '../../utils/utils'; import { LiteratureAutocompleteTemplate } from '../Autocomplete/LiteratureAutocompleteTemplate'; import { DialogErrorMessageComponent } from "../Error/DialogErrorMessageComponent"; +import { getIdentifier } from "../../utils/utils"; const geneSearch = (event, setFiltered, setInputValue) => { const searchService = new SearchService(); @@ -24,16 +25,16 @@ export const GeneEditor = ({ props, errorMessages, onChange }) => { <> } onValueChangeHandler={onChange} /> ); diff --git a/src/main/cliapp/src/components/FieldData/AssertedAlleleAdditionalFieldData.js b/src/main/cliapp/src/components/FieldData/AssertedAlleleAdditionalFieldData.js index 178d0cdf4..654530618 100644 --- a/src/main/cliapp/src/components/FieldData/AssertedAlleleAdditionalFieldData.js +++ b/src/main/cliapp/src/components/FieldData/AssertedAlleleAdditionalFieldData.js @@ -1,8 +1,9 @@ import React from 'react'; +import { getIdentifier } from '../../utils/utils'; export function AssertedAlleleAdditionalFieldData({ fieldData }) { if (fieldData) { - if (fieldData["curie"] !== '' && fieldData["type"] === "Allele") + if (getIdentifier(fieldData) !== '' && fieldData["type"] === "Allele") return
; } return null; diff --git a/src/main/cliapp/src/components/FieldData/AssertedGenesAdditionalFieldData.js b/src/main/cliapp/src/components/FieldData/AssertedGenesAdditionalFieldData.js index a49ee2881..0db30c44e 100644 --- a/src/main/cliapp/src/components/FieldData/AssertedGenesAdditionalFieldData.js +++ b/src/main/cliapp/src/components/FieldData/AssertedGenesAdditionalFieldData.js @@ -1,10 +1,11 @@ import React from 'react'; +import { getIdentifier } from '../../utils/utils'; export function AssertedGenesAdditionalFieldData({ fieldData }) { let ret = []; if (fieldData && fieldData.length >0) { for(let i=0; i< fieldData.length; i++){ - if (fieldData[i]["curie"] !== '' && fieldData[i]["type"] === "Gene") + if (getIdentifty(fieldData[i]) !== '' && fieldData[i]["type"] === "Gene") ret.push(
); } } diff --git a/src/main/cliapp/src/components/FieldData/GeneticModifiersAdditionalFieldData.js b/src/main/cliapp/src/components/FieldData/GeneticModifiersAdditionalFieldData.js index 6d2ee3e21..d4b56c7d0 100644 --- a/src/main/cliapp/src/components/FieldData/GeneticModifiersAdditionalFieldData.js +++ b/src/main/cliapp/src/components/FieldData/GeneticModifiersAdditionalFieldData.js @@ -1,15 +1,16 @@ import React from 'react'; +import { getIdentifier } from '../../utils/utils'; export function GeneticModifiersAdditionalFieldData({ fieldData }) { let ret = []; if (fieldData && fieldData.length > 0) { for(let i=0; i < fieldData.length; i++) { - if (fieldData[i]["curie"]) { - if (fieldData[i]["curie"] !== '' && fieldData[i]["type"] === "Gene") + if (getIdentifier(fieldData[i]) !== '') { + if (fieldData[i]["type"] === "Gene") ret.push(
); - else if (fieldData[i]["curie"] !== '' && fieldData[i]["type"] === "Allele") + else if (fieldData[i]["type"] === "Allele") ret.push(
); - else if (fieldData[i]["curie"] !== '' && fieldData[i]["type"] === "AffectedGenomicModel") + else if (fieldData[i]["type"] === "AffectedGenomicModel") ret.push(
); } } diff --git a/src/main/cliapp/src/components/FieldData/SGDStrainBackgroundAdditionalFieldData.js b/src/main/cliapp/src/components/FieldData/SGDStrainBackgroundAdditionalFieldData.js index dafad7d6b..1aabf0f64 100644 --- a/src/main/cliapp/src/components/FieldData/SGDStrainBackgroundAdditionalFieldData.js +++ b/src/main/cliapp/src/components/FieldData/SGDStrainBackgroundAdditionalFieldData.js @@ -1,8 +1,9 @@ import React from 'react'; +import { getIdentifier } from '../../utils/utils'; export function SGDStrainBackgroundAdditionalFieldData({ fieldData }){ if (fieldData) { - if (fieldData["curie"] !== '' && fieldData["name"] !== '') + if (getIdentifier(fieldData) !== '' && fieldData["name"] !== '') return
{fieldData["name"]}
; } return null; diff --git a/src/main/cliapp/src/components/FieldData/SubjectAdditionalFieldData.js b/src/main/cliapp/src/components/FieldData/SubjectAdditionalFieldData.js index dfaf829a2..22f15a35c 100644 --- a/src/main/cliapp/src/components/FieldData/SubjectAdditionalFieldData.js +++ b/src/main/cliapp/src/components/FieldData/SubjectAdditionalFieldData.js @@ -1,12 +1,13 @@ import React from 'react'; +import { getIdentifier } from '../../utils/utils'; export function SubjectAdditionalFieldData({ fieldData }) { - if (fieldData && fieldData["curie"]) { - if (fieldData["curie"] !== '' && fieldData["type"] === "Gene") + if (fieldData && getIdentifier(fieldData) !== '') { + if (fieldData["type"] === "Gene") return
; - else if (fieldData["curie"] !== '' && fieldData["type"] === "Allele") + else if (fieldData["type"] === "Allele") return
; - else if (fieldData["curie"] !== '' && fieldData["type"] === "AffectedGenomicModel") + else if (fieldData["type"] === "AffectedGenomicModel") return
; } return null; diff --git a/src/main/cliapp/src/components/FieldData/WithAdditionalFieldData.js b/src/main/cliapp/src/components/FieldData/WithAdditionalFieldData.js index 720da6507..c7b9d9d85 100644 --- a/src/main/cliapp/src/components/FieldData/WithAdditionalFieldData.js +++ b/src/main/cliapp/src/components/FieldData/WithAdditionalFieldData.js @@ -1,10 +1,11 @@ import React from 'react'; +import { getIdentifier } from '../../utils/utils'; export function WithAdditionalFieldData({ fieldData }) { let ret = []; if (fieldData && fieldData.length >0) { for(let i=0; i< fieldData.length; i++){ - if (fieldData[i]["curie"] !== '' && fieldData[i]["type"] === "Gene") + if (getIdentifier(fieldData[i]) !== '' && fieldData[i]["type"] === "Gene") ret.push(
{fieldData[i]["geneSymbol"]["displayText"]}
); } } diff --git a/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js b/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js index a5f051af5..f84c71c17 100644 --- a/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js +++ b/src/main/cliapp/src/components/GenericDataTable/GenericDataTable.js @@ -14,7 +14,7 @@ import { DuplicationAction } from "../Actions/DuplicationAction"; import { EntityDetailsAction } from "../Actions/EntityDetailsAction"; -import { filterColumns, orderColumns } from '../../utils/utils'; +import { filterColumns, orderColumns, getIdentifier } from '../../utils/utils'; import { useGenericDataTable } from "./useGenericDataTable"; export const GenericDataTable = (props) => { @@ -288,8 +288,8 @@ export const GenericDataTable = (props) => { } {hasDetails && } - body={(props) => } + editor={(props) => } + body={(props) => } showFilterMenu={false} style={{maxWidth: '4rem', minWidth: '4rem', display: props.isEditable ? 'visible' : 'none' }} headerStyle={{ width: '4rem', position: 'sticky' }} bodyStyle={{textAlign: 'center'}} frozen headerClassName='surface-0'/> } diff --git a/src/main/cliapp/src/components/Templates/CurieFormTemplate.js b/src/main/cliapp/src/components/Templates/IdentifierFormTemplate.js similarity index 67% rename from src/main/cliapp/src/components/Templates/CurieFormTemplate.js rename to src/main/cliapp/src/components/Templates/IdentifierFormTemplate.js index 2affc61fc..ef15973c7 100644 --- a/src/main/cliapp/src/components/Templates/CurieFormTemplate.js +++ b/src/main/cliapp/src/components/Templates/IdentifierFormTemplate.js @@ -1,7 +1,8 @@ import { FormFieldWrapper } from "../FormFieldWrapper"; -export const CurieFormTemplate = ({ - curie, +export const IdentifierFormTemplate = ({ + identifier, + label, widgetColumnSize, labelColumnSize, fieldDetailsColumnSize, @@ -12,9 +13,9 @@ export const CurieFormTemplate = ({ labelColumnSize={labelColumnSize} fieldDetailsColumnSize={fieldDetailsColumnSize} widgetColumnSize={widgetColumnSize} - fieldName="Curie" - formField={curie} - additionalDataField={curie} + fieldName={label} + formField={identifier} + additionalDataField={identifier} /> ); diff --git a/src/main/cliapp/src/constants/FilterFields.js b/src/main/cliapp/src/constants/FilterFields.js index 96ad3dfcf..659e5ebd8 100644 --- a/src/main/cliapp/src/constants/FilterFields.js +++ b/src/main/cliapp/src/constants/FilterFields.js @@ -62,11 +62,11 @@ export const FIELD_SETS = Object.freeze({ }, assertedAlleleFieldSet: { filterName: "assertedAlleleFilter", - fields: ["assertedAllele.alleleSymbol.displayText", "assertedAllele.alleleSymbol.formatText", "assertedAllele.curie"], + fields: ["assertedAllele.alleleSymbol.displayText", "assertedAllele.alleleSymbol.formatText", "assertedAllele.curie", "assertedAllele.modEntityId", "assertedAllele.modInternalId"], }, assertedGenesFieldSet: { filterName: "assertedGenesFilter", - fields: ["assertedGenes.geneSymbol.displayText", "assertedGenes.geneSymbol.formatText", "assertedGenes.curie"], + fields: ["assertedGenes.geneSymbol.displayText", "assertedGenes.geneSymbol.formatText", "assertedGenes.curie", "assertedGenes.modEntityId", "assertedGenes.modInternalId"], }, citationFieldSet: { filterName: "citationFilter", @@ -146,7 +146,7 @@ export const FIELD_SETS = Object.freeze({ }, constructGenomicComponentsFieldSet: { filterName: "constructGenomicComponentsFilter", - fields: ["constructGenomicEntityAssociations.object.symbol", "constructGenomicEntityAssociations.object.name", "constructGenomicEntityAssociations.object.curie", "constructGenomicEntityAssociations.relation.name"], + fields: ["constructGenomicEntityAssociations.object.symbol", "constructGenomicEntityAssociations.object.name", "constructGenomicEntityAssociations.object.curie", "constructGenomicEntityAssociations.object.modEntityId", "constructGenomicEntityAssociations.object.modInternalId", "constructGenomicEntityAssociations.relation.name"], }, daConditionRelationsHandleFieldSet: { filterName: "daConditionRelationHandleFilter", @@ -238,7 +238,7 @@ export const FIELD_SETS = Object.freeze({ }, geneticModifiersFieldSet: { filterName: "geneticModifiersFilter", - fields: ["diseaseGeneticModifiers.symbol", "diseaseGeneticModifiers.name", "diseaseGeneticModifiers.curie"], + fields: ["diseaseGeneticModifiers.symbol", "diseaseGeneticModifiers.name", "diseaseGeneticModifiers.curie", "diseaseGeneticModifiers.modEntityId", "diseaseGeneticModifiers.modInternalId"], }, geneticModifierRelationFieldSet: { filterName: "geneticModifierRelationFilter", @@ -274,11 +274,11 @@ export const FIELD_SETS = Object.freeze({ }, inferredAlleleFieldSet: { filterName: "inferredAlleleFilter", - fields: ["inferredAllele.alleleSymbol.displayText", "inferredAllele.alleleSymbol.formatText", "inferredAllele.curie"], + fields: ["inferredAllele.alleleSymbol.displayText", "inferredAllele.alleleSymbol.formatText", "inferredAllele.curie", "inferredAllele.modEntityId", "inferredAllele.modInternalId"], }, inferredGeneFieldSet: { filterName: "inferredGeneFilter", - fields: ["inferredGene.geneSymbol.displayText", "inferredGene.geneSymbol.formatText", "inferredGene.curie"] + fields: ["inferredGene.geneSymbol.displayText", "inferredGene.geneSymbol.formatText", "inferredGene.curie", "inferredGene.modEntityId", "inferredGene.modInternalId"] }, internalFieldSet: { filterName: "internalFilter", @@ -322,7 +322,7 @@ export const FIELD_SETS = Object.freeze({ }, objectGeneFieldSet: { filterName: "objectGeneFilter", - fields: ["objectGene.geneSymbol.displayText", "objectGene.geneSymbol.formatText", "objectGene.curie"], + fields: ["object.geneSymbol.displayText", "object.geneSymbol.formatText", "object.curie", "object.modEntityId", "object.modInternalId"], }, obsoleteFieldSet: { filterName: "obsoleteFilter", @@ -370,7 +370,7 @@ export const FIELD_SETS = Object.freeze({ }, sgdStrainBackgroundFieldSet: { filterName: "sgdStrainBackgroundFilter", - fields: ["sgdStrainBackground.name", "sgdStrainBackground.curie"], + fields: ["sgdStrainBackground.name", "sgdStrainBackground.curie", "sgdStrainBackground.modEntityId", "sgdStrainBackground.modInternalId"], }, singleReferenceFieldSet: { filterName: "singleReferenceFilter", @@ -414,11 +414,7 @@ export const FIELD_SETS = Object.freeze({ }, subjectFieldSet: { filterName: "subjectFilter", - fields: ["subject.symbol", "subject.name", "subject.curie"], - }, - subjectGeneTaxonFieldSet: { - filterName: "subjectGeneTaxonFilter", - fields: ["subjectGene.taxon.name", "subjectGene.taxon.curie"], + fields: ["subject.symbol", "subject.name", "subject.curie", "subject.modEntityId", "subject.modInternalId"], }, subtypeFieldSet: { filterName: "subtypeFilter", @@ -478,7 +474,7 @@ export const FIELD_SETS = Object.freeze({ }, withFieldSet: { filterName: "withFilter", - fields: ["with.geneSymbol.displayText", "with.geneSymbol.formatText", "with.curie"], + fields: ["with.geneSymbol.displayText", "with.geneSymbol.formatText", "with.curie", "with.modEntityId", "with.modInternalId"], } }); diff --git a/src/main/cliapp/src/constants/SortFields.js b/src/main/cliapp/src/constants/SortFields.js index ddc7e0855..dae432ae8 100644 --- a/src/main/cliapp/src/constants/SortFields.js +++ b/src/main/cliapp/src/constants/SortFields.js @@ -1,6 +1,7 @@ export const SORT_FIELDS = Object.freeze([ "uniqueId", "modEntityId", + "modInternalId", "subject.symbol", "relation.name", "negated", diff --git a/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js b/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js index 2a127307e..f6803331c 100644 --- a/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js +++ b/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js @@ -20,8 +20,8 @@ export const AffectedGenomicModelTable = () => { const nameTemplate = (rowData) => { return ( <> -
- +
+
@@ -32,10 +32,10 @@ export const AffectedGenomicModelTable = () => { if (rowData.taxon) { return ( <> - + {rowData.taxon.name} ({rowData.taxon.curie}) - + ); } @@ -48,6 +48,18 @@ export const AffectedGenomicModelTable = () => { sortable: true, filterConfig: FILTER_CONFIGS.curieFilterConfig }, + { + field: "modEntityId", + header: "MOD Entity ID", + sortable: true, + filterConfig: FILTER_CONFIGS.modentityidFilterConfig, + }, + { + field: "modInternalId", + header: "MOD Internal ID", + sortable: true, + filterConfig: FILTER_CONFIGS.modinternalidFilterConfig, + }, { field: "name", header: "Name", @@ -138,7 +150,6 @@ export const AffectedGenomicModelTable = () => { ", () => { it("Contains Correct Table Data", async () => { let result = await renderWithClient(); - const curie = await result.findByText(/WB:WBStrain00051221/i); - expect(curie).toBeInTheDocument(); + const modEntityId = await result.findByText(/WB:WBStrain00051221/i); + expect(modEntityId).toBeInTheDocument(); }); }); \ No newline at end of file diff --git a/src/main/cliapp/src/containers/affectedGenomicModelPage/mockData/mockData.js b/src/main/cliapp/src/containers/affectedGenomicModelPage/mockData/mockData.js index 33bf4c967..59bc02b07 100644 --- a/src/main/cliapp/src/containers/affectedGenomicModelPage/mockData/mockData.js +++ b/src/main/cliapp/src/containers/affectedGenomicModelPage/mockData/mockData.js @@ -6,13 +6,13 @@ export const data = { "internal": false, "obsolete": false, "dbDateCreated": "2022-11-02T22:19:23.387435Z", - "dbDateUpdated": "2022-12-22T15:16:30.834738Z", "curie": "WB:WBStrain00051221", "taxon": { "internal": false, "obsolete": false, "curie": "NCBITaxon:6239", "name": "Caenorhabditis elegans" }, "name": "VC4532", "subtype": { "internal": false, "obsolete": false, "id": 25575353, "name": "strain" } + "dbDateUpdated": "2022-12-22T15:16:30.834738Z", "modEntityId": "WB:WBStrain00051221", "taxon": { "internal": false, "obsolete": false, "curie": "NCBITaxon:6239", "name": "Caenorhabditis elegans" }, "name": "VC4532", "subtype": { "internal": false, "obsolete": false, "id": 25575353, "name": "strain" } }, { - "type": "AffectedGenomicModel", "dateCreated": "2006-10-13T14:12:37Z", "dateUpdated": "2006-10-13T14:12:37Z", "internal": false, "obsolete": false, "dbDateUpdated": "2022-12-22T15:10:00.706858Z", "curie": "RGD:1581633", "taxon": { "internal": false, "obsolete": false, "curie": "NCBITaxon:10116", "name": "Rattus norvegicus" }, "name": "DA.ACI-(D15Rat6-D15Rat71)/Kini", "subtype": { "internal": false, "obsolete": false, "id": 25575353, "name": "strain" } + "type": "AffectedGenomicModel", "dateCreated": "2006-10-13T14:12:37Z", "dateUpdated": "2006-10-13T14:12:37Z", "internal": false, "obsolete": false, "dbDateUpdated": "2022-12-22T15:10:00.706858Z", "modEntityId": "RGD:1581633", "taxon": { "internal": false, "obsolete": false, "curie": "NCBITaxon:10116", "name": "Rattus norvegicus" }, "name": "DA.ACI-(D15Rat6-D15Rat71)/Kini", "subtype": { "internal": false, "obsolete": false, "id": 25575353, "name": "strain" } }, { - "type": "AffectedGenomicModel", "dateCreated": "2021-09-02T22:25:17Z", "dateUpdated": "2021-09-02T22:25:17Z", "internal": false, "obsolete": false, "dbDateUpdated": "2022-12-22T15:10:21.254879Z", "curie": "RGD:150404267", "taxon": { "internal": false, "obsolete": false, "curie": "NCBITaxon:10116", "name": "Rattus norvegicus" }, "name": "LEW-Myo15aci2/Ztm", "subtype": { "internal": false, "obsolete": false, "id": 25575353, "name": "strain" } + "type": "AffectedGenomicModel", "dateCreated": "2021-09-02T22:25:17Z", "dateUpdated": "2021-09-02T22:25:17Z", "internal": false, "obsolete": false, "dbDateUpdated": "2022-12-22T15:10:21.254879Z", "modEntityId": "RGD:150404267", "taxon": { "internal": false, "obsolete": false, "curie": "NCBITaxon:10116", "name": "Rattus norvegicus" }, "name": "LEW-Myo15aci2/Ztm", "subtype": { "internal": false, "obsolete": false, "id": 25575353, "name": "strain" } } ], "totalResults": 196858, "returnedRecords": 50 diff --git a/src/main/cliapp/src/containers/allelesPage/AlleleDetailPage.js b/src/main/cliapp/src/containers/allelesPage/AlleleDetailPage.js index d14817a26..da48f7b54 100644 --- a/src/main/cliapp/src/containers/allelesPage/AlleleDetailPage.js +++ b/src/main/cliapp/src/containers/allelesPage/AlleleDetailPage.js @@ -13,7 +13,7 @@ import { TaxonFormEditor } from '../../components/Editors/taxon/TaxonFormEditor' import { useAlleleReducer } from './useAlleleReducer'; import { InCollectionFormEditor } from '../../components/Editors/inCollection/InCollectionFormEditor'; import { BooleanFormEditor } from '../../components/Editors/boolean/BooleanFormEditor'; -import { CurieFormTemplate } from '../../components/Templates/CurieFormTemplate'; +import { IdentifierFormTemplate } from '../../components/Templates/IdentifierFormTemplate'; import { DataProviderFormTemplate } from '../../components/Templates/DataProviderFormTemplate'; import { DateFormTemplate } from '../../components/Templates/DateFormTemplate'; import { UserFormTemplate } from '../../components/Templates/UserFormTemplate'; @@ -36,7 +36,7 @@ import { AlleleGeneAssociationsForm } from './alleleGeneAssociations/AlleleGeneA import { validateAlleleDetailTable } from '../../utils/utils'; export default function AlleleDetailPage() { - const { curie } = useParams(); + const { identifier } = useParams(); const { alleleState, alleleDispatch } = useAlleleReducer(); const alleleService = new AlleleService(); const alleleGeneAssociationService = new AlleleGeneAssociationService(); @@ -47,8 +47,8 @@ export default function AlleleDetailPage() { const widgetColumnSize = "col-4"; const fieldDetailsColumnSize = "col-5"; - const { isLoading: getRequestIsLoading } = useQuery([curie], - () => alleleService.getAllele(curie), + const { isLoading: getRequestIsLoading } = useQuery([identifier], + () => alleleService.getAllele(identifier), { onSuccess: (result) => { alleleDispatch({ type: 'SET', value: result?.data?.entity }); @@ -79,13 +79,13 @@ export default function AlleleDetailPage() { const table = alleleState.allele.alleleGeneAssociations; let uiErrors = false; table.forEach((association, index) => { - const gene = association.objectGene; + const gene = association.object; if (!gene || typeof gene === 'string') { const updatedErrorMessages = global.structuredClone(alleleState.entityStates.alleleGeneAssociations.errorMessages); const errorMessage = { ...updatedErrorMessages[index], - objectGene: {message: "Must select gene from dropdown", severity: "error"}, + object: {message: "Must select gene from dropdown", severity: "error"}, }; updatedErrorMessages[index] = errorMessage; alleleDispatch({ @@ -196,11 +196,11 @@ export default function AlleleDetailPage() { const headerText = () => { let prefix = "Allele: "; - if (alleleState.allele?.alleleSymbol?.displayText && alleleState.allele?.curie) { - return `${prefix} ${alleleState.allele.alleleSymbol.displayText} (${alleleState.allele.curie})`; + if (alleleState.allele?.alleleSymbol?.displayText && alleleState.allele?.modEntityId) { + return `${prefix} ${alleleState.allele.alleleSymbol.displayText} (${alleleState.allele.modEntityId})`; } - if (alleleState.allele?.curie) { - return `${prefix} ${alleleState.allele.curie}`; + if (alleleState.allele?.modEntityId) { + return `${prefix} ${alleleState.allele.modEntityId}`; } return "Allele Detail Page"; }; @@ -222,8 +222,29 @@ export default function AlleleDetailPage() {
- + + + + + + + + { if (rowData?.taxon) { return ( <> - + {rowData.taxon.name} ({rowData.taxon.curie}) - + ); } @@ -152,10 +152,10 @@ export const AllelesTable = () => { } }; - const DetailMessage = ({curie, text, display}) => { + const DetailMessage = ({modEntityId, text, display}) => { if (display) { return ( - {text}}/> + {text}}/> ); }; return null; @@ -178,9 +178,9 @@ export const AllelesTable = () => { }; return ( <> -
+
- +
); @@ -1094,6 +1094,18 @@ export const AllelesTable = () => { sortable: true, filterConfig: FILTER_CONFIGS.curieFilterConfig, }, + { + field: "modEntityId", + header: "MOD Entity ID", + sortable: true, + filterConfig: FILTER_CONFIGS.modentityidFilterConfig, + }, + { + field: "modInternalId", + header: "MOD Internal ID", + sortable: true, + filterConfig: FILTER_CONFIGS.modinternalidFilterConfig, + }, { field: "alleleFullName.displayText", header: "Name", @@ -1290,7 +1302,6 @@ export const AllelesTable = () => { ", () => { it("Contains Correct Table Data", async () => { let result = await renderWithClient(); - const curieTd = await result.findByText(/FB:FBal0196303/i); + const modEntityIdTd = await result.findByText(/FB:FBal0196303/i); const nameTd = await result.findByText(/Saccharomyces cerevisiae UAS construct a of Stefancsik/i); const symbolTd = await result.findByText(/symbol display text/i); const secondaryIdsTd = await result.findByText(/FB:FBal0123136/i); @@ -47,7 +47,7 @@ describe("", () => { const alleleDatabaseStatusTd = await result.findByText(/approved/i); await waitFor(() => { - expect(curieTd).toBeInTheDocument(); + expect(modEntityIdTd).toBeInTheDocument(); expect(nameTd).toBeInTheDocument(); expect(symbolTd).toBeInTheDocument(); expect(secondaryIdsTd).toBeInTheDocument(); diff --git a/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsForm.js b/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsForm.js index 4bdd1fec0..9cc6dffe2 100644 --- a/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsForm.js +++ b/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsForm.js @@ -65,7 +65,7 @@ export const AlleleGeneAssociationsForm = ({ labelColumnSize, state, dispatch }) type: 'EDIT_ROW', entityType: 'alleleGeneAssociations', index: props.rowIndex, - field: "objectGene", + field: "object", value: event.target.value }); }; diff --git a/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js b/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js index a76318613..cbef458dd 100644 --- a/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js +++ b/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js @@ -82,13 +82,13 @@ export const AlleleGeneAssociationsFormTable = ({ onChange={geneOnChangeHandler} />; }} - field="objectGene" + field="object" header="Gene" headerClassName='surface-0' filter sortable - filterField="objectGene.curie" - sortField="objectGene.curie" + filterField="object.modEntityId" + sortField="object.modEntityId" showFilterMenu={false} filterMatchMode='contains' /> diff --git a/src/main/cliapp/src/containers/allelesPage/mockData/mockData.js b/src/main/cliapp/src/containers/allelesPage/mockData/mockData.js index 7186c69cc..f98d54b0d 100644 --- a/src/main/cliapp/src/containers/allelesPage/mockData/mockData.js +++ b/src/main/cliapp/src/containers/allelesPage/mockData/mockData.js @@ -24,7 +24,7 @@ export const data = { "internal": false, "obsolete": false, "dbDateUpdated": "2023-04-05T02:49:57.970413Z", - "curie": "FB:FBal0196303", + "modEntityId": "FB:FBal0196303", "taxon": { "internal": false, "obsolete": false, @@ -530,7 +530,7 @@ export const alleleDetailData = { "internal": false, "obsolete": false, "dbDateUpdated": "2023-04-14T22:58:06.51117Z", - "curie": "MGI:5146840", + "modEntityId": "MGI:5146840", "taxon": { "internal": false, "obsolete": false, @@ -721,6 +721,8 @@ export const mockSettingsData = { "multiSortMeta": [], "selectedColumnNames": [ "Curie", + "MOD Entity ID", + "MOD Internal ID", "Name", "Symbol", "Secondary IDs", diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index cf821e47b..7c69ebed2 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -23,7 +23,7 @@ import { ErrorMessageComponent } from '../../components/Error/ErrorMessageCompon import { TrueFalseDropdown } from '../../components/TrueFalseDropDownSelector'; import { Button } from 'primereact/button'; import { Tooltip } from 'primereact/tooltip'; -import { getRefString, autocompleteSearch, buildAutocompleteFilter, defaultAutocompleteOnChange, multipleAutocompleteOnChange } from '../../utils/utils'; +import { getRefString, autocompleteSearch, buildAutocompleteFilter, defaultAutocompleteOnChange, multipleAutocompleteOnChange, getIdentifier } from '../../utils/utils'; import { useNewAnnotationReducer } from "./useNewAnnotationReducer"; import { NewAnnotationForm } from "./NewAnnotationForm"; import { internalTemplate, obsoleteTemplate } from '../../components/AuditedObjectComponent'; @@ -76,10 +76,10 @@ export const DiseaseAnnotationsTable = () => { const sortMapping = { 'object.name': ['object.curie', 'object.namespace'], - 'subject.symbol': ['subject.name', 'subject.curie'], - 'with.geneSymbol.displayText': ['with.geneFullName.displayText', 'with.curie'], - 'sgdStrainBackground.name': ['sgdStrainBackground.curie'], - 'diseaseGeneticModifier.symbol': ['diseaseGeneticModifier.name', 'diseaseGeneticModifier.curie'] + 'subject.symbol': ['subject.name', 'subject.modEntityId'], + 'with.geneSymbol.displayText': ['with.geneFullName.displayText', 'with.modEntityId'], + 'sgdStrainBackground.name': ['sgdStrainBackground.modEntityId'], + 'diseaseGeneticModifier.symbol': ['diseaseGeneticModifier.name', 'diseaseGeneticModifier.modEntityId'] }; @@ -167,11 +167,11 @@ export const DiseaseAnnotationsTable = () => { const withTemplate = (rowData) => { if (rowData && rowData.with) { - const sortedWithGenes = rowData.with.sort((a, b) => (a.geneSymbol.displayText > b.geneSymbol.displayText) ? 1 : (a.curie === b.curie) ? 1 : -1); + const sortedWithGenes = rowData.with.sort((a, b) => (a.geneSymbol.displayText > b.geneSymbol.displayText) ? 1 : (getIdentifier(a) === getIdentifier(b)) ? 1 : -1); const listTemplate = (item) => { return ( - {item.geneSymbol.displayText + ' (' + item.curie + ')'} + {item.geneSymbol.displayText + ' (' + getIdentifier(item) + ')'} ); }; @@ -181,21 +181,21 @@ export const DiseaseAnnotationsTable = () => { const assertedGenesBodyTemplate = (rowData) => { if (rowData && rowData.assertedGenes && rowData.assertedGenes.length > 0) { - const sortedAssertedGenes = rowData.assertedGenes.sort((a, b) => (a.geneSymbol?.displayText > b.geneSymbol?.displayText) ? 1 : (a.curie === b.curie) ? 1 : -1); + const sortedAssertedGenes = rowData.assertedGenes.sort((a, b) => (a.geneSymbol?.displayText > b.geneSymbol?.displayText) ? 1 : (getIdentifier(a) === getIdentifier(b)) ? 1 : -1); const listTemplate = (item) => { return ( - {item.geneSymbol?.displayText + ' (' + item.curie + ')'} + {item.geneSymbol?.displayText + ' (' + getIdentifier(item) + ')'} ); }; - + const identifier = getIdentifier(rowData.assertedGenes[0]); return ( <> -
+
- + @@ -250,16 +250,17 @@ export const DiseaseAnnotationsTable = () => { const inferredGeneBodyTemplate = (rowData) => { if (rowData && rowData.inferredGene) { + const identifier = getIdentifier(rowData.inferredGene); return ( <> -
- +
@@ -270,17 +271,18 @@ export const DiseaseAnnotationsTable = () => { const inferredAlleleBodyTemplate = (rowData) => { if (rowData && rowData.inferredAllele) { + const identifier = getIdentifier(rowData.inferredAllele); if (rowData.inferredAllele.alleleSymbol?.displayText) { return ( <> -
- +
@@ -289,14 +291,14 @@ export const DiseaseAnnotationsTable = () => { } else { return ( <> -
- +
@@ -308,17 +310,18 @@ export const DiseaseAnnotationsTable = () => { const assertedAlleleBodyTemplate = (rowData) => { if (rowData && rowData.assertedAllele) { + const identifier = getIdentifier(rowData.assertedAllele); if (rowData.assertedAllele.alleleSymbol) { return ( <> -
- +
@@ -327,14 +330,14 @@ export const DiseaseAnnotationsTable = () => { } else { return ( <> -
- +
@@ -705,7 +708,7 @@ export const DiseaseAnnotationsTable = () => { return ( <> { }; const getSubjectAutocompleteFields = (props) => { - let subjectFields = ["curie", "crossReferences.referencedCurie"]; + let subjectFields = ["curie", "modEntityId", "modInternalId", "crossReferences.referencedCurie"]; if (props.rowData.type === "AGMDiseaseAnnotation") { subjectFields.push("name"); } else if (props.rowData.type === "AlleleDiseaseAnnotation") { @@ -749,7 +752,7 @@ export const DiseaseAnnotationsTable = () => { }; const sgdStrainBackgroundSearch = (event, setFiltered, setQuery) => { - const autocompleteFields = ["name", "curie", "crossReferences.referencedCurie"]; + const autocompleteFields = ["name", "curie", "modEntityId", "modInternalId", "crossReferences.referencedCurie"]; const endpoint = "agm"; const filterName = "sgdStrainBackgroundFilter"; const filter = buildAutocompleteFilter(event, autocompleteFields); @@ -769,7 +772,7 @@ export const DiseaseAnnotationsTable = () => { <> { }; const geneticModifiersSearch = (event, setFiltered, setInputValue) => { - const autocompleteFields = ["geneSymbol.formatText", "geneSymbol.displayText", "geneFullName.formatText", "geneFullName.displayText", "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSecondaryIds.secondaryId", "alleleSymbol.formatText", "alleleFullName.formatText", "alleleFullName.displayText", "alleleSynonyms.formatText", "alleleSynonyms.displayText", "name", "curie", "crossReferences.referencedCurie", "alleleSecondaryIds.secondaryId"]; + const autocompleteFields = ["geneSymbol.formatText", "geneSymbol.displayText", "geneFullName.formatText", "geneFullName.displayText", "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSecondaryIds.secondaryId", "alleleSymbol.formatText", "alleleFullName.formatText", "alleleFullName.displayText", "alleleSynonyms.formatText", "alleleSynonyms.displayText", "name", "curie", "modEntityId", "modInternalId", "crossReferences.referencedCurie", "alleleSecondaryIds.secondaryId"]; const endpoint = "biologicalentity"; const filterName = "geneticModifiersFilter"; const filter = buildAutocompleteFilter(event, autocompleteFields); @@ -831,7 +834,7 @@ export const DiseaseAnnotationsTable = () => { }; const assertedAlleleSearch = (event, setFiltered, setQuery) => { - const autocompleteFields = ["alleleSymbol.formatText", "alleleSymbol.displayText", "alleleFullName.formatText", "alleleFullName.displayText", "curie", "crossReferences.referencedCurie", "alleleSecondaryIds.secondaryId", "alleleSynonyms.formatText", "alleleSynonyms.displayText"]; + const autocompleteFields = ["alleleSymbol.formatText", "alleleSymbol.displayText", "alleleFullName.formatText", "alleleFullName.displayText", "curie", "modEntityId", "modInternalId", "crossReferences.referencedCurie", "alleleSecondaryIds.secondaryId", "alleleSynonyms.formatText", "alleleSynonyms.displayText"]; const endpoint = "allele"; const filterName = "assertedAlleleFilter"; const filter = buildAutocompleteFilter(event, autocompleteFields); @@ -845,7 +848,7 @@ export const DiseaseAnnotationsTable = () => { <> @@ -910,7 +913,7 @@ export const DiseaseAnnotationsTable = () => { }; const assertedGenesSearch = (event, setFiltered, setInputValue) => { - const autocompleteFields = ["geneSymbol.formatText", "geneSymbol.displayText", "geneFullName.formatText", "geneFullName.displayText", "curie", "crossReferences.referencedCurie", "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSystematicName.formatText", "geneSystematicName.displayText"]; + const autocompleteFields = ["geneSymbol.formatText", "geneSymbol.displayText", "geneFullName.formatText", "geneFullName.displayText", "curie", "modEntityId", "modInternalId", "crossReferences.referencedCurie", "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSystematicName.formatText", "geneSystematicName.displayText"]; const endpoint = "gene"; const filterName = "assertedGenesFilter"; const filter = buildAutocompleteFilter(event, autocompleteFields); @@ -948,7 +951,7 @@ export const DiseaseAnnotationsTable = () => { }; const withSearch = (event, setFiltered, setInputValue) => { - const autocompleteFields = ["geneSymbol.formatText", "geneSymbol.displayText", "geneFullName.formatText", "geneFullName.displayText", "curie", "crossReferences.referencedCurie", "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSecondaryIds.secondaryId"]; + const autocompleteFields = ["geneSymbol.formatText", "geneSymbol.displayText", "geneFullName.formatText", "geneFullName.displayText", "modEntityId", "modInternalId", "curie", "crossReferences.referencedCurie", "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSecondaryIds.secondaryId"]; const endpoint = "gene"; const filterName = "withFilter"; const filter = buildAutocompleteFilter(event, autocompleteFields); @@ -1031,17 +1034,18 @@ export const DiseaseAnnotationsTable = () => { const subjectBodyTemplate = (rowData) => { if (rowData.subject) { + const identifier = getIdentifier(rowData.subject); if (rowData.subject.geneSymbol) { return ( <> -
- +
@@ -1050,14 +1054,14 @@ export const DiseaseAnnotationsTable = () => { } else if (rowData.subject.alleleSymbol) { return ( <> -
- +
@@ -1066,14 +1070,14 @@ export const DiseaseAnnotationsTable = () => { } else if (rowData.subject.geneFullName) { return ( <> -
- +
@@ -1082,14 +1086,14 @@ export const DiseaseAnnotationsTable = () => { } else if (rowData.subject.alleleFullName) { return ( <> -
- +
@@ -1098,35 +1102,36 @@ export const DiseaseAnnotationsTable = () => { } else if (rowData.subject.name) { return ( <> -
- +
) } else { - return
{rowData.subject.curie}
; + return
{identifier}
; } } }; const sgdStrainBackgroundBodyTemplate = (rowData) => { if (rowData.sgdStrainBackground) { + const identifier = getIdentifier(rowData.sgdStrainBackground); if (rowData.sgdStrainBackground.name) { return
; } else { - return
{rowData.sgdStrainBackground.curie}
; + return
{identifier}
; } } }; @@ -1135,13 +1140,14 @@ export const DiseaseAnnotationsTable = () => { if (rowData?.diseaseGeneticModifiers && rowData.diseaseGeneticModifiers.length > 0) { const diseaseGeneticModifierStrings = []; rowData.diseaseGeneticModifiers.forEach((dgm) => { + const identifier = getIdentifier(dgm); if (dgm.geneSymbol || dgm.alleleSymbol) { let symbolValue = dgm.geneSymbol ? dgm.geneSymbol.displayText : dgm.alleleSymbol.displayText; - diseaseGeneticModifierStrings.push(symbolValue + ' (' + dgm.curie + ')'); + diseaseGeneticModifierStrings.push(symbolValue + ' (' + identifier + ')'); } else if (dgm.name) { - diseaseGeneticModifierStrings.push(dgm.name + ' (' + dgm.curie + ')'); + diseaseGeneticModifierStrings.push(dgm.name + ' (' + identifier + ')'); } else { - diseaseGeneticModifierStrings.push(dgm.curie); + diseaseGeneticModifierStrings.push(identifier); } }); const sortedDiseaseGeneticModifierStrings = diseaseGeneticModifierStrings.sort(); @@ -1154,10 +1160,10 @@ export const DiseaseAnnotationsTable = () => { }; return ( <> -
+
- + diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js index 7a58d1d7b..933c54aa0 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js @@ -193,7 +193,7 @@ export const NewAnnotationForm = ({ } const sgdStrainBackgroundSearch = (event, setFiltered, setQuery) => { - const autocompleteFields = ["name", "curie", "crossReferences.referencedCurie"]; + const autocompleteFields = ["name", "curie", "modEntityId", "modInternalId", "crossReferences.referencedCurie"]; const endpoint = "agm"; const filterName = "sgdStrainBackgroundFilter"; const filter = buildAutocompleteFilter(event, autocompleteFields); @@ -209,7 +209,7 @@ export const NewAnnotationForm = ({ } const geneticModifiersSearch = (event, setFiltered, setQuery) => { - const autocompleteFields = ["geneSymbol.displayText", "geneFullName.displayText", "alleleSymbol.displayText", "alleleFullName.displayText", "name", "curie", "crossReferences.referencedCurie", "alleleSecondaryIds.secondaryId", "geneSynonyms.displayText", "alleleSynonyms.displayText"]; + const autocompleteFields = ["geneSymbol.displayText", "geneFullName.displayText", "alleleSymbol.displayText", "alleleFullName.displayText", "modEntityId", "modInternalId", "name", "curie", "crossReferences.referencedCurie", "alleleSecondaryIds.secondaryId", "geneSynonyms.displayText", "alleleSynonyms.displayText"]; const endpoint = "biologicalentity"; const filterName = "geneticModifiersFilter"; const filter = buildAutocompleteFilter(event, autocompleteFields); @@ -251,6 +251,8 @@ export const NewAnnotationForm = ({ "alleleFullName.displayText", "alleleSynonyms.displayText", "geneSynonyms.displayText", + "modEntityId", + "modInternalId", "curie", "crossReferences.referencedCurie", "alleleSecondaryIds.secondaryId", @@ -347,7 +349,7 @@ export const NewAnnotationForm = ({ } const withSearch = (event, setFiltered, setInputValue) => { - const autocompleteFields = ["geneSymbol.displayText", "geneFullName.displayText", "curie", "crossReferences.referencedCurie", "geneSynonyms.displayText"]; + const autocompleteFields = ["geneSymbol.displayText", "geneFullName.displayText", "modEntityId", "modInternalId", "curie", "crossReferences.referencedCurie", "geneSynonyms.displayText"]; const endpoint = "gene"; const filterName = "withFilter"; const filter = buildAutocompleteFilter(event, autocompleteFields); @@ -381,7 +383,7 @@ export const NewAnnotationForm = ({ ); const assertedGenesSearch = (event, setFiltered, setInputValue) => { - const autocompleteFields = ["geneSymbol.displayText", "geneFullName.displayText", "curie", "crossReferences.referencedCurie", "geneSynonyms.displayText"]; + const autocompleteFields = ["geneSymbol.displayText", "geneFullName.displayText", "modEntityId", "modInternalId", "curie", "crossReferences.referencedCurie", "geneSynonyms.displayText"]; const endpoint = "gene"; const filterName = "assertedGenesFilter"; const filter = buildAutocompleteFilter(event, autocompleteFields); @@ -390,7 +392,7 @@ export const NewAnnotationForm = ({ } const assertedAlleleSearch = (event, setFiltered, setInputValue) => { - const autocompleteFields = ["alleleSymbol.displayText", "alleleFullName.displayText", "curie", "crossReferences.referencedCurie", "alleleSecondaryIds.secondaryId", "alleleSynonyms.displayText"]; + const autocompleteFields = ["alleleSymbol.displayText", "alleleFullName.displayText", "modEntityId", "modInternalId", "curie", "crossReferences.referencedCurie", "alleleSecondaryIds.secondaryId", "alleleSynonyms.displayText"]; const endpoint = "allele"; const filterName = "assertedAlleleFilter"; const filter = buildAutocompleteFilter(event, autocompleteFields); diff --git a/src/main/cliapp/src/containers/genesPage/GenesTable.js b/src/main/cliapp/src/containers/genesPage/GenesTable.js index ec7d79b65..2f71a5894 100644 --- a/src/main/cliapp/src/containers/genesPage/GenesTable.js +++ b/src/main/cliapp/src/containers/genesPage/GenesTable.js @@ -47,10 +47,10 @@ export const GenesTable = () => { return ( <> @@ -110,10 +110,10 @@ export const GenesTable = () => { <> @@ -166,10 +166,10 @@ export const GenesTable = () => { return ( <> @@ -191,10 +191,10 @@ export const GenesTable = () => { if (rowData.taxon) { return ( <> - + {rowData.taxon.name} ({rowData.taxon.curie}) - + ); } @@ -208,6 +208,18 @@ export const GenesTable = () => { filter: true, filterConfig: FILTER_CONFIGS.curieFilterConfig }, + { + field: "modEntityId", + header: "MOD Entity ID", + sortable: true, + filterConfig: FILTER_CONFIGS.modentityidFilterConfig, + }, + { + field: "modInternalId", + header: "MOD Internal ID", + sortable: true, + filterConfig: FILTER_CONFIGS.modinternalidFilterConfig, + }, { field: "geneFullName.displayText", header: "Name", @@ -325,7 +337,6 @@ export const GenesTable = () => { ", () => { it("The table contains correct data", async () => { let result = await renderWithClient(); - const curieTd = await result.findByText(/WB:WBGene00003771/i); + const modEntityIdTd = await result.findByText(/WB:WBGene00003771/i); const nameTd = await result.findByText(/LEVamisole resistant 8/i); const symbolTd = await result.findByText(/lev-8/i); const synonymsTd = await result.findByText(/acr-13/i); @@ -43,7 +43,7 @@ describe("", () => { await waitFor(() => { - expect(curieTd).toBeInTheDocument(); + expect(modEntityIdTd).toBeInTheDocument(); expect(nameTd).toBeInTheDocument(); expect(symbolTd).toBeInTheDocument(); expect(synonymsTd).toBeInTheDocument(); diff --git a/src/main/cliapp/src/containers/genesPage/mockData/mockData.js b/src/main/cliapp/src/containers/genesPage/mockData/mockData.js index f49196f6a..37238a92c 100644 --- a/src/main/cliapp/src/containers/genesPage/mockData/mockData.js +++ b/src/main/cliapp/src/containers/genesPage/mockData/mockData.js @@ -21,7 +21,7 @@ export const data = { "internal": false, "obsolete": false, "dbDateUpdated": "2023-05-16T12:31:21.941713Z", - "curie": "WB:WBGene00003771", + "modEntityId": "WB:WBGene00003771", "taxon": { "internal": false, "obsolete": false, diff --git a/src/main/cliapp/src/utils/utils.js b/src/main/cliapp/src/utils/utils.js index 0ac49e5f2..6c86cce74 100644 --- a/src/main/cliapp/src/utils/utils.js +++ b/src/main/cliapp/src/utils/utils.js @@ -108,6 +108,19 @@ export function getEntityType(entity) { return 'Unknown Entity' } +export function getIdentifier(data) { + if (data.modEntityId) { + return data.modEntityId; + } + if (data.modInternalId) { + return data.modInternalId; + } + if (data.curie) { + return data.curie; + } + return ""; +} + export function getRefStrings(referenceItems) { if (!referenceItems) return; diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java index 616da075e..8a8682d03 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java @@ -97,7 +97,8 @@ public void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataPro history.incrementFailed(); addException(history, e.getData()); } catch (Exception e) { - Log.info("EXCEPTION 2: " + e.getLocalizedMessage()); + Log.info("EXCEPTION 2: "); + e.printStackTrace(); history.incrementFailed(); addException(history, new ObjectUpdateExceptionData(annotationDTO, e.getMessage(), e.getStackTrace())); } From ceb6b1248fdb0592e2dfb6ce401e67302d12a356 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Wed, 3 Jan 2024 13:30:43 +0000 Subject: [PATCH 020/159] More UI updates --- .../containers/constructsPage/GenomicComponentsDialog.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/cliapp/src/containers/constructsPage/GenomicComponentsDialog.js b/src/main/cliapp/src/containers/constructsPage/GenomicComponentsDialog.js index 33527d5bb..c17829e61 100644 --- a/src/main/cliapp/src/containers/constructsPage/GenomicComponentsDialog.js +++ b/src/main/cliapp/src/containers/constructsPage/GenomicComponentsDialog.js @@ -9,6 +9,7 @@ import { EllipsisTableCell } from '../../components/EllipsisTableCell'; import { evidenceTemplate } from '../../components/EvidenceComponent'; import { Button } from 'primereact/button'; import { RelatedNotesDialog } from '../../components/RelatedNotesDialog'; +import { getIdentifier } from '../../utils/utils'; export const GenomicComponentsDialog = ({ originalComponentsData, @@ -92,11 +93,11 @@ export const GenomicComponentsDialog = ({ let componentDisplayValue = ""; if (rowData.object.geneSymbol || rowData.object.alleleSymbol) { let symbolValue = rowData.object.geneSymbol ? rowData.object.geneSymbol.displayText : rowData.object.alleleSymbol.displayText; - componentDisplayValue = symbolValue + ' (' + rowData.object.curie + ')'; + componentDisplayValue = symbolValue + ' (' + getIdentifier(rowData.object) + ')'; } else if (rowData.object.name) { - componentDisplayValue = rowData.object.name + ' (' + rowData.object.curie + ')'; + componentDisplayValue = rowData.object.name + ' (' + getIdentifier(rowData.object) + ')'; } else { - componentDisplayValue = rowData.object.curie; + componentDisplayValue = getIdentifier(rowData.object); } return ( <> @@ -131,7 +132,7 @@ export const GenomicComponentsDialog = ({ - + evidenceTemplate(rowData)}/> From 4e5fa76a46168da7ef7ce604a2a538df3870ca3a Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 4 Jan 2024 01:21:08 +0000 Subject: [PATCH 021/159] Remove non-updated rows from audit tables to avoid PK duplicates in root audit table --- .../v0.30.0.1__linkml_v2.0.0_update.sql | 66 ++++++++++++++++++- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index a711b56d0..fbbce1383 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -531,8 +531,8 @@ CREATE TABLE submittedobject_aud ( rev integer NOT NULL, PRIMARY KEY (id, rev) ); - -CREATE SEQUENCE auditedobject_seq START WITH 200250000 INCREMENT BY 50 NO MINVALUE NO MAXVALUE CACHE 1; + +CREATE SEQUENCE auditedobject_seq START WITH 200250000 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; DROP SEQUENCE association_seq; DROP SEQUENCE bulkload_seq; @@ -1588,6 +1588,7 @@ UPDATE affectedgenomicmodel_aud t SET id = a.id FROM auditedobject a WHERE t.cur DELETE FROM affectedgenomicmodel_aud WHERE id IS NULL; UPDATE affectedgenomicmodel_aud t SET subtype_id = a.id FROM auditedobject a WHERE t.subtype_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE agmdiseaseannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +DELETE FROM agmdiseaseannotation_aud WHERE id < 200250000; UPDATE agmdiseaseannotation_aud t SET inferredallele_id = a.id FROM auditedobject a WHERE t.inferredallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE agmdiseaseannotation_aud t SET assertedallele_id = a.id FROM auditedobject a WHERE t.assertedallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE agmdiseaseannotation_aud t SET inferredgene_id = a.id FROM auditedobject a WHERE t.inferredgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; @@ -1604,51 +1605,66 @@ UPDATE allele_reference_aud t SET allele_id = a.id FROM auditedobject a WHERE t. DELETE FROM allele_reference_aud WHERE allele_id IS NULL; UPDATE allele_reference_aud t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; UPDATE alleledatabasestatusslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM alleledatabasestatusslotannotation_aud WHERE id < 200250000; UPDATE alleledatabasestatusslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE alleledatabasestatusslotannotation_aud t SET databasestatus_id = a.id FROM auditedobject a WHERE t.databasestatus_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE allelediseaseannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +DELETE FROM allelediseaseannotation_aud WHERE id < 200250000; UPDATE allelediseaseannotation_aud t SET inferredgene_id = a.id FROM auditedobject a WHERE t.inferredgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE allelediseaseannotation_aud t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE allelediseaseannotation_gene_aud t SET allelediseaseannotation_id = a.id FROM auditedobject a WHERE t.allelediseaseannotation_id = a.old_id AND a.tablename = 'association'; UPDATE allelediseaseannotation_gene_aud t SET assertedgenes_id = a.id FROM auditedobject a WHERE t.assertedgenes_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE allelefullnameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM allelefullnameslotannotation_aud WHERE id < 200250000; UPDATE allelefullnameslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE allelefunctionalimpactslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM allelefunctionalimpactslotannotation_aud WHERE id < 200250000; UPDATE allelefunctionalimpactslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE allelefunctionalimpactslotannotation_aud t SET phenotypeterm_id = a.id FROM auditedobject a WHERE t.phenotypeterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE allelefunctionalimpactslotannotation_vocabularyterm_aud t SET allelefunctionalimpactslotannotation_id = a.id FROM auditedobject a WHERE t.allelefunctionalimpactslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; UPDATE allelefunctionalimpactslotannotation_vocabularyterm_aud t SET functionalimpacts_id = a.id FROM auditedobject a WHERE t.functionalimpacts_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE allelegeneassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +DELETE FROM allelegeneassociation_aud WHERE id < 200250000; UPDATE allelegeneassociation_aud t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE allelegeneassociation_aud t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE allelegenomicentityassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +DELETE FROM allelegenomicentityassociation_aud WHERE id < 200250000; UPDATE allelegenomicentityassociation_aud t SET evidencecode_id = a.id FROM auditedobject a WHERE t.evidencecode_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE allelegenomicentityassociation_aud t SET relatednote_id = a.id FROM auditedobject a WHERE t.relatednote_id = a.old_id AND a.tablename = 'note'; UPDATE allelegenomicentityassociation_aud t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE allelegermlinetransmissionstatusslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM allelegermlinetransmissionstatusslotannotation_aud WHERE id < 200250000; UPDATE allelegermlinetransmissionstatusslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE allelegermlinetransmissionstatusslotannotation_aud t SET germlinetransmissionstatus_id = a.id FROM auditedobject a WHERE t.germlinetransmissionstatus_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE alleleinheritancemodeslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM alleleinheritancemodeslotannotation_aud WHERE id < 200250000; UPDATE alleleinheritancemodeslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE alleleinheritancemodeslotannotation_aud t SET inheritancemode_id = a.id FROM auditedobject a WHERE t.inheritancemode_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE alleleinheritancemodeslotannotation_aud t SET phenotypeterm_id = a.id FROM auditedobject a WHERE t.phenotypeterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE allelemutationtypeslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM allelemutationtypeslotannotation_aud WHERE id < 200250000; UPDATE allelemutationtypeslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE allelemutationtypeslotannotation_soterm_aud t SET allelemutationtypeslotannotation_id = a.id FROM auditedobject a WHERE t.allelemutationtypeslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; UPDATE allelemutationtypeslotannotation_soterm_aud t SET mutationtypes_id = a.id FROM auditedobject a WHERE t.mutationtypes_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE allelenomenclatureeventslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM allelenomenclatureeventslotannotation_aud WHERE id < 200250000; UPDATE allelenomenclatureeventslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE allelenomenclatureeventslotannotation_aud t SET nomenclatureevent_id = a.id FROM auditedobject a WHERE t.nomenclatureevent_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE allelesecondaryidslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM allelesecondaryidslotannotation_aud WHERE id < 200250000; UPDATE allelesecondaryidslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE allelesymbolslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM allelesymbolslotannotation_aud WHERE id < 200250000; UPDATE allelesymbolslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE allelesynonymslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM allelesynonymslotannotation_aud WHERE id < 200250000; UPDATE allelesynonymslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE alliancemember_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'organization'; +DELETE FROM alliancemember_aud WHERE id < 200250000; UPDATE anatomicalterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM anatomicalterm_aud WHERE id IS NULL; UPDATE annotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +DELETE FROM annotation_aud WHERE id < 200250000; UPDATE annotation_aud t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; UPDATE annotation_conditionrelation_aud t SET annotation_id = a.id FROM auditedobject a WHERE t.annotation_id = a.old_id AND a.tablename = 'association'; UPDATE annotation_conditionrelation_aud t SET conditionrelations_id = a.id FROM auditedobject a WHERE t.conditionrelations_id = a.old_id AND a.tablename = 'conditionrelation'; @@ -1657,6 +1673,7 @@ UPDATE annotation_note_aud t SET relatednotes_id = a.id FROM auditedobject a WHE UPDATE apoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM apoterm_aud WHERE id IS NULL; UPDATE association_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +DELETE FROM association_aud WHERE id < 200250000; UPDATE atpterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM atpterm_aud WHERE id IS NULL; UPDATE biologicalentity_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; @@ -1666,18 +1683,27 @@ UPDATE biologicalentity_aud t SET dataprovider_id = a.id FROM auditedobject a WH UPDATE bspoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM bspoterm_aud WHERE id IS NULL; UPDATE bulkfmsload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +DELETE FROM bulkfmsload_aud WHERE id < 200250000; UPDATE bulkload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +DELETE FROM bulkload_aud WHERE id < 200250000; UPDATE bulkload_aud t SET group_id = a.id FROM auditedobject a WHERE t.group_id = a.old_id AND a.tablename = 'bulkloadgroup'; UPDATE bulkloadfile_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfile'; +DELETE FROM bulkloadfile_aud WHERE id < 200250000; UPDATE bulkloadfile_aud t SET bulkload_id = a.id FROM auditedobject a WHERE t.bulkload_id = a.old_id AND a.tablename = 'bulkload'; UPDATE bulkloadfileexception_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfileexception'; +DELETE FROM bulkloadfileexception_aud WHERE id < 200250000; UPDATE bulkloadfileexception_aud t SET bulkloadfilehistory_id = a.id FROM auditedobject a WHERE t.bulkloadfilehistory_id = a.old_id AND a.tablename = 'bulkloadfilehistory'; UPDATE bulkloadfilehistory_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfilehistory'; +DELETE FROM bulkloadfilehistory_aud WHERE id < 200250000; UPDATE bulkloadfilehistory_aud t SET bulkloadfile_id = a.id FROM auditedobject a WHERE t.bulkloadfile_id = a.old_id AND a.tablename = 'bulkloadfile'; UPDATE bulkloadgroup_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadgroup'; +DELETE FROM bulkloadgroup_aud WHERE id < 200250000; UPDATE bulkmanualload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +DELETE FROM bulkmanualload_aud WHERE id < 200250000; UPDATE bulkscheduledload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +DELETE FROM bulkscheduledload_aud WHERE id < 200250000; UPDATE bulkurlload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; +DELETE FROM bulkurlload_aud WHERE id < 200250000; UPDATE chebiterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM chebiterm_aud WHERE id IS NULL; UPDATE chemicalterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; @@ -1687,39 +1713,49 @@ DELETE FROM clterm_aud WHERE id IS NULL; UPDATE cmoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM cmoterm_aud WHERE id IS NULL; UPDATE conditionrelation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'conditionrelation'; +DELETE FROM conditionrelation_aud WHERE id < 200250000; UPDATE conditionrelation_aud t SET conditionrelationtype_id = a.id FROM auditedobject a WHERE t.conditionrelationtype_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE conditionrelation_aud t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; UPDATE conditionrelation_experimentalcondition_aud t SET conditionrelation_id = a.id FROM auditedobject a WHERE t.conditionrelation_id = a.old_id AND a.tablename = 'conditionrelation'; UPDATE conditionrelation_experimentalcondition_aud t SET conditions_id = a.id FROM auditedobject a WHERE t.conditions_id = a.old_id AND a.tablename = 'experimentalcondition'; UPDATE construct_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'reagent'; +DELETE FROM construct_aud WHERE id < 200250000; UPDATE construct_reference_aud t SET construct_id = a.id FROM auditedobject a WHERE t.construct_id = a.old_id AND a.tablename = 'reagent'; UPDATE construct_reference_aud t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; UPDATE constructcomponentslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM constructcomponentslotannotation_aud WHERE id < 200250000; UPDATE constructcomponentslotannotation_aud t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; UPDATE constructcomponentslotannotation_aud t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE constructcomponentslotannotation_aud t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE constructcomponentslotannotation_note_aud t SET constructcomponentslotannotation_id = a.id FROM auditedobject a WHERE t.constructcomponentslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; UPDATE constructcomponentslotannotation_note_aud t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; UPDATE constructfullnameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM constructfullnameslotannotation_aud WHERE id < 200250000; UPDATE constructfullnameslotannotation_aud t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; UPDATE constructgenomicentityassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +DELETE FROM constructgenomicentityassociation_aud WHERE id < 200250000; UPDATE constructgenomicentityassociation_aud t SET subject_id = a.id FROM auditedobject a WHERE t.subject_id = a.old_id AND a.tablename = 'reagent'; UPDATE constructgenomicentityassociation_aud t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE constructgenomicentityassociation_aud t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE constructgenomicentityassociation_note_aud t SET constructgenomicentityassociation_id = a.id FROM auditedobject a WHERE t.constructgenomicentityassociation_id = a.old_id AND a.tablename = 'association'; UPDATE constructgenomicentityassociation_note_aud t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; UPDATE constructsymbolslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM constructsymbolslotannotation_aud WHERE id < 200250000; UPDATE constructsymbolslotannotation_aud t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; UPDATE constructsynonymslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM constructsynonymslotannotation_aud WHERE id < 200250000; UPDATE constructsynonymslotannotation_aud t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; UPDATE crossreference_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'crossreference'; +DELETE FROM crossreference_aud WHERE id < 200250000; UPDATE crossreference_aud t SET resourcedescriptorpage_id = a.id FROM auditedobject a WHERE t.resourcedescriptorpage_id = a.old_id AND a.tablename = 'resourcedescriptorpage'; UPDATE daoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM daoterm_aud WHERE id IS NULL; UPDATE dataprovider_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'dataprovider'; +DELETE FROM dataprovider_aud WHERE id < 200250000; UPDATE dataprovider_aud t SET sourceorganization_id = a.id FROM auditedobject a WHERE t.sourceorganization_id = a.old_id AND a.tablename = 'organization'; UPDATE dataprovider_aud t SET crossreference_id = a.id FROM auditedobject a WHERE t.crossreference_id = a.old_id AND a.tablename = 'crossreference'; UPDATE diseaseannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +DELETE FROM diseaseannotation_aud WHERE id < 200250000; UPDATE diseaseannotation_aud t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE diseaseannotation_aud t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE diseaseannotation_aud t SET diseasegeneticmodifierrelation_id = a.id FROM auditedobject a WHERE t.diseasegeneticmodifierrelation_id = a.old_id AND a.tablename = 'vocabularyterm'; @@ -1743,9 +1779,11 @@ DELETE FROM ecoterm_aud WHERE id IS NULL; UPDATE emapaterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM emapaterm_aud WHERE id IS NULL; UPDATE evidenceassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +DELETE FROM evidenceassociation_aud WHERE id < 200250000; UPDATE evidenceassociation_informationcontententity_aud t SET evidenceassociation_id = a.id FROM auditedobject a WHERE t.evidenceassociation_id = a.old_id AND a.tablename = 'association'; UPDATE evidenceassociation_informationcontententity_aud t SET evidence_id = a.id FROM auditedobject a WHERE t.evidence_curie = a.old_curie AND a.tablename = 'informationcontententity'; UPDATE experimentalcondition_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'experimentalcondition'; +DELETE FROM experimentalcondition_aud WHERE id < 200250000; UPDATE experimentalcondition_aud t SET conditionanatomy_id = a.id FROM auditedobject a WHERE t.conditionanatomy_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE experimentalcondition_aud t SET conditionchemical_id = a.id FROM auditedobject a WHERE t.conditionchemical_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE experimentalcondition_aud t SET conditionclass_id = a.id FROM auditedobject a WHERE t.conditionclass_curie = a.old_curie AND a.tablename = 'ontologyterm'; @@ -1753,31 +1791,40 @@ UPDATE experimentalcondition_aud t SET conditiongeneontology_id = a.id FROM audi UPDATE experimentalcondition_aud t SET conditionid_id = a.id FROM auditedobject a WHERE t.conditionid_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE experimentalcondition_aud t SET conditiontaxon_id = a.id FROM auditedobject a WHERE t.conditiontaxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE experimentalconditionontologyterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; +DELETE FROM experimentalconditionontologyterm_aud WHERE id IS NULL; UPDATE fbdvterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM fbdvterm_aud WHERE id IS NULL; UPDATE gene_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; DELETE FROM gene_aud WHERE id IS NULL; UPDATE gene_aud t SET genetype_id = a.id FROM auditedobject a WHERE t.genetype_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE genediseaseannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +DELETE FROM genediseaseannotation_aud WHERE id < 200250000; UPDATE genediseaseannotation_aud t SET sgdstrainbackground_id = a.id FROM auditedobject a WHERE t.sgdstrainbackground_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE genediseaseannotation_aud t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE genefullnameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM genefullnameslotannotation_aud WHERE id < 200250000; UPDATE genefullnameslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE genesecondaryidslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM genesecondaryidslotannotation_aud WHERE id < 200250000; UPDATE genesecondaryidslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE genesymbolslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM genesymbolslotannotation_aud WHERE id < 200250000; UPDATE genesymbolslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE genesynonymslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; UPDATE genesynonymslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE genesystematicnameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM genesystematicnameslotannotation_aud WHERE id < 200250000; UPDATE genesystematicnameslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE genetogeneorthology_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; +DELETE FROM genetogeneorthology_aud WHERE id < 200250000; UPDATE genetogeneorthology_aud t SET subjectgene_id = a.id FROM auditedobject a WHERE t.subjectgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE genetogeneorthology_aud t SET objectgene_id = a.id FROM auditedobject a WHERE t.objectgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; UPDATE genetogeneorthologycurated_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; +DELETE FROM genetogeneorthologycurated_aud WHERE id < 200250000; UPDATE genetogeneorthologycurated_aud t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; UPDATE genetogeneorthologycurated_aud t SET evidencecode_id = a.id FROM auditedobject a WHERE t.evidencecode_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE genetogeneorthologygenerated_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; +DELETE FROM genetogeneorthologygenerated_aud WHERE id < 200250000; UPDATE genetogeneorthologygenerated_aud t SET isbestscore_id = a.id FROM auditedobject a WHERE t.isbestscore_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE genetogeneorthologygenerated_aud t SET isbestscorereverse_id = a.id FROM auditedobject a WHERE t.isbestscorereverse_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE genetogeneorthologygenerated_aud t SET confidence_id = a.id FROM auditedobject a WHERE t.confidence_id = a.old_id AND a.tablename = 'vocabularyterm'; @@ -1815,11 +1862,13 @@ DELETE FROM mpathterm_aud WHERE id IS NULL; UPDATE mpterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM mpterm_aud WHERE id IS NULL; UPDATE nameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM nameslotannotation_aud WHERE id < 200250000; UPDATE nameslotannotation_aud t SET nametype_id = a.id FROM auditedobject a WHERE t.nametype_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE nameslotannotation_aud t SET synonymscope_id = a.id FROM auditedobject a WHERE t.synonymscope_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE ncbitaxonterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM ncbitaxonterm_aud WHERE id IS NULL; UPDATE note_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'note'; +DELETE FROM note_aud WHERE id < 200250000; UPDATE note_aud t SET notetype_id = a.id FROM auditedobject a WHERE t.notetype_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE note_reference_aud t SET note_id = a.id FROM auditedobject a WHERE t.note_id = a.old_id AND a.tablename = 'note'; UPDATE note_reference_aud t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; @@ -1846,18 +1895,22 @@ UPDATE ontologyterm_synonym_aud t SET ontologyterm_id = a.id FROM auditedobject DELETE FROM ontologyterm_synonym_aud WHERE ontologyterm_id IS NULL; UPDATE ontologyterm_synonym_aud t SET synonyms_id = a.id FROM auditedobject a WHERE t.synonyms_id = a.old_id AND a.tablename = 'synonym'; UPDATE organization_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'organization'; +DELETE FROM organization_aud WHERE id < 200250000; UPDATE organization_aud t SET homepageresourcedescriptorpage_id = a.id FROM auditedobject a WHERE t.homepageresourcedescriptorpage_id = a.old_id AND a.tablename = 'resourcedescriptorpage'; UPDATE patoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM patoterm_aud WHERE id IS NULL; UPDATE person_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'person'; +DELETE FROM person_aud WHERE id < 200250000; UPDATE person_aud t SET alliancemember_id = a.id FROM auditedobject a WHERE t.alliancemember_id = a.old_id AND a.tablename = 'organization'; UPDATE person_emails_aud t SET person_id = a.id FROM auditedobject a WHERE t.person_id = a.old_id AND a.tablename = 'person'; UPDATE person_oldemails_aud t SET person_id = a.id FROM auditedobject a WHERE t.person_id = a.old_id AND a.tablename = 'person'; UPDATE personsetting_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'personsetting'; +DELETE FROM personsetting_aud WHERE id < 200250000; UPDATE phenotypeterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE pwterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM pwterm_aud WHERE id IS NULL; UPDATE reagent_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'reagent'; +DELETE FROM reagent_aud WHERE id < 200250000; UPDATE reagent_aud t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; UPDATE reagent_secondaryidentifiers_aud t SET reagent_id = a.id FROM auditedobject a WHERE t.reagent_id = a.old_id AND a.tablename = 'reagent'; UPDATE reference_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'informationcontententity'; @@ -1866,6 +1919,7 @@ UPDATE reference_crossreference_aud t SET reference_id = a.id FROM auditedobject DELETE FROM reference_crossreference_aud WHERE reference_id IS NULL; UPDATE reference_crossreference_aud t SET crossreferences_id = a.id FROM auditedobject a WHERE t.crossreferences_id = a.old_id AND a.tablename = 'crossreference'; UPDATE resourcedescriptor_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'resourcedescriptor'; +DELETE FROM resourcedescriptor_aud WHERE id < 200250000; UPDATE resourcedescriptor_synonyms_aud t SET resourcedescriptor_id = a.id FROM auditedobject a WHERE t.resourcedescriptor_id = a.old_id AND a.tablename = 'resourcedescriptor'; UPDATE resourcedescriptorpage_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'resourcedescriptorpage'; UPDATE resourcedescriptorpage_aud t SET resourcedescriptor_id = a.id FROM auditedobject a WHERE t.resourcedescriptor_id = a.old_id AND a.tablename = 'resourcedescriptor'; @@ -1874,19 +1928,24 @@ DELETE FROM roterm_aud WHERE id IS NULL; UPDATE rsterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM rsterm_aud WHERE id IS NULL; UPDATE secondaryidslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM secondaryidslotannotation_aud WHERE id < 200250000; UPDATE singlereferenceassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; +DELETE FROM singlereferenceassociation_aud WHERE id < 200250000; UPDATE singlereferenceassociation_aud t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; UPDATE slotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; +DELETE FROM slotannotation_aud WHERE id < 200250000; UPDATE slotannotation_informationcontententity_aud t SET slotannotation_id = a.id FROM auditedobject a WHERE t.slotannotation_id = a.old_id AND a.tablename = 'slotannotation'; UPDATE slotannotation_informationcontententity_aud t SET evidence_id = a.id FROM auditedobject a WHERE t.evidence_curie = a.old_curie AND a.tablename = 'informationcontententity'; UPDATE soterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM soterm_aud WHERE id IS NULL; UPDATE species_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'species'; +DELETE FROM species_aud WHERE id < 200250000; UPDATE species_aud t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE species_commonnames_aud t SET species_id = a.id FROM auditedobject a WHERE t.species_id = a.old_id AND a.tablename = 'species'; UPDATE stageterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM stageterm_aud WHERE id IS NULL; UPDATE synonym_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'synonym'; +DELETE FROM synonym_aud WHERE id < 200250000; UPDATE uberonterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; DELETE FROM uberonterm_aud WHERE id IS NULL; UPDATE variant_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; @@ -1898,10 +1957,13 @@ UPDATE variant_note_aud t SET variant_id = a.id FROM auditedobject a WHERE t.var DELETE FROM variant_note_aud WHERE variant_id IS NULL; UPDATE variant_note_aud t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; UPDATE vocabulary_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabulary'; +DELETE FROM vocabulary_aud WHERE id < 200250000; UPDATE vocabularyterm_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabularyterm'; +DELETE FROM vocabularyterm_aud WHERE id < 200250000; UPDATE vocabularyterm_aud t SET vocabulary_id = a.id FROM auditedobject a WHERE t.vocabulary_id = a.old_id AND a.tablename = 'vocabulary'; UPDATE vocabularyterm_synonyms_aud t SET vocabularyterm_id = a.id FROM auditedobject a WHERE t.vocabularyterm_id = a.old_id AND a.tablename = 'vocabularyterm'; UPDATE vocabularytermset_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabularytermset'; +DELETE FROM vocabularytermset_aud WHERE id < 200250000; UPDATE vocabularytermset_aud t SET vocabularytermsetvocabulary_id = a.id FROM auditedobject a WHERE t.vocabularytermsetvocabulary_id = a.old_id AND a.tablename = 'vocabulary'; UPDATE vocabularytermset_vocabularyterm_aud t SET vocabularytermsets_id = a.id FROM auditedobject a WHERE t.vocabularytermsets_id = a.old_id AND a.tablename = 'vocabularytermset'; UPDATE vocabularytermset_vocabularyterm_aud t SET memberterms_id = a.id FROM auditedobject a WHERE t.memberterms_id = a.old_id AND a.tablename = 'vocabularyterm';; From 2881256411e82e7bb7debfb4bdb0eedad0cf54f5 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 4 Jan 2024 01:31:38 +0000 Subject: [PATCH 022/159] Some requested fixes --- .../curation_api/interfaces/crud/ReferenceCrudInterface.java | 2 +- .../jobs/executors/AgmDiseaseAnnotationExecutor.java | 3 --- .../jobs/executors/AlleleDiseaseAnnotationExecutor.java | 3 --- .../jobs/executors/GeneDiseaseAnnotationExecutor.java | 3 --- .../org/alliancegenome/curation_api/model/entities/Allele.java | 3 +-- .../curation_api/services/ExperimentalConditionService.java | 2 +- .../curation_api/services/ontology/NcbiTaxonTermService.java | 3 +-- 7 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ReferenceCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ReferenceCrudInterface.java index 8d9ca630b..0c8293f09 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ReferenceCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ReferenceCrudInterface.java @@ -28,5 +28,5 @@ public interface ReferenceCrudInterface extends CurieObjectCrudInterface synchroniseReference(@PathParam("curie") Long id); + public ObjectResponse synchroniseReference(@PathParam("id") Long id); } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java index f39433108..aaf7bcdbe 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java @@ -20,7 +20,6 @@ import org.alliancegenome.curation_api.services.DiseaseAnnotationService; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; -import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import lombok.extern.jbosslog.JBossLog; @@ -93,11 +92,9 @@ public void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataPro idsAdded.add(annotation.getId()); } } catch (ObjectUpdateException e) { - Log.info("EXCEPTION 1: " + e.getData()); history.incrementFailed(); addException(history, e.getData()); } catch (Exception e) { - Log.info("EXCEPTION 2: " + e.getLocalizedMessage()); history.incrementFailed(); addException(history, new ObjectUpdateExceptionData(annotationDTO, e.getMessage(), e.getStackTrace())); } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java index 6e6f2e173..d98fc6f4e 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java @@ -20,7 +20,6 @@ import org.alliancegenome.curation_api.services.DiseaseAnnotationService; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; -import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import lombok.extern.jbosslog.JBossLog; @@ -93,11 +92,9 @@ public void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataPro idsAdded.add(annotation.getId()); } } catch (ObjectUpdateException e) { - Log.info("EXCEPTION 1: " + e.getData()); history.incrementFailed(); addException(history, e.getData()); } catch (Exception e) { - Log.info("EXCEPTION 2: " + e.getLocalizedMessage()); history.incrementFailed(); addException(history, new ObjectUpdateExceptionData(annotationDTO, e.getMessage(), e.getStackTrace())); } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java index 8a8682d03..088468e92 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java @@ -20,7 +20,6 @@ import org.alliancegenome.curation_api.services.GeneDiseaseAnnotationService; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; -import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import lombok.extern.jbosslog.JBossLog; @@ -93,11 +92,9 @@ public void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataPro idsAdded.add(annotation.getId()); } } catch (ObjectUpdateException e) { - Log.info("EXCEPTION 1: " + e.getData()); history.incrementFailed(); addException(history, e.getData()); } catch (Exception e) { - Log.info("EXCEPTION 2: "); e.printStackTrace(); history.incrementFailed(); addException(history, new ObjectUpdateExceptionData(annotationDTO, e.getMessage(), e.getStackTrace())); diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java index 690f56c90..0b7ebf2d9 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java @@ -36,7 +36,6 @@ import jakarta.persistence.CascadeType; import jakarta.persistence.Entity; -import jakarta.persistence.FetchType; import jakarta.persistence.Index; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; @@ -60,7 +59,7 @@ public class Allele extends GenomicEntity { @IndexedEmbedded(includePaths = {"primaryCrossReferenceCurie", "crossReferences.referencedCurie", "crossReferences.displayName", "curie", "primaryCrossReferenceCurie_keyword", "crossReferences.referencedCurie_keyword", "crossReferences.displayName_keyword", "curie_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) - @ManyToMany(fetch = FetchType.EAGER) + @ManyToMany @Fetch(FetchMode.JOIN) @JoinTable(indexes = { @Index(name = "allele_reference_allele_index", columnList = "allele_id"), diff --git a/src/main/java/org/alliancegenome/curation_api/services/ExperimentalConditionService.java b/src/main/java/org/alliancegenome/curation_api/services/ExperimentalConditionService.java index be99e2579..60f5eb407 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ExperimentalConditionService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ExperimentalConditionService.java @@ -41,7 +41,7 @@ public ObjectResponse update(ExperimentalCondition uiEnti @Transactional public ObjectResponse create(ExperimentalCondition uiEntity) { ExperimentalCondition dbEntity = experimentalConditionValidator.validateExperimentalConditionCreate(uiEntity); - return new ObjectResponse<>(experimentalConditionDAO.persist(dbEntity)); + return new ObjectResponse<>(experimentalConditionDAO.persist(dbEntity)); } public void deleteUnusedExperiments() { diff --git a/src/main/java/org/alliancegenome/curation_api/services/ontology/NcbiTaxonTermService.java b/src/main/java/org/alliancegenome/curation_api/services/ontology/NcbiTaxonTermService.java index ce35da177..ff4a2f213 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ontology/NcbiTaxonTermService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ontology/NcbiTaxonTermService.java @@ -106,9 +106,8 @@ public NCBITaxonTerm downloadAndSave(String taxonCurie) { } else { taxon.setObsolete(true); } - ncbiTaxonTermDAO.persist(taxon); - return taxon; + return ncbiTaxonTermDAO.persist(taxon); } } From d5359bc6e12d270304626c33b0cfe9abb2d6d519 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 4 Jan 2024 01:45:35 +0000 Subject: [PATCH 023/159] Fix typo --- .../components/FieldData/AssertedGenesAdditionalFieldData.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/cliapp/src/components/FieldData/AssertedGenesAdditionalFieldData.js b/src/main/cliapp/src/components/FieldData/AssertedGenesAdditionalFieldData.js index 0db30c44e..0fc3f2eb8 100644 --- a/src/main/cliapp/src/components/FieldData/AssertedGenesAdditionalFieldData.js +++ b/src/main/cliapp/src/components/FieldData/AssertedGenesAdditionalFieldData.js @@ -5,7 +5,7 @@ export function AssertedGenesAdditionalFieldData({ fieldData }) { let ret = []; if (fieldData && fieldData.length >0) { for(let i=0; i< fieldData.length; i++){ - if (getIdentifty(fieldData[i]) !== '' && fieldData[i]["type"] === "Gene") + if (getIdentifier(fieldData[i]) !== '' && fieldData[i]["type"] === "Gene") ret.push(
); } } From 6aa2b77d1ebc92aeb74dd389518ea323d3793bc7 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 4 Jan 2024 02:21:00 +0000 Subject: [PATCH 024/159] Add SequenceGenerator annotation --- .../curation_api/model/entities/base/AuditedObject.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java index 70aa1860e..59ac8e166 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java @@ -37,6 +37,7 @@ import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; +import jakarta.persistence.SequenceGenerator; import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; @@ -58,7 +59,8 @@ public class AuditedObject extends BaseEntity { @Id @DocumentId @GenericField(aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES) - @GeneratedValue(strategy = GenerationType.SEQUENCE) + @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "auditedobject_seq_generator") + @SequenceGenerator(name = "auditedobject_seq_generator", sequenceName = "auditedobject_seq", allocationSize = 1) @JsonView({ View.FieldsOnly.class, View.PersonSettingView.class, VocabularyTermSetView.class }) @EqualsAndHashCode.Include protected Long id; From 4e4aa4703bea47e7a08476e4c66fe6636eba78b7 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 4 Jan 2024 18:15:54 +0000 Subject: [PATCH 025/159] Drop audit tables --- .../model/entities/AGMDiseaseAnnotation.java | 4 - .../model/entities/AffectedGenomicModel.java | 2 - .../curation_api/model/entities/Allele.java | 2 - .../entities/AlleleDiseaseAnnotation.java | 2 - .../model/entities/AllianceMember.java | 2 - .../model/entities/Annotation.java | 2 - .../model/entities/Association.java | 2 - .../model/entities/BiologicalEntity.java | 2 - .../model/entities/ConditionRelation.java | 2 - .../model/entities/Construct.java | 2 - .../model/entities/CrossReference.java | 2 - .../model/entities/DataProvider.java | 2 - .../model/entities/DiseaseAnnotation.java | 2 - .../model/entities/EvidenceAssociation.java | 2 - .../model/entities/ExperimentalCondition.java | 2 - .../curation_api/model/entities/Gene.java | 2 - .../model/entities/GeneDiseaseAnnotation.java | 2 - .../model/entities/GenomicEntity.java | 2 - .../entities/InformationContentEntity.java | 4 - .../curation_api/model/entities/Molecule.java | 2 - .../curation_api/model/entities/Note.java | 2 - .../model/entities/Organization.java | 2 - .../curation_api/model/entities/Person.java | 2 - .../model/entities/PersonSetting.java | 2 - .../curation_api/model/entities/Reagent.java | 2 - .../model/entities/Reference.java | 3 - .../model/entities/ResourceDescriptor.java | 2 - .../entities/ResourceDescriptorPage.java | 2 - .../entities/SingleReferenceAssociation.java | 2 - .../curation_api/model/entities/Species.java | 2 - .../curation_api/model/entities/Synonym.java | 2 - .../curation_api/model/entities/Variant.java | 2 - .../model/entities/Vocabulary.java | 2 - .../model/entities/VocabularyTerm.java | 2 - .../model/entities/VocabularyTermSet.java | 2 - .../AlleleGeneAssociation.java | 2 - .../AlleleGenomicEntityAssociation.java | 3 - .../ConstructGenomicEntityAssociation.java | 2 - .../model/entities/base/AuditedObject.java | 2 - .../model/entities/base/CurieObject.java | 2 - .../model/entities/base/SubmittedObject.java | 2 - .../model/entities/bulkloads/BulkFMSLoad.java | 2 - .../model/entities/bulkloads/BulkLoad.java | 2 - .../entities/bulkloads/BulkLoadFile.java | 2 - .../bulkloads/BulkLoadFileException.java | 2 - .../bulkloads/BulkLoadFileHistory.java | 2 - .../entities/bulkloads/BulkLoadGroup.java | 2 - .../entities/bulkloads/BulkManualLoad.java | 2 - .../entities/bulkloads/BulkScheduledLoad.java | 2 - .../model/entities/bulkloads/BulkURLLoad.java | 2 - .../curationreports/CurationReport.java | 2 - .../curationreports/CurationReportGroup.java | 2 - .../CurationReportHistory.java | 2 - .../model/entities/ontology/APOTerm.java | 2 - .../model/entities/ontology/ATPTerm.java | 2 - .../entities/ontology/AnatomicalTerm.java | 2 - .../model/entities/ontology/BSPOTerm.java | 2 - .../model/entities/ontology/CHEBITerm.java | 2 - .../model/entities/ontology/CLTerm.java | 2 - .../model/entities/ontology/CMOTerm.java | 2 - .../model/entities/ontology/ChemicalTerm.java | 2 - .../model/entities/ontology/DAOTerm.java | 2 - .../model/entities/ontology/DOTerm.java | 2 - .../model/entities/ontology/DPOTerm.java | 2 - .../model/entities/ontology/ECOTerm.java | 2 - .../model/entities/ontology/EMAPATerm.java | 2 - .../ExperimentalConditionOntologyTerm.java | 2 - .../model/entities/ontology/FBDVTerm.java | 2 - .../model/entities/ontology/GOTerm.java | 2 - .../model/entities/ontology/HPTerm.java | 2 - .../model/entities/ontology/MATerm.java | 2 - .../model/entities/ontology/MITerm.java | 2 - .../model/entities/ontology/MMOTerm.java | 2 - .../model/entities/ontology/MMUSDVTerm.java | 2 - .../model/entities/ontology/MODTerm.java | 2 - .../model/entities/ontology/MPATHTerm.java | 2 - .../model/entities/ontology/MPTerm.java | 2 - .../entities/ontology/NCBITaxonTerm.java | 2 - .../model/entities/ontology/OBITerm.java | 2 - .../model/entities/ontology/OntologyTerm.java | 2 - .../model/entities/ontology/PATOTerm.java | 2 - .../model/entities/ontology/PWTerm.java | 2 - .../entities/ontology/PhenotypeTerm.java | 2 - .../model/entities/ontology/ROTerm.java | 2 - .../model/entities/ontology/RSTerm.java | 2 - .../model/entities/ontology/SOTerm.java | 2 - .../model/entities/ontology/StageTerm.java | 2 - .../model/entities/ontology/UBERONTerm.java | 2 - .../model/entities/ontology/VTTerm.java | 2 - .../model/entities/ontology/WBBTTerm.java | 2 - .../model/entities/ontology/WBLSTerm.java | 2 - .../entities/ontology/WBPhenotypeTerm.java | 2 - .../model/entities/ontology/XBATerm.java | 2 - .../model/entities/ontology/XBEDTerm.java | 2 - .../model/entities/ontology/XBSTerm.java | 2 - .../model/entities/ontology/XCOTerm.java | 2 - .../model/entities/ontology/XPOTerm.java | 2 - .../model/entities/ontology/XSMOTerm.java | 2 - .../model/entities/ontology/ZECOTerm.java | 2 - .../model/entities/ontology/ZFATerm.java | 2 - .../model/entities/ontology/ZFSTerm.java | 2 - .../orthology/GeneToGeneOrthology.java | 2 - .../orthology/GeneToGeneOrthologyCurated.java | 2 - .../GeneToGeneOrthologyGenerated.java | 2 - .../slotAnnotations/NameSlotAnnotation.java | 4 - .../SecondaryIdSlotAnnotation.java | 4 - .../slotAnnotations/SlotAnnotation.java | 4 - .../AlleleDatabaseStatusSlotAnnotation.java | 2 - .../AlleleFullNameSlotAnnotation.java | 2 - .../AlleleFunctionalImpactSlotAnnotation.java | 2 - ...mlineTransmissionStatusSlotAnnotation.java | 2 - .../AlleleInheritanceModeSlotAnnotation.java | 2 - .../AlleleMutationTypeSlotAnnotation.java | 2 - ...AlleleNomenclatureEventSlotAnnotation.java | 2 - .../AlleleSecondaryIdSlotAnnotation.java | 2 - .../AlleleSymbolSlotAnnotation.java | 2 - .../AlleleSynonymSlotAnnotation.java | 2 - .../ConstructComponentSlotAnnotation.java | 3 - .../ConstructFullNameSlotAnnotation.java | 2 - .../ConstructSymbolSlotAnnotation.java | 2 - .../ConstructSynonymSlotAnnotation.java | 2 - .../GeneFullNameSlotAnnotation.java | 2 - .../GeneSecondaryIdSlotAnnotation.java | 2 - .../GeneSymbolSlotAnnotation.java | 2 - .../GeneSynonymSlotAnnotation.java | 2 - .../GeneSystematicNameSlotAnnotation.java | 2 - .../v0.30.0.1__linkml_v2.0.0_update.sql | 1230 +++-------------- 127 files changed, 164 insertions(+), 1331 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java index 68efed837..2dde302f8 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java @@ -10,7 +10,6 @@ import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.OnDelete; import org.hibernate.annotations.OnDeleteAction; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; @@ -21,9 +20,7 @@ import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; -import jakarta.persistence.ForeignKey; import jakarta.persistence.Index; -import jakarta.persistence.JoinColumn; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; import jakarta.persistence.ManyToOne; @@ -32,7 +29,6 @@ import lombok.EqualsAndHashCode; @Indexed -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java index 33b2e871c..40bbd4b78 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; @@ -23,7 +22,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java index 0b7ebf2d9..7fdcf343b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java @@ -19,7 +19,6 @@ import org.alliancegenome.curation_api.view.View; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -47,7 +46,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java index 9b4f58c0d..41c02f4b8 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java @@ -10,7 +10,6 @@ import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.OnDelete; import org.hibernate.annotations.OnDeleteAction; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; @@ -31,7 +30,6 @@ import lombok.EqualsAndHashCode; @Indexed -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AllianceMember.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AllianceMember.java index d43c6bf35..c93a050ec 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AllianceMember.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AllianceMember.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import jakarta.persistence.Entity; import lombok.Data; @@ -11,7 +10,6 @@ @Data @Entity -@Audited @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Organization.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java index bb61ab8cf..2fa0c95e9 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java @@ -9,7 +9,6 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -41,7 +40,6 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = DiseaseAnnotation.class, name = "DiseaseAnnotation") }) -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java index 36b7efd85..a2ef4b341 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java @@ -4,7 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -19,7 +18,6 @@ @JsonSubTypes.Type(value = SingleReferenceAssociation.class, name = "SingleReferenceAssociation"), @JsonSubTypes.Type(value = EvidenceAssociation.class, name = "EvidenceAssociation") }) -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java index 4e4692c56..7c6903565 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; import org.alliancegenome.curation_api.model.entities.ontology.NCBITaxonTerm; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.bridge.mapping.annotation.TypeBinderRef; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; @@ -28,7 +27,6 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonSubTypes({ @JsonSubTypes.Type(value = AffectedGenomicModel.class, name = "AffectedGenomicModel"), @JsonSubTypes.Type(value = Allele.class, name = "Allele"), @JsonSubTypes.Type(value = Gene.class, name = "Gene"), @JsonSubTypes.Type(value = Variant.class, name = "Variant") }) -@Audited @Entity @TypeBinding(binder = @TypeBinderRef(type = BiologicalEntityTypeBridge.class)) @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java index 1609dfad7..c6cfcfb92 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java @@ -10,7 +10,6 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -30,7 +29,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @Indexed diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java index 2e6111c7e..cce768085 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java @@ -11,7 +11,6 @@ import org.alliancegenome.curation_api.model.entities.slotAnnotations.constructSlotAnnotations.ConstructSynonymSlotAnnotation; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; @@ -31,7 +30,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/CrossReference.java b/src/main/java/org/alliancegenome/curation_api/model/entities/CrossReference.java index 05c2fb527..1d2306621 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/CrossReference.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/CrossReference.java @@ -7,7 +7,6 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -27,7 +26,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = false) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/DataProvider.java b/src/main/java/org/alliancegenome/curation_api/model/entities/DataProvider.java index a0c51a5c5..c89ce5cca 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/DataProvider.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/DataProvider.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -20,7 +19,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java index 0da1ef773..b411c1838 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java @@ -11,7 +11,6 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -44,7 +43,6 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonSubTypes({ @Type(value = AGMDiseaseAnnotation.class, name = "AGMDiseaseAnnotation"), @Type(value = AlleleDiseaseAnnotation.class, name = "AlleleDiseaseAnnotation"), @Type(value = GeneDiseaseAnnotation.class, name = "GeneDiseaseAnnotation") }) -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java index a04d02b03..1d933e437 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java @@ -8,7 +8,6 @@ import org.alliancegenome.curation_api.model.entities.associations.constructAssociations.ConstructGenomicEntityAssociation; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -31,7 +30,6 @@ @JsonSubTypes.Type(value = AlleleGenomicEntityAssociation.class, name = "AlleleGenomicEntityAssociation"), @JsonSubTypes.Type(value = ConstructGenomicEntityAssociation.class, name = "ConstructGenomicEntityAssociation") }) -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ExperimentalCondition.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ExperimentalCondition.java index fa2e1986a..03fa19e92 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ExperimentalCondition.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ExperimentalCondition.java @@ -12,7 +12,6 @@ import org.alliancegenome.curation_api.model.entities.ontology.ZECOTerm; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -32,7 +31,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Indexed @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java index 7cca99227..560eb79d1 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java @@ -13,7 +13,6 @@ import org.alliancegenome.curation_api.model.entities.slotAnnotations.geneSlotAnnotations.GeneSystematicNameSlotAnnotation; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; @@ -31,7 +30,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java index 922e6c93c..d160ca0cd 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java @@ -6,7 +6,6 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.OnDelete; import org.hibernate.annotations.OnDeleteAction; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; @@ -23,7 +22,6 @@ import lombok.EqualsAndHashCode; @Indexed -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java index 0d227389c..5126e4689 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.associations.constructAssociations.ConstructGenomicEntityAssociation; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -24,7 +23,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Inheritance(strategy = InheritanceType.JOINED) @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java index b5b1e4b7f..f0d3e3bf5 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java @@ -4,19 +4,15 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.model.entities.base.CurieObject; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonSubTypes; import jakarta.persistence.Entity; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Molecule.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Molecule.java index 8a45a1fb1..0fdbbad6a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Molecule.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Molecule.java @@ -4,14 +4,12 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.ontology.ChemicalTerm; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; import lombok.Data; import lombok.EqualsAndHashCode; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java index fa7e999d4..1b3272b03 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java @@ -8,7 +8,6 @@ import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -32,7 +31,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java index 7d4575f54..fe1dc5efd 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java @@ -3,7 +3,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -32,7 +31,6 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = AllianceMember.class, name = "AllianceMember") }) @Data @Entity -@Audited @Inheritance(strategy = InheritanceType.JOINED) @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java index 97843dcb4..76883fef5 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -29,7 +28,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Inheritance(strategy = InheritanceType.JOINED) @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java b/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java index d5cea6943..ecab844f4 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java @@ -7,7 +7,6 @@ import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; import org.hibernate.annotations.JdbcTypeCode; -import org.hibernate.envers.Audited; import org.hibernate.type.SqlTypes; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -21,7 +20,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java index 3bc14fe3d..7dbd78b50 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java @@ -7,7 +7,6 @@ import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -30,7 +29,6 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonSubTypes({ @JsonSubTypes.Type(value = Construct.class, name = "Construct") }) -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java index b1ad60054..8d76566c8 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Reference.java @@ -12,7 +12,6 @@ import org.alliancegenome.curation_api.view.View; import org.apache.commons.collections.CollectionUtils; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -36,8 +35,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; - -@Audited @Entity @TypeBinding(binder = @TypeBinderRef(type = ReferenceTypeBridge.class)) @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java index 276669d12..e841ed448 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java @@ -7,7 +7,6 @@ import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -31,7 +30,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java index 9a756f958..7228b58a7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -26,7 +25,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java index 076327970..099f1779b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java @@ -4,7 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -20,7 +19,6 @@ import lombok.Data; import lombok.EqualsAndHashCode; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java index cc878b390..07d968f70 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java @@ -9,7 +9,6 @@ import org.alliancegenome.curation_api.view.View; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -34,7 +33,6 @@ import lombok.NoArgsConstructor; import lombok.ToString; -@Audited @Entity @Data @Indexed diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java index c39c91cb5..4a986b2bf 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java @@ -4,7 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -20,7 +19,6 @@ import lombok.NoArgsConstructor; import lombok.ToString; -@Audited @Entity @Data @NoArgsConstructor diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Variant.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Variant.java index f8c5c526d..ee90aac8e 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Variant.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Variant.java @@ -8,7 +8,6 @@ import org.alliancegenome.curation_api.view.View; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; @@ -27,7 +26,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java index 05adc0cdf..8a19742fb 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java @@ -7,7 +7,6 @@ import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -29,7 +28,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java index e7835bc37..b7dbf63ff 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java @@ -7,7 +7,6 @@ import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -32,7 +31,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java index 41f62dba1..b2c21eaf0 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java @@ -7,7 +7,6 @@ import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -31,7 +30,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java index 5120137db..3b59b06e5 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java @@ -8,7 +8,6 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -25,7 +24,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java index 7f40bf75d..19ea6da11 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java @@ -4,12 +4,10 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.EvidenceAssociation; import org.alliancegenome.curation_api.model.entities.Note; -import org.alliancegenome.curation_api.model.entities.SingleReferenceAssociation; import org.alliancegenome.curation_api.model.entities.VocabularyTerm; import org.alliancegenome.curation_api.model.entities.ontology.ECOTerm; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -30,7 +28,6 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonSubTypes({ @JsonSubTypes.Type(value = AlleleGeneAssociation.class, name = "AlleleGeneAssociation") }) -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java index 022fdc177..e74ac4290 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java @@ -13,7 +13,6 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -33,7 +32,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java index 59ac8e166..5c9f32c0b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java @@ -13,7 +13,6 @@ import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.UpdateTimestamp; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -45,7 +44,6 @@ @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@Audited @Entity @ToString(exclude = { "createdBy", "updatedBy" }) @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java index b294656bd..9d8663b17 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java @@ -3,7 +3,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -22,7 +21,6 @@ @Data @EqualsAndHashCode(callSuper = true) -@Audited @Entity @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java index 4c829363a..6b66225c4 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java @@ -7,7 +7,6 @@ import org.apache.commons.lang3.StringUtils; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -30,7 +29,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkFMSLoad.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkFMSLoad.java index 7802a6be9..3500b9514 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkFMSLoad.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkFMSLoad.java @@ -4,7 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonView; @@ -14,7 +13,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java index d950ff73c..a01ff1f9c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java @@ -9,7 +9,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonView; @@ -27,7 +26,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Inheritance(strategy = InheritanceType.JOINED) @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFile.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFile.java index 90527616c..e3dbfa2fb 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFile.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFile.java @@ -10,7 +10,6 @@ import org.alliancegenome.curation_api.model.bridges.OffsetDateTimeValueBridge; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -34,7 +33,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileException.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileException.java index d5a19c71c..5f412e99d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileException.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileException.java @@ -8,7 +8,6 @@ import org.hibernate.annotations.JdbcTypeCode; import org.hibernate.annotations.OnDelete; import org.hibernate.annotations.OnDeleteAction; -import org.hibernate.envers.Audited; import org.hibernate.type.SqlTypes; import com.fasterxml.jackson.annotation.JsonView; @@ -21,7 +20,6 @@ import lombok.NoArgsConstructor; import lombok.ToString; -@Audited @Entity @Data @AllArgsConstructor diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileHistory.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileHistory.java index 017f0af73..b30d401ff 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileHistory.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadFileHistory.java @@ -10,7 +10,6 @@ import org.alliancegenome.curation_api.view.View; import org.hibernate.annotations.OnDelete; import org.hibernate.annotations.OnDeleteAction; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonView; @@ -24,7 +23,6 @@ import lombok.NoArgsConstructor; import lombok.ToString; -@Audited @Entity @Data @AllArgsConstructor diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadGroup.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadGroup.java index 59a1f17c7..4475cacd4 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadGroup.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoadGroup.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonView; @@ -16,7 +15,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkManualLoad.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkManualLoad.java index e4e0a2eec..ddbf2f3c5 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkManualLoad.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkManualLoad.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonView; @@ -17,7 +16,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkScheduledLoad.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkScheduledLoad.java index b397df8af..8d8e5490c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkScheduledLoad.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkScheduledLoad.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import com.cronutils.model.Cron; import com.cronutils.model.CronType; @@ -25,7 +24,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Inheritance(strategy = InheritanceType.JOINED) @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkURLLoad.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkURLLoad.java index 4bc0a431e..2076f493a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkURLLoad.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkURLLoad.java @@ -4,7 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonView; @@ -14,7 +13,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java index e30f44bbf..39c51ff70 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java @@ -7,7 +7,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonView; @@ -24,7 +23,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Inheritance(strategy = InheritanceType.JOINED) @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportGroup.java b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportGroup.java index 204900e7f..3d9243070 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportGroup.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportGroup.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonView; @@ -16,7 +15,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportHistory.java b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportHistory.java index 241503679..de83f44a4 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportHistory.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportHistory.java @@ -7,7 +7,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonView; @@ -22,7 +21,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Inheritance(strategy = InheritanceType.JOINED) @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/APOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/APOTerm.java index 1e2bb8536..a7f89280b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/APOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/APOTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ATPTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ATPTerm.java index 5d08669f0..3c8dc1a74 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ATPTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ATPTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java index 705239791..ce34170b4 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import jakarta.persistence.Entity; import jakarta.persistence.Inheritance; @@ -11,7 +10,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/BSPOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/BSPOTerm.java index 48ebb44cf..39a9922cf 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/BSPOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/BSPOTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/CHEBITerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/CHEBITerm.java index ad07e839b..ec92e5101 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/CHEBITerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/CHEBITerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/CLTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/CLTerm.java index c4abff5ea..5227e00c7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/CLTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/CLTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/CMOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/CMOTerm.java index 99f8c3f1e..b33e4fda1 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/CMOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/CMOTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java index 564fbf73b..fe70cad7c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java @@ -3,7 +3,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -20,7 +19,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/DAOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/DAOTerm.java index 3c14f7e62..f735dc40c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/DAOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/DAOTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/DOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/DOTerm.java index a49e18bd6..30709899e 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/DOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/DOTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/DPOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/DPOTerm.java index c14f64808..ab512be7f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/DPOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/DPOTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ECOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ECOTerm.java index b8ff67189..55a319294 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ECOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ECOTerm.java @@ -3,7 +3,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -18,7 +17,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/EMAPATerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/EMAPATerm.java index d2095ef6b..155558b0b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/EMAPATerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/EMAPATerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java index 29195df3b..632eb6e77 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import jakarta.persistence.Entity; import jakarta.persistence.Inheritance; @@ -11,7 +10,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/FBDVTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/FBDVTerm.java index 792f64059..afe5da425 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/FBDVTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/FBDVTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/GOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/GOTerm.java index b38c8f2c6..9e7af9fb4 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/GOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/GOTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/HPTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/HPTerm.java index 83e8fccd8..55414d4a0 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/HPTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/HPTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MATerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MATerm.java index a15929739..567289211 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MATerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MATerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MITerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MITerm.java index ad9f98b93..f98bde72d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MITerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MITerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MMOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MMOTerm.java index 7818e7ff5..2a0794298 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MMOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MMOTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MMUSDVTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MMUSDVTerm.java index 9528f273d..e43a70ef0 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MMUSDVTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MMUSDVTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MODTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MODTerm.java index d03a47169..8e5379cec 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MODTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MODTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MPATHTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MPATHTerm.java index ca6cc64c3..58de4be88 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MPATHTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MPATHTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MPTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MPTerm.java index efdf5807c..116f182ba 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MPTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/MPTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/NCBITaxonTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/NCBITaxonTerm.java index b47b74a83..fd81018ed 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/NCBITaxonTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/NCBITaxonTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -13,7 +12,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OBITerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OBITerm.java index b6a780af2..6a91f0976 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OBITerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OBITerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java index 90b78ca9d..3d01df26e 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java @@ -11,7 +11,6 @@ import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.model.entities.base.CurieObject; import org.alliancegenome.curation_api.view.View; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -34,7 +33,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @Entity diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PATOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PATOTerm.java index 1d7a76f36..5be279d67 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PATOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PATOTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PWTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PWTerm.java index 01bf5da9d..337f78307 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PWTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PWTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java index f068cdf0a..fb2ae3db2 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import jakarta.persistence.Entity; import jakarta.persistence.Inheritance; @@ -11,7 +10,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ROTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ROTerm.java index 70ac99a4e..54d673ad3 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ROTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ROTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/RSTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/RSTerm.java index 22b9494eb..c543268be 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/RSTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/RSTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/SOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/SOTerm.java index b73a26473..cbcdcc8c9 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/SOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/SOTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java index a2ded9c71..6fd5c5eaf 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import jakarta.persistence.Entity; import jakarta.persistence.Inheritance; @@ -11,7 +10,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/UBERONTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/UBERONTerm.java index 009f84771..49d9d082e 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/UBERONTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/UBERONTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/VTTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/VTTerm.java index ec37b0c30..d66cb5db7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/VTTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/VTTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/WBBTTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/WBBTTerm.java index a91072637..8f1e81bb2 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/WBBTTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/WBBTTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/WBLSTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/WBLSTerm.java index 9b9b340c8..8db211d9b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/WBLSTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/WBLSTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/WBPhenotypeTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/WBPhenotypeTerm.java index 59f5f5457..70fd5e3d8 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/WBPhenotypeTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/WBPhenotypeTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XBATerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XBATerm.java index d05300394..1297f91e3 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XBATerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XBATerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XBEDTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XBEDTerm.java index 7b705be20..44cb8e9d5 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XBEDTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XBEDTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XBSTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XBSTerm.java index 345147e1b..b6b8934cc 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XBSTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XBSTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XCOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XCOTerm.java index 5f4017792..995c5a9d2 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XCOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XCOTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XPOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XPOTerm.java index bdfae8831..d73a8f395 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XPOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XPOTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XSMOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XSMOTerm.java index c7fc38e5c..f97dd1253 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XSMOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/XSMOTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ZECOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ZECOTerm.java index d0783a5aa..609d1ff63 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ZECOTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ZECOTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ZFATerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ZFATerm.java index 8bdaf0a32..16cc9fb7d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ZFATerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ZFATerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ZFSTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ZFSTerm.java index 7491dd8e3..79c8c4dec 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ZFSTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ZFSTerm.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import jakarta.persistence.Entity; @@ -10,7 +9,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Indexed @Entity @Data diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java index 03da3ca56..91a72c078 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -23,7 +22,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthologyCurated.java b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthologyCurated.java index 67b5f2835..7abe71168 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthologyCurated.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthologyCurated.java @@ -7,7 +7,6 @@ import org.alliancegenome.curation_api.model.entities.ontology.ECOTerm; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -22,7 +21,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthologyGenerated.java b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthologyGenerated.java index 0db8f9dc7..e62bbe6a1 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthologyGenerated.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthologyGenerated.java @@ -9,7 +9,6 @@ import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -33,7 +32,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/NameSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/NameSlotAnnotation.java index 279d25e67..cc59ac765 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/NameSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/NameSlotAnnotation.java @@ -7,7 +7,6 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -21,15 +20,12 @@ import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SecondaryIdSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SecondaryIdSlotAnnotation.java index 6a55f1b32..3515e7104 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SecondaryIdSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SecondaryIdSlotAnnotation.java @@ -4,7 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -14,13 +13,10 @@ import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java index 23658c5f4..fd5b86a88 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java @@ -8,7 +8,6 @@ import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -17,15 +16,12 @@ import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleDatabaseStatusSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleDatabaseStatusSlotAnnotation.java index f0978b6e8..ad40fc984 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleDatabaseStatusSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleDatabaseStatusSlotAnnotation.java @@ -7,7 +7,6 @@ import org.alliancegenome.curation_api.model.entities.slotAnnotations.SlotAnnotation; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -24,7 +23,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFullNameSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFullNameSlotAnnotation.java index 43633b7e1..090397126 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFullNameSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFullNameSlotAnnotation.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.model.entities.Allele; import org.alliancegenome.curation_api.model.entities.slotAnnotations.NameSlotAnnotation; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonBackReference; @@ -17,7 +16,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotation.java index a8987580e..e8aaee170 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotation.java @@ -12,7 +12,6 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -36,7 +35,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleGermlineTransmissionStatusSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleGermlineTransmissionStatusSlotAnnotation.java index a0a3b56b8..cb8a284c7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleGermlineTransmissionStatusSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleGermlineTransmissionStatusSlotAnnotation.java @@ -7,7 +7,6 @@ import org.alliancegenome.curation_api.model.entities.slotAnnotations.SlotAnnotation; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -23,7 +22,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotation.java index fa78311ba..97cee9787 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotation.java @@ -8,7 +8,6 @@ import org.alliancegenome.curation_api.model.entities.slotAnnotations.SlotAnnotation; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -30,7 +29,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotation.java index 59cd8a4cd..1c0f0e0fc 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotation.java @@ -11,7 +11,6 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -29,7 +28,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleNomenclatureEventSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleNomenclatureEventSlotAnnotation.java index 0b893ea78..b626d523f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleNomenclatureEventSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleNomenclatureEventSlotAnnotation.java @@ -7,7 +7,6 @@ import org.alliancegenome.curation_api.model.entities.slotAnnotations.SlotAnnotation; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; @@ -23,7 +22,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSecondaryIdSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSecondaryIdSlotAnnotation.java index 3624ff1d0..727014b2d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSecondaryIdSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSecondaryIdSlotAnnotation.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.model.entities.slotAnnotations.SecondaryIdSlotAnnotation; import org.alliancegenome.curation_api.model.entities.slotAnnotations.SlotAnnotation; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonBackReference; @@ -18,7 +17,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSymbolSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSymbolSlotAnnotation.java index 9a7d829c5..cbc11f4eb 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSymbolSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSymbolSlotAnnotation.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.model.entities.Allele; import org.alliancegenome.curation_api.model.entities.slotAnnotations.NameSlotAnnotation; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonBackReference; @@ -17,7 +16,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSynonymSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSynonymSlotAnnotation.java index 31ef845ed..f2e2f9c25 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSynonymSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/alleleSlotAnnotations/AlleleSynonymSlotAnnotation.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.model.entities.Allele; import org.alliancegenome.curation_api.model.entities.slotAnnotations.NameSlotAnnotation; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonBackReference; @@ -17,7 +16,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructComponentSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructComponentSlotAnnotation.java index 0cc08140c..d663068b7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructComponentSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructComponentSlotAnnotation.java @@ -13,7 +13,6 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.envers.Audited; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -33,13 +32,11 @@ import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; -import jakarta.persistence.OneToOne; import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructFullNameSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructFullNameSlotAnnotation.java index 235ba7c26..8e7c90eb4 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructFullNameSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructFullNameSlotAnnotation.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.model.entities.Construct; import org.alliancegenome.curation_api.model.entities.slotAnnotations.NameSlotAnnotation; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonBackReference; @@ -17,7 +16,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSymbolSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSymbolSlotAnnotation.java index 833485194..c1aa33fa7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSymbolSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSymbolSlotAnnotation.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.model.entities.Construct; import org.alliancegenome.curation_api.model.entities.slotAnnotations.NameSlotAnnotation; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonBackReference; @@ -17,7 +16,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSynonymSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSynonymSlotAnnotation.java index 556d1a3d9..dc4582151 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSynonymSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructSynonymSlotAnnotation.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.model.entities.Construct; import org.alliancegenome.curation_api.model.entities.slotAnnotations.NameSlotAnnotation; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonBackReference; @@ -17,7 +16,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneFullNameSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneFullNameSlotAnnotation.java index 32789765e..0a1d9f935 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneFullNameSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneFullNameSlotAnnotation.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.model.entities.Gene; import org.alliancegenome.curation_api.model.entities.slotAnnotations.NameSlotAnnotation; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonBackReference; @@ -17,7 +16,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSecondaryIdSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSecondaryIdSlotAnnotation.java index ef558b85c..46df33a11 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSecondaryIdSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSecondaryIdSlotAnnotation.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.model.entities.slotAnnotations.SecondaryIdSlotAnnotation; import org.alliancegenome.curation_api.model.entities.slotAnnotations.SlotAnnotation; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonBackReference; @@ -18,7 +17,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSymbolSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSymbolSlotAnnotation.java index 9793e2b7f..e7ef28b8f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSymbolSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSymbolSlotAnnotation.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.model.entities.Gene; import org.alliancegenome.curation_api.model.entities.slotAnnotations.NameSlotAnnotation; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonBackReference; @@ -17,7 +16,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSynonymSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSynonymSlotAnnotation.java index 04cce7d28..1b1a8521b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSynonymSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSynonymSlotAnnotation.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.model.entities.Gene; import org.alliancegenome.curation_api.model.entities.slotAnnotations.NameSlotAnnotation; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonBackReference; @@ -17,7 +16,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSystematicNameSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSystematicNameSlotAnnotation.java index 8091c2a71..8f750f48a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSystematicNameSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/geneSlotAnnotations/GeneSystematicNameSlotAnnotation.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.model.entities.Gene; import org.alliancegenome.curation_api.model.entities.slotAnnotations.NameSlotAnnotation; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.hibernate.envers.Audited; import com.fasterxml.jackson.annotation.JsonBackReference; @@ -17,7 +16,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Audited @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index fbbce1383..d5ca50176 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -1,18 +1,14 @@ -- Revert temporary changes to association table columns ALTER TABLE constructgenomicentityassociation RENAME subjectconstruct_id TO subject_id; -ALTER TABLE constructgenomicentityassociation_aud RENAME subjectconstruct_id TO subject_id; ALTER TABLE constructgenomicentityassociation RENAME objectgenomicentity_curie TO object_curie; -ALTER TABLE constructgenomicentityassociation_aud RENAME objectgenomicentity_curie TO object_curie; ALTER TABLE allelegeneassociation RENAME objectgene_curie TO object_curie; -ALTER TABLE allelegeneassociation_aud RENAME objectgene_curie TO object_curie; -- Random cleanup ALTER TABLE organization DROP COLUMN IF EXISTS uniqueid; -ALTER TABLE organization_aud DROP COLUMN IF EXISTS uniqueid; DROP TABLE IF EXISTS paperhandle; DROP TABLE IF EXISTS paperhandle_aud; @@ -23,23 +19,182 @@ ALTER TABLE genediseaseannotation DROP COLUMN IF EXISTS predicate; ALTER TABLE synonym ALTER COLUMN name SET DATA TYPE text; -ALTER TABLE person_aud ADD COLUMN uniqueid varchar (2000); +-- Drop audit tables +DROP TABLE affectedgenomicmodel_aud; +DROP TABLE agmdiseaseannotation_aud; +DROP TABLE agmdiseaseannotation_gene_aud; +DROP TABLE allele_aud; +DROP TABLE allele_note_aud; +DROP TABLE allele_reference_aud; +DROP TABLE alleledatabasestatusslotannotation_aud; +DROP TABLE allelediseaseannotation_aud; +DROP TABLE allelediseaseannotation_gene_aud; +DROP TABLE allelefullnameslotannotation_aud; +DROP TABLE allelefunctionalimpactslotannotation_aud; +DROP TABLE allelefunctionalimpactslotannotation_vocabularyterm_aud; +DROP TABLE allelegeneassociation_aud; +DROP TABLE allelegenomicentityassociation_aud; +DROP TABLE allelegermlinetransmissionstatusslotannotation_aud; +DROP TABLE alleleinheritancemodeslotannotation_aud; +DROP TABLE allelemutationtypeslotannotation_aud; +DROP TABLE allelemutationtypeslotannotation_soterm_aud; +DROP TABLE allelenomenclatureeventslotannotation_aud; +DROP TABLE allelesecondaryidslotannotation_aud; +DROP TABLE allelesymbolslotannotation_aud; +DROP TABLE allelesynonymslotannotation_aud; +DROP TABLE alliancemember_aud; +DROP TABLE anatomicalterm_aud; +DROP TABLE annotation_aud; +DROP TABLE annotation_conditionrelation_aud; +DROP TABLE annotation_note_aud; +DROP TABLE apoterm_aud; +DROP TABLE association_aud; +DROP TABLE atpterm_aud; +DROP TABLE biologicalentity_aud; +DROP TABLE bspoterm_aud; +DROP TABLE bulkfmsload_aud; +DROP TABLE bulkload_aud; +DROP TABLE bulkloadfile_aud; +DROP TABLE bulkloadfileexception_aud; +DROP TABLE bulkloadfilehistory_aud; +DROP TABLE bulkloadgroup_aud; +DROP TABLE bulkmanualload_aud; +DROP TABLE bulkscheduledload_aud; +DROP TABLE bulkurlload_aud; +DROP TABLE chebiterm_aud; +DROP TABLE chemicalterm_aud; +DROP TABLE clterm_aud; +DROP TABLE cmoterm_aud; +DROP TABLE conditionrelation_aud; +DROP TABLE conditionrelation_experimentalcondition_aud; +DROP TABLE construct_aud; +DROP TABLE construct_reference_aud; +DROP TABLE constructcomponentslotannotation_aud; +DROP TABLE constructcomponentslotannotation_note_aud; +DROP TABLE constructfullnameslotannotation_aud; +DROP TABLE constructgenomicentityassociation_aud; +DROP TABLE constructgenomicentityassociation_note_aud; +DROP TABLE constructsymbolslotannotation_aud; +DROP TABLE constructsynonymslotannotation_aud; +DROP TABLE crossreference_aud; +DROP TABLE curationreport_aud; +DROP TABLE curationreportgroup_aud; +DROP TABLE curationreporthistory_aud; +DROP TABLE daoterm_aud; +DROP TABLE dataprovider_aud; +DROP TABLE diseaseannotation_aud; +DROP TABLE diseaseannotation_biologicalentity_aud; +DROP TABLE diseaseannotation_ecoterm_aud; +DROP TABLE diseaseannotation_gene_aud; +DROP TABLE diseaseannotation_vocabularyterm_aud; +DROP TABLE doterm_aud; +DROP TABLE dpoterm_aud; +DROP TABLE ecoterm_aud; +DROP TABLE emapaterm_aud; +DROP TABLE evidenceassociation_aud; +DROP TABLE evidenceassociation_informationcontententity_aud; +DROP TABLE experimentalcondition_aud; +DROP TABLE experimentalconditionontologyterm_aud; +DROP TABLE fbdvterm_aud; +DROP TABLE gene_aud; +DROP TABLE genediseaseannotation_aud; +DROP TABLE genefullnameslotannotation_aud; +DROP TABLE genesecondaryidslotannotation_aud; +DROP TABLE genesymbolslotannotation_aud; +DROP TABLE genesynonymslotannotation_aud; +DROP TABLE genesystematicnameslotannotation_aud; +DROP TABLE genetogeneorthology_aud; +DROP TABLE genetogeneorthologycurated_aud; +DROP TABLE genetogeneorthologygenerated_aud; +DROP TABLE genetogeneorthologygenerated_predictionmethodsmatched_aud; +DROP TABLE genetogeneorthologygenerated_predictionmethodsnotcalled_aud; +DROP TABLE genetogeneorthologygenerated_predictionmethodsnotmatched_aud; +DROP TABLE genomicentity_aud; +DROP TABLE genomicentity_crossreference_aud; +DROP TABLE goterm_aud; +DROP TABLE hpterm_aud; +DROP TABLE informationcontententity_aud; +DROP TABLE materm_aud; +DROP TABLE miterm_aud; +DROP TABLE mmoterm_aud; +DROP TABLE mmusdvterm_aud; +DROP TABLE modterm_aud; +DROP TABLE molecule_aud; +DROP TABLE mpathterm_aud; +DROP TABLE mpterm_aud; +DROP TABLE nameslotannotation_aud; +DROP TABLE ncbitaxonterm_aud; +DROP TABLE note_aud; +DROP TABLE note_reference_aud; +DROP TABLE obiterm_aud; +DROP TABLE ontologyterm_aud; +DROP TABLE ontologyterm_crossreference_aud; +DROP TABLE ontologyterm_definitionurls_aud; +DROP TABLE ontologyterm_isa_ancestor_descendant_aud; +DROP TABLE ontologyterm_isa_parent_children_aud; +DROP TABLE ontologyterm_secondaryidentifiers_aud; +DROP TABLE ontologyterm_subsets_aud; +DROP TABLE ontologyterm_synonym_aud; +DROP TABLE organization_aud; +DROP TABLE paperhandle_aud; +DROP TABLE patoterm_aud; +DROP TABLE person_aud; +DROP TABLE person_emails_aud; +DROP TABLE person_oldemails_aud; +DROP TABLE personsetting_aud; +DROP TABLE phenotypeterm_aud; +DROP TABLE pwterm_aud; +DROP TABLE reagent_aud; +DROP TABLE reagent_secondaryidentifiers_aud; +DROP TABLE reference_aud; +DROP TABLE reference_crossreference_aud; +DROP TABLE resourcedescriptor_aud; +DROP TABLE resourcedescriptor_synonyms_aud; +DROP TABLE resourcedescriptorpage_aud; +DROP TABLE roterm_aud; +DROP TABLE rsterm_aud; +DROP TABLE secondaryidslotannotation_aud; +DROP TABLE singlereferenceassociation_aud; +DROP TABLE slotannotation_aud; +DROP TABLE slotannotation_informationcontententity_aud; +DROP TABLE soterm_aud; +DROP TABLE species_aud; +DROP TABLE species_commonnames_aud; +DROP TABLE stageterm_aud; +DROP TABLE synonym_aud; +DROP TABLE uberonterm_aud; +DROP TABLE variant_aud; +DROP TABLE variant_note_aud; +DROP TABLE vocabulary_aud; +DROP TABLE vocabularyterm_aud; +DROP TABLE vocabularyterm_synonyms_aud; +DROP TABLE vocabularytermset_aud; +DROP TABLE vocabularytermset_vocabularyterm_aud; +DROP TABLE vtterm_aud; +DROP TABLE wbbtterm_aud; +DROP TABLE wblsterm_aud; +DROP TABLE wbphenotypeterm_aud; +DROP TABLE xbaterm_aud; +DROP TABLE xbedterm_aud; +DROP TABLE xbsterm_aud; +DROP TABLE xcoterm_aud; +DROP TABLE xpoterm_aud; +DROP TABLE xsmoterm_aud; +DROP TABLE zecoterm_aud; +DROP TABLE zfaterm_aud; +DROP TABLE zfsterm_aud; -- Drop indexes and constraints ALTER TABLE affectedgenomicmodel DROP CONSTRAINT fkke1qw7ijaa33fqv1bifsiwiv9; -ALTER TABLE affectedgenomicmodel_aud DROP CONSTRAINT fkd6m9in16kh1tqvln37a13r3hx; ALTER TABLE agmdiseaseannotation DROP CONSTRAINT agmdiseaseannotation_assertedallele_curie_fk; ALTER TABLE agmdiseaseannotation DROP CONSTRAINT fk_agmdasubject; ALTER TABLE agmdiseaseannotation DROP CONSTRAINT fko9dilcfxv6tw0oaeds0yss8op; ALTER TABLE agmdiseaseannotation RENAME CONSTRAINT fkp1rktcpoyvnr2f756ncdb8k24 TO agmdiseaseannotation_id_fk; ALTER TABLE agmdiseaseannotation DROP CONSTRAINT fktj1uj3to13fi4q32bc2p65lah; -ALTER TABLE agmdiseaseannotation_aud RENAME CONSTRAINT fkl6x226295n9ms1kugrsi88efp TO agmdiseaseannotation_aud_id_rev_fk; ALTER TABLE agmdiseaseannotation_gene DROP CONSTRAINT agmdiseaseannotation_gene_assertedgenes_curie_fk; ALTER INDEX idxbcpc5ib23w0ssq0wskm99vxmq RENAME TO agmdiseaseannotation_gene_agmdiseaseannotation_index; -ALTER TABLE agmdiseaseannotation_gene_aud RENAME CONSTRAINT fkrbw9608l4haci5t3w3ll9xmcu TO agmdiseaseannotation_gene_aud_rev_fk; ALTER TABLE allele DROP CONSTRAINT fk42r7586hi59wcwakfyr30l6l3; -ALTER TABLE allele_aud DROP CONSTRAINT fkc4cub43jynmwqke9rpwpglhkt; ALTER TABLE allele_note DROP CONSTRAINT allele_note_allele_curie_fk; ALTER TABLE allele_note DROP CONSTRAINT uk_3ja9wii4jxp0krcfpturumjhb; ALTER TABLE allele_note RENAME CONSTRAINT allele_note_relatednotes_id_key TO allele_note_relatednotes_id_uk; @@ -50,7 +205,6 @@ ALTER TABLE allele_reference DROP CONSTRAINT allele_reference_references_curie_f DROP INDEX idxce99mr9ponwii377kkwpess1l; DROP INDEX idxo6e5hexti6nfdj1v6ytnlwjvd; DROP INDEX idxsfk08sqo0k364ixvsd8iui53i; -ALTER TABLE allele_reference_aud RENAME CONSTRAINT fkhuya942qqdhsi6m0v37njxh30 TO allele_reference_aud_rev_fk; ALTER TABLE alleledatabasestatusslotannotation DROP CONSTRAINT alleledatabasestatus_singleallele_curie_fk; ALTER INDEX alleledatabasestatus_databasestatus_id_index RENAME TO alleledatabasestatus_databasestatus_index; DROP INDEX alleledatabasestatus_singleallele_curie_index; @@ -102,37 +256,22 @@ DROP INDEX allelesymbol_singleallele_curie_index; ALTER TABLE allelesynonymslotannotation DROP CONSTRAINT allelesynonymslotannotation_singleallele_curie_fk; DROP INDEX allelesynonym_singleallele_curie_index; ALTER TABLE anatomicalterm DROP CONSTRAINT fkfepti479fro1b09ybaltkofqu; -ALTER TABLE anatomicalterm_aud DROP CONSTRAINT fkan2c886jcsep01s7rqibfghfh; ALTER INDEX annotation_conditionrelation_annotation_id_index RENAME TO annotation_conditionrelation_annotation_index; ALTER INDEX annotation_conditionrelation_conditionrelations_id_index RENAME TO annotation_conditionrelation_conditionrelations_index; ALTER TABLE annotation_note RENAME CONSTRAINT fks4im5g992bpgi6wa1rp9y8vil TO annotation_note_annotation_id_fk; ALTER INDEX annotation_note_annotation_id_index RENAME TO annotation_note_annotation_index; ALTER INDEX annotation_note_relatednotes_id_index RENAME TO annotation_note_relatednotes_index; ALTER TABLE apoterm DROP CONSTRAINT apoterm_curie_fk; -ALTER TABLE apoterm_aud DROP CONSTRAINT apoterm_aud_curie_rev_fk; ALTER TABLE atpterm DROP CONSTRAINT fksnxpka3rhxycguxrcyfyobtjf; -ALTER TABLE atpterm_aud DROP CONSTRAINT fki65mb9a7b4el107fk4ox2f0kd; ALTER TABLE biologicalentity DROP CONSTRAINT fk5c19vicptarinu2wgj7xyhhum; DROP INDEX biologicalentity_taxon_index; -ALTER TABLE biologicalentity_aud DROP CONSTRAINT fk5hkwd2k49xql5qy0aby85qtad; ALTER TABLE bspoterm DROP CONSTRAINT bspoterm_curie_fk; -ALTER TABLE bspoterm_aud DROP CONSTRAINT bspoterm_aud_curie_rev_fk; -ALTER TABLE bulkload_aud DROP CONSTRAINT fkhhh8994753467hwa33blp22dc; -ALTER TABLE bulkloadfile_aud DROP CONSTRAINT fk7sl5m81qa11sr40chch9vg6uj; -ALTER TABLE bulkloadfileexception_aud DROP CONSTRAINT fkm7op2ir0vi9pwcctl39kqbo70; -ALTER TABLE bulkloadfilehistory_aud DROP CONSTRAINT fkppa5tcqtwv560svqkq6b958hc; -ALTER TABLE bulkloadgroup_aud DROP CONSTRAINT fk722g0iotb8v01pq0cej3w7gke; ALTER TABLE chebiterm DROP CONSTRAINT fk7enwyeblw2xt5yo5co0keko5f; -ALTER TABLE chebiterm_aud DROP CONSTRAINT fk7grscrrhdcw9ek6agi78j4ca1; ALTER TABLE chemicalterm DROP CONSTRAINT fk2fegif3wy9egh5r2yy8wplrwu; -ALTER TABLE chemicalterm_aud DROP CONSTRAINT fkieeg5x1a11dqom8dw4valm169; ALTER TABLE clterm DROP CONSTRAINT clterm_curie_fk; -ALTER TABLE clterm_aud DROP CONSTRAINT clterm_aud_curie_rev_fk; ALTER TABLE cmoterm DROP CONSTRAINT cmoterm_curie_fk; -ALTER TABLE cmoterm_aud DROP CONSTRAINT cmoterm_aud_curie_rev_fk; ALTER TABLE conditionrelation RENAME CONSTRAINT fkn8t4joy3iheftpbxt0omvxl52 TO conditionrelation_conditionrelationtype_id_fk; ALTER TABLE conditionrelation DROP CONSTRAINT conditionrelation_singlereference_curie_fk; -ALTER TABLE conditionrelation_aud DROP CONSTRAINT fkkcw0iu1vmw6ttm7g645947yyy; ALTER TABLE construct_reference DROP CONSTRAINT construct_reference_references_curie_fk; ALTER INDEX construct_reference_construct_id_index RENAME TO construct_reference_construct_index; DROP INDEX construct_reference_references_curie_index; @@ -148,13 +287,7 @@ ALTER INDEX cgeassociation_note_cgeassociation_id_index RENAME TO cgeassociation ALTER INDEX cgeassociation_note_relatednotes_id_index RENAME TO cgeassociation_note_relatednotes_index; ALTER INDEX constructsymbol_singleconstruct_id_index RENAME TO constructsymbol_singleconstruct_index; ALTER INDEX constructsynonym_singleconstruct_id_index RENAME TO constructsynonym_singleconstruct_index; -ALTER TABLE crossreference_aud DROP CONSTRAINT fkricj7nn0u0fec2l2r2fo7al55; -ALTER TABLE curationreport_aud DROP CONSTRAINT fks2fh7j9mb60yfxyd83gklhgmo; -ALTER TABLE curationreportgroup_aud DROP CONSTRAINT fk7pl1pmjstb9eqi80e353a06v8; -ALTER TABLE curationreporthistory_aud DROP CONSTRAINT fk5mffk8y6qajllde8m24dwjn9v; ALTER TABLE daoterm DROP CONSTRAINT fk3xjbjyyuqqyvspspeael1m7fe; -ALTER TABLE daoterm_aud DROP CONSTRAINT fkgif1cep78abowfodb5rxvoq1x; -ALTER TABLE dataprovider_aud DROP CONSTRAINT fk66rd9ltf5l9paxmvyr63tcqwf; ALTER TABLE diseaseannotation DROP CONSTRAINT diseaseannotation_object_curie_fk; DROP INDEX diseaseannotation_object_index; ALTER TABLE diseaseannotation_biologicalentity DROP CONSTRAINT diseaseannotation_biologicalentity_dgm_curie_fk; @@ -173,13 +306,9 @@ ALTER TABLE diseaseannotation_vocabularyterm RENAME CONSTRAINT fkb7dg8qvpicnh87s ALTER INDEX idxbnb14fsatd291upd9af38fnyp RENAME TO diseaseannotation_vocabularyterm_diseasequalifiers_index; ALTER INDEX idxc8oiw5qoippfjl0b6s9oegiss RENAME TO diseaseannotation_vocabularyterm_diseaseannotation_index; ALTER TABLE doterm DROP CONSTRAINT fkp8el2duba9ym3l6gd5dy43swk; -ALTER TABLE doterm_aud DROP CONSTRAINT fkkgu80ih0f55tskr386gucsqh2; ALTER TABLE dpoterm DROP CONSTRAINT dpoterm_curie_fk; -ALTER TABLE dpoterm_aud DROP CONSTRAINT dpoterm_aud_curie_rev_fk; ALTER TABLE ecoterm DROP CONSTRAINT fkskvp24kfp723htxmk0m9ev4ns; -ALTER TABLE ecoterm_aud DROP CONSTRAINT fkrdtwy8r0gnnh6numgdbgi9e6s; ALTER TABLE emapaterm DROP CONSTRAINT fkcm3tpjo7lxsx61pj7gs5y9f9u; -ALTER TABLE emapaterm_aud DROP CONSTRAINT fkaipxoy4lm50q9mphk2yp7whyh; ALTER TABLE evidenceassociation_informationcontententity DROP CONSTRAINT evidenceassociation_infocontent_evidence_curie_fk; ALTER INDEX evidenceassociation_infocontent_evidenceassociation_id_index RENAME TO evidenceassociation_infocontent_evidenceassociation_index; DROP INDEX evidenceassociation_infocontent_evidence_curie_index; @@ -190,13 +319,10 @@ ALTER TABLE experimentalcondition DROP CONSTRAINT fkhi2109btsx06x2u9kdg7y7xp0; ALTER TABLE experimentalcondition DROP CONSTRAINT fkp0oqdnt9bmx68i84neufkcb3a; ALTER TABLE experimentalcondition DROP CONSTRAINT fksso9a3875a8t0ver6u6qciuap; ALTER TABLE experimentalconditionontologyterm DROP CONSTRAINT fk5jlaea2evnqnrlf72jglhqq6p; -ALTER TABLE experimentalconditionontologyterm_aud DROP CONSTRAINT fkkr4o08hq0jboq6g4ou5gmn8xd; ALTER TABLE fbdvterm DROP CONSTRAINT fkn7q3y19l70sef1h4f9ippnjoa; -ALTER TABLE fbdvterm_aud DROP CONSTRAINT fkvtaradvq4e6fdjecf2m4ujap; ALTER TABLE gene DROP CONSTRAINT fk9v4jtwy759c3cfub0uxye5rue; ALTER TABLE gene DROP CONSTRAINT fkiaxg0dhug3stym3gjovw598w1; DROP INDEX gene_taxon_index; -ALTER TABLE gene_aud DROP CONSTRAINT fk4n82maba8vniaxet7w2w1sfg4; ALTER TABLE genediseaseannotation RENAME CONSTRAINT fk3j5deigrhrwln0srh51vtw3m8 TO genediseaseannotation_id_fk; ALTER TABLE genediseaseannotation DROP CONSTRAINT fk51h0w9jsd45qw5f3v2v0o28mu; ALTER TABLE genediseaseannotation DROP CONSTRAINT fk_genedasubject; @@ -220,41 +346,25 @@ ALTER TABLE genetogeneorthologycurated DROP CONSTRAINT genetogeneorthologycurate DROP INDEX genetogeneorthologycurated_evidencecode_index; DROP INDEX genetogeneorthologycurated_singlereference_index; ALTER TABLE genomicentity DROP CONSTRAINT fkhi54si7gksfs3f6jrbytaddbi; -ALTER TABLE genomicentity_aud DROP CONSTRAINT fknd0sic0qo3ko71w4d9k5urg48; ALTER TABLE genomicentity_crossreference DROP CONSTRAINT fk9b9qofiu2sump8fnfxgux1lvl; ALTER INDEX genomicentity_crossreference_crossreferences_id_index RENAME TO genomicentity_crossreference_crossreferences_index; DROP INDEX genomicentity_crossreference_ge_curie_xref_id_index; DROP INDEX genomicentity_crossreference_genomicentity_curie_index; ALTER TABLE goterm DROP CONSTRAINT fk4gf262ba8btx03wi3vl5vhfao; -ALTER TABLE goterm_aud DROP CONSTRAINT fk4kjm9hm06yutma1ilq04h967s; ALTER TABLE hpterm DROP CONSTRAINT hpterm_curie_fk; -ALTER TABLE hpterm_aud DROP CONSTRAINT hpterm_aud_curie_rev_fk; -ALTER TABLE informationcontententity_aud DROP CONSTRAINT informationcontententity_aud_rev_fk; ALTER TABLE materm DROP CONSTRAINT fktlgqvrv4vuh8gqihevh6adya4; -ALTER TABLE materm_aud DROP CONSTRAINT fk7lfprbh8k8mnw9yf8ywp7xieg; ALTER TABLE miterm DROP CONSTRAINT miterm_curie_fk; -ALTER TABLE miterm_aud DROP CONSTRAINT miterm_aud_curie_rev_fk; ALTER TABLE mmoterm DROP CONSTRAINT mmoterm_curie_fk; -ALTER TABLE mmoterm_aud DROP CONSTRAINT mmoterm_aud_curie_rev_fk; ALTER TABLE mmusdvterm DROP CONSTRAINT fkmkv8r93hlnf06oa8xy2usdq9g; -ALTER TABLE mmusdvterm_aud DROP CONSTRAINT fk19prhk8fikp11bpxxm2tqxh6u; ALTER TABLE modterm DROP CONSTRAINT modterm_curie_fk; -ALTER TABLE modterm_aud DROP CONSTRAINT modterm_aud_curie_rev_fk; ALTER TABLE molecule DROP CONSTRAINT fknnf79fdaivbnqu0p9kes1jtd1; -ALTER TABLE molecule_aud DROP CONSTRAINT fkcbo1onn61w7v5ivh1e1h2tcd7; ALTER TABLE mpathterm DROP CONSTRAINT mpathterm_curie_fk; -ALTER TABLE mpathterm_aud DROP CONSTRAINT mpathterm_aud_curie_rev_fk; ALTER TABLE mpterm DROP CONSTRAINT fkorn5mvrebk70b70o3sepp2fwe; -ALTER TABLE mpterm_aud DROP CONSTRAINT fkjw611qjy95wa8gjjthb1uptjy; ALTER TABLE ncbitaxonterm DROP CONSTRAINT fk47k37g37jc1e4wdt76ajmn0xk; -ALTER TABLE ncbitaxonterm_aud DROP CONSTRAINT fkap27v3trsn5u9q93qb8ikabrf; -ALTER TABLE note_aud DROP CONSTRAINT fk1r4uoh4rg9vyahvb8bpd6dfn7; ALTER TABLE note_reference RENAME CONSTRAINT fknr8td9rfl6vd6cstukci0e0qq TO note_reference_note_id_fk; ALTER TABLE note_reference DROP CONSTRAINT note_reference_references_curie_fk; ALTER INDEX idxk4kbcn96bs4gafx883i9sj7my RENAME TO note_reference_note_index; ALTER TABLE obiterm DROP CONSTRAINT obiterm_curie_fk; -ALTER TABLE obiterm_aud DROP CONSTRAINT obiterm_aud_curie_rev_fk; -ALTER TABLE ontologyterm_aud DROP CONSTRAINT fkdxjp2u3w3xoi7p9j7huceg2ts; ALTER TABLE ontologyterm_crossreference DROP CONSTRAINT fk3e1a40poh1ehjk91h42bx7i45; DROP INDEX ontologyterm_crossreference_ontologyterm_curie_index; ALTER INDEX ontologyterm_crossreference_crossreferences_id_index RENAME TO ontologyterm_crossreference_crossreferences_index; @@ -277,200 +387,105 @@ DROP INDEX idxips7lcqafkikxweue2p0h13t9; ALTER TABLE ontologyterm_synonym RENAME CONSTRAINT fk4uyg8s1tkgg3vp1cb8dn3vyvr TO ontologyterm_synonym_synonyms_id_fk; ALTER TABLE ontologyterm_synonym DROP CONSTRAINT fkjf8xunyry3dy9njpqb01tvjsr; DROP INDEX ontologyterm_synonym_ontologyterm_curie_index; -ALTER TABLE organization_aud DROP CONSTRAINT organization_aud_rev_fk; ALTER TABLE patoterm DROP CONSTRAINT patoterm_curie_fk; -ALTER TABLE patoterm_aud DROP CONSTRAINT patoterm_aud_curie_rev_fk; -ALTER TABLE person_aud DROP CONSTRAINT fkqbm2y5o4elhanxeq26reu73yd; -ALTER TABLE personsetting_aud DROP CONSTRAINT fkq0ul02mp3963koe1p6sntqc8e; ALTER TABLE phenotypeterm DROP CONSTRAINT fk4ymq8h2kdhq6ix6sfb4q4fn7a; -ALTER TABLE phenotypeterm_aud DROP CONSTRAINT fksap791c8unrey4xnqcydm8kv1; ALTER TABLE pwterm DROP CONSTRAINT pwterm_curie_fk; -ALTER TABLE pwterm_aud DROP CONSTRAINT pwterm_aud_curie_rev_fk; -ALTER TABLE reagent_aud DROP CONSTRAINT reagent_aud_rev_fk; ALTER INDEX reagent_secondaryidentifiers_reagent_id_index RENAME TO reagent_secondaryidentifiers_reagent_index; ALTER TABLE reference DROP CONSTRAINT fk17o77er2650ydtr1dhtd0y5kn; -ALTER TABLE reference_aud DROP CONSTRAINT fk897g2lxdu1btxkcikigm6j4wo; -ALTER TABLE reference_aud DROP CONSTRAINT reference_aud_curie_rev_fk; ALTER TABLE reference_crossreference DROP CONSTRAINT reference_crossreference_reference_curie_fk; DROP INDEX idx5f73olsmf7f70k9nimewmv2ov; ALTER INDEX reference_crossreference_crossreferences_id_index RENAME TO reference_crossreference_crossreferences_index; DROP INDEX idx8o0l1xsm13k7qe0btnlr0x32j; -ALTER TABLE resourcedescriptor_aud DROP CONSTRAINT resourcedescriptor_aud_rev_fk; -ALTER TABLE resourcedescriptorpage_aud DROP CONSTRAINT resourcedescriptorpage_aud_rev_fk; ALTER TABLE roterm DROP CONSTRAINT fkyqhfu00n2xcrfg2w4iv9wwx8; -ALTER TABLE roterm_aud DROP CONSTRAINT fk8wmlph21s6vviddt2tx63fhqn; ALTER TABLE rsterm DROP CONSTRAINT rsterm_curie_fk; -ALTER TABLE rsterm_aud DROP CONSTRAINT rsterm_aud_curie_rev_fk; ALTER TABLE singlereferenceassociation DROP CONSTRAINT singlereferenceassociation_singlereference_curie_fk; DROP INDEX singlereferenceassociation_singlereference_index; -ALTER TABLE slotannotation_aud DROP CONSTRAINT slotannotation_aud_rev_fk; ALTER TABLE slotannotation_informationcontententity DROP CONSTRAINT slotannotation_informationcontententity_evidence_curie_fk; DROP INDEX slotannotation_informationcontententity_evidence_curie_index; ALTER INDEX slotannotation_informationcontententity_slotannotation_id_index RENAME TO slotannotation_informationcontententity_slotannotation_index; ALTER TABLE soterm DROP CONSTRAINT fkri7tkc9slvpex9v83peovegyt; -ALTER TABLE soterm_aud DROP CONSTRAINT fk5i3iqfnxf9hxjq6jmay2gm68g; ALTER TABLE species DROP CONSTRAINT species_taxon_curie_fk; -ALTER TABLE species_aud DROP CONSTRAINT species_aud_rev_fk; ALTER TABLE stageterm DROP CONSTRAINT fkas58x03rc132q00y838dv1gsb; -ALTER TABLE stageterm_aud DROP CONSTRAINT fkbe4dl5s3i7ga7hqryddog2g0f; -ALTER TABLE synonym_aud DROP CONSTRAINT fk8y4re95uhgku1km6nsauced0b; ALTER TABLE uberonterm DROP CONSTRAINT uberonterm_curie_fk; -ALTER TABLE uberonterm_aud DROP CONSTRAINT uberonterm_aud_curie_rev_fk; ALTER TABLE variant DROP CONSTRAINT variant_curie_fk; ALTER TABLE variant DROP CONSTRAINT variant_sourcegeneralconsequence_curie_fk; ALTER TABLE variant DROP CONSTRAINT variant_varianttype_curie_fk; DROP INDEX variant_sourcegeneralconsequence_index; DROP INDEX variant_varianttype_index; -ALTER TABLE variant_aud DROP CONSTRAINT variant_aud_curie_rev_fk; ALTER TABLE variant_note DROP CONSTRAINT variant_note_variant_curie_fk; DROP INDEX variant_note_variant_curie_index; ALTER INDEX variant_note_relatednotes_id_index RENAME TO variant_note_relatednotes_index; -ALTER TABLE vocabulary_aud DROP CONSTRAINT fk2pe60ji8kxipj6qf3cd6hjda5; -ALTER TABLE vocabularyterm_aud DROP CONSTRAINT fkfg8df1h10nehkt3pw4cebbde8; -ALTER TABLE vocabularytermset_aud DROP CONSTRAINT fkkqfblby0u8l1h2i3fm7h4ynlh; ALTER TABLE vtterm DROP CONSTRAINT vtterm_curie_fk; -ALTER TABLE vtterm_aud DROP CONSTRAINT vtterm_aud_curie_rev_fk; ALTER TABLE wbbtterm DROP CONSTRAINT fkqnxqrnadcxojeti2ienobdqh0; -ALTER TABLE wbbtterm_aud DROP CONSTRAINT fkhu85m34h8hf95s453u3m4ed8y; ALTER TABLE wblsterm DROP CONSTRAINT fk4k9uvngmwim574bm5mu5q4203; -ALTER TABLE wblsterm_aud DROP CONSTRAINT fkbug8ndvvjf8e7e3rpcih06j63; ALTER TABLE wbphenotypeterm DROP CONSTRAINT fkhonuwqm6g91le1xigmik3yrwl; -ALTER TABLE wbphenotypeterm_aud DROP CONSTRAINT fk48fs5fxgn3sfvyyiqpgoquuma; ALTER TABLE xbaterm DROP CONSTRAINT fkcnuymf0pvlgwcfd918o4pgs5n; -ALTER TABLE xbaterm_aud DROP CONSTRAINT fkha6obinkag86qlcpemxmgv4ly; ALTER TABLE xbedterm DROP CONSTRAINT fkc0dct519510hodhd9d7phfq6g; -ALTER TABLE xbedterm_aud DROP CONSTRAINT fkshxj981p427yuk4qgtvcirp5k; ALTER TABLE xbsterm DROP CONSTRAINT fkn8tvxj5qdpjssxjl9jneqst92; -ALTER TABLE xbsterm_aud DROP CONSTRAINT fkij9o8qar117chfev5ghkupl3o; ALTER TABLE xcoterm DROP CONSTRAINT fk35ywtb8qiadqbwsb706ebu81c; -ALTER TABLE xcoterm_aud DROP CONSTRAINT fknlbuiyo3i6daerkmpim317bd3; ALTER TABLE xpoterm DROP CONSTRAINT fkqeoygtsa6sf94gw089ugocoph; -ALTER TABLE xpoterm_aud DROP CONSTRAINT fkbqybirrf1obv6esgeaj8os211; ALTER TABLE xsmoterm DROP CONSTRAINT fk36v85u2ghsukqljkkh1jxmtlx; -ALTER TABLE xsmoterm_aud DROP CONSTRAINT fkjdlhxyvw79i14932dqdb1bx8f; ALTER TABLE zecoterm DROP CONSTRAINT fkqd3f6hcopl67fwai6viq07t88; -ALTER TABLE zecoterm_aud DROP CONSTRAINT fke5wuchgyjhb2orgvht50q2dah; ALTER TABLE zfaterm DROP CONSTRAINT fk572s3xiqi0y4gjblq8xjyk3f7; -ALTER TABLE zfaterm_aud DROP CONSTRAINT fks66s1k4fon0to2kk7qfsm1xon; ALTER TABLE zfsterm DROP CONSTRAINT fknkrcnh3l23ol126v9w61nk079; -ALTER TABLE zfsterm_aud DROP CONSTRAINT fk27dwwh5ekpa60ug4ystuwwn6w; ALTER TABLE affectedgenomicmodel DROP CONSTRAINT affectedgenomicmodel_pkey; -ALTER TABLE affectedgenomicmodel_aud DROP CONSTRAINT affectedgenomicmodel_aud_pkey; ALTER TABLE allele DROP CONSTRAINT allele_pkey; -ALTER TABLE allele_aud DROP CONSTRAINT allele_aud_pkey; -ALTER TABLE allele_note_aud DROP CONSTRAINT allele_note_aud_pkey; -ALTER TABLE allele_reference_aud DROP CONSTRAINT allele_reference_aud_pkey; ALTER TABLE anatomicalterm DROP CONSTRAINT anatomicalterm_pkey; -ALTER TABLE anatomicalterm_aud DROP CONSTRAINT anatomicalterm_aud_pkey; ALTER TABLE apoterm DROP CONSTRAINT apoterm_pkey; -ALTER TABLE apoterm_aud DROP CONSTRAINT apoterm_aud_pkey; ALTER TABLE atpterm DROP CONSTRAINT atpterm_pkey; -ALTER TABLE atpterm_aud DROP CONSTRAINT atpterm_aud_pkey; ALTER TABLE biologicalentity DROP CONSTRAINT biologicalentity_pkey; -ALTER TABLE biologicalentity_aud DROP CONSTRAINT biologicalentity_aud_pkey; ALTER TABLE bspoterm DROP CONSTRAINT bspoterm_pkey; -ALTER TABLE bspoterm_aud DROP CONSTRAINT bspoterm_aud_pkey; ALTER TABLE chebiterm DROP CONSTRAINT chebiterm_pkey; -ALTER TABLE chebiterm_aud DROP CONSTRAINT chebiterm_aud_pkey; ALTER TABLE chemicalterm DROP CONSTRAINT chemicalterm_pkey; -ALTER TABLE chemicalterm_aud DROP CONSTRAINT chemicalterm_aud_pkey; ALTER TABLE clterm DROP CONSTRAINT clterm_pkey; -ALTER TABLE clterm_aud DROP CONSTRAINT clterm_aud_pkey; ALTER TABLE cmoterm DROP CONSTRAINT cmoterm_pkey; -ALTER TABLE cmoterm_aud DROP CONSTRAINT cmoterm_aud_pkey; ALTER TABLE daoterm DROP CONSTRAINT daoterm_pkey; -ALTER TABLE daoterm_aud DROP CONSTRAINT daoterm_aud_pkey; ALTER TABLE doterm DROP CONSTRAINT doterm_pkey; -ALTER TABLE doterm_aud DROP CONSTRAINT doterm_aud_pkey; ALTER TABLE dpoterm DROP CONSTRAINT dpoterm_pkey; -ALTER TABLE dpoterm_aud DROP CONSTRAINT dpoterm_aud_pkey; ALTER TABLE ecoterm DROP CONSTRAINT ecoterm_pkey; -ALTER TABLE ecoterm_aud DROP CONSTRAINT ecoterm_aud_pkey; ALTER TABLE emapaterm DROP CONSTRAINT emapaterm_pkey; -ALTER TABLE emapaterm_aud DROP CONSTRAINT emapaterm_aud_pkey; ALTER TABLE experimentalconditionontologyterm DROP CONSTRAINT experimentalconditionontologyterm_pkey; -ALTER TABLE experimentalconditionontologyterm_aud DROP CONSTRAINT experimentalconditionontologyterm_aud_pkey; ALTER TABLE fbdvterm DROP CONSTRAINT IF EXISTS fbdvterm_pkey; -ALTER TABLE fbdvterm_aud DROP CONSTRAINT fbdvterm_aud_pkey; ALTER TABLE gene DROP CONSTRAINT gene_pkey; -ALTER TABLE gene_aud DROP CONSTRAINT gene_aud_pkey; ALTER TABLE genomicentity DROP CONSTRAINT genomicentity_pkey; -ALTER TABLE genomicentity_aud DROP CONSTRAINT genomicentity_aud_pkey; ALTER TABLE goterm DROP CONSTRAINT goterm_pkey; -ALTER TABLE goterm_aud DROP CONSTRAINT goterm_aud_pkey; ALTER TABLE hpterm DROP CONSTRAINT hpterm_pkey; -ALTER TABLE hpterm_aud DROP CONSTRAINT hpterm_aud_pkey; ALTER TABLE informationcontententity DROP CONSTRAINT informationcontententity_pkey; -ALTER TABLE informationcontententity_aud DROP CONSTRAINT informationcontententity_aud_pkey; ALTER TABLE materm DROP CONSTRAINT materm_pkey; -ALTER TABLE materm_aud DROP CONSTRAINT materm_aud_pkey; ALTER TABLE miterm DROP CONSTRAINT miterm_pkey; -ALTER TABLE miterm_aud DROP CONSTRAINT miterm_aud_pkey; ALTER TABLE mmoterm DROP CONSTRAINT mmoterm_pkey; -ALTER TABLE mmoterm_aud DROP CONSTRAINT mmoterm_aud_pkey; ALTER TABLE mmusdvterm DROP CONSTRAINT IF EXISTS mmusdvterm_pkey; -ALTER TABLE mmusdvterm_aud DROP CONSTRAINT mmusdvterm_aud_pkey; ALTER TABLE modterm DROP CONSTRAINT modterm_pkey; -ALTER TABLE modterm_aud DROP CONSTRAINT modterm_aud_pkey; ALTER TABLE molecule DROP CONSTRAINT molecule_pkey; -ALTER TABLE molecule_aud DROP CONSTRAINT molecule_aud_pkey; ALTER TABLE mpathterm DROP CONSTRAINT mpathterm_pkey; -ALTER TABLE mpathterm_aud DROP CONSTRAINT mpathterm_aud_pkey; ALTER TABLE mpterm DROP CONSTRAINT mpterm_pkey; -ALTER TABLE mpterm_aud DROP CONSTRAINT mpterm_aud_pkey; ALTER TABLE ncbitaxonterm DROP CONSTRAINT ncbitaxonterm_pkey; -ALTER TABLE ncbitaxonterm_aud DROP CONSTRAINT ncbitaxonterm_aud_pkey; ALTER TABLE obiterm DROP CONSTRAINT obiterm_pkey; -ALTER TABLE obiterm_aud DROP CONSTRAINT obiterm_aud_pkey; ALTER TABLE ontologyterm DROP CONSTRAINT ontologyterm_pkey; -ALTER TABLE ontologyterm_aud DROP CONSTRAINT ontologyterm_aud_pkey; ALTER TABLE patoterm DROP CONSTRAINT patoterm_pkey; -ALTER TABLE patoterm_aud DROP CONSTRAINT patoterm_aud_pkey; ALTER TABLE phenotypeterm DROP CONSTRAINT phenotypeterm_pkey; -ALTER TABLE phenotypeterm_aud DROP CONSTRAINT phenotypeterm_aud_pkey; ALTER TABLE pwterm DROP CONSTRAINT pwterm_pkey; -ALTER TABLE pwterm_aud DROP CONSTRAINT pwterm_aud_pkey; ALTER TABLE reference DROP CONSTRAINT reference_pkey; -ALTER TABLE reference_aud DROP CONSTRAINT reference_aud_pkey; ALTER TABLE roterm DROP CONSTRAINT roterm_pkey; -ALTER TABLE roterm_aud DROP CONSTRAINT roterm_aud_pkey; ALTER TABLE rsterm DROP CONSTRAINT rsterm_pkey; -ALTER TABLE rsterm_aud DROP CONSTRAINT rsterm_aud_pkey; ALTER TABLE soterm DROP CONSTRAINT soterm_pkey; -ALTER TABLE soterm_aud DROP CONSTRAINT soterm_aud_pkey; ALTER TABLE stageterm DROP CONSTRAINT stageterm_pkey; -ALTER TABLE stageterm_aud DROP CONSTRAINT stageterm_aud_pkey; ALTER TABLE uberonterm DROP CONSTRAINT uberonterm_pkey; -ALTER TABLE uberonterm_aud DROP CONSTRAINT uberonterm_aud_pkey; ALTER TABLE variant DROP CONSTRAINT variant_pkey; -ALTER TABLE variant_aud DROP CONSTRAINT variant_aud_pkey; ALTER TABLE vtterm DROP CONSTRAINT vtterm_pkey; -ALTER TABLE vtterm_aud DROP CONSTRAINT vtterm_aud_pkey; ALTER TABLE wbbtterm DROP CONSTRAINT wbbtterm_pkey; -ALTER TABLE wbbtterm_aud DROP CONSTRAINT IF EXISTS wbbtterm_aud_pkey; ALTER TABLE wblsterm DROP CONSTRAINT wblsterm_pkey; -ALTER TABLE wblsterm_aud DROP CONSTRAINT IF EXISTS wblsterm_aud_pkey; ALTER TABLE wbphenotypeterm DROP CONSTRAINT wbphenotypeterm_pkey; -ALTER TABLE wbphenotypeterm_aud DROP CONSTRAINT wbphenotypeterm_aud_pkey; ALTER TABLE xbaterm DROP CONSTRAINT xbaterm_pkey; -ALTER TABLE xbaterm_aud DROP CONSTRAINT IF EXISTS xbaterm_aud_pkey; ALTER TABLE xbedterm DROP CONSTRAINT xbedterm_pkey; -ALTER TABLE xbedterm_aud DROP CONSTRAINT IF EXISTS xbedterm_aud_pkey; ALTER TABLE xbsterm DROP CONSTRAINT xbsterm_pkey; -ALTER TABLE xbsterm_aud DROP CONSTRAINT IF EXISTS xbsterm_aud_pkey; ALTER TABLE xcoterm DROP CONSTRAINT xcoterm_pkey; -ALTER TABLE xcoterm_aud DROP CONSTRAINT IF EXISTS xcoterm_aud_pkey; ALTER TABLE xpoterm DROP CONSTRAINT xpoterm_pkey; -ALTER TABLE xpoterm_aud DROP CONSTRAINT IF EXISTS xpoterm_aud_pkey; ALTER TABLE xsmoterm DROP CONSTRAINT xsmoterm_pkey; -ALTER TABLE xsmoterm_aud DROP CONSTRAINT IF EXISTS xsmoterm_aud_pkey; ALTER TABLE zecoterm DROP CONSTRAINT zecoterm_pkey; -ALTER TABLE zecoterm_aud DROP CONSTRAINT IF EXISTS zecoterm_aud_pkey; ALTER TABLE zfaterm DROP CONSTRAINT zfaterm_pkey; -ALTER TABLE zfaterm_aud DROP CONSTRAINT IF EXISTS zfaterm_aud_pkey; ALTER TABLE zfsterm DROP CONSTRAINT zfsterm_pkey; -ALTER TABLE zfsterm_aud DROP CONSTRAINT IF EXISTS zfsterm_aud_pkey; -- Create tables @@ -488,33 +503,11 @@ CREATE TABLE auditedobject ( internal boolean NOT NULL DEFAULT false, obsolete boolean NOT NULL DEFAULT false ); - -CREATE TABLE auditedobject_aud ( - id bigint NOT NULL, - createdby_id bigint, - updatedby_id bigint, - datecreated timestamp without time zone, - dateupdated timestamp without time zone, - dbdatecreated timestamp without time zone, - dbdateupdated timestamp without time zone, - internal boolean, - obsolete boolean, - rev integer NOT NULL, - revtype smallint, - PRIMARY KEY (id, rev) - ); CREATE TABLE curieobject ( id bigint PRIMARY KEY, curie varchar(255) ); - -CREATE TABLE curieobject_aud ( - id bigint NOT NULL, - curie varchar(255), - rev integer NOT NULL, - PRIMARY KEY (id, rev) - ); CREATE TABLE submittedobject ( id bigint PRIMARY KEY, @@ -522,15 +515,6 @@ CREATE TABLE submittedobject ( modinternalid varchar(255), dataprovider_id bigint ); - -CREATE TABLE submittedobject_aud ( - id bigint NOT NULL, - modentityid varchar(255), - modinternalid varchar(255), - dataprovider_id bigint, - rev integer NOT NULL, - PRIMARY KEY (id, rev) - ); CREATE SEQUENCE auditedobject_seq START WITH 200250000 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; @@ -695,137 +679,6 @@ ALTER TABLE zecoterm ADD COLUMN id bigint; ALTER TABLE zfaterm ADD COLUMN id bigint; ALTER TABLE zfsterm ADD COLUMN id bigint; -ALTER TABLE affectedgenomicmodel_aud ADD COLUMN id bigint; -ALTER TABLE agmdiseaseannotation_aud ADD COLUMN inferredallele_id bigint; -ALTER TABLE agmdiseaseannotation_aud ADD COLUMN inferredgene_id bigint; -ALTER TABLE agmdiseaseannotation_aud ADD COLUMN assertedallele_id bigint; -ALTER TABLE agmdiseaseannotation_aud ADD COLUMN subject_id bigint; -ALTER TABLE agmdiseaseannotation_gene_aud ADD COLUMN assertedgenes_id bigint; -ALTER TABLE allele_aud ADD COLUMN id bigint; -ALTER TABLE allele_note_aud ADD COLUMN allele_id bigint; -ALTER TABLE allele_reference_aud ADD COLUMN allele_id bigint; -ALTER TABLE allele_reference_aud ADD COLUMN references_id bigint; -ALTER TABLE alleledatabasestatusslotannotation_aud ADD COLUMN singleallele_id bigint; -ALTER TABLE allelediseaseannotation_aud ADD COLUMN inferredgene_id bigint; -ALTER TABLE allelediseaseannotation_aud ADD COLUMN subject_id bigint; -ALTER TABLE allelediseaseannotation_gene_aud ADD COLUMN assertedgenes_id bigint; -ALTER TABLE allelefullnameslotannotation_aud ADD COLUMN singleallele_id bigint; -ALTER TABLE allelefunctionalimpactslotannotation_aud ADD COLUMN singleallele_id bigint; -ALTER TABLE allelefunctionalimpactslotannotation_aud ADD COLUMN phenotypeterm_id bigint; -ALTER TABLE allelegeneassociation_aud ADD COLUMN subject_id bigint; -ALTER TABLE allelegeneassociation_aud ADD COLUMN object_id bigint; -ALTER TABLE allelegenomicentityassociation_aud ADD COLUMN evidencecode_id bigint; -ALTER TABLE allelegermlinetransmissionstatusslotannotation_aud ADD COLUMN singleallele_id bigint; -ALTER TABLE alleleinheritancemodeslotannotation_aud ADD COLUMN singleallele_id bigint; -ALTER TABLE alleleinheritancemodeslotannotation_aud ADD COLUMN phenotypeterm_id bigint; -ALTER TABLE allelemutationtypeslotannotation_aud ADD COLUMN singleallele_id bigint; -ALTER TABLE allelemutationtypeslotannotation_soterm_aud ADD COLUMN mutationtypes_id bigint; -ALTER TABLE allelenomenclatureeventslotannotation_aud ADD COLUMN singleallele_id bigint; -ALTER TABLE allelesecondaryidslotannotation_aud ADD COLUMN singleallele_id bigint; -ALTER TABLE allelesymbolslotannotation_aud ADD COLUMN singleallele_id bigint; -ALTER TABLE allelesynonymslotannotation_aud ADD COLUMN singleallele_id bigint; -ALTER TABLE anatomicalterm_aud ADD COLUMN id bigint; -ALTER TABLE apoterm_aud ADD COLUMN id bigint; -ALTER TABLE atpterm_aud ADD COLUMN id bigint; -ALTER TABLE biologicalentity_aud ADD COLUMN id bigint; -ALTER TABLE biologicalentity_aud ADD COLUMN taxon_id bigint; -ALTER TABLE bspoterm_aud ADD COLUMN id bigint; -ALTER TABLE chebiterm_aud ADD COLUMN id bigint; -ALTER TABLE chemicalterm_aud ADD COLUMN id bigint; -ALTER TABLE clterm_aud ADD COLUMN id bigint; -ALTER TABLE cmoterm_aud ADD COLUMN id bigint; -ALTER TABLE conditionrelation_aud ADD COLUMN singlereference_id bigint; -ALTER TABLE construct_reference_aud ADD COLUMN references_id bigint; -ALTER TABLE constructcomponentslotannotation_aud ADD COLUMN taxon_id bigint; -ALTER TABLE constructgenomicentityassociation_aud ADD COLUMN object_id bigint; -ALTER TABLE daoterm_aud ADD COLUMN id bigint; -ALTER TABLE diseaseannotation_aud ADD COLUMN object_id bigint; -ALTER TABLE diseaseannotation_biologicalentity_aud ADD COLUMN diseasegeneticmodifiers_id bigint; -ALTER TABLE diseaseannotation_ecoterm_aud ADD COLUMN evidencecodes_id bigint; -ALTER TABLE diseaseannotation_gene_aud ADD COLUMN with_id bigint; -ALTER TABLE doterm_aud ADD COLUMN id bigint; -ALTER TABLE dpoterm_aud ADD COLUMN id bigint; -ALTER TABLE ecoterm_aud ADD COLUMN id bigint; -ALTER TABLE emapaterm_aud ADD COLUMN id bigint; -ALTER TABLE evidenceassociation_informationcontententity_aud ADD COLUMN evidence_id bigint; -ALTER TABLE experimentalcondition_aud ADD COLUMN conditionanatomy_id bigint; -ALTER TABLE experimentalcondition_aud ADD COLUMN conditionchemical_id bigint; -ALTER TABLE experimentalcondition_aud ADD COLUMN conditionclass_id bigint; -ALTER TABLE experimentalcondition_aud ADD COLUMN conditiongeneontology_id bigint; -ALTER TABLE experimentalcondition_aud ADD COLUMN conditionid_id bigint; -ALTER TABLE experimentalcondition_aud ADD COLUMN conditiontaxon_id bigint; -ALTER TABLE experimentalconditionontologyterm_aud ADD COLUMN id bigint; -ALTER TABLE fbdvterm_aud ADD COLUMN id bigint; -ALTER TABLE gene_aud ADD COLUMN id bigint; -ALTER TABLE gene_aud ADD COLUMN genetype_id bigint; -ALTER TABLE genediseaseannotation_aud ADD COLUMN sgdstrainbackground_id bigint; -ALTER TABLE genediseaseannotation_aud ADD COLUMN subject_id bigint; -ALTER TABLE genefullnameslotannotation_aud ADD COLUMN singlegene_id bigint; -ALTER TABLE genesecondaryidslotannotation_aud ADD COLUMN singlegene_id bigint; -ALTER TABLE genesymbolslotannotation_aud ADD COLUMN singlegene_id bigint; -ALTER TABLE genesynonymslotannotation_aud ADD COLUMN singlegene_id bigint; -ALTER TABLE genesystematicnameslotannotation_aud ADD COLUMN singlegene_id bigint; -ALTER TABLE genetogeneorthology_aud ADD COLUMN subjectgene_id bigint; -ALTER TABLE genetogeneorthology_aud ADD COLUMN objectgene_id bigint; -ALTER TABLE genetogeneorthologycurated_aud ADD COLUMN singlereference_id bigint; -ALTER TABLE genetogeneorthologycurated_aud ADD COLUMN evidencecode_id bigint; -ALTER TABLE genomicentity_aud ADD COLUMN id bigint; -ALTER TABLE genomicentity_crossreference_aud ADD COLUMN genomicentity_id bigint; -ALTER TABLE goterm_aud ADD COLUMN id bigint; -ALTER TABLE hpterm_aud ADD COLUMN id bigint; -ALTER TABLE informationcontententity_aud ADD COLUMN id bigint; -ALTER TABLE materm_aud ADD COLUMN id bigint; -ALTER TABLE miterm_aud ADD COLUMN id bigint; -ALTER TABLE mmoterm_aud ADD COLUMN id bigint; -ALTER TABLE mmusdvterm_aud ADD COLUMN id bigint; -ALTER TABLE modterm_aud ADD COLUMN id bigint; -ALTER TABLE molecule_aud ADD COLUMN id bigint; -ALTER TABLE mpathterm_aud ADD COLUMN id bigint; -ALTER TABLE mpterm_aud ADD COLUMN id bigint; -ALTER TABLE ncbitaxonterm_aud ADD COLUMN id bigint; -ALTER TABLE note_reference_aud ADD COLUMN references_id bigint; -ALTER TABLE obiterm_aud ADD COLUMN id bigint; -ALTER TABLE ontologyterm_aud ADD COLUMN id bigint; -ALTER TABLE ontologyterm_crossreference_aud ADD COLUMN ontologyterm_id bigint; -ALTER TABLE ontologyterm_definitionurls_aud ADD COLUMN ontologyterm_id bigint; -ALTER TABLE ontologyterm_isa_ancestor_descendant_aud ADD COLUMN isadescendants_id bigint; -ALTER TABLE ontologyterm_isa_ancestor_descendant_aud ADD COLUMN isaancestors_id bigint; -ALTER TABLE ontologyterm_isa_parent_children_aud ADD COLUMN isachildren_id bigint; -ALTER TABLE ontologyterm_isa_parent_children_aud ADD COLUMN isaparents_id bigint; -ALTER TABLE ontologyterm_secondaryidentifiers_aud ADD COLUMN ontologyterm_id bigint; -ALTER TABLE ontologyterm_subsets_aud ADD COLUMN ontologyterm_id bigint; -ALTER TABLE ontologyterm_synonym_aud ADD COLUMN ontologyterm_id bigint; -ALTER TABLE patoterm_aud ADD COLUMN id bigint; -ALTER TABLE phenotypeterm_aud ADD COLUMN id bigint; -ALTER TABLE pwterm_aud ADD COLUMN id bigint; -ALTER TABLE reference_aud ADD COLUMN id bigint; -ALTER TABLE reference_crossreference_aud ADD COLUMN reference_id bigint; -ALTER TABLE roterm_aud ADD COLUMN id bigint; -ALTER TABLE rsterm_aud ADD COLUMN id bigint; -ALTER TABLE singlereferenceassociation_aud ADD COLUMN singlereference_id bigint; -ALTER TABLE slotannotation_informationcontententity_aud ADD COLUMN evidence_id bigint; -ALTER TABLE soterm_aud ADD COLUMN id bigint; -ALTER TABLE species_aud ADD COLUMN taxon_id bigint; -ALTER TABLE stageterm_aud ADD COLUMN id bigint; -ALTER TABLE uberonterm_aud ADD COLUMN id bigint; -ALTER TABLE variant_aud ADD COLUMN id bigint; -ALTER TABLE variant_aud ADD COLUMN varianttype_id bigint; -ALTER TABLE variant_aud ADD COLUMN sourcegeneralconsequence_id bigint; -ALTER TABLE variant_note_aud ADD COLUMN variant_id bigint; -ALTER TABLE vtterm_aud ADD COLUMN id bigint; -ALTER TABLE wbbtterm_aud ADD COLUMN id bigint; -ALTER TABLE wblsterm_aud ADD COLUMN id bigint; -ALTER TABLE wbphenotypeterm_aud ADD COLUMN id bigint; -ALTER TABLE xbaterm_aud ADD COLUMN id bigint; -ALTER TABLE xbedterm_aud ADD COLUMN id bigint; -ALTER TABLE xbsterm_aud ADD COLUMN id bigint; -ALTER TABLE xcoterm_aud ADD COLUMN id bigint; -ALTER TABLE xpoterm_aud ADD COLUMN id bigint; -ALTER TABLE xsmoterm_aud ADD COLUMN id bigint; -ALTER TABLE zecoterm_aud ADD COLUMN id bigint; -ALTER TABLE zfaterm_aud ADD COLUMN id bigint; -ALTER TABLE zfsterm_aud ADD COLUMN id bigint; - -- Move data around SET session_replication_role = 'replica'; @@ -1584,620 +1437,10 @@ ALTER TABLE zecoterm DROP COLUMN curie; ALTER TABLE zfaterm DROP COLUMN curie; ALTER TABLE zfsterm DROP COLUMN curie; -UPDATE affectedgenomicmodel_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; -DELETE FROM affectedgenomicmodel_aud WHERE id IS NULL; -UPDATE affectedgenomicmodel_aud t SET subtype_id = a.id FROM auditedobject a WHERE t.subtype_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE agmdiseaseannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -DELETE FROM agmdiseaseannotation_aud WHERE id < 200250000; -UPDATE agmdiseaseannotation_aud t SET inferredallele_id = a.id FROM auditedobject a WHERE t.inferredallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE agmdiseaseannotation_aud t SET assertedallele_id = a.id FROM auditedobject a WHERE t.assertedallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE agmdiseaseannotation_aud t SET inferredgene_id = a.id FROM auditedobject a WHERE t.inferredgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE agmdiseaseannotation_aud t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE agmdiseaseannotation_gene_aud t SET agmdiseaseannotation_id = a.id FROM auditedobject a WHERE t.agmdiseaseannotation_id = a.old_id AND a.tablename = 'association'; -UPDATE agmdiseaseannotation_gene_aud t SET assertedgenes_id = a.id FROM auditedobject a WHERE t.assertedgenes_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allele_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; -DELETE FROM allele_aud WHERE id IS NULL; -UPDATE allele_aud t SET incollection_id = a.id FROM auditedobject a WHERE t.incollection_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE allele_note_aud t SET allele_id = a.id FROM auditedobject a WHERE t.allele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -DELETE FROM allele_note_aud WHERE allele_id IS NULL; -UPDATE allele_note_aud t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; -UPDATE allele_reference_aud t SET allele_id = a.id FROM auditedobject a WHERE t.allele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -DELETE FROM allele_reference_aud WHERE allele_id IS NULL; -UPDATE allele_reference_aud t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE alleledatabasestatusslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM alleledatabasestatusslotannotation_aud WHERE id < 200250000; -UPDATE alleledatabasestatusslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE alleledatabasestatusslotannotation_aud t SET databasestatus_id = a.id FROM auditedobject a WHERE t.databasestatus_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE allelediseaseannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -DELETE FROM allelediseaseannotation_aud WHERE id < 200250000; -UPDATE allelediseaseannotation_aud t SET inferredgene_id = a.id FROM auditedobject a WHERE t.inferredgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelediseaseannotation_aud t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelediseaseannotation_gene_aud t SET allelediseaseannotation_id = a.id FROM auditedobject a WHERE t.allelediseaseannotation_id = a.old_id AND a.tablename = 'association'; -UPDATE allelediseaseannotation_gene_aud t SET assertedgenes_id = a.id FROM auditedobject a WHERE t.assertedgenes_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelefullnameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM allelefullnameslotannotation_aud WHERE id < 200250000; -UPDATE allelefullnameslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelefunctionalimpactslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM allelefunctionalimpactslotannotation_aud WHERE id < 200250000; -UPDATE allelefunctionalimpactslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelefunctionalimpactslotannotation_aud t SET phenotypeterm_id = a.id FROM auditedobject a WHERE t.phenotypeterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE allelefunctionalimpactslotannotation_vocabularyterm_aud t SET allelefunctionalimpactslotannotation_id = a.id FROM auditedobject a WHERE t.allelefunctionalimpactslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE allelefunctionalimpactslotannotation_vocabularyterm_aud t SET functionalimpacts_id = a.id FROM auditedobject a WHERE t.functionalimpacts_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE allelegeneassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -DELETE FROM allelegeneassociation_aud WHERE id < 200250000; -UPDATE allelegeneassociation_aud t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelegeneassociation_aud t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelegenomicentityassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -DELETE FROM allelegenomicentityassociation_aud WHERE id < 200250000; -UPDATE allelegenomicentityassociation_aud t SET evidencecode_id = a.id FROM auditedobject a WHERE t.evidencecode_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE allelegenomicentityassociation_aud t SET relatednote_id = a.id FROM auditedobject a WHERE t.relatednote_id = a.old_id AND a.tablename = 'note'; -UPDATE allelegenomicentityassociation_aud t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE allelegermlinetransmissionstatusslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM allelegermlinetransmissionstatusslotannotation_aud WHERE id < 200250000; -UPDATE allelegermlinetransmissionstatusslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelegermlinetransmissionstatusslotannotation_aud t SET germlinetransmissionstatus_id = a.id FROM auditedobject a WHERE t.germlinetransmissionstatus_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE alleleinheritancemodeslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM alleleinheritancemodeslotannotation_aud WHERE id < 200250000; -UPDATE alleleinheritancemodeslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE alleleinheritancemodeslotannotation_aud t SET inheritancemode_id = a.id FROM auditedobject a WHERE t.inheritancemode_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE alleleinheritancemodeslotannotation_aud t SET phenotypeterm_id = a.id FROM auditedobject a WHERE t.phenotypeterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE allelemutationtypeslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM allelemutationtypeslotannotation_aud WHERE id < 200250000; -UPDATE allelemutationtypeslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelemutationtypeslotannotation_soterm_aud t SET allelemutationtypeslotannotation_id = a.id FROM auditedobject a WHERE t.allelemutationtypeslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE allelemutationtypeslotannotation_soterm_aud t SET mutationtypes_id = a.id FROM auditedobject a WHERE t.mutationtypes_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE allelenomenclatureeventslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM allelenomenclatureeventslotannotation_aud WHERE id < 200250000; -UPDATE allelenomenclatureeventslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelenomenclatureeventslotannotation_aud t SET nomenclatureevent_id = a.id FROM auditedobject a WHERE t.nomenclatureevent_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE allelesecondaryidslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM allelesecondaryidslotannotation_aud WHERE id < 200250000; -UPDATE allelesecondaryidslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelesymbolslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM allelesymbolslotannotation_aud WHERE id < 200250000; -UPDATE allelesymbolslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelesynonymslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM allelesynonymslotannotation_aud WHERE id < 200250000; -UPDATE allelesynonymslotannotation_aud t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE alliancemember_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'organization'; -DELETE FROM alliancemember_aud WHERE id < 200250000; -UPDATE anatomicalterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM anatomicalterm_aud WHERE id IS NULL; -UPDATE annotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -DELETE FROM annotation_aud WHERE id < 200250000; -UPDATE annotation_aud t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; -UPDATE annotation_conditionrelation_aud t SET annotation_id = a.id FROM auditedobject a WHERE t.annotation_id = a.old_id AND a.tablename = 'association'; -UPDATE annotation_conditionrelation_aud t SET conditionrelations_id = a.id FROM auditedobject a WHERE t.conditionrelations_id = a.old_id AND a.tablename = 'conditionrelation'; -UPDATE annotation_note_aud t SET annotation_id = a.id FROM auditedobject a WHERE t.annotation_id = a.old_id AND a.tablename = 'association'; -UPDATE annotation_note_aud t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; -UPDATE apoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM apoterm_aud WHERE id IS NULL; -UPDATE association_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -DELETE FROM association_aud WHERE id < 200250000; -UPDATE atpterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM atpterm_aud WHERE id IS NULL; -UPDATE biologicalentity_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; -DELETE FROM biologicalentity_aud WHERE id IS NULL; -UPDATE biologicalentity_aud t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE biologicalentity_aud t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; -UPDATE bspoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM bspoterm_aud WHERE id IS NULL; -UPDATE bulkfmsload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; -DELETE FROM bulkfmsload_aud WHERE id < 200250000; -UPDATE bulkload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; -DELETE FROM bulkload_aud WHERE id < 200250000; -UPDATE bulkload_aud t SET group_id = a.id FROM auditedobject a WHERE t.group_id = a.old_id AND a.tablename = 'bulkloadgroup'; -UPDATE bulkloadfile_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfile'; -DELETE FROM bulkloadfile_aud WHERE id < 200250000; -UPDATE bulkloadfile_aud t SET bulkload_id = a.id FROM auditedobject a WHERE t.bulkload_id = a.old_id AND a.tablename = 'bulkload'; -UPDATE bulkloadfileexception_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfileexception'; -DELETE FROM bulkloadfileexception_aud WHERE id < 200250000; -UPDATE bulkloadfileexception_aud t SET bulkloadfilehistory_id = a.id FROM auditedobject a WHERE t.bulkloadfilehistory_id = a.old_id AND a.tablename = 'bulkloadfilehistory'; -UPDATE bulkloadfilehistory_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfilehistory'; -DELETE FROM bulkloadfilehistory_aud WHERE id < 200250000; -UPDATE bulkloadfilehistory_aud t SET bulkloadfile_id = a.id FROM auditedobject a WHERE t.bulkloadfile_id = a.old_id AND a.tablename = 'bulkloadfile'; -UPDATE bulkloadgroup_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadgroup'; -DELETE FROM bulkloadgroup_aud WHERE id < 200250000; -UPDATE bulkmanualload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; -DELETE FROM bulkmanualload_aud WHERE id < 200250000; -UPDATE bulkscheduledload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; -DELETE FROM bulkscheduledload_aud WHERE id < 200250000; -UPDATE bulkurlload_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; -DELETE FROM bulkurlload_aud WHERE id < 200250000; -UPDATE chebiterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM chebiterm_aud WHERE id IS NULL; -UPDATE chemicalterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM chemicalterm_aud WHERE id IS NULL; -UPDATE clterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM clterm_aud WHERE id IS NULL; -UPDATE cmoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM cmoterm_aud WHERE id IS NULL; -UPDATE conditionrelation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'conditionrelation'; -DELETE FROM conditionrelation_aud WHERE id < 200250000; -UPDATE conditionrelation_aud t SET conditionrelationtype_id = a.id FROM auditedobject a WHERE t.conditionrelationtype_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE conditionrelation_aud t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE conditionrelation_experimentalcondition_aud t SET conditionrelation_id = a.id FROM auditedobject a WHERE t.conditionrelation_id = a.old_id AND a.tablename = 'conditionrelation'; -UPDATE conditionrelation_experimentalcondition_aud t SET conditions_id = a.id FROM auditedobject a WHERE t.conditions_id = a.old_id AND a.tablename = 'experimentalcondition'; -UPDATE construct_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'reagent'; -DELETE FROM construct_aud WHERE id < 200250000; -UPDATE construct_reference_aud t SET construct_id = a.id FROM auditedobject a WHERE t.construct_id = a.old_id AND a.tablename = 'reagent'; -UPDATE construct_reference_aud t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE constructcomponentslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM constructcomponentslotannotation_aud WHERE id < 200250000; -UPDATE constructcomponentslotannotation_aud t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; -UPDATE constructcomponentslotannotation_aud t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE constructcomponentslotannotation_aud t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE constructcomponentslotannotation_note_aud t SET constructcomponentslotannotation_id = a.id FROM auditedobject a WHERE t.constructcomponentslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE constructcomponentslotannotation_note_aud t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; -UPDATE constructfullnameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM constructfullnameslotannotation_aud WHERE id < 200250000; -UPDATE constructfullnameslotannotation_aud t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; -UPDATE constructgenomicentityassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -DELETE FROM constructgenomicentityassociation_aud WHERE id < 200250000; -UPDATE constructgenomicentityassociation_aud t SET subject_id = a.id FROM auditedobject a WHERE t.subject_id = a.old_id AND a.tablename = 'reagent'; -UPDATE constructgenomicentityassociation_aud t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE constructgenomicentityassociation_aud t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE constructgenomicentityassociation_note_aud t SET constructgenomicentityassociation_id = a.id FROM auditedobject a WHERE t.constructgenomicentityassociation_id = a.old_id AND a.tablename = 'association'; -UPDATE constructgenomicentityassociation_note_aud t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; -UPDATE constructsymbolslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM constructsymbolslotannotation_aud WHERE id < 200250000; -UPDATE constructsymbolslotannotation_aud t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; -UPDATE constructsynonymslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM constructsynonymslotannotation_aud WHERE id < 200250000; -UPDATE constructsynonymslotannotation_aud t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; -UPDATE crossreference_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'crossreference'; -DELETE FROM crossreference_aud WHERE id < 200250000; -UPDATE crossreference_aud t SET resourcedescriptorpage_id = a.id FROM auditedobject a WHERE t.resourcedescriptorpage_id = a.old_id AND a.tablename = 'resourcedescriptorpage'; -UPDATE daoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM daoterm_aud WHERE id IS NULL; -UPDATE dataprovider_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'dataprovider'; -DELETE FROM dataprovider_aud WHERE id < 200250000; -UPDATE dataprovider_aud t SET sourceorganization_id = a.id FROM auditedobject a WHERE t.sourceorganization_id = a.old_id AND a.tablename = 'organization'; -UPDATE dataprovider_aud t SET crossreference_id = a.id FROM auditedobject a WHERE t.crossreference_id = a.old_id AND a.tablename = 'crossreference'; -UPDATE diseaseannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -DELETE FROM diseaseannotation_aud WHERE id < 200250000; -UPDATE diseaseannotation_aud t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE diseaseannotation_aud t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE diseaseannotation_aud t SET diseasegeneticmodifierrelation_id = a.id FROM auditedobject a WHERE t.diseasegeneticmodifierrelation_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE diseaseannotation_aud t SET annotationtype_id = a.id FROM auditedobject a WHERE t.annotationtype_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE diseaseannotation_aud t SET geneticsex_id = a.id FROM auditedobject a WHERE t.geneticsex_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE diseaseannotation_aud t SET secondarydataprovider_id = a.id FROM auditedobject a WHERE t.secondarydataprovider_id = a.old_id AND a.tablename = 'dataprovider'; -UPDATE diseaseannotation_biologicalentity_aud t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; -UPDATE diseaseannotation_biologicalentity_aud t SET diseasegeneticmodifiers_id = a.id FROM auditedobject a WHERE t.diseasegeneticmodifiers_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE diseaseannotation_ecoterm_aud t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; -UPDATE diseaseannotation_ecoterm_aud t SET evidencecodes_id = a.id FROM auditedobject a WHERE t.evidencecodes_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE diseaseannotation_gene_aud t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; -UPDATE diseaseannotation_gene_aud t SET with_id = a.id FROM auditedobject a WHERE t.with_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE diseaseannotation_vocabularyterm_aud t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; -UPDATE diseaseannotation_vocabularyterm_aud t SET diseasequalifiers_id = a.id FROM auditedobject a WHERE t.diseasequalifiers_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE doterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM doterm_aud WHERE id IS NULL; -UPDATE dpoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM dpoterm_aud WHERE id IS NULL; -UPDATE ecoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM ecoterm_aud WHERE id IS NULL; -UPDATE emapaterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM emapaterm_aud WHERE id IS NULL; -UPDATE evidenceassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -DELETE FROM evidenceassociation_aud WHERE id < 200250000; -UPDATE evidenceassociation_informationcontententity_aud t SET evidenceassociation_id = a.id FROM auditedobject a WHERE t.evidenceassociation_id = a.old_id AND a.tablename = 'association'; -UPDATE evidenceassociation_informationcontententity_aud t SET evidence_id = a.id FROM auditedobject a WHERE t.evidence_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE experimentalcondition_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'experimentalcondition'; -DELETE FROM experimentalcondition_aud WHERE id < 200250000; -UPDATE experimentalcondition_aud t SET conditionanatomy_id = a.id FROM auditedobject a WHERE t.conditionanatomy_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE experimentalcondition_aud t SET conditionchemical_id = a.id FROM auditedobject a WHERE t.conditionchemical_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE experimentalcondition_aud t SET conditionclass_id = a.id FROM auditedobject a WHERE t.conditionclass_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE experimentalcondition_aud t SET conditiongeneontology_id = a.id FROM auditedobject a WHERE t.conditiongeneontology_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE experimentalcondition_aud t SET conditionid_id = a.id FROM auditedobject a WHERE t.conditionid_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE experimentalcondition_aud t SET conditiontaxon_id = a.id FROM auditedobject a WHERE t.conditiontaxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE experimentalconditionontologyterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM experimentalconditionontologyterm_aud WHERE id IS NULL; -UPDATE fbdvterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM fbdvterm_aud WHERE id IS NULL; -UPDATE gene_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; -DELETE FROM gene_aud WHERE id IS NULL; -UPDATE gene_aud t SET genetype_id = a.id FROM auditedobject a WHERE t.genetype_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE genediseaseannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -DELETE FROM genediseaseannotation_aud WHERE id < 200250000; -UPDATE genediseaseannotation_aud t SET sgdstrainbackground_id = a.id FROM auditedobject a WHERE t.sgdstrainbackground_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genediseaseannotation_aud t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genefullnameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM genefullnameslotannotation_aud WHERE id < 200250000; -UPDATE genefullnameslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genesecondaryidslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM genesecondaryidslotannotation_aud WHERE id < 200250000; -UPDATE genesecondaryidslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genesymbolslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM genesymbolslotannotation_aud WHERE id < 200250000; -UPDATE genesymbolslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genesynonymslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE genesynonymslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genesystematicnameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM genesystematicnameslotannotation_aud WHERE id < 200250000; -UPDATE genesystematicnameslotannotation_aud t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genetogeneorthology_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; -DELETE FROM genetogeneorthology_aud WHERE id < 200250000; -UPDATE genetogeneorthology_aud t SET subjectgene_id = a.id FROM auditedobject a WHERE t.subjectgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genetogeneorthology_aud t SET objectgene_id = a.id FROM auditedobject a WHERE t.objectgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genetogeneorthologycurated_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; -DELETE FROM genetogeneorthologycurated_aud WHERE id < 200250000; -UPDATE genetogeneorthologycurated_aud t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE genetogeneorthologycurated_aud t SET evidencecode_id = a.id FROM auditedobject a WHERE t.evidencecode_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE genetogeneorthologygenerated_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; -DELETE FROM genetogeneorthologygenerated_aud WHERE id < 200250000; -UPDATE genetogeneorthologygenerated_aud t SET isbestscore_id = a.id FROM auditedobject a WHERE t.isbestscore_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE genetogeneorthologygenerated_aud t SET isbestscorereverse_id = a.id FROM auditedobject a WHERE t.isbestscorereverse_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE genetogeneorthologygenerated_aud t SET confidence_id = a.id FROM auditedobject a WHERE t.confidence_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE genetogeneorthologygenerated_predictionmethodsmatched_aud t SET genetogeneorthologygenerated_id = a.id FROM auditedobject a WHERE t.genetogeneorthologygenerated_id = a.old_id AND a.tablename = 'genetogeneorthology'; -UPDATE genetogeneorthologygenerated_predictionmethodsmatched_aud t SET predictionmethodsmatched_id = a.id FROM auditedobject a WHERE t.predictionmethodsmatched_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE genetogeneorthologygenerated_predictionmethodsnotcalled_aud t SET genetogeneorthologygenerated_id = a.id FROM auditedobject a WHERE t.genetogeneorthologygenerated_id = a.old_id AND a.tablename = 'genetogeneorthology'; -UPDATE genetogeneorthologygenerated_predictionmethodsnotcalled_aud t SET predictionmethodsnotcalled_id = a.id FROM auditedobject a WHERE t.predictionmethodsnotcalled_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE genetogeneorthologygenerated_predictionmethodsnotmatched_aud t SET genetogeneorthologygenerated_id = a.id FROM auditedobject a WHERE t.genetogeneorthologygenerated_id = a.old_id AND a.tablename = 'genetogeneorthology'; -UPDATE genetogeneorthologygenerated_predictionmethodsnotmatched_aud t SET predictionmethodsnotmatched_id = a.id FROM auditedobject a WHERE t.predictionmethodsnotmatched_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE genomicentity_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; -DELETE FROM genomicentity_aud WHERE id IS NULL; -UPDATE genomicentity_crossreference_aud t SET genomicentity_id = a.id FROM auditedobject a WHERE t.genomicentity_curie = a.old_curie AND a.tablename = 'biologicalentity'; -DELETE FROM genomicentity_crossreference_aud WHERE genomicentity_id IS NULL; -UPDATE genomicentity_crossreference_aud t SET crossreferences_id = a.id FROM auditedobject a WHERE t.crossreferences_id = a.old_id AND a.tablename = 'crossreference'; -UPDATE goterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM goterm_aud WHERE id IS NULL; -UPDATE hpterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM hpterm_aud WHERE id IS NULL; -UPDATE informationcontententity_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'informationcontententity'; -DELETE FROM informationcontententity_aud WHERE id IS NULL; -UPDATE materm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM materm_aud WHERE id IS NULL; -UPDATE miterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM miterm_aud WHERE id IS NULL; -UPDATE mmoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM mmoterm_aud WHERE id IS NULL; -UPDATE mmusdvterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM mmusdvterm_aud WHERE id IS NULL; -UPDATE modterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM modterm_aud WHERE id IS NULL; -UPDATE molecule_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM molecule_aud WHERE id IS NULL; -UPDATE mpathterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM mpathterm_aud WHERE id IS NULL; -UPDATE mpterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM mpterm_aud WHERE id IS NULL; -UPDATE nameslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM nameslotannotation_aud WHERE id < 200250000; -UPDATE nameslotannotation_aud t SET nametype_id = a.id FROM auditedobject a WHERE t.nametype_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE nameslotannotation_aud t SET synonymscope_id = a.id FROM auditedobject a WHERE t.synonymscope_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE ncbitaxonterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM ncbitaxonterm_aud WHERE id IS NULL; -UPDATE note_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'note'; -DELETE FROM note_aud WHERE id < 200250000; -UPDATE note_aud t SET notetype_id = a.id FROM auditedobject a WHERE t.notetype_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE note_reference_aud t SET note_id = a.id FROM auditedobject a WHERE t.note_id = a.old_id AND a.tablename = 'note'; -UPDATE note_reference_aud t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE obiterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM obiterm_aud WHERE id IS NULL; -UPDATE ontologyterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM ontologyterm_aud WHERE id IS NULL; -UPDATE ontologyterm_crossreference_aud t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM ontologyterm_crossreference_aud WHERE ontologyterm_id IS NULL; -UPDATE ontologyterm_crossreference_aud t SET crossreferences_id = a.id FROM auditedobject a WHERE t.crossreferences_id = a.old_id AND a.tablename = 'crossreference'; -UPDATE ontologyterm_definitionurls_aud t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM ontologyterm_definitionurls_aud WHERE ontologyterm_id IS NULL; -UPDATE ontologyterm_isa_ancestor_descendant_aud t SET isadescendants_id = a.id FROM auditedobject a WHERE t.isadescendants_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ontologyterm_isa_ancestor_descendant_aud t SET isaancestors_id = a.id FROM auditedobject a WHERE t.isaancestors_curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM ontologyterm_isa_ancestor_descendant_aud WHERE isadescendants_id IS NULL OR isaancestors_id IS NULL; -UPDATE ontologyterm_isa_parent_children_aud t SET isachildren_id = a.id FROM auditedobject a WHERE t.isachildren_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ontologyterm_isa_parent_children_aud t SET isaparents_id = a.id FROM auditedobject a WHERE t.isaparents_curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM ontologyterm_isa_parent_children_aud WHERE isachildren_id IS NULL OR isaparents_id IS NULL; -UPDATE ontologyterm_secondaryidentifiers_aud t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM ontologyterm_secondaryidentifiers_aud WHERE ontologyterm_id IS NULL; -UPDATE ontologyterm_subsets_aud t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM ontologyterm_subsets_aud WHERE ontologyterm_id IS NULL; -UPDATE ontologyterm_synonym_aud t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM ontologyterm_synonym_aud WHERE ontologyterm_id IS NULL; -UPDATE ontologyterm_synonym_aud t SET synonyms_id = a.id FROM auditedobject a WHERE t.synonyms_id = a.old_id AND a.tablename = 'synonym'; -UPDATE organization_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'organization'; -DELETE FROM organization_aud WHERE id < 200250000; -UPDATE organization_aud t SET homepageresourcedescriptorpage_id = a.id FROM auditedobject a WHERE t.homepageresourcedescriptorpage_id = a.old_id AND a.tablename = 'resourcedescriptorpage'; -UPDATE patoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM patoterm_aud WHERE id IS NULL; -UPDATE person_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'person'; -DELETE FROM person_aud WHERE id < 200250000; -UPDATE person_aud t SET alliancemember_id = a.id FROM auditedobject a WHERE t.alliancemember_id = a.old_id AND a.tablename = 'organization'; -UPDATE person_emails_aud t SET person_id = a.id FROM auditedobject a WHERE t.person_id = a.old_id AND a.tablename = 'person'; -UPDATE person_oldemails_aud t SET person_id = a.id FROM auditedobject a WHERE t.person_id = a.old_id AND a.tablename = 'person'; -UPDATE personsetting_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'personsetting'; -DELETE FROM personsetting_aud WHERE id < 200250000; -UPDATE phenotypeterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE pwterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM pwterm_aud WHERE id IS NULL; -UPDATE reagent_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'reagent'; -DELETE FROM reagent_aud WHERE id < 200250000; -UPDATE reagent_aud t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; -UPDATE reagent_secondaryidentifiers_aud t SET reagent_id = a.id FROM auditedobject a WHERE t.reagent_id = a.old_id AND a.tablename = 'reagent'; -UPDATE reference_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'informationcontententity'; -DELETE FROM reference_aud WHERE id IS NULL; -UPDATE reference_crossreference_aud t SET reference_id = a.id FROM auditedobject a WHERE t.reference_curie = a.old_curie AND a.tablename = 'informationcontententity'; -DELETE FROM reference_crossreference_aud WHERE reference_id IS NULL; -UPDATE reference_crossreference_aud t SET crossreferences_id = a.id FROM auditedobject a WHERE t.crossreferences_id = a.old_id AND a.tablename = 'crossreference'; -UPDATE resourcedescriptor_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'resourcedescriptor'; -DELETE FROM resourcedescriptor_aud WHERE id < 200250000; -UPDATE resourcedescriptor_synonyms_aud t SET resourcedescriptor_id = a.id FROM auditedobject a WHERE t.resourcedescriptor_id = a.old_id AND a.tablename = 'resourcedescriptor'; -UPDATE resourcedescriptorpage_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'resourcedescriptorpage'; -UPDATE resourcedescriptorpage_aud t SET resourcedescriptor_id = a.id FROM auditedobject a WHERE t.resourcedescriptor_id = a.old_id AND a.tablename = 'resourcedescriptor'; -UPDATE roterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM roterm_aud WHERE id IS NULL; -UPDATE rsterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM rsterm_aud WHERE id IS NULL; -UPDATE secondaryidslotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM secondaryidslotannotation_aud WHERE id < 200250000; -UPDATE singlereferenceassociation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -DELETE FROM singlereferenceassociation_aud WHERE id < 200250000; -UPDATE singlereferenceassociation_aud t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE slotannotation_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -DELETE FROM slotannotation_aud WHERE id < 200250000; -UPDATE slotannotation_informationcontententity_aud t SET slotannotation_id = a.id FROM auditedobject a WHERE t.slotannotation_id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE slotannotation_informationcontententity_aud t SET evidence_id = a.id FROM auditedobject a WHERE t.evidence_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE soterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM soterm_aud WHERE id IS NULL; -UPDATE species_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'species'; -DELETE FROM species_aud WHERE id < 200250000; -UPDATE species_aud t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE species_commonnames_aud t SET species_id = a.id FROM auditedobject a WHERE t.species_id = a.old_id AND a.tablename = 'species'; -UPDATE stageterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM stageterm_aud WHERE id IS NULL; -UPDATE synonym_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'synonym'; -DELETE FROM synonym_aud WHERE id < 200250000; -UPDATE uberonterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM uberonterm_aud WHERE id IS NULL; -UPDATE variant_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; -DELETE FROM variant_aud WHERE id IS NULL; -UPDATE variant_aud t SET varianttype_id = a.id FROM auditedobject a WHERE t.varianttype_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE variant_aud t SET sourcegeneralconsequence_id = a.id FROM auditedobject a WHERE t.sourcegeneralconsequence_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE variant_aud t SET variantstatus_id = a.id FROM auditedobject a WHERE t.variantstatus_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE variant_note_aud t SET variant_id = a.id FROM auditedobject a WHERE t.variant_curie = a.old_curie AND a.tablename = 'biologicalentity'; -DELETE FROM variant_note_aud WHERE variant_id IS NULL; -UPDATE variant_note_aud t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; -UPDATE vocabulary_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabulary'; -DELETE FROM vocabulary_aud WHERE id < 200250000; -UPDATE vocabularyterm_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabularyterm'; -DELETE FROM vocabularyterm_aud WHERE id < 200250000; -UPDATE vocabularyterm_aud t SET vocabulary_id = a.id FROM auditedobject a WHERE t.vocabulary_id = a.old_id AND a.tablename = 'vocabulary'; -UPDATE vocabularyterm_synonyms_aud t SET vocabularyterm_id = a.id FROM auditedobject a WHERE t.vocabularyterm_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE vocabularytermset_aud t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabularytermset'; -DELETE FROM vocabularytermset_aud WHERE id < 200250000; -UPDATE vocabularytermset_aud t SET vocabularytermsetvocabulary_id = a.id FROM auditedobject a WHERE t.vocabularytermsetvocabulary_id = a.old_id AND a.tablename = 'vocabulary'; -UPDATE vocabularytermset_vocabularyterm_aud t SET vocabularytermsets_id = a.id FROM auditedobject a WHERE t.vocabularytermsets_id = a.old_id AND a.tablename = 'vocabularytermset'; -UPDATE vocabularytermset_vocabularyterm_aud t SET memberterms_id = a.id FROM auditedobject a WHERE t.memberterms_id = a.old_id AND a.tablename = 'vocabularyterm';; -UPDATE vtterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM vtterm_aud WHERE id IS NULL; -UPDATE wbbtterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM wbbtterm_aud WHERE id IS NULL; -UPDATE wblsterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM wblsterm_aud WHERE id IS NULL; -UPDATE wbphenotypeterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM wbphenotypeterm_aud WHERE id IS NULL; -UPDATE xbaterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM xbaterm_aud WHERE id IS NULL; -UPDATE xbedterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM xbedterm_aud WHERE id IS NULL; -UPDATE xbsterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM xbsterm_aud WHERE id IS NULL; -UPDATE xcoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM xcoterm_aud WHERE id IS NULL; -UPDATE xpoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM xpoterm_aud WHERE id IS NULL; -UPDATE xsmoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM xsmoterm_aud WHERE id IS NULL; -UPDATE zecoterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM zecoterm_aud WHERE id IS NULL; -UPDATE zfaterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM zfaterm_aud WHERE id IS NULL; -UPDATE zfsterm_aud t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -DELETE FROM zfsterm_aud WHERE id IS NULL; - -ALTER TABLE affectedgenomicmodel_aud DROP COLUMN curie; -ALTER TABLE agmdiseaseannotation_aud DROP COLUMN inferredallele_curie; -ALTER TABLE agmdiseaseannotation_aud DROP COLUMN inferredgene_curie; -ALTER TABLE agmdiseaseannotation_aud DROP COLUMN assertedallele_curie; -ALTER TABLE agmdiseaseannotation_aud DROP COLUMN subject_curie; -ALTER TABLE agmdiseaseannotation_gene_aud DROP COLUMN assertedgenes_curie; -ALTER TABLE allele_aud DROP COLUMN curie; -ALTER TABLE allele_note_aud DROP COLUMN allele_curie; -ALTER TABLE allele_reference_aud DROP COLUMN allele_curie; -ALTER TABLE allele_reference_aud DROP COLUMN references_curie; -ALTER TABLE alleledatabasestatusslotannotation_aud DROP COLUMN singleallele_curie; -ALTER TABLE allelediseaseannotation_aud DROP COLUMN inferredgene_curie; -ALTER TABLE allelediseaseannotation_aud DROP COLUMN subject_curie; -ALTER TABLE allelediseaseannotation_gene_aud DROP COLUMN assertedgenes_curie; -ALTER TABLE allelefullnameslotannotation_aud DROP COLUMN singleallele_curie; -ALTER TABLE allelefunctionalimpactslotannotation_aud DROP COLUMN singleallele_curie; -ALTER TABLE allelefunctionalimpactslotannotation_aud DROP COLUMN phenotypeterm_curie; -ALTER TABLE allelegeneassociation_aud DROP COLUMN subject_curie; -ALTER TABLE allelegeneassociation_aud DROP COLUMN object_curie; -ALTER TABLE allelegenomicentityassociation_aud DROP COLUMN evidencecode_curie; -ALTER TABLE allelegermlinetransmissionstatusslotannotation_aud DROP COLUMN singleallele_curie; -ALTER TABLE alleleinheritancemodeslotannotation_aud DROP COLUMN singleallele_curie; -ALTER TABLE alleleinheritancemodeslotannotation_aud DROP COLUMN phenotypeterm_curie; -ALTER TABLE allelemutationtypeslotannotation_aud DROP COLUMN singleallele_curie; -ALTER TABLE allelemutationtypeslotannotation_soterm_aud DROP COLUMN mutationtypes_curie; -ALTER TABLE allelenomenclatureeventslotannotation_aud DROP COLUMN singleallele_curie; -ALTER TABLE allelesecondaryidslotannotation_aud DROP COLUMN singleallele_curie; -ALTER TABLE allelesymbolslotannotation_aud DROP COLUMN singleallele_curie; -ALTER TABLE allelesynonymslotannotation_aud DROP COLUMN singleallele_curie; -ALTER TABLE anatomicalterm_aud DROP COLUMN curie; -ALTER TABLE apoterm_aud DROP COLUMN curie; -ALTER TABLE atpterm_aud DROP COLUMN curie; -ALTER TABLE biologicalentity_aud DROP COLUMN curie; -ALTER TABLE biologicalentity_aud DROP COLUMN taxon_curie; -ALTER TABLE biologicalentity_aud DROP COLUMN dataprovider_id; -ALTER TABLE bspoterm_aud DROP COLUMN curie; -ALTER TABLE chebiterm_aud DROP COLUMN curie; -ALTER TABLE chemicalterm_aud DROP COLUMN curie; -ALTER TABLE clterm_aud DROP COLUMN curie; -ALTER TABLE cmoterm_aud DROP COLUMN curie; -ALTER TABLE conditionrelation_aud DROP COLUMN singlereference_curie; -ALTER TABLE construct_reference_aud DROP COLUMN references_curie; -ALTER TABLE constructcomponentslotannotation_aud DROP COLUMN taxon_curie; -ALTER TABLE constructgenomicentityassociation_aud DROP COLUMN object_curie; -ALTER TABLE daoterm_aud DROP COLUMN curie; -ALTER TABLE diseaseannotation_aud DROP COLUMN object_curie; -ALTER TABLE diseaseannotation_biologicalentity_aud DROP COLUMN diseasegeneticmodifiers_curie; -ALTER TABLE diseaseannotation_ecoterm_aud DROP COLUMN evidencecodes_curie; -ALTER TABLE diseaseannotation_gene_aud DROP COLUMN with_curie; -ALTER TABLE doterm_aud DROP COLUMN curie; -ALTER TABLE dpoterm_aud DROP COLUMN curie; -ALTER TABLE ecoterm_aud DROP COLUMN curie; -ALTER TABLE emapaterm_aud DROP COLUMN curie; -ALTER TABLE evidenceassociation_informationcontententity_aud DROP COLUMN evidence_curie; -ALTER TABLE experimentalcondition_aud DROP COLUMN conditionanatomy_curie; -ALTER TABLE experimentalcondition_aud DROP COLUMN conditionchemical_curie; -ALTER TABLE experimentalcondition_aud DROP COLUMN conditionclass_curie; -ALTER TABLE experimentalcondition_aud DROP COLUMN conditiongeneontology_curie; -ALTER TABLE experimentalcondition_aud DROP COLUMN conditionid_curie; -ALTER TABLE experimentalcondition_aud DROP COLUMN conditiontaxon_curie; -ALTER TABLE experimentalconditionontologyterm_aud DROP COLUMN curie; -ALTER TABLE fbdvterm_aud DROP COLUMN curie; -ALTER TABLE gene_aud DROP COLUMN curie; -ALTER TABLE gene_aud DROP COLUMN genetype_curie; -ALTER TABLE genediseaseannotation_aud DROP COLUMN sgdstrainbackground_curie; -ALTER TABLE genediseaseannotation_aud DROP COLUMN subject_curie; -ALTER TABLE genefullnameslotannotation_aud DROP COLUMN singlegene_curie; -ALTER TABLE genesecondaryidslotannotation_aud DROP COLUMN singlegene_curie; -ALTER TABLE genesymbolslotannotation_aud DROP COLUMN singlegene_curie; -ALTER TABLE genesynonymslotannotation_aud DROP COLUMN singlegene_curie; -ALTER TABLE genesystematicnameslotannotation_aud DROP COLUMN singlegene_curie; -ALTER TABLE genetogeneorthology_aud DROP COLUMN subjectgene_curie; -ALTER TABLE genetogeneorthology_aud DROP COLUMN objectgene_curie; -ALTER TABLE genetogeneorthologycurated_aud DROP COLUMN singlereference_curie; -ALTER TABLE genetogeneorthologycurated_aud DROP COLUMN evidencecode_curie; -ALTER TABLE genomicentity_aud DROP COLUMN curie; -ALTER TABLE genomicentity_crossreference_aud DROP COLUMN genomicentity_curie; -ALTER TABLE goterm_aud DROP COLUMN curie; -ALTER TABLE hpterm_aud DROP COLUMN curie; -ALTER TABLE informationcontententity_aud DROP COLUMN curie; -ALTER TABLE materm_aud DROP COLUMN curie; -ALTER TABLE miterm_aud DROP COLUMN curie; -ALTER TABLE mmoterm_aud DROP COLUMN curie; -ALTER TABLE mmusdvterm_aud DROP COLUMN curie; -ALTER TABLE modterm_aud DROP COLUMN curie; -ALTER TABLE molecule_aud DROP COLUMN curie; -ALTER TABLE mpathterm_aud DROP COLUMN curie; -ALTER TABLE mpterm_aud DROP COLUMN curie; -ALTER TABLE ncbitaxonterm_aud DROP COLUMN curie; -ALTER TABLE note_reference_aud DROP COLUMN references_curie; -ALTER TABLE obiterm_aud DROP COLUMN curie; -ALTER TABLE ontologyterm_aud DROP COLUMN curie; -ALTER TABLE ontologyterm_crossreference_aud DROP COLUMN ontologyterm_curie; -ALTER TABLE ontologyterm_definitionurls_aud DROP COLUMN ontologyterm_curie; -ALTER TABLE ontologyterm_isa_ancestor_descendant_aud DROP COLUMN isadescendants_curie; -ALTER TABLE ontologyterm_isa_ancestor_descendant_aud DROP COLUMN isaancestors_curie; -ALTER TABLE ontologyterm_isa_parent_children_aud DROP COLUMN isachildren_curie; -ALTER TABLE ontologyterm_isa_parent_children_aud DROP COLUMN isaparents_curie; -ALTER TABLE ontologyterm_secondaryidentifiers_aud DROP COLUMN ontologyterm_curie; -ALTER TABLE ontologyterm_subsets_aud DROP COLUMN ontologyterm_curie; -ALTER TABLE ontologyterm_synonym_aud DROP COLUMN ontologyterm_curie; -ALTER TABLE patoterm_aud DROP COLUMN curie; -ALTER TABLE phenotypeterm_aud DROP COLUMN curie; -ALTER TABLE pwterm_aud DROP COLUMN curie; -ALTER TABLE reagent_aud DROP COLUMN curie; -ALTER TABLE reagent_aud DROP COLUMN modentityid; -ALTER TABLE reagent_aud DROP COLUMN modinternalid; -ALTER TABLE reagent_aud DROP COLUMN dataprovider_id; -ALTER TABLE reference_aud DROP COLUMN curie; -ALTER TABLE reference_crossreference_aud DROP COLUMN reference_curie; -ALTER TABLE roterm_aud DROP COLUMN curie; -ALTER TABLE rsterm_aud DROP COLUMN curie; -ALTER TABLE singlereferenceassociation_aud DROP COLUMN singlereference_curie; -ALTER TABLE slotannotation_informationcontententity_aud DROP COLUMN evidence_curie; -ALTER TABLE soterm_aud DROP COLUMN curie; -ALTER TABLE species_aud DROP COLUMN taxon_curie; -ALTER TABLE stageterm_aud DROP COLUMN curie; -ALTER TABLE uberonterm_aud DROP COLUMN curie; -ALTER TABLE variant_aud DROP COLUMN curie; -ALTER TABLE variant_aud DROP COLUMN varianttype_curie; -ALTER TABLE variant_aud DROP COLUMN sourcegeneralconsequence_curie; -ALTER TABLE variant_note_aud DROP COLUMN variant_curie; -ALTER TABLE vtterm_aud DROP COLUMN curie; -ALTER TABLE wbbtterm_aud DROP COLUMN curie; -ALTER TABLE wblsterm_aud DROP COLUMN curie; -ALTER TABLE wbphenotypeterm_aud DROP COLUMN curie; -ALTER TABLE xbaterm_aud DROP COLUMN curie; -ALTER TABLE xbedterm_aud DROP COLUMN curie; -ALTER TABLE xbsterm_aud DROP COLUMN curie; -ALTER TABLE xcoterm_aud DROP COLUMN curie; -ALTER TABLE xpoterm_aud DROP COLUMN curie; -ALTER TABLE xsmoterm_aud DROP COLUMN curie; -ALTER TABLE zecoterm_aud DROP COLUMN curie; -ALTER TABLE zfaterm_aud DROP COLUMN curie; -ALTER TABLE zfsterm_aud DROP COLUMN curie; - ALTER TABLE auditedobject DROP COLUMN old_id; ALTER TABLE auditedobject DROP COLUMN old_curie; ALTER TABLE auditedobject DROP COLUMN tablename; -INSERT INTO submittedobject_aud (id, rev) SELECT id, rev FROM biologicalentity_aud; -INSERT INTO submittedobject_aud (id, rev) SELECT id, rev FROM reagent_aud; - -INSERT INTO curieobject_aud (id, rev) SELECT id, rev FROM submittedobject_aud; -INSERT INTO curieobject_aud (id, rev) SELECT id, rev FROM ontologyterm_aud; -INSERT INTO curieobject_aud (id, rev) SELECT id, rev FROM informationcontententity_aud; - - -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM association_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM biologicalentity_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM bulkload_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM bulkloadfile_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM bulkloadfileexception_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM bulkloadfilehistory_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM bulkloadgroup_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM conditionrelation_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM crossreference_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM dataprovider_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM experimentalcondition_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM genetogeneorthology_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM informationcontententity_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM note_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM ontologyterm_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM organization_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM person_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM personsetting_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM reagent_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM resourcedescriptor_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM resourcedescriptorpage_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM slotannotation_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM species_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM synonym_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM vocabulary_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM vocabularyterm_aud; -INSERT INTO auditedobject_aud (id, rev, revtype) SELECT id, rev, revtype FROM vocabularytermset_aud; - -ALTER TABLE association_aud DROP COLUMN revtype; -ALTER TABLE biologicalentity_aud DROP COLUMN revtype; -ALTER TABLE bulkload_aud DROP COLUMN revtype; -ALTER TABLE bulkloadfile_aud DROP COLUMN revtype; -ALTER TABLE bulkloadfileexception_aud DROP COLUMN revtype; -ALTER TABLE bulkloadfilehistory_aud DROP COLUMN revtype; -ALTER TABLE bulkloadgroup_aud DROP COLUMN revtype; -ALTER TABLE conditionrelation_aud DROP COLUMN revtype; -ALTER TABLE crossreference_aud DROP COLUMN revtype; -ALTER TABLE dataprovider_aud DROP COLUMN revtype; -ALTER TABLE experimentalcondition_aud DROP COLUMN revtype; -ALTER TABLE genetogeneorthology_aud DROP COLUMN revtype; -ALTER TABLE informationcontententity_aud DROP COLUMN revtype; -ALTER TABLE note_aud DROP COLUMN revtype; -ALTER TABLE ontologyterm_aud DROP COLUMN revtype; -ALTER TABLE organization_aud DROP COLUMN revtype; -ALTER TABLE person_aud DROP COLUMN revtype; -ALTER TABLE personsetting_aud DROP COLUMN revtype; -ALTER TABLE reagent_aud DROP COLUMN revtype; -ALTER TABLE resourcedescriptor_aud DROP COLUMN revtype; -ALTER TABLE resourcedescriptorpage_aud DROP COLUMN revtype; -ALTER TABLE slotannotation_aud DROP COLUMN revtype; -ALTER TABLE species_aud DROP COLUMN revtype; -ALTER TABLE synonym_aud DROP COLUMN revtype; -ALTER TABLE vocabulary_aud DROP COLUMN revtype; -ALTER TABLE vocabularyterm_aud DROP COLUMN revtype; -ALTER TABLE vocabularytermset_aud DROP COLUMN revtype; - SET session_replication_role = 'origin'; -- Add constraints and indexes @@ -2206,14 +1449,10 @@ ALTER TABLE auditedobject ADD CONSTRAINT auditedobject_updatedby_id_fk FOREIGN K CREATE INDEX auditedobject_createdby_index ON auditedobject USING btree (createdby_id); CREATE INDEX auditedobject_updatedby_index ON auditedobject USING btree (updatedby_id); -ALTER TABLE auditedobject_aud ADD CONSTRAINT auditedobject_aud_rev_fk FOREIGN KEY (rev) REFERENCES revinfo (rev); - ALTER TABLE curieobject ADD CONSTRAINT curieobject_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); CREATE INDEX curieobject_curie_index ON curieobject USING btree (curie); ALTER TABLE curieobject ADD CONSTRAINT curieobject_curie_uk UNIQUE (curie); -ALTER TABLE curieobject_aud ADD CONSTRAINT curieobject_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); - ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_dataprovider_id_fk FOREIGN KEY (dataprovider_id) REFERENCES dataprovider (id); CREATE INDEX submittedobject_modentityid_index ON submittedobject USING btree (modentityid); @@ -2222,136 +1461,73 @@ CREATE INDEX submittedobject_dataprovider_index ON submittedobject USING btree ( ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_modentityid_uk UNIQUE (modentityid); ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_modinternalid_uk UNIQUE (modinternalid); -ALTER TABLE submittedobject_aud ADD CONSTRAINT submittedobject_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES curieobject_aud (id, rev); - ALTER TABLE affectedgenomicmodel ADD CONSTRAINT affectedgenomicmodel_pkey PRIMARY KEY (id); -ALTER TABLE affectedgenomicmodel_aud ADD CONSTRAINT affectedgenomicmodel_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE allele ADD CONSTRAINT allele_pkey PRIMARY KEY (id); -ALTER TABLE allele_aud ADD CONSTRAINT allele_aud_pkey PRIMARY KEY (id, rev); -ALTER TABLE allele_note_aud ADD CONSTRAINT allele_note_aud_pkey PRIMARY KEY (allele_id, relatednotes_id, rev); -ALTER TABLE allele_reference_aud ADD CONSTRAINT allele_reference_aud_pkey PRIMARY KEY (allele_id, references_id, rev); ALTER TABLE anatomicalterm ADD CONSTRAINT anatomicalterm_pkey PRIMARY KEY (id); -ALTER TABLE anatomicalterm_aud ADD CONSTRAINT anatomicalterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE apoterm ADD CONSTRAINT apoterm_pkey PRIMARY KEY (id); -ALTER TABLE apoterm_aud ADD CONSTRAINT apoterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE atpterm ADD CONSTRAINT atpterm_pkey PRIMARY KEY (id); -ALTER TABLE atpterm_aud ADD CONSTRAINT atpterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_pkey PRIMARY KEY (id); -ALTER TABLE biologicalentity_aud ADD CONSTRAINT biologicalentity_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE bspoterm ADD CONSTRAINT bspoterm_pkey PRIMARY KEY (id); -ALTER TABLE bspoterm_aud ADD CONSTRAINT bspoterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE chebiterm ADD CONSTRAINT chebiterm_pkey PRIMARY KEY (id); -ALTER TABLE chebiterm_aud ADD CONSTRAINT chebiterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE chemicalterm ADD CONSTRAINT chemicalterm_pkey PRIMARY KEY (id); -ALTER TABLE chemicalterm_aud ADD CONSTRAINT chemicalterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE clterm ADD CONSTRAINT clterm_pkey PRIMARY KEY (id); -ALTER TABLE clterm_aud ADD CONSTRAINT clterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE cmoterm ADD CONSTRAINT cmoterm_pkey PRIMARY KEY (id); -ALTER TABLE cmoterm_aud ADD CONSTRAINT cmoterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE daoterm ADD CONSTRAINT daoterm_pkey PRIMARY KEY (id); -ALTER TABLE daoterm_aud ADD CONSTRAINT daoterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE doterm ADD CONSTRAINT doterm_pkey PRIMARY KEY (id); -ALTER TABLE doterm_aud ADD CONSTRAINT doterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE dpoterm ADD CONSTRAINT dpoterm_pkey PRIMARY KEY (id); -ALTER TABLE dpoterm_aud ADD CONSTRAINT dpoterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE ecoterm ADD CONSTRAINT ecoterm_pkey PRIMARY KEY (id); -ALTER TABLE ecoterm_aud ADD CONSTRAINT ecoterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE emapaterm ADD CONSTRAINT emapaterm_pkey PRIMARY KEY (id); -ALTER TABLE emapaterm_aud ADD CONSTRAINT emapaterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE experimentalconditionontologyterm ADD CONSTRAINT experimentalconditionontologyterm_pkey PRIMARY KEY (id); -ALTER TABLE experimentalconditionontologyterm_aud ADD CONSTRAINT experimentalconditionontologyterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE fbdvterm ADD CONSTRAINT fbdvterm_pkey PRIMARY KEY (id); -ALTER TABLE fbdvterm_aud ADD CONSTRAINT fbdvterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE gene ADD CONSTRAINT gene_pkey PRIMARY KEY (id); -ALTER TABLE gene_aud ADD CONSTRAINT gene_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE genomicentity ADD CONSTRAINT genomicentity_pkey PRIMARY KEY (id); -ALTER TABLE genomicentity_aud ADD CONSTRAINT genomicentity_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE goterm ADD CONSTRAINT goterm_pkey PRIMARY KEY (id); -ALTER TABLE goterm_aud ADD CONSTRAINT goterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE hpterm ADD CONSTRAINT hpterm_pkey PRIMARY KEY (id); -ALTER TABLE hpterm_aud ADD CONSTRAINT hpterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_pkey PRIMARY KEY (id); -ALTER TABLE informationcontententity_aud ADD CONSTRAINT informationcontententity_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE materm ADD CONSTRAINT materm_pkey PRIMARY KEY (id); -ALTER TABLE materm_aud ADD CONSTRAINT materm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE miterm ADD CONSTRAINT miterm_pkey PRIMARY KEY (id); -ALTER TABLE miterm_aud ADD CONSTRAINT miterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_pkey PRIMARY KEY (id); -ALTER TABLE mmoterm_aud ADD CONSTRAINT mmoterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE mmusdvterm ADD CONSTRAINT mmusdvterm_pkey PRIMARY KEY (id); -ALTER TABLE mmusdvterm_aud ADD CONSTRAINT mmusdvterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE modterm ADD CONSTRAINT modterm_pkey PRIMARY KEY (id); -ALTER TABLE modterm_aud ADD CONSTRAINT modterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE molecule ADD CONSTRAINT molecule_pkey PRIMARY KEY (id); -ALTER TABLE molecule_aud ADD CONSTRAINT molecule_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE mpathterm ADD CONSTRAINT mpathterm_pkey PRIMARY KEY (id); -ALTER TABLE mpathterm_aud ADD CONSTRAINT mpathterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE mpterm ADD CONSTRAINT mpterm_pkey PRIMARY KEY (id); -ALTER TABLE mpterm_aud ADD CONSTRAINT mpterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_pkey PRIMARY KEY (id); -ALTER TABLE ncbitaxonterm_aud ADD CONSTRAINT ncbitaxonterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE obiterm ADD CONSTRAINT obiterm_pkey PRIMARY KEY (id); -ALTER TABLE obiterm_aud ADD CONSTRAINT obiterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_pkey PRIMARY KEY (id); -ALTER TABLE ontologyterm_aud ADD CONSTRAINT ontologyterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_pkey PRIMARY KEY (isachildren_id, isaparents_id); ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_pkey PRIMARY KEY (isadescendants_id, isaancestors_id); ALTER TABLE patoterm ADD CONSTRAINT patoterm_pkey PRIMARY KEY (id); -ALTER TABLE patoterm_aud ADD CONSTRAINT patoterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE phenotypeterm ADD CONSTRAINT phenotypeterm_pkey PRIMARY KEY (id); -ALTER TABLE phenotypeterm_aud ADD CONSTRAINT phenotypeterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE pwterm ADD CONSTRAINT pwterm_pkey PRIMARY KEY (id); -ALTER TABLE pwterm_aud ADD CONSTRAINT pwterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE reference ADD CONSTRAINT reference_pkey PRIMARY KEY (id); -ALTER TABLE reference_aud ADD CONSTRAINT reference_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE roterm ADD CONSTRAINT roterm_pkey PRIMARY KEY (id); -ALTER TABLE roterm_aud ADD CONSTRAINT roterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE rsterm ADD CONSTRAINT rsterm_pkey PRIMARY KEY (id); -ALTER TABLE rsterm_aud ADD CONSTRAINT rsterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE soterm ADD CONSTRAINT soterm_pkey PRIMARY KEY (id); -ALTER TABLE soterm_aud ADD CONSTRAINT soterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE stageterm ADD CONSTRAINT stageterm_pkey PRIMARY KEY (id); -ALTER TABLE stageterm_aud ADD CONSTRAINT stageterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE uberonterm ADD CONSTRAINT uberonterm_pkey PRIMARY KEY (id); -ALTER TABLE uberonterm_aud ADD CONSTRAINT uberonterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE variant ADD CONSTRAINT variant_pkey PRIMARY KEY (id); -ALTER TABLE variant_aud ADD CONSTRAINT variant_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE vtterm ADD CONSTRAINT vtterm_pkey PRIMARY KEY (id); -ALTER TABLE vtterm_aud ADD CONSTRAINT vtterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE wbbtterm ADD CONSTRAINT wbbtterm_pkey PRIMARY KEY (id); -ALTER TABLE wbbtterm_aud ADD CONSTRAINT wbbtterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE wblsterm ADD CONSTRAINT wblsterm_pkey PRIMARY KEY (id); -ALTER TABLE wblsterm_aud ADD CONSTRAINT wblsterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE wbphenotypeterm ADD CONSTRAINT wbphenotypeterm_pkey PRIMARY KEY (id); -ALTER TABLE wbphenotypeterm_aud ADD CONSTRAINT wbphenotypeterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE xbaterm ADD CONSTRAINT xbaterm_pkey PRIMARY KEY (id); -ALTER TABLE xbaterm_aud ADD CONSTRAINT xbaterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE xbedterm ADD CONSTRAINT xbedterm_pkey PRIMARY KEY (id); -ALTER TABLE xbedterm_aud ADD CONSTRAINT xbedterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE xbsterm ADD CONSTRAINT xbsterm_pkey PRIMARY KEY (id); -ALTER TABLE xbsterm_aud ADD CONSTRAINT xbsterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE xcoterm ADD CONSTRAINT xcoterm_pkey PRIMARY KEY (id); -ALTER TABLE xcoterm_aud ADD CONSTRAINT xcoterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE xpoterm ADD CONSTRAINT xpoterm_pkey PRIMARY KEY (id); -ALTER TABLE xpoterm_aud ADD CONSTRAINT xpoterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE xsmoterm ADD CONSTRAINT xsmoterm_pkey PRIMARY KEY (id); -ALTER TABLE xsmoterm_aud ADD CONSTRAINT xsmoterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE zecoterm ADD CONSTRAINT zecoterm_pkey PRIMARY KEY (id); -ALTER TABLE zecoterm_aud ADD CONSTRAINT zecoterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_pkey PRIMARY KEY (id); -ALTER TABLE zfaterm_aud ADD CONSTRAINT zfaterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_pkey PRIMARY KEY (id); -ALTER TABLE zfsterm_aud ADD CONSTRAINT zfsterm_aud_pkey PRIMARY KEY (id, rev); ALTER TABLE affectedgenomicmodel ADD CONSTRAINT affectedgenomicmodel_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); -ALTER TABLE affectedgenomicmodel_aud ADD CONSTRAINT affectedgenomicmodel_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES affectedgenomicmodel (id); ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_assertedallele_id_fk FOREIGN KEY (assertedallele_id) REFERENCES allele (id); ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredallele_id_fk FOREIGN KEY (inferredallele_id) REFERENCES allele (id); ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id); ALTER TABLE agmdiseaseannotation_gene ADD CONSTRAINT agmdiseaseannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); ALTER TABLE allele ADD CONSTRAINT allele_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); -ALTER TABLE allele_aud ADD CONSTRAINT allele_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); ALTER TABLE allele_note ADD CONSTRAINT allele_note_allele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id); CREATE INDEX allele_note_allele_index ON allele_note USING btree (allele_id); ALTER TABLE allele_reference ADD CONSTRAINT allele_reference_allele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id); @@ -2396,38 +1572,23 @@ CREATE INDEX allelesymbol_singleallele_index ON allelesymbolslotannotation USING ALTER TABLE allelesynonymslotannotation ADD CONSTRAINT allelesynonymslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); CREATE INDEX allelesynonym_singleallele_index ON allelesynonymslotannotation USING btree (singleallele_id); ALTER TABLE anatomicalterm ADD CONSTRAINT anatomicalterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE anatomicalterm_aud ADD CONSTRAINT anatomicalterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE apoterm ADD CONSTRAINT apoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); -ALTER TABLE apoterm_aud ADD CONSTRAINT apoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); ALTER TABLE atpterm ADD CONSTRAINT atpterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE atpterm_aud ADD CONSTRAINT atpterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_id_fk FOREIGN KEY (id) REFERENCES submittedobject (id); ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); CREATE INDEX biologicalentity_taxon_index ON biologicalentity USING btree (taxon_id); -ALTER TABLE biologicalentity_aud ADD CONSTRAINT biologicalentity_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES submittedobject_aud (id, rev); ALTER TABLE bspoterm ADD CONSTRAINT bspoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE bspoterm_aud ADD CONSTRAINT bspoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE bulkload ADD CONSTRAINT bulkload_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE bulkload_aud ADD CONSTRAINT bulkload_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE bulkloadfile ADD CONSTRAINT bulkloadfile_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE bulkloadfile_aud ADD CONSTRAINT bulkloadfile_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE bulkloadfileexception ADD CONSTRAINT bulkloadfileexception_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE bulkloadfileexception_aud ADD CONSTRAINT bulkloadfileexception_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE bulkloadfilehistory ADD CONSTRAINT bulkloadfilehistory_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE bulkloadfilehistory_aud ADD CONSTRAINT bulkloadfilehistory_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE bulkloadgroup ADD CONSTRAINT bulkloadgroup_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE bulkloadgroup_aud ADD CONSTRAINT bulkloadgroup_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE chebiterm ADD CONSTRAINT chebiterm_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); -ALTER TABLE chebiterm_aud ADD CONSTRAINT chebiterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES chemicalterm_aud (id, rev); ALTER TABLE chemicalterm ADD CONSTRAINT chemicalterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE chemicalterm_aud ADD CONSTRAINT chemicalterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE clterm ADD CONSTRAINT clterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE clterm_aud ADD CONSTRAINT clterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); ALTER TABLE cmoterm ADD CONSTRAINT cmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE cmoterm_aud ADD CONSTRAINT cmoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE conditionrelation ADD CONSTRAINT conditionrelation_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); ALTER TABLE conditionrelation ADD CONSTRAINT conditionrelation_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); -ALTER TABLE conditionrelation_aud ADD CONSTRAINT conditionrelation_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE construct_reference ADD CONSTRAINT construct_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); CREATE INDEX construct_reference_references_index ON construct_reference USING btree (references_id); ALTER TABLE constructcomponentslotannotation ADD CONSTRAINT constructcomponentslotannotation_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); @@ -2435,17 +1596,11 @@ CREATE INDEX constructcomponentslotannotation_taxon_index ON constructcomponents ALTER TABLE constructgenomicentityassociation ADD CONSTRAINT constructgenomicentityassociation_object_id_fk FOREIGN KEY (object_id) REFERENCES genomicentity (id); CREATE INDEX constructgenomicentityassociation_object_index ON constructgenomicentityassociation USING btree (object_id); ALTER TABLE crossreference ADD CONSTRAINT crossreference_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE crossreference_aud ADD CONSTRAINT crossreference_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE curationreport ADD CONSTRAINT curationreport_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE curationreport_aud ADD CONSTRAINT curationreport_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE curationreportgroup ADD CONSTRAINT curationreportgroup_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE curationreportgroup_aud ADD CONSTRAINT curationreportgroup_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE curationreporthistory ADD CONSTRAINT curationreporthistory_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE curationreportgroup_aud ADD CONSTRAINT curationreporthistory_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE daoterm ADD CONSTRAINT daoterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE daoterm_aud ADD CONSTRAINT daoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); ALTER TABLE dataprovider ADD CONSTRAINT dataprovider_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE dataprovider_aud ADD CONSTRAINT dataprovider_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE diseaseannotation ADD CONSTRAINT diseaseannotation_object_id_fk FOREIGN KEY (object_id) REFERENCES doterm (id); CREATE INDEX diseaseannotation_object_index ON diseaseannotation USING btree (object_id); ALTER TABLE diseaseannotation_biologicalentity ADD CONSTRAINT diseaseannotation_biologicalentity_dgm_id_fk FOREIGN KEY (diseasegeneticmodifiers_id) REFERENCES biologicalentity (id); @@ -2455,13 +1610,9 @@ CREATE INDEX diseaseannotation_ecoterm_evidencecodes_index ON diseaseannotation_ ALTER TABLE diseaseannotation_gene ADD CONSTRAINT diseaseannotation_gene_with_id_fk FOREIGN KEY (with_id) REFERENCES gene (id); CREATE INDEX diseaseannotation_gene_with_index ON diseaseannotation_gene USING btree (with_id); ALTER TABLE doterm ADD CONSTRAINT doterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE doterm_aud ADD CONSTRAINT doterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE dpoterm ADD CONSTRAINT dpoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); -ALTER TABLE dpoterm_aud ADD CONSTRAINT dpoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); ALTER TABLE ecoterm ADD CONSTRAINT ecoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE ecoterm_aud ADD CONSTRAINT ecoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE emapaterm ADD CONSTRAINT emapaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE emapaterm_aud ADD CONSTRAINT emapaterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); ALTER TABLE evidenceassociation_informationcontententity ADD CONSTRAINT evidenceassociation_infocontent_evidence_id_fk FOREIGN KEY (evidence_id) REFERENCES informationcontententity (id); CREATE INDEX evidenceassociation_infocontent_evidence_index ON evidenceassociation_informationcontententity USING btree (evidence_id); ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionchemical_id_fk FOREIGN KEY (conditionchemical_id) REFERENCES chemicalterm (id); @@ -2471,13 +1622,10 @@ ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_condition ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionclass_id_fk FOREIGN KEY (conditionclass_id) REFERENCES zecoterm (id); ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionanatomy_id_fk FOREIGN KEY (conditionanatomy_id) REFERENCES anatomicalterm (id); ALTER TABLE experimentalconditionontologyterm ADD CONSTRAINT experimentalconditionontologyterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE experimentalconditionontologyterm_aud ADD CONSTRAINT experimentalconditionontologyterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE fbdvterm ADD CONSTRAINT fbdvterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); -ALTER TABLE fbdvterm_aud ADD CONSTRAINT fbdvterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); ALTER TABLE gene ADD CONSTRAINT gene_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); ALTER TABLE gene ADD CONSTRAINT gene_genetype_id_fk FOREIGN KEY (genetype_id) REFERENCES soterm (id); CREATE INDEX gene_genetype_index ON gene USING btree (genetype_id); -ALTER TABLE gene_aud ADD CONSTRAINT gene_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES gene (id); ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_sgdstrainbackground_id_fk FOREIGN KEY (sgdstrainbackground_id) REFERENCES affectedgenomicmodel (id); ALTER TABLE genefullnameslotannotation ADD CONSTRAINT genefullnameslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); @@ -2500,42 +1648,26 @@ ALTER TABLE genetogeneorthologycurated ADD CONSTRAINT genetogeneorthologycurated CREATE INDEX genetogeneorthologycurated_evidencecode_index ON genetogeneorthologycurated USING btree (evidencecode_id); CREATE INDEX genetogeneorthologycurated_singlereference_index ON genetogeneorthologycurated USING btree (singlereference_id); ALTER TABLE genomicentity ADD CONSTRAINT genomicentity_id_fk FOREIGN KEY (id) REFERENCES biologicalentity (id); -ALTER TABLE genomicentity_aud ADD CONSTRAINT genomicentity_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES biologicalentity_aud (id, rev); ALTER TABLE genomicentity_crossreference ADD CONSTRAINT genomicentitycrossreference_genomicentity_id_fk FOREIGN KEY (genomicentity_id) REFERENCES genomicentity (id); CREATE INDEX genomicentity_crossreference_ge_xref_index ON genomicentity_crossreference USING btree (genomicentity_id, crossreferences_id); CREATE INDEX genomicentity_crossreference_genomicentity_index ON genomicentity_crossreference USING btree (genomicentity_id); ALTER TABLE goterm ADD CONSTRAINT goterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE goterm_aud ADD CONSTRAINT goterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE hpterm ADD CONSTRAINT hpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); -ALTER TABLE hpterm_aud ADD CONSTRAINT hpterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); -ALTER TABLE informationcontententity_aud ADD CONSTRAINT informationcontententity_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES curieobject_aud (id, rev); ALTER TABLE materm ADD CONSTRAINT materm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE materm_aud ADD CONSTRAINT materm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); ALTER TABLE miterm ADD CONSTRAINT miterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE miterm_aud ADD CONSTRAINT miterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE mmoterm_aud ADD CONSTRAINT mmoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE mmusdvterm ADD CONSTRAINT mmusdvterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); -ALTER TABLE mmusdvterm_aud ADD CONSTRAINT mmusdvterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); ALTER TABLE modterm ADD CONSTRAINT modterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE modterm_aud ADD CONSTRAINT modterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE molecule ADD CONSTRAINT molecule_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); -ALTER TABLE molecule_aud ADD CONSTRAINT molecule_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES chemicalterm_aud (id, rev); ALTER TABLE mpathterm ADD CONSTRAINT mpathterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE mpathterm_aud ADD CONSTRAINT mpathterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE mpterm ADD CONSTRAINT mpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); -ALTER TABLE mpterm_aud ADD CONSTRAINT mpterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE ncbitaxonterm_aud ADD CONSTRAINT ncbitaxonterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE note ADD CONSTRAINT note_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE note_aud ADD CONSTRAINT note_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE note_reference ADD CONSTRAINT note_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); CREATE INDEX note_reference_references_index ON note_reference USING btree (references_id); ALTER TABLE obiterm ADD CONSTRAINT obiterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE obiterm_aud ADD CONSTRAINT obiterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); -ALTER TABLE ontologyterm_aud ADD CONSTRAINT ontologyterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES curieobject_aud (id, rev); ALTER TABLE ontologyterm_crossreference ADD CONSTRAINT ontologyterm_crossreference_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); CREATE INDEX ontologyterm_crossreference_ontologyterm_index ON ontologyterm_crossreference USING btree (ontologyterm_id); ALTER TABLE ontologyterm_definitionurls ADD CONSTRAINT ontologyterm_definitionurls_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); @@ -2555,82 +1687,48 @@ CREATE INDEX ontologyterm_subsets_ontologyterm_index ON ontologyterm_subsets USI ALTER TABLE ontologyterm_synonym ADD CONSTRAINT ontologyterm_synonym_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); CREATE INDEX ontologyterm_synonym_ontologyterm_index ON ontologyterm_synonym USING btree (ontologyterm_id); ALTER TABLE organization ADD CONSTRAINT organization_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE organization_aud ADD CONSTRAINT organization_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE patoterm ADD CONSTRAINT patoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE patoterm_aud ADD CONSTRAINT patoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE person ADD CONSTRAINT person_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE person_aud ADD CONSTRAINT person_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE phenotypeterm ADD CONSTRAINT phenotypeterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE phenotypeterm_aud ADD CONSTRAINT phenotypeterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE pwterm ADD CONSTRAINT pwterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE pwterm_aud ADD CONSTRAINT pwterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE reagent ADD CONSTRAINT reagent_id_fk FOREIGN KEY (id) REFERENCES submittedobject (id); -ALTER TABLE reagent_aud ADD CONSTRAINT reagent_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES submittedobject_aud (id, rev); ALTER TABLE reference ADD CONSTRAINT reference_id_fk FOREIGN KEY (id) REFERENCES informationcontententity (id); -ALTER TABLE reference_aud ADD CONSTRAINT reference_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES informationcontententity_aud (id, rev); ALTER TABLE reference_crossreference ADD CONSTRAINT reference_crossreference_reference_id_fk FOREIGN KEY (reference_id) REFERENCES reference (id); CREATE INDEX reference_crossreference_reference_index ON reference_crossreference USING btree (reference_id); ALTER TABLE resourcedescriptor ADD CONSTRAINT resourcedescriptor_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE resourcedescriptor_aud ADD CONSTRAINT resourcedescriptor_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE resourcedescriptorpage ADD CONSTRAINT resourcedescriptorpage_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE resourcedescriptorpage_aud ADD CONSTRAINT resourcedescriptorpage_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE roterm ADD CONSTRAINT roterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE roterm_aud ADD CONSTRAINT roterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE rsterm ADD CONSTRAINT rsterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE rsterm_aud ADD CONSTRAINT rsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE singlereferenceassociation ADD CONSTRAINT singlereferenceassociation_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); CREATE INDEX singlereferenceassociation_singlereference_index ON singlereferenceassociation USING btree (singlereference_id); ALTER TABLE slotannotation ADD CONSTRAINT slotannotation_id_fk FOREIGN KEY (id) REFERENCES auditedobject(id); -ALTER TABLE slotannotation_aud ADD CONSTRAINT slotannotation_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE slotannotation_informationcontententity ADD CONSTRAINT slotannotation_informationcontententity_evidence_id_fk FOREIGN KEY (evidence_id) REFERENCES informationcontententity (id); CREATE INDEX slotannotation_informationcontententity_evidence_index ON slotannotation_informationcontententity USING btree (evidence_id); ALTER TABLE soterm ADD CONSTRAINT soterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE soterm_aud ADD CONSTRAINT soterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE species ADD CONSTRAINT species_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); ALTER TABLE species ADD CONSTRAINT species_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); -ALTER TABLE species_aud ADD CONSTRAINT species_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE stageterm ADD CONSTRAINT stageterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE stageterm_aud ADD CONSTRAINT stageterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); -ALTER TABLE synonym_aud ADD CONSTRAINT synonym_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE uberonterm ADD CONSTRAINT uberonterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE uberonterm_aud ADD CONSTRAINT uberonterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); ALTER TABLE variant ADD CONSTRAINT variant_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); ALTER TABLE variant ADD CONSTRAINT variant_sourcegeneralconsequence_id_fk FOREIGN KEY (sourcegeneralconsequence_id) REFERENCES soterm (id); ALTER TABLE variant ADD CONSTRAINT variant_varianttype_id_fk FOREIGN KEY (varianttype_id) REFERENCES soterm (id); CREATE INDEX variant_sourcegeneralconsequence_index ON variant USING btree (sourcegeneralconsequence_id); CREATE INDEX variant_varianttype_index ON variant USING btree (varianttype_id); -ALTER TABLE variant_aud ADD CONSTRAINT variant_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES genomicentity_aud (id, rev); ALTER TABLE variant_note ADD CONSTRAINT variant_note_variant_id_fk FOREIGN KEY (variant_id) REFERENCES variant (id); CREATE INDEX variant_note_variant_index ON variant_note USING btree (variant_id); ALTER TABLE vocabulary ADD CONSTRAINT vocabulary_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE vocabulary_aud ADD CONSTRAINT vocabulary_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE vocabularyterm ADD CONSTRAINT vocabularyterm_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE vocabularyterm_aud ADD CONSTRAINT vocabularyterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE vocabularytermset ADD CONSTRAINT vocabularytermset_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE vocabularytermset_aud ADD CONSTRAINT vocabularytermset_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES auditedobject_aud (id, rev); ALTER TABLE vtterm ADD CONSTRAINT vtterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE vtterm_aud ADD CONSTRAINT vtterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE wbbtterm ADD CONSTRAINT wbbtterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE wbbtterm_aud ADD CONSTRAINT wbbtterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); ALTER TABLE wblsterm ADD CONSTRAINT wblsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); -ALTER TABLE wblsterm_aud ADD CONSTRAINT wblsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); ALTER TABLE wbphenotypeterm ADD CONSTRAINT wbphenotypeterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); -ALTER TABLE wbphenotypeterm_aud ADD CONSTRAINT wbphenotypeterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); ALTER TABLE xbaterm ADD CONSTRAINT xbaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE xbaterm_aud ADD CONSTRAINT xbaterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); ALTER TABLE xbedterm ADD CONSTRAINT xbedterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE xbedterm_aud ADD CONSTRAINT xbedterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES ontologyterm_aud (id, rev); ALTER TABLE xbsterm ADD CONSTRAINT xbsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); -ALTER TABLE xbsterm_aud ADD CONSTRAINT xbsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); ALTER TABLE xcoterm ADD CONSTRAINT xcoterm_id_fk FOREIGN KEY (id) REFERENCES experimentalconditionontologyterm (id); -ALTER TABLE xcoterm_aud ADD CONSTRAINT xcoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES experimentalconditionontologyterm_aud (id, rev); ALTER TABLE xpoterm ADD CONSTRAINT xpoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); -ALTER TABLE xpoterm_aud ADD CONSTRAINT xpoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES phenotypeterm_aud (id, rev); ALTER TABLE xsmoterm ADD CONSTRAINT xsmoterm_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); -ALTER TABLE xsmoterm_aud ADD CONSTRAINT xsmoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES chemicalterm_aud (id, rev); ALTER TABLE zecoterm ADD CONSTRAINT zecoterm_id_fk FOREIGN KEY (id) REFERENCES experimentalconditionontologyterm (id); -ALTER TABLE zecoterm_aud ADD CONSTRAINT zecoterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES experimentalconditionontologyterm_aud (id, rev); ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE zfaterm_aud ADD CONSTRAINT zfaterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES anatomicalterm_aud (id, rev); ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); -ALTER TABLE zfsterm_aud ADD CONSTRAINT zfsterm_aud_id_rev_fk FOREIGN KEY (id, rev) REFERENCES stageterm_aud (id, rev); From badc295e6b6d2b4224b35720855d811ccd6569e0 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 5 Jan 2024 10:08:27 +0000 Subject: [PATCH 026/159] Migration update --- .../v0.30.0.1__linkml_v2.0.0_update.sql | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index d5ca50176..d2d7a81c4 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -20,6 +20,8 @@ ALTER TABLE genediseaseannotation DROP COLUMN IF EXISTS predicate; ALTER TABLE synonym ALTER COLUMN name SET DATA TYPE text; -- Drop audit tables +SET session_replication_role = 'replica'; + DROP TABLE affectedgenomicmodel_aud; DROP TABLE agmdiseaseannotation_aud; DROP TABLE agmdiseaseannotation_gene_aud; @@ -43,26 +45,20 @@ DROP TABLE allelesecondaryidslotannotation_aud; DROP TABLE allelesymbolslotannotation_aud; DROP TABLE allelesynonymslotannotation_aud; DROP TABLE alliancemember_aud; -DROP TABLE anatomicalterm_aud; -DROP TABLE annotation_aud; DROP TABLE annotation_conditionrelation_aud; DROP TABLE annotation_note_aud; DROP TABLE apoterm_aud; -DROP TABLE association_aud; DROP TABLE atpterm_aud; -DROP TABLE biologicalentity_aud; DROP TABLE bspoterm_aud; DROP TABLE bulkfmsload_aud; -DROP TABLE bulkload_aud; DROP TABLE bulkloadfile_aud; DROP TABLE bulkloadfileexception_aud; DROP TABLE bulkloadfilehistory_aud; DROP TABLE bulkloadgroup_aud; DROP TABLE bulkmanualload_aud; -DROP TABLE bulkscheduledload_aud; DROP TABLE bulkurlload_aud; +DROP TABLE bulkscheduledload_aud; DROP TABLE chebiterm_aud; -DROP TABLE chemicalterm_aud; DROP TABLE clterm_aud; DROP TABLE cmoterm_aud; DROP TABLE conditionrelation_aud; @@ -82,7 +78,6 @@ DROP TABLE curationreportgroup_aud; DROP TABLE curationreporthistory_aud; DROP TABLE daoterm_aud; DROP TABLE dataprovider_aud; -DROP TABLE diseaseannotation_aud; DROP TABLE diseaseannotation_biologicalentity_aud; DROP TABLE diseaseannotation_ecoterm_aud; DROP TABLE diseaseannotation_gene_aud; @@ -91,10 +86,8 @@ DROP TABLE doterm_aud; DROP TABLE dpoterm_aud; DROP TABLE ecoterm_aud; DROP TABLE emapaterm_aud; -DROP TABLE evidenceassociation_aud; DROP TABLE evidenceassociation_informationcontententity_aud; DROP TABLE experimentalcondition_aud; -DROP TABLE experimentalconditionontologyterm_aud; DROP TABLE fbdvterm_aud; DROP TABLE gene_aud; DROP TABLE genediseaseannotation_aud; @@ -103,17 +96,15 @@ DROP TABLE genesecondaryidslotannotation_aud; DROP TABLE genesymbolslotannotation_aud; DROP TABLE genesynonymslotannotation_aud; DROP TABLE genesystematicnameslotannotation_aud; -DROP TABLE genetogeneorthology_aud; DROP TABLE genetogeneorthologycurated_aud; DROP TABLE genetogeneorthologygenerated_aud; +DROP TABLE genetogeneorthology_aud; DROP TABLE genetogeneorthologygenerated_predictionmethodsmatched_aud; DROP TABLE genetogeneorthologygenerated_predictionmethodsnotcalled_aud; DROP TABLE genetogeneorthologygenerated_predictionmethodsnotmatched_aud; -DROP TABLE genomicentity_aud; DROP TABLE genomicentity_crossreference_aud; DROP TABLE goterm_aud; DROP TABLE hpterm_aud; -DROP TABLE informationcontententity_aud; DROP TABLE materm_aud; DROP TABLE miterm_aud; DROP TABLE mmoterm_aud; @@ -122,12 +113,10 @@ DROP TABLE modterm_aud; DROP TABLE molecule_aud; DROP TABLE mpathterm_aud; DROP TABLE mpterm_aud; -DROP TABLE nameslotannotation_aud; DROP TABLE ncbitaxonterm_aud; DROP TABLE note_aud; DROP TABLE note_reference_aud; DROP TABLE obiterm_aud; -DROP TABLE ontologyterm_aud; DROP TABLE ontologyterm_crossreference_aud; DROP TABLE ontologyterm_definitionurls_aud; DROP TABLE ontologyterm_isa_ancestor_descendant_aud; @@ -136,13 +125,11 @@ DROP TABLE ontologyterm_secondaryidentifiers_aud; DROP TABLE ontologyterm_subsets_aud; DROP TABLE ontologyterm_synonym_aud; DROP TABLE organization_aud; -DROP TABLE paperhandle_aud; DROP TABLE patoterm_aud; DROP TABLE person_aud; DROP TABLE person_emails_aud; DROP TABLE person_oldemails_aud; DROP TABLE personsetting_aud; -DROP TABLE phenotypeterm_aud; DROP TABLE pwterm_aud; DROP TABLE reagent_aud; DROP TABLE reagent_secondaryidentifiers_aud; @@ -153,14 +140,10 @@ DROP TABLE resourcedescriptor_synonyms_aud; DROP TABLE resourcedescriptorpage_aud; DROP TABLE roterm_aud; DROP TABLE rsterm_aud; -DROP TABLE secondaryidslotannotation_aud; -DROP TABLE singlereferenceassociation_aud; -DROP TABLE slotannotation_aud; DROP TABLE slotannotation_informationcontententity_aud; DROP TABLE soterm_aud; DROP TABLE species_aud; DROP TABLE species_commonnames_aud; -DROP TABLE stageterm_aud; DROP TABLE synonym_aud; DROP TABLE uberonterm_aud; DROP TABLE variant_aud; @@ -183,6 +166,25 @@ DROP TABLE xsmoterm_aud; DROP TABLE zecoterm_aud; DROP TABLE zfaterm_aud; DROP TABLE zfsterm_aud; +DROP TABLE anatomicalterm_aud; +DROP TABLE chemicalterm_aud; +DROP TABLE experimentalconditionontologyterm_aud; +DROP TABLE phenotypeterm_aud; +DROP TABLE stageterm_aud; +DROP TABLE ontologyterm_aud; +DROP TABLE genomicentity_aud; +DROP TABLE biologicalentity_aud; +DROP TABLE bulkload_aud; +DROP TABLE informationcontententity_aud; +DROP TABLE secondaryidslotannotation_aud; +DROP TABLE nameslotannotation_aud; +DROP TABLE slotannotation_aud; +DROP TABLE diseaseannotation_aud; +DROP TABLE annotation_aud; +DROP TABLE singlereferenceassociation_aud; +DROP TABLE evidenceassociation_aud; +DROP TABLE association_aud; +DROP TABLE revinfo; -- Drop indexes and constraints @@ -681,8 +683,6 @@ ALTER TABLE zfsterm ADD COLUMN id bigint; -- Move data around -SET session_replication_role = 'replica'; - INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) SELECT 'association', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete FROM association; From 29b213c3478fdbc4c7c0435dc289b72e28c093b7 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 5 Jan 2024 11:04:35 +0000 Subject: [PATCH 027/159] Hibernate annotation updates --- .../curation_api/model/entities/DiseaseAnnotation.java | 3 --- .../curation_api/model/entities/GenomicEntity.java | 3 --- .../curation_api/model/entities/base/AuditedObject.java | 2 ++ .../curation_api/model/entities/base/CurieObject.java | 2 ++ .../curation_api/model/entities/base/SubmittedObject.java | 2 ++ 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java index b411c1838..be35581e1 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java @@ -30,8 +30,6 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; import jakarta.persistence.ManyToOne; @@ -46,7 +44,6 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { ConditionRelation.class, Note.class, SingleReferenceAssociation.class }) @Schema(name = "Disease_Annotation", description = "Annotation class representing a disease annotation") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java index 5126e4689..27f92da67 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java @@ -15,8 +15,6 @@ import jakarta.persistence.CascadeType; import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.OneToMany; import lombok.Data; @@ -24,7 +22,6 @@ import lombok.ToString; @Entity -@Inheritance(strategy = InheritanceType.JOINED) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(exclude = { "crossReferences", "constructGenomicEntityAssociations" }, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java index 5c9f32c0b..333188897 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java @@ -9,6 +9,7 @@ import org.alliancegenome.curation_api.model.entities.Person; import org.alliancegenome.curation_api.view.View; import org.alliancegenome.curation_api.view.View.VocabularyTermSetView; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.CreationTimestamp; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; @@ -52,6 +53,7 @@ @Index(name = "auditedobject_createdby_index", columnList = "createdBy_id"), @Index(name = "auditedobject_updatedby_index", columnList = "updatedBy_id") }) +@Schema(name = "AuditedObject", description = "POJO that represents the AuditedObject") public class AuditedObject extends BaseEntity { @Id diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java index 9d8663b17..cbfb6f3bc 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java @@ -3,6 +3,7 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.view.View; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.search.engine.backend.types.Aggregable; import org.hibernate.search.engine.backend.types.Searchable; import org.hibernate.search.engine.backend.types.Sortable; @@ -32,6 +33,7 @@ @UniqueConstraint(name = "curieobject_curie_uk", columnNames = "curie") } ) +@Schema(name = "CurieObject", description = "POJO that represents the CurieObject") public class CurieObject extends AuditedObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java index 6b66225c4..cdf6de7bc 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java @@ -5,6 +5,7 @@ import org.alliancegenome.curation_api.model.entities.DataProvider; import org.alliancegenome.curation_api.view.View; import org.apache.commons.lang3.StringUtils; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; import org.hibernate.search.engine.backend.types.Aggregable; @@ -44,6 +45,7 @@ @UniqueConstraint(name = "submittedobject_modinternalid_uk", columnNames = "modinternalid"), } ) +@Schema(name = "SubmittedObject", description = "POJO that represents the SubmittedObject") public class SubmittedObject extends CurieObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") From 8c090a033255d3751b30b00b550f5444b91d14b9 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 5 Jan 2024 12:44:00 +0000 Subject: [PATCH 028/159] More annotation cleanup --- .../curation_api/model/entities/Association.java | 8 -------- .../model/entities/EvidenceAssociation.java | 12 ------------ .../curation_api/model/entities/Organization.java | 7 ------- .../curation_api/model/entities/Person.java | 3 --- .../model/entities/SingleReferenceAssociation.java | 3 --- .../model/entities/bulkloads/BulkLoad.java | 3 --- .../model/entities/bulkloads/BulkScheduledLoad.java | 3 --- .../entities/curationreports/CurationReport.java | 3 --- .../curationreports/CurationReportHistory.java | 3 --- .../model/entities/ontology/AnatomicalTerm.java | 3 --- .../model/entities/ontology/ChemicalTerm.java | 3 --- .../ontology/ExperimentalConditionOntologyTerm.java | 3 --- .../model/entities/ontology/PhenotypeTerm.java | 3 --- .../model/entities/ontology/StageTerm.java | 3 --- .../entities/orthology/GeneToGeneOrthology.java | 3 --- .../ConstructComponentSlotAnnotation.java | 3 --- 16 files changed, 66 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java index a2ef4b341..b6d266c05 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java @@ -5,19 +5,11 @@ import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; - import jakarta.persistence.Entity; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = SingleReferenceAssociation.class, name = "SingleReferenceAssociation"), - @JsonSubTypes.Type(value = EvidenceAssociation.class, name = "EvidenceAssociation") -}) @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java index 1d933e437..ae0c9e72e 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/EvidenceAssociation.java @@ -4,36 +4,24 @@ import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; -import org.alliancegenome.curation_api.model.entities.associations.alleleAssociations.AlleleGenomicEntityAssociation; -import org.alliancegenome.curation_api.model.entities.associations.constructAssociations.ConstructGenomicEntityAssociation; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; import lombok.Data; import lombok.EqualsAndHashCode; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = AlleleGenomicEntityAssociation.class, name = "AlleleGenomicEntityAssociation"), - @JsonSubTypes.Type(value = ConstructGenomicEntityAssociation.class, name = "ConstructGenomicEntityAssociation") -}) @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @Schema(name = "evidenceAssociation", description = "POJO that represents an association supported by any number of information content entities") @AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Association.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java index fe1dc5efd..584678c0f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java @@ -12,26 +12,19 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.OneToOne; import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ @JsonSubTypes.Type(value = AllianceMember.class, name = "AllianceMember") }) @Data @Entity -@Inheritance(strategy = InheritanceType.JOINED) @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Agent.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java index 76883fef5..84372c2ec 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java @@ -18,8 +18,6 @@ import jakarta.persistence.ElementCollection; import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; @@ -29,7 +27,6 @@ import lombok.ToString; @Entity -@Inheritance(strategy = InheritanceType.JOINED) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java index 099f1779b..686206842 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java @@ -12,8 +12,6 @@ import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; import lombok.Data; @@ -22,7 +20,6 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @Schema(name = "singleReferenceAssociation", description = "POJO that represents an association supported by a single reference") @AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Association.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java index a01ff1f9c..326816802 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java @@ -17,8 +17,6 @@ import jakarta.persistence.EnumType; import jakarta.persistence.Enumerated; import jakarta.persistence.FetchType; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; import jakarta.persistence.OrderBy; @@ -27,7 +25,6 @@ import lombok.ToString; @Entity -@Inheritance(strategy = InheritanceType.JOINED) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(exclude = { "group" }, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkScheduledLoad.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkScheduledLoad.java index 8d8e5490c..3d0c2ccb5 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkScheduledLoad.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkScheduledLoad.java @@ -17,15 +17,12 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.Transient; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @Entity -@Inheritance(strategy = InheritanceType.JOINED) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java index 39c51ff70..a741150f5 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java @@ -14,8 +14,6 @@ import jakarta.persistence.Entity; import jakarta.persistence.EnumType; import jakarta.persistence.Enumerated; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; import jakarta.persistence.OrderBy; @@ -24,7 +22,6 @@ import lombok.ToString; @Entity -@Inheritance(strategy = InheritanceType.JOINED) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(exclude = { "curationReportGroup", "curationReportHistory" }, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportHistory.java b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportHistory.java index de83f44a4..c88592a3f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportHistory.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReportHistory.java @@ -13,8 +13,6 @@ import jakarta.persistence.Entity; import jakarta.persistence.EnumType; import jakarta.persistence.Enumerated; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.Transient; import lombok.Data; @@ -22,7 +20,6 @@ import lombok.ToString; @Entity -@Inheritance(strategy = InheritanceType.JOINED) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(exclude = { "curationReport" }, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java index ce34170b4..855c6fff3 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/AnatomicalTerm.java @@ -4,8 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import jakarta.persistence.Entity; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -14,7 +12,6 @@ @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @AGRCurationSchemaVersion(min = LinkMLSchemaConstants.MIN_ONTOLOGY_RELEASE, max = LinkMLSchemaConstants.MAX_ONTOLOGY_RELEASE, dependencies = { OntologyTerm.class }) public class AnatomicalTerm extends OntologyTerm { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java index fe70cad7c..683cc9ff3 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ChemicalTerm.java @@ -13,8 +13,6 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -23,7 +21,6 @@ @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @AGRCurationSchemaVersion(min = LinkMLSchemaConstants.MIN_ONTOLOGY_RELEASE, max = LinkMLSchemaConstants.MAX_ONTOLOGY_RELEASE, dependencies = { OntologyTerm.class }) public class ChemicalTerm extends OntologyTerm { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java index 632eb6e77..524cd5187 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/ExperimentalConditionOntologyTerm.java @@ -4,8 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import jakarta.persistence.Entity; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -14,7 +12,6 @@ @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @AGRCurationSchemaVersion(min = LinkMLSchemaConstants.MIN_ONTOLOGY_RELEASE, max = LinkMLSchemaConstants.MAX_ONTOLOGY_RELEASE, dependencies = { OntologyTerm.class }) public class ExperimentalConditionOntologyTerm extends OntologyTerm { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java index fb2ae3db2..7e2445877 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/PhenotypeTerm.java @@ -4,8 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import jakarta.persistence.Entity; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -14,7 +12,6 @@ @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @AGRCurationSchemaVersion(min = LinkMLSchemaConstants.MIN_ONTOLOGY_RELEASE, max = LinkMLSchemaConstants.MAX_ONTOLOGY_RELEASE, dependencies = { OntologyTerm.class }) public class PhenotypeTerm extends OntologyTerm { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java index 6fd5c5eaf..b71d736eb 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/StageTerm.java @@ -4,8 +4,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import jakarta.persistence.Entity; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -14,7 +12,6 @@ @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @AGRCurationSchemaVersion(min = LinkMLSchemaConstants.MIN_ONTOLOGY_RELEASE, max = LinkMLSchemaConstants.MAX_ONTOLOGY_RELEASE, dependencies = { OntologyTerm.class }) public class StageTerm extends OntologyTerm { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java index 91a72c078..d8c530949 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java @@ -14,8 +14,6 @@ import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; import lombok.Data; @@ -25,7 +23,6 @@ @Entity @Data @EqualsAndHashCode(callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @ToString(callSuper = true) @Schema(name = "GeneToGeneOrthology", description = "POJO that represents orthology between two genes") @AGRCurationSchemaVersion(min = "1.7.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructComponentSlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructComponentSlotAnnotation.java index d663068b7..1846cb3c5 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructComponentSlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/constructSlotAnnotations/ConstructComponentSlotAnnotation.java @@ -27,8 +27,6 @@ import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; @@ -40,7 +38,6 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@Inheritance(strategy = InheritanceType.JOINED) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.10.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotation.class }) @Schema(name = "ConstructComponentSlotAnnotation", description = "POJO representing a construct component slot annotation") From 7961bf79db844a0c56e8a96d456aa0223a495937 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 5 Jan 2024 13:17:11 +0000 Subject: [PATCH 029/159] More cleanup --- .../alleleAssociations/AlleleGeneAssociationExecutor.java | 3 --- .../ConstructGenomicEntityAssociationExecutor.java | 3 --- .../curation_api/model/entities/Annotation.java | 6 ------ .../alleleAssociations/AlleleGenomicEntityAssociation.java | 4 ---- 4 files changed, 16 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/alleleAssociations/AlleleGeneAssociationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/alleleAssociations/AlleleGeneAssociationExecutor.java index 3710b6f7e..3014a6a83 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/alleleAssociations/AlleleGeneAssociationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/alleleAssociations/AlleleGeneAssociationExecutor.java @@ -19,7 +19,6 @@ import org.alliancegenome.curation_api.services.associations.alleleAssociations.AlleleGeneAssociationService; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; -import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import lombok.extern.jbosslog.JBossLog; @@ -88,11 +87,9 @@ public void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataPro idsAdded.add(association.getId()); } } catch (ObjectUpdateException e) { - Log.info("EXCEPTION 1: " + e.getData()); history.incrementFailed(); addException(history, e.getData()); } catch (Exception e) { - Log.info("EXCEPTION 2: " + e.getLocalizedMessage()); history.incrementFailed(); addException(history, new ObjectUpdateExceptionData(associationDTO, e.getMessage(), e.getStackTrace())); } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/constructAssociations/ConstructGenomicEntityAssociationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/constructAssociations/ConstructGenomicEntityAssociationExecutor.java index a275dbbc3..9a4957dba 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/constructAssociations/ConstructGenomicEntityAssociationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/constructAssociations/ConstructGenomicEntityAssociationExecutor.java @@ -20,7 +20,6 @@ import org.alliancegenome.curation_api.services.associations.constructAssociations.ConstructGenomicEntityAssociationService; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; -import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import lombok.extern.jbosslog.JBossLog; @@ -91,11 +90,9 @@ public void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataPro idsAdded.add(association.getId()); } } catch (ObjectUpdateException e) { - Log.info("EXCEPTION 1: " + e.getData()); history.incrementFailed(); addException(history, e.getData()); } catch (Exception e) { - Log.info("EXCEPTION 2: " + e.getLocalizedMessage()); history.incrementFailed(); addException(history, new ObjectUpdateExceptionData(associationDTO, e.getMessage(), e.getStackTrace())); } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java index 2fa0c95e9..9e1a07828 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java @@ -18,8 +18,6 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.CascadeType; @@ -36,10 +34,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ - @JsonSubTypes.Type(value = DiseaseAnnotation.class, name = "DiseaseAnnotation") -}) @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java index 19ea6da11..017a4cb02 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java @@ -12,8 +12,6 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.CascadeType; @@ -26,8 +24,6 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonSubTypes({ @JsonSubTypes.Type(value = AlleleGeneAssociation.class, name = "AlleleGeneAssociation") }) @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) From df68ba7210f0015d20dbf569ad7ff34c0a7cdcf7 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 5 Jan 2024 15:18:00 +0000 Subject: [PATCH 030/159] Remove envers dependency --- pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pom.xml b/pom.xml index b5012e7ff..2235e2678 100644 --- a/pom.xml +++ b/pom.xml @@ -154,10 +154,6 @@ io.quarkus quarkus-resteasy-multipart - - io.quarkus - quarkus-hibernate-envers - io.quarkus quarkus-jdbc-postgresql From 452b2f4df3b97c9b9f8a7c74c180c47bafa53870 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 5 Jan 2024 20:23:48 +0000 Subject: [PATCH 031/159] Fix NPE --- .../curation_api/services/base/BaseOntologyTermService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java b/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java index 7a60aec3d..1aa8bfa01 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java @@ -42,7 +42,7 @@ public E findByCurieOrSecondaryId(String id) { return term; SearchResponse response = dao.findByField("secondaryIdentifiers", id); - if (response.getTotalResults() == 1) + if (response != null && response.getTotalResults() == 1) return response.getSingleResult(); return null; From 4899892f29bd91bda5c576eb030933dde2374295 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Mon, 8 Jan 2024 13:25:23 +0000 Subject: [PATCH 032/159] Update persist logic --- .../services/validation/AlleleValidator.java | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java index 53bec6591..21970dc7b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java @@ -14,13 +14,10 @@ import org.alliancegenome.curation_api.dao.CrossReferenceDAO; import org.alliancegenome.curation_api.exceptions.ApiErrorException; import org.alliancegenome.curation_api.model.entities.Allele; -import org.alliancegenome.curation_api.model.entities.CrossReference; -import org.alliancegenome.curation_api.model.entities.DataProvider; import org.alliancegenome.curation_api.model.entities.Note; import org.alliancegenome.curation_api.model.entities.Reference; import org.alliancegenome.curation_api.model.entities.VocabularyTerm; import org.alliancegenome.curation_api.model.entities.associations.alleleAssociations.AlleleGeneAssociation; -import org.alliancegenome.curation_api.model.entities.ontology.NCBITaxonTerm; import org.alliancegenome.curation_api.model.entities.slotAnnotations.alleleSlotAnnotations.AlleleDatabaseStatusSlotAnnotation; import org.alliancegenome.curation_api.model.entities.slotAnnotations.alleleSlotAnnotations.AlleleFullNameSlotAnnotation; import org.alliancegenome.curation_api.model.entities.slotAnnotations.alleleSlotAnnotations.AlleleFunctionalImpactSlotAnnotation; @@ -47,7 +44,6 @@ import org.alliancegenome.curation_api.services.validation.slotAnnotations.alleleSlotAnnotations.AlleleSynonymSlotAnnotationValidator; import org.apache.commons.collections.CollectionUtils; -import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -210,6 +206,8 @@ public Allele validateAllele(Allele uiEntity, Allele dbEntity, Boolean updateAll if (inheritanceModes != null) { if (dbEntity.getAlleleInheritanceModes() == null) dbEntity.setAlleleInheritanceModes(new ArrayList<>()); + for (AlleleInheritanceModeSlotAnnotation im : inheritanceModes) + im.setSingleAllele(dbEntity); dbEntity.getAlleleInheritanceModes().addAll(inheritanceModes); } @@ -218,6 +216,8 @@ public Allele validateAllele(Allele uiEntity, Allele dbEntity, Boolean updateAll if (functionalImpacts != null) { if (dbEntity.getAlleleFunctionalImpacts() == null) dbEntity.setAlleleFunctionalImpacts(new ArrayList<>()); + for (AlleleFunctionalImpactSlotAnnotation fi : functionalImpacts) + fi.setSingleAllele(dbEntity); dbEntity.getAlleleFunctionalImpacts().addAll(functionalImpacts); } @@ -226,6 +226,8 @@ public Allele validateAllele(Allele uiEntity, Allele dbEntity, Boolean updateAll if (mutationTypes != null) { if (dbEntity.getAlleleMutationTypes() == null) dbEntity.setAlleleMutationTypes(new ArrayList<>()); + for (AlleleMutationTypeSlotAnnotation mt : mutationTypes) + mt.setSingleAllele(dbEntity); dbEntity.getAlleleMutationTypes().addAll(mutationTypes); } @@ -234,6 +236,8 @@ public Allele validateAllele(Allele uiEntity, Allele dbEntity, Boolean updateAll if (nomenclatureEvents != null) { if (dbEntity.getAlleleNomenclatureEvents() == null) dbEntity.setAlleleNomenclatureEvents(new ArrayList<>()); + for (AlleleNomenclatureEventSlotAnnotation nm : nomenclatureEvents) + nm.setSingleAllele(dbEntity); dbEntity.getAlleleNomenclatureEvents().addAll(nomenclatureEvents); } @@ -368,9 +372,7 @@ private List validateAlleleMutationTypes(Allel allValid = false; response.addErrorMessages(field, ix, mtResponse.getErrorMessages()); } else { - mt = mtResponse.getEntity(); - mt.setSingleAllele(dbEntity); - validatedMutationTypes.add(mt); + validatedMutationTypes.add(mtResponse.getEntity()); } } } @@ -399,9 +401,7 @@ private List validateAlleleInheritanceModes response.addErrorMessages(field, ix, imResponse.getErrorMessages()); allValid = false; } else { - im = imResponse.getEntity(); - im.setSingleAllele(dbEntity); - validatedInheritanceModes.add(im); + validatedInheritanceModes.add(imResponse.getEntity()); } } } @@ -461,9 +461,7 @@ private List validateAlleleNomenclatureEv response.addErrorMessages(field, ix, neResponse.getErrorMessages()); addMessageResponse(field, neResponse.errorMessagesString()); } else { - ne = neResponse.getEntity(); - ne.setSingleAllele(dbEntity); - validatedNomenclatureEvents.add(ne); + validatedNomenclatureEvents.add(neResponse.getEntity()); } } } @@ -583,9 +581,7 @@ private List validateAlleleFunctionalImpac response.addErrorMessages(field, ix, fiResponse.getErrorMessages()); allValid = false; } else { - fi = fiResponse.getEntity(); - fi.setSingleAllele(dbEntity); - validatedFunctionalImpacts.add(fi); + validatedFunctionalImpacts.add(fiResponse.getEntity()); } } } From 6071f165a61d7f8efcba43048a08163c555f206d Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Mon, 8 Jan 2024 13:25:38 +0000 Subject: [PATCH 033/159] Re-add erroneously removed subtypes --- .../curation_api/model/entities/bulkloads/BulkLoad.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java index 326816802..468f7e7e4 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java @@ -10,6 +10,9 @@ import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.view.View; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; @@ -23,7 +26,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; - +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ @Type(value = BulkFMSLoad.class, name = "BulkFMSLoad"), @Type(value = BulkURLLoad.class, name = "BulkURLLoad"), @Type(value = BulkManualLoad.class, name = "BulkManualLoad") }) @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) From c568a4b3ea5b39b529a923d517bfefcedc9941e1 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 9 Jan 2024 10:50:40 +0000 Subject: [PATCH 034/159] Add overrides --- .../interfaces/crud/AGMDiseaseAnnotationCrudInterface.java | 2 ++ .../interfaces/crud/AlleleDiseaseAnnotationCrudInterface.java | 2 ++ .../interfaces/crud/GeneDiseaseAnnotationCrudInterface.java | 2 ++ .../alliancegenome/curation_api/jobs/util/SlackNotifier.java | 2 +- .../ConstructGenomicEntityAssociationDTO.java | 2 +- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AGMDiseaseAnnotationCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AGMDiseaseAnnotationCrudInterface.java index 127694d06..730525f12 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AGMDiseaseAnnotationCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AGMDiseaseAnnotationCrudInterface.java @@ -33,11 +33,13 @@ public interface AGMDiseaseAnnotationCrudInterface extends BaseIdCrudInterface get(@PathParam("identifier") String identifier); + @Override @PUT @Path("/") @JsonView(View.DiseaseAnnotation.class) public ObjectResponse update(AGMDiseaseAnnotation entity); + @Override @POST @Path("/") @JsonView(View.DiseaseAnnotation.class) diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AlleleDiseaseAnnotationCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AlleleDiseaseAnnotationCrudInterface.java index cfd692726..0d9d6e321 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AlleleDiseaseAnnotationCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AlleleDiseaseAnnotationCrudInterface.java @@ -33,11 +33,13 @@ public interface AlleleDiseaseAnnotationCrudInterface extends BaseIdCrudInterfac @JsonView(View.FieldsAndLists.class) public ObjectResponse get(@PathParam("identifier") String identifier); + @Override @PUT @Path("/") @JsonView(View.DiseaseAnnotation.class) public ObjectResponse update(AlleleDiseaseAnnotation entity); + @Override @POST @Path("/") @JsonView(View.DiseaseAnnotation.class) diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/GeneDiseaseAnnotationCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/GeneDiseaseAnnotationCrudInterface.java index 3d934e5da..f98116781 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/GeneDiseaseAnnotationCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/GeneDiseaseAnnotationCrudInterface.java @@ -33,11 +33,13 @@ public interface GeneDiseaseAnnotationCrudInterface extends BaseIdCrudInterface< @JsonView(View.FieldsAndLists.class) public ObjectResponse get(@PathParam("identifier") String identifier); + @Override @PUT @Path("/") @JsonView(View.DiseaseAnnotation.class) public ObjectResponse update(GeneDiseaseAnnotation entity); + @Override @POST @Path("/") @JsonView(View.DiseaseAnnotation.class) diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/util/SlackNotifier.java b/src/main/java/org/alliancegenome/curation_api/jobs/util/SlackNotifier.java index 372967e1a..bfc381b7b 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/util/SlackNotifier.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/util/SlackNotifier.java @@ -22,7 +22,7 @@ @ApplicationScoped public class SlackNotifier { - @ConfigProperty(name = "net") + @ConfigProperty(name = "net", defaultValue="\"\"") Instance systemName; @ConfigProperty(name = "slack.token") Instance slackToken; diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTO.java index 72df3a0b8..0a3341bee 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTO.java @@ -16,7 +16,7 @@ @Setter @Getter -@AGRCurationSchemaVersion(min = "1.11.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { EvidenceAssociationDTO.class, NoteDTO.class }, submitted = true) +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { EvidenceAssociationDTO.class, NoteDTO.class }, submitted = true) public class ConstructGenomicEntityAssociationDTO extends EvidenceAssociationDTO { @JsonView({ View.FieldsOnly.class }) From 8849fc74edad812a6b7459c71a4602dcc067dda7 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Wed, 10 Jan 2024 10:21:13 +0000 Subject: [PATCH 035/159] Add missing updates to migration --- .../resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index d2d7a81c4..61fd3834b 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -1023,6 +1023,7 @@ UPDATE person t SET alliancemember_id = a.id FROM auditedobject a WHERE t.allian UPDATE person_emails t SET person_id = a.id FROM auditedobject a WHERE t.person_id = a.old_id AND a.tablename = 'person'; UPDATE person_oldemails t SET person_id = a.id FROM auditedobject a WHERE t.person_id = a.old_id AND a.tablename = 'person'; UPDATE personsetting t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'personsetting'; +UPDATE personsetting t SET person_id = a.id FROM auditedobject a WHERE t.person_id = a.old_id AND a.tablename = 'person'; UPDATE phenotypeterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE pwterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE reagent t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'reagent'; @@ -1045,6 +1046,7 @@ UPDATE slotannotation_informationcontententity t SET slotannotation_id = a.id FR UPDATE slotannotation_informationcontententity t SET evidence_id = a.id FROM auditedobject a WHERE t.evidence_curie = a.old_curie AND a.tablename = 'informationcontententity'; UPDATE soterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE species t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'species'; +UPDATE species t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; UPDATE species t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; UPDATE species_commonnames t SET species_id = a.id FROM auditedobject a WHERE t.species_id = a.old_id AND a.tablename = 'species'; UPDATE stageterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; From 3c378f5e65793f093e335ecacb19c9546fc419c0 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Wed, 10 Jan 2024 12:40:23 -0500 Subject: [PATCH 036/159] Updated migration file --- .../model/entities/base/AuditedObject.java | 5 +- .../v0.30.0.1__linkml_v2.0.0_update.sql | 97 ++++++++++++++++++- 2 files changed, 100 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java index 333188897..e8301f618 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java @@ -29,6 +29,7 @@ import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; @@ -51,8 +52,10 @@ @Inheritance(strategy = InheritanceType.JOINED) @Table(indexes = { @Index(name = "auditedobject_createdby_index", columnList = "createdBy_id"), - @Index(name = "auditedobject_updatedby_index", columnList = "updatedBy_id") + @Index(name = "auditedobject_updatedby_index", columnList = "updatedBy_id"), + @Index(name = "auditedobject_auditedObjectType_index", columnList = "auditedObjectType"), }) +@DiscriminatorColumn(name = "auditedObjectType") @Schema(name = "AuditedObject", description = "POJO that represents the AuditedObject") public class AuditedObject extends BaseEntity { diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index 61fd3834b..7e91f01d1 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -503,7 +503,8 @@ CREATE TABLE auditedobject ( dbdatecreated timestamp without time zone, dbdateupdated timestamp without time zone, internal boolean NOT NULL DEFAULT false, - obsolete boolean NOT NULL DEFAULT false + obsolete boolean NOT NULL DEFAULT false, + auditedobjecttype varchar(64) ); CREATE TABLE curieobject ( @@ -1087,6 +1088,100 @@ INSERT INTO curieobject (id) SELECT id FROM submittedobject; INSERT INTO curieobject (id, curie) SELECT id, curie FROM ontologyterm; INSERT INTO curieobject (id, curie) SELECT id, curie FROM informationcontententity; + +-- Update Entity Types in the auditedobject table ... this needs to be done for all "leaf" nodes of the class tree +update AuditedObject a SET auditedObjectType = 'AGMDiseaseAnnotation' from AGMDiseaseAnnotation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'APOTerm' from APOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'ATPTerm' from ATPTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'AffectedGenomicModel' from AffectedGenomicModel t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'Allele' from Allele t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'AlleleDatabaseStatusSlotAnnotation' from AlleleDatabaseStatusSlotAnnotation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'AlleleDiseaseAnnotation' from AlleleDiseaseAnnotation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'AlleleFullNameSlotAnnotation' from AlleleFullNameSlotAnnotation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'AlleleFunctionalImpactSlotAnnotation' from AlleleFunctionalImpactSlotAnnotation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'AlleleGeneAssociation' from AlleleGeneAssociation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'AlleleGermlineTransmissionStatusSlotAnnotation' from AlleleGermlineTransmissionStatusSlotAnnotation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'AlleleInheritanceModeSlotAnnotation' from AlleleInheritanceModeSlotAnnotation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'AlleleMutationTypeSlotAnnotation' from AlleleMutationTypeSlotAnnotation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'AlleleNomenclatureEventSlotAnnotation' from AlleleNomenclatureEventSlotAnnotation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'AlleleSecondaryIdSlotAnnotation' from AlleleSecondaryIdSlotAnnotation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'AlleleSymbolSlotAnnotation' from AlleleSymbolSlotAnnotation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'AlleleSynonymSlotAnnotation' from AlleleSynonymSlotAnnotation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'AllianceMember' from AllianceMember t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'BSPOTerm' from BSPOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'BulkFMSLoad' from BulkFMSLoad t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'BulkLoadFile' from BulkLoadFile t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'BulkLoadFileException' from BulkLoadFileException t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'BulkLoadFileHistory' from BulkLoadFileHistory t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'BulkLoadGroup' from BulkLoadGroup t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'BulkManualLoad' from BulkManualLoad t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'BulkURLLoad' from BulkURLLoad t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'CHEBITerm' from CHEBITerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'CLTerm' from CLTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'CMOTerm' from CMOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'ConditionRelation' from ConditionRelation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'Construct' from Construct t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'ConstructGenomicEntityAssociation' from ConstructGenomicEntityAssociation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'CrossReference' from CrossReference t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'CurationReport' from CurationReport t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'CurationReportGroup' from CurationReportGroup t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'CurationReportHistory' from CurationReportHistory t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'DAOTerm' from DAOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'DOTerm' from DOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'DPOTerm' from DPOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'DataProvider' from DataProvider t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'ECOTerm' from ECOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'EMAPATerm' from EMAPATerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'ExperimentalCondition' from ExperimentalCondition t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'FBDVTerm' from FBDVTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'GOTerm' from GOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'Gene' from Gene t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'GeneDiseaseAnnotation' from GeneDiseaseAnnotation t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'GeneToGeneOrthologyCurated' from GeneToGeneOrthologyCurated t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'GeneToGeneOrthologyGenerated' from GeneToGeneOrthologyGenerated t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'HPTerm' from HPTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'MATerm' from MATerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'MITerm' from MITerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'MMOTerm' from MMOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'MMUSDVTerm' from MMUSDVTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'MODTerm' from MODTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'MPATHTerm' from MPATHTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'MPTerm' from MPTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'Molecule' from Molecule t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'NCBITaxonTerm' from NCBITaxonTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'Note' from Note t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'OBITerm' from OBITerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'PATOTerm' from PATOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'PWTerm' from PWTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'Person' from Person t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'PersonSetting' from PersonSetting t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'ROTerm' from ROTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'RSTerm' from RSTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'Reference' from Reference t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'ResourceDescriptor' from ResourceDescriptor t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'ResourceDescriptorPage' from ResourceDescriptorPage t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'SOTerm' from SOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'Species' from Species t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'Synonym' from Synonym t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'UBERONTerm' from UBERONTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'VTTerm' from VTTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'Variant' from Variant t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'Vocabulary' from Vocabulary t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'VocabularyTerm' from VocabularyTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'VocabularyTermSet' from VocabularyTermSet t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'WBBTTerm' from WBBTTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'WBLSTerm' from WBLSTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'WBPhenotypeTerm' from WBPhenotypeTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'XBATerm' from XBATerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'XBEDTerm' from XBEDTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'XBSTerm' from XBSTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'XCOTerm' from XCOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'XPOTerm' from XPOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'XSMOTerm' from XSMOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'ZECOTerm' from ZECOTerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'ZFATerm' from ZFATerm t where a.id = t.id; +update AuditedObject a SET auditedObjectType = 'ZFSTerm' from ZFSTerm t where a.id = t.id; + ALTER TABLE affectedgenomicmodel DROP COLUMN curie; ALTER TABLE agmdiseaseannotation DROP COLUMN inferredallele_curie; ALTER TABLE agmdiseaseannotation DROP COLUMN inferredgene_curie; From 1225d65e71de29c32b31216601a327f87bcb94a5 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 11 Jan 2024 18:04:02 +0000 Subject: [PATCH 037/159] Various bug fixes --- .../crud/ConstructCrudInterface.java | 3 +++ .../model/entities/AGMDiseaseAnnotation.java | 9 +++++++ .../entities/AlleleDiseaseAnnotation.java | 9 +++++++ .../model/entities/DiseaseAnnotation.java | 3 +++ .../model/entities/GeneDiseaseAnnotation.java | 9 +++++++ .../services/ConstructService.java | 24 ++++++------------- .../services/OrganizationService.java | 10 ++++++-- .../base/SubmittedObjectCrudService.java | 6 ++--- .../DiseaseAnnotationUniqueIdHelper.java | 2 +- .../validation/dto/VariantDTOValidator.java | 3 ++- ...omicEntityAssociationBulkUploadITCase.java | 18 +++++++------- .../controllers/DiseaseAnnotationITCase.java | 12 +++++----- .../AlleleGeneAssociationITCase.java | 4 ++-- 13 files changed, 70 insertions(+), 42 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ConstructCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ConstructCrudInterface.java index aadb58e61..cbdb092ef 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ConstructCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ConstructCrudInterface.java @@ -28,16 +28,19 @@ @Consumes(MediaType.APPLICATION_JSON) public interface ConstructCrudInterface extends SubmittedObjectCrudInterface, BaseDTOCrudControllerInterface { + @Override @GET @Path("/{identifierString}") @JsonView(View.ConstructView.class) public ObjectResponse get(@PathParam("identifierString") String identifierString); + @Override @PUT @Path("/") @JsonView(View.ConstructView.class) public ObjectResponse update(Construct entity); + @Override @POST @Path("/") @JsonView(View.ConstructView.class) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java index 2dde302f8..86437ae89 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java @@ -94,6 +94,15 @@ public String getSubjectTaxonCurie() { return null; return subject.getTaxon().getCurie(); } + + @Transient + @Override + @JsonIgnore + public String getSubjectIdentifier() { + if (subject == null) + return null; + return subject.getIdentifier(); + } @Transient @Override diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java index 41c02f4b8..91be3444c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java @@ -85,6 +85,15 @@ public String getSubjectTaxonCurie() { return null; return subject.getTaxon().getCurie(); } + + @Transient + @Override + @JsonIgnore + public String getSubjectIdentifier() { + if (subject == null) + return null; + return subject.getIdentifier(); + } @Transient @Override diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java index be35581e1..224a0a822 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java @@ -152,6 +152,9 @@ public abstract class DiseaseAnnotation extends Annotation { @Transient public abstract String getSubjectSpeciesName(); + + @Transient + public abstract String getSubjectIdentifier(); @Transient @JsonIgnore diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java index d160ca0cd..6b859d24d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java @@ -63,6 +63,15 @@ public String getSubjectTaxonCurie() { return null; return subject.getTaxon().getCurie(); } + + @Transient + @Override + @JsonIgnore + public String getSubjectIdentifier() { + if (subject == null) + return null; + return subject.getIdentifier(); + } @Transient @Override diff --git a/src/main/java/org/alliancegenome/curation_api/services/ConstructService.java b/src/main/java/org/alliancegenome/curation_api/services/ConstructService.java index 491ab034f..f9ce95baf 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ConstructService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ConstructService.java @@ -56,23 +56,13 @@ protected void init() { @Override public ObjectResponse get(String identifier) { - SearchResponse ret = findByField("curie", identifier); - if (ret != null && ret.getTotalResults() == 1) - return new ObjectResponse(ret.getResults().get(0)); - - ret = findByField("modEntityId", identifier); - if (ret != null && ret.getTotalResults() == 1) - return new ObjectResponse(ret.getResults().get(0)); - - ret = findByField("modInternalId", identifier); - if (ret != null && ret.getTotalResults() == 1) - return new ObjectResponse(ret.getResults().get(0)); - - ret = findByField("uniqueId", identifier); - if (ret != null && ret.getTotalResults() == 1) - return new ObjectResponse(ret.getResults().get(0)); - - return new ObjectResponse(); + Construct construct = findByIdentifierString(identifier); + if (construct == null) { + SearchResponse response = findByField("uniqueId", identifier); + if (response != null) + construct = response.getSingleResult(); + } + return new ObjectResponse(construct); } @Override diff --git a/src/main/java/org/alliancegenome/curation_api/services/OrganizationService.java b/src/main/java/org/alliancegenome/curation_api/services/OrganizationService.java index b27c61847..8b24da299 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/OrganizationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/OrganizationService.java @@ -6,6 +6,7 @@ import org.alliancegenome.curation_api.dao.OrganizationDAO; import org.alliancegenome.curation_api.model.entities.Organization; import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.base.BaseEntityCrudService; import io.quarkus.logging.Log; @@ -53,17 +54,22 @@ public ObjectResponse get(String orgId) { public ObjectResponse getByAbbr(String abbr) { Organization org = null; + SearchResponse orgResponse = null; if(orgRequest != null) { if(orgCacheMap.containsKey(abbr)) { org = orgCacheMap.get(abbr); } else { Log.debug("Org not cached, caching org: (" + abbr + ")"); - org = organizationDAO.findByField("abbreviation", abbr).getSingleResult(); + orgResponse = organizationDAO.findByField("abbreviation", abbr); + if (orgResponse != null) + org = orgResponse.getSingleResult(); orgCacheMap.put(abbr, org); } } else { - org = organizationDAO.findByField("abbreviation", abbr).getSingleResult(); + orgResponse = organizationDAO.findByField("abbreviation", abbr); + if (orgResponse != null) + org = orgResponse.getSingleResult(); orgRequest = new Date(); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java b/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java index 94076c055..5b4c815dc 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/base/SubmittedObjectCrudService.java @@ -40,11 +40,9 @@ public E findByIdentifierString(String id) { if (id.startsWith("AGRKB:")) { response = findByField("curie", id); } else { + response = findByField("modEntityId", id); if (response == null || response.getSingleResult() == null) { - response = findByField("modEntityId", id); - if (response == null || response.getSingleResult() == null) { - response = findByField("modInternalId", id); - } + response = findByField("modInternalId", id); } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java index 1c81cd155..5c5a4175c 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java @@ -77,7 +77,7 @@ public static String getDiseaseAnnotationUniqueId(DiseaseAnnotationDTO annotatio public static String getDiseaseAnnotationUniqueId(DiseaseAnnotation annotation) { UniqueIdGeneratorHelper uniqueId = new UniqueIdGeneratorHelper(); - uniqueId.add(annotation.getSubjectCurie()); + uniqueId.add(annotation.getSubjectIdentifier()); if (annotation.getRelation() != null) uniqueId.add(annotation.getRelation().getName()); if (annotation.getNegated() != null) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java index e766abde6..84cf84fb1 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java @@ -24,6 +24,7 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; import jakarta.transaction.Transactional; @@ -97,7 +98,7 @@ public Variant validateVariantDTO(VariantDTO dto, BackendBulkDataProvider dataPr SOTerm sourceGeneralConsequence = null; if (!StringUtils.isBlank(dto.getSourceGeneralConsequenceCurie())) { sourceGeneralConsequence = soTermService.findByCurieOrSecondaryId(dto.getSourceGeneralConsequenceCurie()); - if (variantType == null) + if (sourceGeneralConsequence == null) variantResponse.addErrorMessage("source_general_consequence_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getSourceGeneralConsequenceCurie() + ")"); } variant.setSourceGeneralConsequence(sourceGeneralConsequence); diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java index eaf0b5e32..3fe526d93 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java @@ -36,7 +36,7 @@ public class ConstructGenomicEntityAssociationBulkUploadITCase extends BaseITCas private String constructModEntityId = "WB:Construct0001"; private String relationName = "is_regulated_by"; - private String geneCurie = "GENETEST:Gene0001"; + private String geneModEntityId = "GENETEST:Gene0001"; private String reference = "AGRKB:000000001"; private String reference2 = "AGRKB:000000021"; private String noteType = "comment"; @@ -55,11 +55,11 @@ public void init() { private final String constructGenomicEntityAssociationBulkPostEndpoint = "/api/constructgenomicentityassociation/bulk/WB/associationFile"; private final String constructGenomicEntityAssociationGetEndpoint = "/api/constructgenomicentityassociation/findBy"; private final String constructGenomicEntityAssociationTestFilePath = "src/test/resources/bulk/CA01_construct_genomic_entity_association/"; - private final String constructGetEndpoint = "/api/construct/findBy/"; + private final String constructGetEndpoint = "/api/construct/"; private final String geneGetEndpoint = "/api/gene/"; private void loadRequiredEntities() throws Exception { - gene = getGene(geneCurie); + gene = getGene(geneModEntityId); constructId = getConstruct(constructModEntityId).getId(); } @@ -76,7 +76,7 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.object.modEntityId", is(geneCurie)). + body("entity.object.modEntityId", is(geneModEntityId)). body("entity.subject.modEntityId", is(constructModEntityId)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference)). @@ -104,17 +104,17 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce body("entity.modEntityId", is(constructModEntityId)). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relationName)). - body("entity.constructGenomicEntityAssociations[0].object.modEntityId", is(geneCurie)). + body("entity.constructGenomicEntityAssociations[0].object.modEntityId", is(geneModEntityId)). body("entity.constructGenomicEntityAssociations[0].subject", not(hasKey("constructGenomicEntityAssociations"))); RestAssured.given(). when(). - get(geneGetEndpoint + geneCurie). + get(geneGetEndpoint + geneModEntityId). then(). statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relationName)). - body("entity.constructGenomicEntityAssociations[0].object.modEntityId", is(geneCurie)). + body("entity.constructGenomicEntityAssociations[0].object.modEntityId", is(geneModEntityId)). body("entity.constructGenomicEntityAssociations[0].object", not(hasKey("constructGenomicEntityAssociations"))); } @@ -129,7 +129,7 @@ public void constructGenomicEntityAssociationBulkUploadUpdateCheckFields() throw then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.object.modEntityId", is(geneCurie)). + body("entity.object.modEntityId", is(geneModEntityId)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2)). body("entity.internal", is(false)). @@ -157,7 +157,7 @@ public void constructGenomicEntityAssociationBulkUploadUpdateCheckFields() throw RestAssured.given(). when(). - get(geneGetEndpoint + geneCurie). + get(geneGetEndpoint + geneModEntityId). then(). statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)); diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java index 685182c64..ceb75b44a 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java @@ -254,7 +254,7 @@ public void createGeneDiseaseAnnotation() { body("entity.uniqueId", is("GENE:da0001|is_implicated_in|false|DOID:da0001|AGRKB:100000005|ECO:da00001|HGNC:1|has_condition|ZECO:da001|severity|ameliorated_by|SGD:da0002")). body("entity.modEntityId", is(GENE_DISEASE_ANNOTATION)). body("entity.subject.modEntityId", is(gene.getModEntityId())). - body("entity.object.modEntityId", is(doTerm.getCurie())). + body("entity.object.curie", is(doTerm.getCurie())). body("entity.relation.name", is(alleleAndGeneRelation.getName())). body("entity.negated", is(false)). body("entity.internal", is(false)). @@ -325,7 +325,7 @@ public void createAlleleDiseaseAnnotation() { body("entity.uniqueId", is("ALLELE:da0001|is_implicated_in|false|DOID:da0001|AGRKB:100000005|ECO:da00001|HGNC:1|has_condition|ZECO:da001|severity|ameliorated_by|SGD:da0002")). body("entity.modEntityId", is(ALLELE_DISEASE_ANNOTATION)). body("entity.subject.modEntityId", is(allele.getModEntityId())). - body("entity.object.modEntityId", is(doTerm.getCurie())). + body("entity.object.curie", is(doTerm.getCurie())). body("entity.relation.name", is(alleleAndGeneRelation.getName())). body("entity.negated", is(false)). body("entity.internal", is(false)). @@ -400,7 +400,7 @@ public void createAgmDiseaseAnnotation() { body("entity.uniqueId", is("SGD:da0001|is_model_of|false|DOID:da0001|AGRKB:100000005|ECO:da00001|HGNC:1|has_condition|ZECO:da001|severity|ameliorated_by|SGD:da0002")). body("entity.modEntityId", is(AGM_DISEASE_ANNOTATION)). body("entity.subject.modEntityId", is(agm.getModEntityId())). - body("entity.object.modEntityId", is(doTerm.getCurie())). + body("entity.object.curie", is(doTerm.getCurie())). body("entity.relation.name", is(agmRelation.getName())). body("entity.negated", is(false)). body("entity.internal", is(false)). @@ -488,7 +488,7 @@ public void editGeneDiseaseAnnotation() { body("entity.uniqueId", is("GENE:da0002|is_marker_for|true|DOID:da0002|AGRKB:100000006|ECO:da00002|HGNC:2|induced_by|ZECO:da002|onset|exacerbated_by|SGD:da0001")). body("entity.modEntityId", is(GENE_DISEASE_ANNOTATION)). body("entity.subject.modEntityId", is(gene2.getModEntityId())). - body("entity.object.modEntityId", is(doTerm2.getCurie())). + body("entity.object.curie", is(doTerm2.getCurie())). body("entity.relation.name", is(geneRelation.getName())). body("entity.negated", is(true)). body("entity.internal", is(true)). @@ -572,7 +572,7 @@ public void editAlleleDiseaseAnnotation() { body("entity.uniqueId", is("ALLELE:da0002|is_implicated_in|true|DOID:da0002|AGRKB:100000006|ECO:da00002|HGNC:2|induced_by|ZECO:da002|onset|exacerbated_by|SGD:da0001")). body("entity.modEntityId", is(ALLELE_DISEASE_ANNOTATION)). body("entity.subject.modEntityId", is(allele2.getModEntityId())). - body("entity.object.modEntityId", is(doTerm2.getCurie())). + body("entity.object.curie", is(doTerm2.getCurie())). body("entity.relation.name", is(alleleAndGeneRelation.getName())). body("entity.negated", is(true)). body("entity.internal", is(true)). @@ -661,7 +661,7 @@ public void editAgmDiseaseAnnotation() { body("entity.uniqueId", is("SGD:da0002|is_exacerbated_model_of|true|DOID:da0002|AGRKB:100000006|ECO:da00002|HGNC:2|induced_by|ZECO:da002|onset|exacerbated_by|SGD:da0001")). body("entity.modEntityId", is(AGM_DISEASE_ANNOTATION)). body("entity.subject.modEntityId", is(agm2.getModEntityId())). - body("entity.object.modEntityId", is(doTerm2.getCurie())). + body("entity.object.curie", is(doTerm2.getCurie())). body("entity.relation.name", is(agmRelation2.getName())). body("entity.negated", is(true)). body("entity.internal", is(true)). diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java index 24f5fd302..99802ca47 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java @@ -505,7 +505,7 @@ public void editAlleleGeneAssociationWithNullNonRequiredFieldsLevel2() { RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?allleleId=" + allele2.getId() + "&relationName=" + relation2.getName() + "&geneId=" + gene2.getId()). + get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele2.getId() + "&relationName=" + relation2.getName() + "&geneId=" + gene2.getId()). then(). statusCode(200). body("entity", hasKey("relatedNote")). @@ -531,7 +531,7 @@ public void editAlleleGeneAssociationWithNullNonRequiredFieldsLevel1() { RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?allleleId=" + allele2.getId() + "&relationName=" + relation2.getName() + "&geneId=" + gene2.getId()). + get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele2.getId() + "&relationName=" + relation2.getName() + "&geneId=" + gene2.getId()). then(). statusCode(200). body("entity", not(hasKey("evidence"))). From 81b343dcf5ef9086cca977d86a0a8170008b0464 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 12 Jan 2024 12:13:14 +0000 Subject: [PATCH 038/159] Fixes and cleanup --- .../interfaces/crud/SpeciesCrudInterface.java | 10 ++++----- .../ingest/dto/AGMDiseaseAnnotationDTO.java | 8 +++---- .../ingest/dto/AffectedGenomicModelDTO.java | 2 ++ .../model/ingest/dto/AgentDTO.java | 8 +++---- .../model/ingest/dto/AlleleDTO.java | 2 ++ .../dto/AlleleDiseaseAnnotationDTO.java | 8 +++---- .../model/ingest/dto/AnnotationDTO.java | 8 +++---- .../model/ingest/dto/BiologicalEntityDTO.java | 2 ++ .../ingest/dto/ConditionRelationDTO.java | 2 ++ .../model/ingest/dto/ConstructDTO.java | 8 +++---- .../model/ingest/dto/CrossReferenceDTO.java | 2 ++ .../model/ingest/dto/DataProviderDTO.java | 2 ++ .../ingest/dto/DiseaseAnnotationDTO.java | 8 +++---- .../ingest/dto/ExperimentalConditionDTO.java | 2 ++ .../model/ingest/dto/GeneDTO.java | 2 ++ .../ingest/dto/GeneDiseaseAnnotationDTO.java | 8 +++---- .../model/ingest/dto/GenomicEntityDTO.java | 2 ++ .../model/ingest/dto/IngestDTO.java | 6 ++--- .../model/ingest/dto/NoteDTO.java | 8 +++---- .../model/ingest/dto/ReagentDTO.java | 8 +++---- .../ingest/dto/ResourceDescriptorDTO.java | 7 +++--- .../ingest/dto/ResourceDescriptorPageDTO.java | 6 ++--- .../model/ingest/dto/SynonymDTO.java | 2 ++ .../model/ingest/dto/VariantDTO.java | 2 ++ .../associations/EvidenceAssociationDTO.java | 8 +++---- .../AlleleGeneAssociationDTO.java | 8 +++---- .../AlleleGenomicEntityAssociationDTO.java | 8 +++---- .../ConstructGenomicEntityAssociationDTO.java | 8 +++---- .../ingest/dto/base/AuditedObjectDTO.java | 8 +++---- .../ingest/dto/base/SubmittedObjectDTO.java | 8 +++---- .../ingest/dto/fms/CrossReferenceFmsDTO.java | 2 ++ .../ingest/dto/fms/DataProviderFmsDTO.java | 2 ++ .../model/ingest/dto/fms/EvidenceFmsDTO.java | 2 ++ .../model/ingest/dto/fms/MetaDataFmsDTO.java | 2 ++ .../model/ingest/dto/fms/MoleculeFmsDTO.java | 2 ++ .../ingest/dto/fms/MoleculeIngestFmsDTO.java | 2 ++ .../model/ingest/dto/fms/OrthologyFmsDTO.java | 2 ++ .../ingest/dto/fms/OrthologyIngestFmsDTO.java | 2 ++ .../ingest/dto/fms/PublicationFmsDTO.java | 2 ++ .../slotAnnotions/NameSlotAnnotationDTO.java | 8 +++---- .../SecondaryIdSlotAnnotationDTO.java | 8 +++---- .../dto/slotAnnotions/SlotAnnotationDTO.java | 8 +++---- ...AlleleDatabaseStatusSlotAnnotationDTO.java | 8 +++---- ...leleFunctionalImpactSlotAnnotationDTO.java | 8 +++---- ...neTransmissionStatusSlotAnnotationDTO.java | 8 +++---- ...lleleInheritanceModeSlotAnnotationDTO.java | 8 +++---- .../AlleleMutationTypeSlotAnnotationDTO.java | 8 +++---- ...eleNomenclatureEventSlotAnnotationDTO.java | 8 +++---- .../ConstructComponentSlotAnnotationDTO.java | 8 +++---- .../AGMDiseaseAnnotationValidator.java | 2 -- .../AlleleDiseaseAnnotationValidator.java | 3 --- .../validation/AnnotationValidator.java | 2 -- .../DiseaseAnnotationValidator.java | 1 - .../GeneDiseaseAnnotationValidator.java | 2 -- ...ructGenomicEntityAssociationValidator.java | 2 +- .../dto/AffectedGenomicModelDTOValidator.java | 1 - .../validation/dto/ConstructDTOValidator.java | 22 ++++++++----------- .../validation/dto/GeneDTOValidator.java | 1 - .../validation/dto/ReagentDTOValidator.java | 2 -- .../validation/dto/VariantDTOValidator.java | 2 -- ...tGenomicEntityAssociationDTOValidator.java | 13 +++++------ .../bulkupload/ConstructBulkUploadITCase.java | 16 ++++++++++++++ ...AlleleGeneAssociationBulkUploadITCase.java | 10 ++++----- ...omicEntityAssociationBulkUploadITCase.java | 16 +++++++------- .../fms/MoleculeBulkUploadFmsITCase.java | 2 +- .../fms/OrthologyBulkUploadFmsITCase.java | 2 +- ...nstructGenomicEntityAssociationITCase.java | 2 +- .../controllers/ontology/CHEBITermITCase.java | 2 +- .../controllers/ontology/DOTermITCase.java | 2 +- .../ontology/NCBITaxonTermITCase.java | 2 +- 70 files changed, 201 insertions(+), 175 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/SpeciesCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/SpeciesCrudInterface.java index e522f981a..dd7a94cc9 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/SpeciesCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/SpeciesCrudInterface.java @@ -1,15 +1,13 @@ package org.alliancegenome.curation_api.interfaces.crud; -import jakarta.ws.rs.*; - -import jakarta.ws.rs.core.MediaType; import org.alliancegenome.curation_api.interfaces.base.BaseIdCrudInterface; import org.alliancegenome.curation_api.model.entities.Species; -import org.alliancegenome.curation_api.response.ObjectResponse; -import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.tags.Tag; -import com.fasterxml.jackson.annotation.JsonView; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; @Path("/species") @Tag(name = "CRUD - Species") diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AGMDiseaseAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AGMDiseaseAnnotationDTO.java index 7ee6a3b43..1d04fafa3 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AGMDiseaseAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AGMDiseaseAnnotationDTO.java @@ -9,11 +9,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotationDTO.class }, submitted = true) public class AGMDiseaseAnnotationDTO extends DiseaseAnnotationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AffectedGenomicModelDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AffectedGenomicModelDTO.java index 626f06707..c85353b78 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AffectedGenomicModelDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AffectedGenomicModelDTO.java @@ -8,8 +8,10 @@ import com.fasterxml.jackson.annotation.JsonView; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { GenomicEntityDTO.class }, submitted = true) public class AffectedGenomicModelDTO extends GenomicEntityDTO { @JsonView({ View.FieldsOnly.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AgentDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AgentDTO.java index 712dcb552..c5d8f724a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AgentDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AgentDTO.java @@ -2,11 +2,11 @@ import org.alliancegenome.curation_api.model.ingest.dto.base.AuditedObjectDTO; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) public class AgentDTO extends AuditedObjectDTO { } diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AlleleDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AlleleDTO.java index a693af2aa..19ada0e84 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AlleleDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AlleleDTO.java @@ -18,8 +18,10 @@ import com.fasterxml.jackson.annotation.JsonView; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.7.3", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { GenomicEntityDTO.class, AlleleMutationTypeSlotAnnotationDTO.class, NameSlotAnnotationDTO.class, SecondaryIdSlotAnnotationDTO.class, AlleleInheritanceModeSlotAnnotationDTO.class, AlleleFunctionalImpactSlotAnnotationDTO.class, AlleleGermlineTransmissionStatusSlotAnnotationDTO.class, AlleleDatabaseStatusSlotAnnotationDTO.class, AlleleNomenclatureEventSlotAnnotationDTO.class, NoteDTO.class }, submitted = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AlleleDiseaseAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AlleleDiseaseAnnotationDTO.java index 60d5cccc1..5d6d9736e 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AlleleDiseaseAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AlleleDiseaseAnnotationDTO.java @@ -9,11 +9,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotationDTO.class }, submitted = true) public class AlleleDiseaseAnnotationDTO extends DiseaseAnnotationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AnnotationDTO.java index dee1af919..84cbebebd 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/AnnotationDTO.java @@ -10,11 +10,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.7.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObjectDTO.class, ConditionRelationDTO.class, NoteDTO.class, DataProviderDTO.class }) public class AnnotationDTO extends AuditedObjectDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/BiologicalEntityDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/BiologicalEntityDTO.java index 9584ce810..ddd2be1ce 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/BiologicalEntityDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/BiologicalEntityDTO.java @@ -9,8 +9,10 @@ import com.fasterxml.jackson.annotation.JsonView; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SubmittedObjectDTO.class }) public class BiologicalEntityDTO extends SubmittedObjectDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ConditionRelationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ConditionRelationDTO.java index be773c023..b6f404d1a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ConditionRelationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ConditionRelationDTO.java @@ -10,8 +10,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObjectDTO.class, ExperimentalConditionDTO.class }) public class ConditionRelationDTO extends AuditedObjectDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ConstructDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ConstructDTO.java index 1f892989e..2b537d305 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ConstructDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ConstructDTO.java @@ -11,11 +11,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.10.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { ReagentDTO.class, ConstructComponentSlotAnnotationDTO.class }, submitted = true) public class ConstructDTO extends ReagentDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/CrossReferenceDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/CrossReferenceDTO.java index 63d90f2a8..eefaee11f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/CrossReferenceDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/CrossReferenceDTO.java @@ -9,8 +9,10 @@ import com.fasterxml.jackson.annotation.JsonView; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.6.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObjectDTO.class}) public class CrossReferenceDTO extends AuditedObjectDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/DataProviderDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/DataProviderDTO.java index a52567628..99b94cee5 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/DataProviderDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/DataProviderDTO.java @@ -9,8 +9,10 @@ import com.fasterxml.jackson.annotation.JsonView; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.6.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObjectDTO.class, CrossReferenceDTO.class}) public class DataProviderDTO extends AuditedObjectDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/DiseaseAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/DiseaseAnnotationDTO.java index 07212c786..1ae96869f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/DiseaseAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/DiseaseAnnotationDTO.java @@ -9,11 +9,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AnnotationDTO.class }) public class DiseaseAnnotationDTO extends AnnotationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ExperimentalConditionDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ExperimentalConditionDTO.java index d3279751e..f3e11b075 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ExperimentalConditionDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ExperimentalConditionDTO.java @@ -9,8 +9,10 @@ import com.fasterxml.jackson.annotation.JsonView; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObjectDTO.class }) public class ExperimentalConditionDTO extends AuditedObjectDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GeneDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GeneDTO.java index 923e228ff..b1ace4eec 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GeneDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GeneDTO.java @@ -12,8 +12,10 @@ import com.fasterxml.jackson.annotation.JsonView; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.7.2", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { GenomicEntityDTO.class, NameSlotAnnotationDTO.class }, submitted = true) public class GeneDTO extends GenomicEntityDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GeneDiseaseAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GeneDiseaseAnnotationDTO.java index df5fe8d3e..91909dbc1 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GeneDiseaseAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GeneDiseaseAnnotationDTO.java @@ -7,11 +7,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotationDTO.class }, submitted = true) public class GeneDiseaseAnnotationDTO extends DiseaseAnnotationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GenomicEntityDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GenomicEntityDTO.java index f697e08a1..f3d74cdc9 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GenomicEntityDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/GenomicEntityDTO.java @@ -4,8 +4,10 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { BiologicalEntityDTO.class }) public class GenomicEntityDTO extends BiologicalEntityDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/IngestDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/IngestDTO.java index 87d682ae1..e745081c7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/IngestDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/IngestDTO.java @@ -9,11 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; -@Setter -@Getter +@Data public class IngestDTO { @JsonView({ View.FieldsOnly.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/NoteDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/NoteDTO.java index 992af46f7..d77b54f7e 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/NoteDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/NoteDTO.java @@ -10,11 +10,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObjectDTO.class }) public class NoteDTO extends AuditedObjectDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ReagentDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ReagentDTO.java index 742f4d82a..9a020879d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ReagentDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ReagentDTO.java @@ -10,11 +10,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SubmittedObjectDTO.class }) public class ReagentDTO extends SubmittedObjectDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ResourceDescriptorDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ResourceDescriptorDTO.java index 1b5758459..1fe01e8eb 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ResourceDescriptorDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ResourceDescriptorDTO.java @@ -9,11 +9,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data @AGRCurationSchemaVersion(min = "1.5.1", max = LinkMLSchemaConstants.LATEST_RELEASE) public class ResourceDescriptorDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ResourceDescriptorPageDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ResourceDescriptorPageDTO.java index 0b7bab2ab..09e6c36eb 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ResourceDescriptorPageDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/ResourceDescriptorPageDTO.java @@ -6,11 +6,9 @@ import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; -@Setter -@Getter +@Data @AGRCurationSchemaVersion(min = "1.5.1", max = LinkMLSchemaConstants.LATEST_RELEASE) public class ResourceDescriptorPageDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/SynonymDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/SynonymDTO.java index d74500d06..f3eff9138 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/SynonymDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/SynonymDTO.java @@ -8,8 +8,10 @@ import com.fasterxml.jackson.annotation.JsonView; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObjectDTO.class }) public class SynonymDTO extends AuditedObjectDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/VariantDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/VariantDTO.java index 0c800b683..6b52f5054 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/VariantDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/VariantDTO.java @@ -10,8 +10,10 @@ import com.fasterxml.jackson.annotation.JsonView; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.10.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { GenomicEntityDTO.class, NoteDTO.class }, submitted = true) public class VariantDTO extends GenomicEntityDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/EvidenceAssociationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/EvidenceAssociationDTO.java index 776ea6252..2ec83703c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/EvidenceAssociationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/EvidenceAssociationDTO.java @@ -10,11 +10,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObjectDTO.class }) public class EvidenceAssociationDTO extends AuditedObjectDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGeneAssociationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGeneAssociationDTO.java index d8d0f7f81..26f52bfe7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGeneAssociationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGeneAssociationDTO.java @@ -7,11 +7,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AlleleGenomicEntityAssociationDTO.class }, submitted = true) public class AlleleGeneAssociationDTO extends AlleleGenomicEntityAssociationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGenomicEntityAssociationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGenomicEntityAssociationDTO.java index d7e26a44b..68fe5de39 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGenomicEntityAssociationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/alleleAssociations/AlleleGenomicEntityAssociationDTO.java @@ -9,11 +9,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { EvidenceAssociationDTO.class, NoteDTO.class }) public class AlleleGenomicEntityAssociationDTO extends EvidenceAssociationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTO.java index 0a3341bee..f3597752f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTO.java @@ -11,11 +11,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { EvidenceAssociationDTO.class, NoteDTO.class }, submitted = true) public class ConstructGenomicEntityAssociationDTO extends EvidenceAssociationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/base/AuditedObjectDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/base/AuditedObjectDTO.java index 749f14846..042882aa7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/base/AuditedObjectDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/base/AuditedObjectDTO.java @@ -7,11 +7,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE) public class AuditedObjectDTO extends BaseDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/base/SubmittedObjectDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/base/SubmittedObjectDTO.java index a9ebbe5cc..b516f4c74 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/base/SubmittedObjectDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/base/SubmittedObjectDTO.java @@ -8,11 +8,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObjectDTO.class, DataProviderDTO.class }) public class SubmittedObjectDTO extends AuditedObjectDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/CrossReferenceFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/CrossReferenceFmsDTO.java index af09ba04d..035f20f0d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/CrossReferenceFmsDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/CrossReferenceFmsDTO.java @@ -5,8 +5,10 @@ import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) public class CrossReferenceFmsDTO extends BaseDTO { private String id; private List pages; diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/DataProviderFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/DataProviderFmsDTO.java index 0071a96a3..445640e87 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/DataProviderFmsDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/DataProviderFmsDTO.java @@ -3,8 +3,10 @@ import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) public class DataProviderFmsDTO extends BaseDTO { private CrossReferenceFmsDTO crossReference; diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/EvidenceFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/EvidenceFmsDTO.java index 978cb3a8f..1e6789405 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/EvidenceFmsDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/EvidenceFmsDTO.java @@ -5,8 +5,10 @@ import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) public class EvidenceFmsDTO extends BaseDTO { private PublicationFmsDTO publication; diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/MetaDataFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/MetaDataFmsDTO.java index e5e6b74a1..ecbe527ea 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/MetaDataFmsDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/MetaDataFmsDTO.java @@ -3,8 +3,10 @@ import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) public class MetaDataFmsDTO extends BaseDTO { private String dateProduced; diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/MoleculeFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/MoleculeFmsDTO.java index 9cdfa3810..a36dd7466 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/MoleculeFmsDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/MoleculeFmsDTO.java @@ -5,8 +5,10 @@ import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) public class MoleculeFmsDTO extends BaseDTO { private String id; private String name; diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/MoleculeIngestFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/MoleculeIngestFmsDTO.java index 647913da9..aa05ebb2b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/MoleculeIngestFmsDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/MoleculeIngestFmsDTO.java @@ -5,8 +5,10 @@ import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) public class MoleculeIngestFmsDTO extends BaseDTO { private MetaDataFmsDTO metaData; diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/OrthologyFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/OrthologyFmsDTO.java index 474f0e84c..c025e5184 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/OrthologyFmsDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/OrthologyFmsDTO.java @@ -5,8 +5,10 @@ import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) public class OrthologyFmsDTO extends BaseDTO { private Integer gene1Species; private Integer gene2Species; diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/OrthologyIngestFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/OrthologyIngestFmsDTO.java index eb99a1fa9..b9972baaa 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/OrthologyIngestFmsDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/OrthologyIngestFmsDTO.java @@ -5,8 +5,10 @@ import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) public class OrthologyIngestFmsDTO extends BaseDTO { private MetaDataFmsDTO metaData; diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PublicationFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PublicationFmsDTO.java index 97cd2cc90..295145904 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PublicationFmsDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PublicationFmsDTO.java @@ -3,8 +3,10 @@ import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; import lombok.Data; +import lombok.EqualsAndHashCode; @Data +@EqualsAndHashCode(callSuper = true) public class PublicationFmsDTO extends BaseDTO { private String publicationId; diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/NameSlotAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/NameSlotAnnotationDTO.java index acfdac4a0..d1f7e4284 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/NameSlotAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/NameSlotAnnotationDTO.java @@ -7,11 +7,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotationDTO.class }) public class NameSlotAnnotationDTO extends SlotAnnotationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/SecondaryIdSlotAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/SecondaryIdSlotAnnotationDTO.java index 57d60fe10..d9c2c9ea9 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/SecondaryIdSlotAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/SecondaryIdSlotAnnotationDTO.java @@ -7,11 +7,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.3.3", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotationDTO.class }) public class SecondaryIdSlotAnnotationDTO extends SlotAnnotationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/SlotAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/SlotAnnotationDTO.java index 3b6df156a..50e5c0339 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/SlotAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/SlotAnnotationDTO.java @@ -10,11 +10,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.3.3", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObjectDTO.class }) public class SlotAnnotationDTO extends AuditedObjectDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleDatabaseStatusSlotAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleDatabaseStatusSlotAnnotationDTO.java index 1bc692188..2b1df5d5a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleDatabaseStatusSlotAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleDatabaseStatusSlotAnnotationDTO.java @@ -8,11 +8,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.3.3", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotationDTO.class }) public class AlleleDatabaseStatusSlotAnnotationDTO extends SlotAnnotationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationDTO.java index 2b0bd5b92..2e7f34246 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationDTO.java @@ -10,11 +10,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotationDTO.class }) public class AlleleFunctionalImpactSlotAnnotationDTO extends SlotAnnotationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleGermlineTransmissionStatusSlotAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleGermlineTransmissionStatusSlotAnnotationDTO.java index cdb5487f6..56c294948 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleGermlineTransmissionStatusSlotAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleGermlineTransmissionStatusSlotAnnotationDTO.java @@ -8,11 +8,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.3.3", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotationDTO.class }) public class AlleleGermlineTransmissionStatusSlotAnnotationDTO extends SlotAnnotationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationDTO.java index 389ec6dd2..38b64c98b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationDTO.java @@ -8,11 +8,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.3.3", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotationDTO.class }) public class AlleleInheritanceModeSlotAnnotationDTO extends SlotAnnotationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotationDTO.java index f34ed9c16..84d7ed808 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleMutationTypeSlotAnnotationDTO.java @@ -10,11 +10,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.3.3", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotationDTO.class }) public class AlleleMutationTypeSlotAnnotationDTO extends SlotAnnotationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleNomenclatureEventSlotAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleNomenclatureEventSlotAnnotationDTO.java index 987ef86d2..edb08dae1 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleNomenclatureEventSlotAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/alleleSlotAnnotations/AlleleNomenclatureEventSlotAnnotationDTO.java @@ -8,11 +8,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotationDTO.class }) public class AlleleNomenclatureEventSlotAnnotationDTO extends SlotAnnotationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/constructSlotAnnotations/ConstructComponentSlotAnnotationDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/constructSlotAnnotations/ConstructComponentSlotAnnotationDTO.java index a377447e7..63c9b87ad 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/constructSlotAnnotations/ConstructComponentSlotAnnotationDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/slotAnnotions/constructSlotAnnotations/ConstructComponentSlotAnnotationDTO.java @@ -11,11 +11,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonView; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; -@Setter -@Getter +@Data +@EqualsAndHashCode(callSuper = true) @AGRCurationSchemaVersion(min = "1.10.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SlotAnnotationDTO.class, NoteDTO.class }) public class ConstructComponentSlotAnnotationDTO extends SlotAnnotationDTO { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java index 0e701b1ca..8eca03f0b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java @@ -20,7 +20,6 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; -import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -93,7 +92,6 @@ public AGMDiseaseAnnotation validateAnnotation(AGMDiseaseAnnotation uiEntity, AG dbEntity = (AGMDiseaseAnnotation) validateCommonDiseaseAnnotationFields(uiEntity, dbEntity); if (response.hasErrors()) { - Log.info("ERROR: " + response.getErrorMessages()); response.setErrorMessage(errorMessage); throw new ApiErrorException(response); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java index 112e8483a..4d4fc4aed 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java @@ -17,9 +17,7 @@ import org.alliancegenome.curation_api.services.VocabularyTermService; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; -import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -83,7 +81,6 @@ public AlleleDiseaseAnnotation validateAnnotation(AlleleDiseaseAnnotation uiEnti dbEntity = (AlleleDiseaseAnnotation) validateCommonDiseaseAnnotationFields(uiEntity, dbEntity); if (response.hasErrors()) { - Log.info("ERROR: " + response.getErrorMessages()); response.setErrorMessage(errorMessage); throw new ApiErrorException(response); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AnnotationValidator.java index 284d1c5c3..f1fe26223 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AnnotationValidator.java @@ -9,7 +9,6 @@ import java.util.stream.Collectors; import org.alliancegenome.curation_api.constants.ValidationConstants; -import org.alliancegenome.curation_api.constants.VocabularyConstants; import org.alliancegenome.curation_api.dao.AnnotationDAO; import org.alliancegenome.curation_api.dao.ConditionRelationDAO; import org.alliancegenome.curation_api.dao.NoteDAO; @@ -24,7 +23,6 @@ import org.alliancegenome.curation_api.services.helpers.notes.NoteIdentityHelper; import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.collections.ListUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java index 0a10ec584..da536a96f 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java @@ -26,7 +26,6 @@ import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; import jakarta.inject.Inject; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java index b44ccebd3..9da323c37 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java @@ -14,7 +14,6 @@ import org.alliancegenome.curation_api.services.VocabularyTermService; import org.apache.commons.lang3.ObjectUtils; -import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -76,7 +75,6 @@ public GeneDiseaseAnnotation validateAnnotation(GeneDiseaseAnnotation uiEntity, if (response.hasErrors()) { response.setErrorMessage(errorMessage); - Log.info("ERROR: " + response.getErrorMessages()); throw new ApiErrorException(response); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java index 2fc6cf43c..22fd123c0 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java @@ -127,7 +127,7 @@ private Construct validateSubject(ConstructGenomicEntityAssociation uiEntity, Co } private GenomicEntity validateObject(ConstructGenomicEntityAssociation uiEntity, ConstructGenomicEntityAssociation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getObject()) || uiEntity.getObject().getId() == null) { + if (ObjectUtils.isEmpty(uiEntity.getObject())) { addMessageResponse("object", ValidationConstants.REQUIRED_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AffectedGenomicModelDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AffectedGenomicModelDTOValidator.java index 1b245b6a2..801f99be1 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AffectedGenomicModelDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AffectedGenomicModelDTOValidator.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; import org.alliancegenome.curation_api.model.entities.AffectedGenomicModel; -import org.alliancegenome.curation_api.model.entities.Allele; import org.alliancegenome.curation_api.model.entities.VocabularyTerm; import org.alliancegenome.curation_api.model.ingest.dto.AffectedGenomicModelDTO; import org.alliancegenome.curation_api.response.ObjectResponse; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConstructDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConstructDTOValidator.java index d38fbfbc7..28a09e214 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConstructDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConstructDTOValidator.java @@ -10,7 +10,6 @@ import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; import org.alliancegenome.curation_api.model.entities.Construct; -import org.alliancegenome.curation_api.model.entities.GeneDiseaseAnnotation; import org.alliancegenome.curation_api.model.entities.Reference; import org.alliancegenome.curation_api.model.entities.slotAnnotations.constructSlotAnnotations.ConstructComponentSlotAnnotation; import org.alliancegenome.curation_api.model.entities.slotAnnotations.constructSlotAnnotations.ConstructFullNameSlotAnnotation; @@ -55,32 +54,29 @@ public class ConstructDTOValidator extends ReagentDTOValidator { @Transactional public Construct validateConstructDTO(ConstructDTO dto, BackendBulkDataProvider dataProvider) throws ObjectValidationException { - Construct construct = new Construct(); + Construct construct = null; String uniqueId = ConstructUniqueIdHelper.getConstructUniqueId(dto); SearchResponse constructList; - Boolean annotationFound = false; if (StringUtils.isNotBlank(dto.getModEntityId())) { constructList = constructDAO.findByField("modEntityId", dto.getModEntityId()); - if (constructList != null && constructList.getSingleResult() != null) { + if (constructList != null && constructList.getSingleResult() != null) construct = constructList.getSingleResult(); - annotationFound = true; - } } - construct.setModEntityId(dto.getModEntityId()); - if (!annotationFound && StringUtils.isNotBlank(dto.getModInternalId())) { + if (construct == null && StringUtils.isNotBlank(dto.getModInternalId())) { constructList = constructDAO.findByField("modInternalId", dto.getModInternalId()); - if (constructList != null && constructList.getSingleResult() != null) { + if (constructList != null && constructList.getSingleResult() != null) construct = constructList.getSingleResult(); - annotationFound = true; - } } - construct.setModInternalId(dto.getModInternalId()); - if (!annotationFound){ + if (construct == null) { constructList = constructDAO.findByField("uniqueId", uniqueId); if (constructList != null && constructList.getSingleResult() != null) construct = constructList.getSingleResult(); } + if (construct == null) + construct = new Construct(); construct.setUniqueId(uniqueId); + construct.setModEntityId(dto.getModEntityId()); + construct.setModInternalId(dto.getModInternalId()); ObjectResponse reagentResponse = validateReagentDTO(construct, dto); constructResponse.addErrorMessages(reagentResponse.getErrorMessages()); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDTOValidator.java index 28c11354d..137e79f40 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDTOValidator.java @@ -9,7 +9,6 @@ import org.alliancegenome.curation_api.dao.GeneDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; -import org.alliancegenome.curation_api.model.entities.Allele; import org.alliancegenome.curation_api.model.entities.Gene; import org.alliancegenome.curation_api.model.entities.slotAnnotations.geneSlotAnnotations.GeneFullNameSlotAnnotation; import org.alliancegenome.curation_api.model.entities.slotAnnotations.geneSlotAnnotations.GeneSecondaryIdSlotAnnotation; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ReagentDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ReagentDTOValidator.java index 316883601..bf4441293 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ReagentDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ReagentDTOValidator.java @@ -6,8 +6,6 @@ import org.alliancegenome.curation_api.model.ingest.dto.ReagentDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.ontology.NcbiTaxonTermService; -import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java index 84cf84fb1..69eb4192b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/VariantDTOValidator.java @@ -9,7 +9,6 @@ import org.alliancegenome.curation_api.dao.VariantDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; -import org.alliancegenome.curation_api.model.entities.Allele; import org.alliancegenome.curation_api.model.entities.Note; import org.alliancegenome.curation_api.model.entities.Variant; import org.alliancegenome.curation_api.model.entities.VocabularyTerm; @@ -24,7 +23,6 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; import jakarta.transaction.Transactional; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java index 2877dfa23..5e473feed 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java @@ -6,7 +6,6 @@ import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.constants.VocabularyConstants; -import org.alliancegenome.curation_api.dao.ConstructDAO; import org.alliancegenome.curation_api.dao.associations.constructAssociations.ConstructGenomicEntityAssociationDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; @@ -18,6 +17,7 @@ import org.alliancegenome.curation_api.model.ingest.dto.associations.constructAssociations.ConstructGenomicEntityAssociationDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.ConstructService; import org.alliancegenome.curation_api.services.GenomicEntityService; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.helpers.notes.NoteIdentityHelper; @@ -33,7 +33,7 @@ public class ConstructGenomicEntityAssociationDTOValidator extends EvidenceAssociationDTOValidator { @Inject - ConstructDAO constructDAO; + ConstructService constructService; @Inject GenomicEntityService genomicEntityService; @Inject @@ -49,14 +49,11 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati Construct construct = null; if (StringUtils.isNotBlank(dto.getConstructIdentifier())) { - SearchResponse res = constructDAO.findByField("modEntityId", dto.getConstructIdentifier()); - if (res == null || res.getSingleResult() == null) { - res = constructDAO.findByField("modInternalId", dto.getConstructIdentifier()); - } - if (res == null || res.getSingleResult() == null) { + ObjectResponse constructResponse = constructService.get(dto.getConstructIdentifier()); + if (constructResponse == null || constructResponse.getEntity() == null) { assocResponse.addErrorMessage("construct_identifier", ValidationConstants.INVALID_MESSAGE); } else { - construct = res.getSingleResult(); + construct = constructResponse.getEntity(); if (beDataProvider != null && !construct.getDataProvider().getSourceOrganization().getAbbreviation().equals(beDataProvider.sourceOrganization)) assocResponse.addErrorMessage("construct_identifier", ValidationConstants.INVALID_MESSAGE + " for " + beDataProvider.name() + " load"); } diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/ConstructBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/ConstructBulkUploadITCase.java index cd1c37a06..7207fd0f9 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/ConstructBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/ConstructBulkUploadITCase.java @@ -475,4 +475,20 @@ public void constructBulkUploadDuplicateNotes() throws Exception { body("entity.constructComponents", hasSize(1)). body("entity.constructComponents[0].relatedNotes", hasSize(1)); } + + @Test + @Order(13) + public void reloadInitialConstruct() throws Exception { + // Required for later association tests - original gets overwritten + // by missing fields tests due to uniqueId matching + checkSuccessfulBulkLoad(constructBulkPostEndpoint, constructTestFilePath + "AF_01_all_fields.json"); + + RestAssured.given(). + when(). + get(constructGetEndpoint + "WB:Construct0001"). + then(). + statusCode(200). + body("entity.modEntityId", is("WB:Construct0001")); + } + } diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java index 2a5456a94..a0c7cd4c9 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java @@ -78,7 +78,7 @@ public void alleleGeneAssociationBulkUploadCheckFields() throws Exception { RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "?geneId=" + gene.getId()). + get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "&geneId=" + gene.getId()). then(). statusCode(200). body("entity.relation.name", is(relationName)). @@ -133,7 +133,7 @@ public void alleleGeneAssociationBulkUploadUpdateCheckFields() throws Exception RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "?geneId=" + gene.getId()). + get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "&geneId=" + gene.getId()). then(). statusCode(200). body("entity.relation.name", is(relationName)). @@ -213,7 +213,7 @@ public void alleleGeneAssociationBulkUploadUpdateMissingNonRequiredFieldsLevel1( RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "?geneId=" + gene.getId()). + get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "&geneId=" + gene.getId()). then(). statusCode(200). body("entity", not(hasKey("createdBy"))). @@ -231,7 +231,7 @@ public void alleleGeneAssociationBulkUploadUpdateMissingNonRequiredFieldsLevel2( RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "?geneId=" + gene.getId()). + get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "&geneId=" + gene.getId()). then(). statusCode(200). body("entity.relatedNote", not(hasKey("createdBy"))). @@ -247,7 +247,7 @@ public void alleleGeneAssociationBulkUploadUpdateEmptyNonRequiredFieldsLevel2() RestAssured.given(). when(). - get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "?geneId=" + gene.getId()). + get(alleleGeneAssociationGetEndpoint + "?alleleId=" + allele.getId() + "&relationName=" + relationName + "&geneId=" + gene.getId()). then(). statusCode(200). body("entity", not(hasKey("createdBy"))). diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java index 3fe526d93..0d75e39c3 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java @@ -8,8 +8,8 @@ import java.time.OffsetDateTime; import org.alliancegenome.curation_api.base.BaseITCase; +import org.alliancegenome.curation_api.model.entities.Construct; import org.alliancegenome.curation_api.model.entities.Gene; -import org.alliancegenome.curation_api.model.entities.Vocabulary; import org.alliancegenome.curation_api.resources.TestContainerResource; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -41,7 +41,7 @@ public class ConstructGenomicEntityAssociationBulkUploadITCase extends BaseITCas private String reference2 = "AGRKB:000000021"; private String noteType = "comment"; private String noteType2 = "test_construct_component_summary"; - private Long constructId; + private Construct construct; private Gene gene; @BeforeEach @@ -60,7 +60,7 @@ public void init() { private void loadRequiredEntities() throws Exception { gene = getGene(geneModEntityId); - constructId = getConstruct(constructModEntityId).getId(); + construct = getConstruct(constructModEntityId); } @Test @@ -72,7 +72,7 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce RestAssured.given(). when(). - get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). + get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + construct.getId() + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). then(). statusCode(200). body("entity.relation.name", is(relationName)). @@ -125,7 +125,7 @@ public void constructGenomicEntityAssociationBulkUploadUpdateCheckFields() throw RestAssured.given(). when(). - get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). + get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + construct.getId() + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). then(). statusCode(200). body("entity.relation.name", is(relationName)). @@ -203,7 +203,7 @@ public void constructGenomicEntityAssociationBulkUploadUpdateMissingNonRequiredF RestAssured.given(). when(). - get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). + get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + construct.getId() + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). then(). statusCode(200). body("entity", not(hasKey("createdBy"))). @@ -220,7 +220,7 @@ public void constructGenomicEntityAssociationBulkUploadUpdateMissingNonRequiredF RestAssured.given(). when(). - get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). + get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + construct.getId() + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). then(). statusCode(200). body("entity.relatedNotes[0]", not(hasKey("createdBy"))). @@ -236,7 +236,7 @@ public void constructGenomicEntityAssociationBulkUploadUpdateEmptyNonRequiredFie RestAssured.given(). when(). - get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + constructId + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). + get(constructGenomicEntityAssociationGetEndpoint + "?constructId=" + construct.getId() + "&relationName=" + relationName + "&genomicEntityId=" + gene.getId()). then(). statusCode(200). body("entity", not(hasKey("createdBy"))). diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/MoleculeBulkUploadFmsITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/MoleculeBulkUploadFmsITCase.java index d8d8a6b52..21ec70364 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/MoleculeBulkUploadFmsITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/MoleculeBulkUploadFmsITCase.java @@ -26,7 +26,7 @@ @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) @DisplayName("06 - Molecule bulk upload - FMS") -@Order(6) +@Order(501) public class MoleculeBulkUploadFmsITCase { @BeforeEach diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/OrthologyBulkUploadFmsITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/OrthologyBulkUploadFmsITCase.java index b01f9c427..a54953953 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/OrthologyBulkUploadFmsITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/OrthologyBulkUploadFmsITCase.java @@ -26,7 +26,7 @@ @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) @DisplayName("07 - Orthology bulk upload - FMS") -@Order(7) +@Order(502) public class OrthologyBulkUploadFmsITCase extends BaseITCase { @BeforeEach diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java index 0baa39554..b0031a079 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java @@ -129,7 +129,7 @@ public void createValidConstructGenomicEntityAssociation() { RestAssured.given(). when(). - get(constructGetEndpoint + construct.getId()). + get(constructGetEndpoint + construct.getModEntityId()). then(). statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)). diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ontology/CHEBITermITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ontology/CHEBITermITCase.java index f4065c717..386dca737 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ontology/CHEBITermITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ontology/CHEBITermITCase.java @@ -19,7 +19,7 @@ @QuarkusTestResource(TestContainerResource.Initializer.class) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Order(211) +@Order(401) public class CHEBITermITCase { private String CHEBITERMCURIE = "CH:0001"; diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ontology/DOTermITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ontology/DOTermITCase.java index 0b418212c..bbe9572d5 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ontology/DOTermITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ontology/DOTermITCase.java @@ -20,7 +20,7 @@ @QuarkusTestResource(TestContainerResource.Initializer.class) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Order(212) +@Order(402) public class DOTermITCase { private String DOTERMCURIE = "DOID:10001"; diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ontology/NCBITaxonTermITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ontology/NCBITaxonTermITCase.java index 21d28f4c7..b0e42ca41 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ontology/NCBITaxonTermITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ontology/NCBITaxonTermITCase.java @@ -20,7 +20,7 @@ @QuarkusTestResource(TestContainerResource.Initializer.class) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Order(213) +@Order(403) public class NCBITaxonTermITCase { private String VALID_TAXON_CURIE = "NCBITaxon:1"; private String INVALID_TAXON_PREFIX = "NCBI:1"; From e22aee0a58e6ff5ef17286ea083dad2da63c4f4f Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 12 Jan 2024 12:24:57 +0000 Subject: [PATCH 039/159] Remove logging --- .../services/validation/ConditionRelationValidator.java | 2 -- .../services/validation/ExperimentalConditionValidator.java | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java index 91394d407..222cb6688 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java @@ -24,7 +24,6 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -117,7 +116,6 @@ public ConditionRelation validateConditionRelation(ConditionRelation uiEntity, C if (response.hasErrors()) { if (throwError) { - Log.info("ERROR: " + response.getErrorMessages()); response.setErrorMessage(errorMessage); throw new ApiErrorException(response); } else { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java index b9e48d028..8b3b6f8b0 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java @@ -25,7 +25,6 @@ import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.lang3.ObjectUtils; -import io.quarkus.logging.Log; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -118,7 +117,6 @@ public ExperimentalCondition validateExperimentalCondition(ExperimentalCondition if (response.hasErrors()) { response.setErrorMessage(errorMessage); - Log.info("ERROR: " + response.getErrorMessages()); throw new ApiErrorException(response); } From 1622f24b4761fdeebbde9906e18677ad777f6dcf Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 12 Jan 2024 13:35:12 +0000 Subject: [PATCH 040/159] Fix conflict resolution error --- .../curation_api/model/entities/DiseaseAnnotation.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java index 9ecf6e164..7221ebd88 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java @@ -95,6 +95,7 @@ public abstract class DiseaseAnnotation extends Annotation { @Index(name = "diseaseannotation_gene_diseaseannotation_index", columnList = "diseaseannotation_id"), @Index(name = "diseaseannotation_gene_with_index", columnList = "with_id") }) + @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class, View.ForPublic.class }) private List with; @IndexedEmbedded(includeDepth = 1) From efe2fc77a4c5472a562ddd4cafdb6e337a1d0f4e Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 18 Jan 2024 13:16:28 +0000 Subject: [PATCH 041/159] Use includePaths instead of includeDepth --- .../model/entities/AGMDiseaseAnnotation.java | 38 ++++++++++++++++--- .../model/entities/AffectedGenomicModel.java | 2 +- .../curation_api/model/entities/Allele.java | 3 +- .../entities/AlleleDiseaseAnnotation.java | 26 +++++++++++-- .../model/entities/Annotation.java | 13 +++++-- .../model/entities/DiseaseAnnotation.java | 19 ++++++---- .../curation_api/model/entities/Gene.java | 3 +- .../model/entities/GeneDiseaseAnnotation.java | 11 +++++- .../entities/SingleReferenceAssociation.java | 3 +- .../model/entities/Vocabulary.java | 2 +- 10 files changed, 93 insertions(+), 27 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java index 21cf4f175..28eee6dd1 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java @@ -35,10 +35,10 @@ @Schema(name = "AGM_Disease_Annotation", description = "Annotation class representing a agm disease annotation") @JsonTypeName("AGMDiseaseAnnotation") @OnDelete(action = OnDeleteAction.CASCADE) -@AGRCurationSchemaVersion(min = "1.3.2", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotation.class }) +@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotation.class }) public class AGMDiseaseAnnotation extends DiseaseAnnotation { - @IndexedEmbedded(includeDepth = 2) + @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @Fetch(FetchMode.SELECT) @@ -46,21 +46,41 @@ public class AGMDiseaseAnnotation extends DiseaseAnnotation { @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) private AffectedGenomicModel subject; - @IndexedEmbedded(includeDepth = 2) + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "geneSymbol.formatText", "geneSymbol.displayText", "geneSymbol.formatText_keyword", "geneSymbol.displayText_keyword", + "geneFullName.formatText", "geneFullName.displayText", "geneFullName.formatText_keyword", "geneFullName.displayText_keyword", + "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSystematicName.formatText_keyword", "geneSystematicName.displayText_keyword", + "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSynonyms.formatText_keyword", "geneSynonyms.displayText_keyword", + "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword" + }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @Fetch(FetchMode.SELECT) @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) private Gene inferredGene; - @IndexedEmbedded(includeDepth = 2) + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "alleleSymbol.formatText", "alleleSymbol.displayText", "alleleSymbol.formatText_keyword", "alleleSymbol.displayText_keyword", + "alleleFullName.formatText", "alleleFullName.displayText", "alleleFullName.formatText_keyword", "alleleFullName.displayText_keyword", + "alleleSynonyms.formatText", "alleleSynonyms.displayText", "alleleSynonyms.formatText_keyword", "alleleSynonyms.displayText_keyword", + "alleleSecondaryIds.secondaryId", "alleleSecondaryIds.secondaryId_keyword" + }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @Fetch(FetchMode.SELECT) @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) private Allele inferredAllele; - @IndexedEmbedded(includeDepth = 2) + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "geneSymbol.formatText", "geneSymbol.displayText", "geneSymbol.formatText_keyword", "geneSymbol.displayText_keyword", + "geneFullName.formatText", "geneFullName.displayText", "geneFullName.formatText_keyword", "geneFullName.displayText_keyword", + "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSystematicName.formatText_keyword", "geneSystematicName.displayText_keyword", + "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSynonyms.formatText_keyword", "geneSynonyms.displayText_keyword", + "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword" + }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @Fetch(FetchMode.SELECT) @@ -68,7 +88,13 @@ public class AGMDiseaseAnnotation extends DiseaseAnnotation { @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class, View.ForPublic.class }) private List assertedGenes; - @IndexedEmbedded(includeDepth = 2) + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "alleleSymbol.formatText", "alleleSymbol.displayText", "alleleSymbol.formatText_keyword", "alleleSymbol.displayText_keyword", + "alleleFullName.formatText", "alleleFullName.displayText", "alleleFullName.formatText_keyword", "alleleFullName.displayText_keyword", + "alleleSynonyms.formatText", "alleleSynonyms.displayText", "alleleSynonyms.formatText_keyword", "alleleSynonyms.displayText_keyword", + "alleleSecondaryIds.secondaryId", "alleleSecondaryIds.secondaryId_keyword" + }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @Fetch(FetchMode.SELECT) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java index cc669927f..92891c4b1 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java @@ -38,7 +38,7 @@ public class AffectedGenomicModel extends GenomicEntity { @OneToMany(mappedBy = "subject", cascade = CascadeType.ALL, orphanRemoval = true) private List agmDiseaseAnnotations; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java index efb11a035..be26e3b20 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java @@ -143,7 +143,8 @@ public class Allele extends GenomicEntity { private List alleleNomenclatureEvents; @IndexedEmbedded(includePaths = {"object.curie", "object.geneSymbol.displayText", "object.geneSymbol.formatText", "object.geneFullName.displayText", "object.geneFullName.formatText", - "object.curie_keyword", "object.geneSymbol.displayText_keyword", "object.geneSymbol.formatText_keyword", "object.geneFullName.displayText_keyword", "object.geneFullName.formatText_keyword"}) + "object.curie_keyword", "object.geneSymbol.displayText_keyword", "object.geneSymbol.formatText_keyword", "object.geneFullName.displayText_keyword", "object.geneFullName.formatText_keyword", + "object.modEntityId", "object.modInternalId", "object.modEntityId_keyword", "object.modInternalId_keyword" }) @OneToMany(mappedBy = "subject", cascade = CascadeType.ALL, orphanRemoval = true) @JsonView({ View.FieldsAndLists.class, View.AlleleDetailView.class }) private List alleleGeneAssociations; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java index 3ca8bdf54..bbef336c3 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java @@ -40,7 +40,13 @@ @Table(indexes = { @Index(name = "AlleleDiseaseAnnotation_inferredGene_index", columnList = "inferredGene_id"), @Index(name = "AlleleDiseaseAnnotation_Subject_index", columnList = "subject_id")}) public class AlleleDiseaseAnnotation extends DiseaseAnnotation { - @IndexedEmbedded(includeDepth = 2) + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "alleleSymbol.formatText", "alleleSymbol.displayText", "alleleSymbol.formatText_keyword", "alleleSymbol.displayText_keyword", + "alleleFullName.formatText", "alleleFullName.displayText", "alleleFullName.formatText_keyword", "alleleFullName.displayText_keyword", + "alleleSynonyms.formatText", "alleleSynonyms.displayText", "alleleSynonyms.formatText_keyword", "alleleSynonyms.displayText_keyword", + "alleleSecondaryIds.secondaryId", "alleleSecondaryIds.secondaryId_keyword" + }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @Fetch(FetchMode.SELECT) @@ -48,14 +54,28 @@ public class AlleleDiseaseAnnotation extends DiseaseAnnotation { @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) private Allele subject; - @IndexedEmbedded(includeDepth = 2) + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "geneSymbol.formatText", "geneSymbol.displayText", "geneSymbol.formatText_keyword", "geneSymbol.displayText_keyword", + "geneFullName.formatText", "geneFullName.displayText", "geneFullName.formatText_keyword", "geneFullName.displayText_keyword", + "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSystematicName.formatText_keyword", "geneSystematicName.displayText_keyword", + "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSynonyms.formatText_keyword", "geneSynonyms.displayText_keyword", + "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword" + }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @Fetch(FetchMode.SELECT) @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) private Gene inferredGene; - @IndexedEmbedded(includeDepth = 2) + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "geneSymbol.formatText", "geneSymbol.displayText", "geneSymbol.formatText_keyword", "geneSymbol.displayText_keyword", + "geneFullName.formatText", "geneFullName.displayText", "geneFullName.formatText_keyword", "geneFullName.displayText_keyword", + "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSystematicName.formatText_keyword", "geneSystematicName.displayText_keyword", + "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSynonyms.formatText_keyword", "geneSynonyms.displayText_keyword", + "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword" + }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @Fetch(FetchMode.SELECT) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java index c201c5171..ed7d1ca84 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java @@ -80,21 +80,28 @@ public class Annotation extends SingleReferenceAssociation { @EqualsAndHashCode.Include private String modInternalId; - @IndexedEmbedded(includeDepth = 2) + @IndexedEmbedded(includePaths = {"handle", "conditionRelationType.name", "singleReference.curie", + "singleReference.crossReferences.referencedCurie", "conditions.conditionSummary", "conditions.uniqueId", + "handle_keyword", "conditionRelationType.name_keyword", "singleReference.curie_keyword", + "singleReference.crossReferences.referencedCurie_keyword", "conditions.conditionSummary_keyword", "conditions.uniqueId_keyword" }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class, View.ForPublic.class }) @JoinTable(indexes = { @Index(name = "annotation_conditionrelation_annotation_index", columnList = "annotation_id"), @Index(name = "annotation_conditionrelation_conditionrelations_index", columnList = "conditionrelations_id")}) private List conditionRelations; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"freeText", "noteType.name", "references.curie", + "references.primaryCrossReferenceCurie", "freeText_keyword", "noteType.name_keyword", "references.curie_keyword", + "references.primaryCrossReferenceCurie_keyword" + }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true) @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class, View.ForPublic.class }) @JoinTable(indexes = { @Index(name = "annotation_note_annotation_index", columnList = "annotation_id"), @Index(name = "annotation_note_relatednotes_index",columnList = "relatednotes_id")}) private List relatedNotes; - @IndexedEmbedded(includeDepth = 2) + @IndexedEmbedded(includePaths = {"sourceOrganization.abbreviation", "sourceOrganization.fullName", "sourceOrganization.shortName", "crossReference.displayName", "crossReference.referencedCurie", + "sourceOrganization.abbreviation_keyword", "sourceOrganization.fullName_keyword", "sourceOrganization.shortName_keyword", "crossReference.displayName_keyword", "crossReference.referencedCurie_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @Fetch(FetchMode.SELECT) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java index 7221ebd88..f0c976d5f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java @@ -58,7 +58,8 @@ public abstract class DiseaseAnnotation extends Annotation { - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"curie", "name", "secondaryIdentifiers", "synonyms.name", + "curie_keyword", "name_keyword", "secondaryIdentifiers_keyword", "synonyms.name_keyword" }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @Fetch(FetchMode.SELECT) @@ -71,13 +72,14 @@ public abstract class DiseaseAnnotation extends Annotation { @Column(columnDefinition = "boolean default false", nullable = false) private Boolean negated = false; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) private VocabularyTerm relation; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"curie", "name", "secondaryIdentifiers", "synonyms.name", "abbreviation", + "curie_keyword", "name_keyword", "secondaryIdentifiers_keyword", "synonyms.name_keyword", "abbreviation_keyword" }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class, View.ForPublic.class }) @@ -98,13 +100,13 @@ public abstract class DiseaseAnnotation extends Annotation { @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class, View.ForPublic.class }) private List with; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) private VocabularyTerm annotationType; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class, View.ForPublic.class }) @@ -114,13 +116,14 @@ public abstract class DiseaseAnnotation extends Annotation { }) private List diseaseQualifiers; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) private VocabularyTerm geneticSex; - @IndexedEmbedded(includeDepth = 2) + @IndexedEmbedded(includePaths = {"sourceOrganization.abbreviation", "sourceOrganization.fullName", "sourceOrganization.shortName", "crossReference.displayName", "crossReference.referencedCurie", + "sourceOrganization.abbreviation_keyword", "sourceOrganization.fullName_keyword", "sourceOrganization.shortName_keyword", "crossReference.displayName_keyword", "crossReference.referencedCurie_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @Fetch(FetchMode.SELECT) @@ -138,7 +141,7 @@ public abstract class DiseaseAnnotation extends Annotation { }) private List diseaseGeneticModifiers; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java index 106ef9590..7f6ea8094 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java @@ -78,7 +78,8 @@ public class Gene extends GenomicEntity { private List geneSecondaryIds; @IndexedEmbedded(includePaths = {"subject.curie", "subject.alleleSymbol.displayText", "subject.alleleSymbol.formatText", "subject.alleleFullName.displayText", "subject.alleleFullName.formatText", - "subject.curie_keyword", "subject.alleleSymbol.displayText_keyword", "subject.alleleSymbol.formatText_keyword", "subject.alleleFullName.displayText_keyword", "subject.alleleFullName.formatText_keyword"}) + "subject.curie_keyword", "subject.alleleSymbol.displayText_keyword", "subject.alleleSymbol.formatText_keyword", "subject.alleleFullName.displayText_keyword", "subject.alleleFullName.formatText_keyword", + "subject.modEntityId", "subject.modInternalId", "subject.modEntityId_keyword", "subject.modInternalId_keyword"}) @OneToMany(mappedBy = "object", cascade = CascadeType.ALL, orphanRemoval = true) @JsonView({ View.FieldsAndLists.class, View.GeneDetailView.class }) private List alleleGeneAssociations; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java index 7610fefe5..141883ce8 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java @@ -31,14 +31,21 @@ @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotation.class }) public class GeneDiseaseAnnotation extends DiseaseAnnotation { - @IndexedEmbedded(includeDepth = 2) + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "geneSymbol.formatText", "geneSymbol.displayText", "geneSymbol.formatText_keyword", "geneSymbol.displayText_keyword", + "geneFullName.formatText", "geneFullName.displayText", "geneFullName.formatText_keyword", "geneFullName.displayText_keyword", + "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSystematicName.formatText_keyword", "geneSystematicName.displayText_keyword", + "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSynonyms.formatText_keyword", "geneSynonyms.displayText_keyword", + "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword" + }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) private Gene subject; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java index f36f560a0..bd84ca70f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java @@ -29,7 +29,8 @@ public class SingleReferenceAssociation extends Association { - @IndexedEmbedded(includeDepth = 2) + @IndexedEmbedded(includePaths = {"curie", "primaryCrossReferenceCurie", + "curie_keyword", "primaryCrossReferenceCurie_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java index 8a19742fb..aa8170bee 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java @@ -62,7 +62,7 @@ public class Vocabulary extends AuditedObject { @JsonView({ View.FieldsOnly.class }) private String vocabularyDescription; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @OneToMany(mappedBy = "vocabulary") @JsonView({ View.VocabularyView.class }) From 7d50e0f7eb72c492263a18262f5df0e220ca5ad6 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 18 Jan 2024 13:20:56 +0000 Subject: [PATCH 042/159] Update index paths for AGMs --- .../curation_api/model/entities/AGMDiseaseAnnotation.java | 2 +- .../curation_api/model/entities/GeneDiseaseAnnotation.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java index 28eee6dd1..5fcb4d136 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java @@ -38,7 +38,7 @@ @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotation.class }) public class AGMDiseaseAnnotation extends DiseaseAnnotation { - @IndexedEmbedded(includePaths = {"name", "name_keyword"}) + @IndexedEmbedded(includePaths = {"name", "name_keyword", "curie", "curie_keyword", "modEntityId", "modEntityId_keyword", "modInternalId", "modInternalId_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @Fetch(FetchMode.SELECT) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java index 141883ce8..f37c5f7fc 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java @@ -45,7 +45,7 @@ public class GeneDiseaseAnnotation extends DiseaseAnnotation { @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) private Gene subject; - @IndexedEmbedded(includePaths = {"name", "name_keyword"}) + @IndexedEmbedded(includePaths = {"name", "name_keyword", "curie", "curie_keyword", "modEntityId", "modEntityId_keyword", "modInternalId", "modInternalId_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) From 0fc51009475aacb2d93674a2027f25d40a0b9f8e Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 18 Jan 2024 13:28:07 +0000 Subject: [PATCH 043/159] More indexing updates --- .../curation_api/model/entities/Variant.java | 5 ++++- .../model/entities/VocabularyTermSet.java | 4 ++-- .../alleleAssociations/AlleleGeneAssociation.java | 6 ++++-- .../AlleleGenomicEntityAssociation.java | 10 +++++++--- .../ConstructGenomicEntityAssociation.java | 11 +++++++---- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Variant.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Variant.java index ee90aac8e..8df2d5a44 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Variant.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Variant.java @@ -58,7 +58,10 @@ public class Variant extends GenomicEntity { @JsonView({ View.FieldsOnly.class }) private SOTerm sourceGeneralConsequence; - @IndexedEmbedded(includePaths = {"freeText", "freeText_keyword"}) + @IndexedEmbedded(includePaths = {"freeText", "noteType.name", "references.curie", + "references.primaryCrossReferenceCurie", "freeText_keyword", "noteType.name_keyword", "references.curie_keyword", + "references.primaryCrossReferenceCurie_keyword" + }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true) @JsonView({ View.FieldsAndLists.class, View.VariantView.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java index b2c21eaf0..20a75c29b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java @@ -58,13 +58,13 @@ public class VocabularyTermSet extends AuditedObject { @JsonView({ View.FieldsOnly.class }) private String vocabularyLabel; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @JsonView({ View.VocabularyTermSetView.class }) private Vocabulary vocabularyTermSetVocabulary; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @JoinTable(indexes = { @Index(columnList = "vocabularytermsets_id", name = "vocabularytermset_vocabularyterm_vocabularytermsets_id_index"), diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java index 3b59b06e5..7b3fb17ef 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java @@ -37,7 +37,8 @@ public class AlleleGeneAssociation extends AlleleGenomicEntityAssociation { @IndexedEmbedded(includePaths = {"curie", "alleleSymbol.displayText", "alleleSymbol.formatText", "alleleFullName.displayText", "alleleFullName.formatText", - "curie_keyword", "alleleSymbol.displayText_keyword", "alleleSymbol.formatText_keyword", "alleleFullName.displayText_keyword", "alleleFullName.formatText_keyword"}) + "curie_keyword", "alleleSymbol.displayText_keyword", "alleleSymbol.formatText_keyword", "alleleFullName.displayText_keyword", "alleleFullName.formatText_keyword", + "modEntityId", "modEntityId_keyword", "modInternalId", "modInternalId_keyword"}) @ManyToOne @JsonView({ View.FieldsOnly.class }) @JsonIgnoreProperties("alleleGeneAssociations") @@ -45,7 +46,8 @@ public class AlleleGeneAssociation extends AlleleGenomicEntityAssociation { private Allele subject; @IndexedEmbedded(includePaths = {"curie", "geneSymbol.displayText", "geneSymbol.formatText", "geneFullName.displayText", "geneFullName.formatText", - "curie_keyword", "geneSymbol.displayText_keyword", "geneSymbol.formatText_keyword", "geneFullName.displayText_keyword", "geneFullName.formatText_keyword"}) + "curie_keyword", "geneSymbol.displayText_keyword", "geneSymbol.formatText_keyword", "geneFullName.displayText_keyword", "geneFullName.formatText_keyword", + "modEntityId", "modEntityId_keyword", "modInternalId", "modInternalId_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @OneToOne @JsonView({ View.FieldsOnly.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java index 017a4cb02..626f22bcb 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGenomicEntityAssociation.java @@ -35,19 +35,23 @@ }) public class AlleleGenomicEntityAssociation extends EvidenceAssociation { - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @JsonView({ View.FieldsOnly.class }) private VocabularyTerm relation; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"curie", "name", "secondaryIdentifiers", "synonyms.name", "abbreviation", + "curie_keyword", "name_keyword", "secondaryIdentifiers_keyword", "synonyms.name_keyword", "abbreviation_keyword" }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @JsonView({ View.FieldsOnly.class }) private ECOTerm evidenceCode; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"freeText", "noteType.name", "references.curie", + "references.primaryCrossReferenceCurie", "freeText_keyword", "noteType.name_keyword", "references.curie_keyword", + "references.primaryCrossReferenceCurie_keyword" + }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @OneToOne(cascade = CascadeType.ALL, orphanRemoval=true) @JsonView({ View.FieldsOnly.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java index e74ac4290..121e4142a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java @@ -46,16 +46,16 @@ public class ConstructGenomicEntityAssociation extends EvidenceAssociation { @IndexedEmbedded(includePaths = {"curie", "constructSymbol.displayText", "constructSymbol.formatText", - "constructFullName.displayText", "constructFullName.formatText", "modEntityId", + "constructFullName.displayText", "constructFullName.formatText", "modEntityId", "modInternalId", "curie_keyword", "constructSymbol.displayText_keyword", "constructSymbol.formatText_keyword", - "constructFullName.displayText_keyword", "constructFullName.formatText_keyword", "modEntityId_keyword",}) + "constructFullName.displayText_keyword", "constructFullName.formatText_keyword", "modEntityId_keyword", "modInternalId_keyword"}) @ManyToOne @JsonView({ View.FieldsOnly.class }) @JsonIgnoreProperties("constructGenomicEntityAssociations") @Fetch(FetchMode.JOIN) private Construct subject; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @JsonView({ View.FieldsOnly.class }) @@ -68,7 +68,10 @@ public class ConstructGenomicEntityAssociation extends EvidenceAssociation { @JsonIgnoreProperties({"alleleGeneAssociations", "constructGenomicEntityAssociations"}) private GenomicEntity object; - @IndexedEmbedded(includeDepth = 1) + @IndexedEmbedded(includePaths = {"freeText", "noteType.name", "references.curie", + "references.primaryCrossReferenceCurie", "freeText_keyword", "noteType.name_keyword", "references.curie_keyword", + "references.primaryCrossReferenceCurie_keyword" + }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true) @JsonView({ View.FieldsAndLists.class, View.ConstructView.class }) From 7317498a4aa8a2e9c51fc5e78c16fae89c14f837 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Sat, 27 Jan 2024 09:31:42 +0000 Subject: [PATCH 044/159] Use mapped superclasses --- .../model/entities/Annotation.java | 1 - .../model/entities/Association.java | 9 + .../model/entities/ConditionRelation.java | 6 + .../model/entities/CrossReference.java | 6 +- .../model/entities/DataProvider.java | 6 +- .../model/entities/ExperimentalCondition.java | 6 + .../entities/InformationContentEntity.java | 10 + .../curation_api/model/entities/Note.java | 6 +- .../model/entities/Organization.java | 9 +- .../curation_api/model/entities/Person.java | 11 +- .../model/entities/PersonSetting.java | 6 +- .../curation_api/model/entities/Reagent.java | 5 +- .../model/entities/ResourceDescriptor.java | 5 + .../entities/ResourceDescriptorPage.java | 6 +- .../curation_api/model/entities/Species.java | 5 + .../curation_api/model/entities/Synonym.java | 6 + .../model/entities/Vocabulary.java | 2 + .../model/entities/VocabularyTerm.java | 4 +- .../model/entities/VocabularyTermSet.java | 2 + .../model/entities/base/AuditedObject.java | 19 +- .../model/entities/base/CurieObject.java | 14 +- .../model/entities/base/SubmittedObject.java | 12 +- .../model/entities/bulkloads/BulkLoad.java | 3 + .../curationreports/CurationReport.java | 3 + .../model/entities/ontology/OntologyTerm.java | 8 + .../orthology/GeneToGeneOrthology.java | 5 + .../slotAnnotations/SlotAnnotation.java | 8 + .../v0.30.0.1__linkml_v2.0.0_update.sql | 955 ++++-------------- 28 files changed, 317 insertions(+), 821 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java index ed7d1ca84..418a61c3d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java @@ -52,7 +52,6 @@ @UniqueConstraint(name = "annotation_modinternalid_uk", columnNames = "modInternalId"), } ) - public class Annotation extends SingleReferenceAssociation { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java index b6d266c05..41e8e4577 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Association.java @@ -6,15 +6,24 @@ import org.eclipse.microprofile.openapi.annotations.media.Schema; import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +@Inheritance(strategy = InheritanceType.JOINED) @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) @Schema(name = "association", description = "POJO that represents an association") +@Table(indexes = { + @Index(name = "association_createdby_index", columnList = "createdBy_id"), + @Index(name = "association_updatedby_index", columnList = "updatedBy_id") +}) @AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) public class Association extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java index 2e2256227..bf0eb0842 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java @@ -23,8 +23,10 @@ import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; +import jakarta.persistence.Index; import jakarta.persistence.ManyToMany; import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -35,6 +37,10 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) @Schema(name = "ConditionRelation", description = "POJO that describes the Condition Relation") +@Table(indexes = { + @Index(name = "conditionrelation_createdby_index", columnList = "createdBy_id"), + @Index(name = "conditionrelation_updatedby_index", columnList = "updatedBy_id") +}) @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { ExperimentalCondition.class }) public class ConditionRelation extends UniqueIdAuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/CrossReference.java b/src/main/java/org/alliancegenome/curation_api/model/entities/CrossReference.java index fa59feb4b..735ab9fd8 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/CrossReference.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/CrossReference.java @@ -33,8 +33,10 @@ @Schema(name = "CrossReference", description = "POJO that represents the Cross Reference") @AGRCurationSchemaVersion(min = "1.6.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Table(indexes = { - @Index(name = "crossreference_resourcedescriptorpage_index", columnList = "resourcedescriptorpage_id"), - @Index(name = "crossreference_referencedcurie_index", columnList = "referencedcurie") + @Index(name = "crossreference_createdby_index", columnList = "createdBy_id"), + @Index(name = "crossreference_updatedby_index", columnList = "updatedBy_id"), + @Index(name = "crossreference_resourcedescriptorpage_index", columnList = "resourcedescriptorpage_id"), + @Index(name = "crossreference_referencedcurie_index", columnList = "referencedcurie") }) public class CrossReference extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/DataProvider.java b/src/main/java/org/alliancegenome/curation_api/model/entities/DataProvider.java index 2f623e224..8968635f3 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/DataProvider.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/DataProvider.java @@ -26,8 +26,10 @@ @Schema(name = "DataProvider", description = "POJO that represents the data provider") @AGRCurationSchemaVersion(min = "1.6.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Table(indexes = { - @Index(name = "dataprovider_crossreference_index", columnList = "crossreference_id"), - @Index(name = "dataprovider_sourceorganization_index", columnList = "sourceorganization_id") + @Index(name = "dataprovider_createdby_index", columnList = "createdBy_id"), + @Index(name = "dataprovider_updatedby_index", columnList = "updatedBy_id"), + @Index(name = "dataprovider_crossreference_index", columnList = "crossreference_id"), + @Index(name = "dataprovider_sourceorganization_index", columnList = "sourceorganization_id") }) public class DataProvider extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ExperimentalCondition.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ExperimentalCondition.java index 10a046cb4..93dad2d72 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ExperimentalCondition.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ExperimentalCondition.java @@ -26,7 +26,9 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; +import jakarta.persistence.Index; import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -37,6 +39,10 @@ @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @Schema(name = "ExperimentalCondition", description = "POJO that describes the Experimental Condition") +@Table(indexes = { + @Index(name = "experimentalcondition_createdby_index", columnList = "createdBy_id"), + @Index(name = "experimentalcondition_updatedby_index", columnList = "updatedBy_id") +}) @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) public class ExperimentalCondition extends UniqueIdAuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java index f0d3e3bf5..e1c8bec18 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java @@ -9,16 +9,26 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.SequenceGenerator; +import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +@Inheritance(strategy = InheritanceType.JOINED) @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @JsonIgnoreProperties(ignoreUnknown = true) @ToString(callSuper = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Reference.class, name = "Reference") }) +@Table(indexes = { + @Index(name = "informationcontent_createdby_index", columnList = "createdBy_id"), + @Index(name = "informationcontent_updatedby_index", columnList = "updatedBy_id") +}) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) public class InformationContentEntity extends CurieObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java index b87892173..9b0173d6f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Note.java @@ -37,7 +37,11 @@ @ToString(callSuper = true) @Schema(name = "Note", description = "POJO that represents the Note") @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -@Table(indexes = { @Index(name = "Note_noteType_index", columnList = "noteType_id")}) +@Table(indexes = { + @Index(name = "Note_noteType_index", columnList = "noteType_id"), + @Index(name = "Note_createdby_index", columnList = "createdBy_id"), + @Index(name = "Note_updatedby_index", columnList = "updatedBy_id") +}) public class Note extends AuditedObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer", valueBridge = @ValueBridgeRef(type = FreeTextValueBridge.class)) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java index d02d3c54f..8520a597b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Organization.java @@ -17,18 +17,25 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; import jakarta.persistence.OneToOne; import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +@Inheritance(strategy = InheritanceType.JOINED) @Data @Entity @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.4.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Agent.class }) -@Table(indexes = { @Index(name = "organization_homepageresourcedescriptorpage_id_index", columnList = "homepageresourcedescriptorpage_id") }) +@Table(indexes = { + @Index(name = "organization_homepageresourcedescriptorpage_id_index", columnList = "homepageresourcedescriptorpage_id"), + @Index(name = "organization_createdby_index", columnList = "createdBy_id"), + @Index(name = "organization_updatedby_index", columnList = "updatedBy_id") +}) public class Organization extends Agent { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java index 84372c2ec..7a14ffee7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Person.java @@ -18,6 +18,8 @@ import jakarta.persistence.ElementCollection; import jakarta.persistence.Entity; import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; @@ -26,15 +28,18 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@Inheritance(strategy = InheritanceType.JOINED) @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) @JsonIgnoreProperties(ignoreUnknown = true) @AGRCurationSchemaVersion(min = "1.3.2", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Agent.class }) -@Table(indexes = { - @Index(name = "person_uniqueid_index", columnList = "uniqueid"), - @Index(name = "person_allianceMember_index", columnList = "allianceMember_id"), +@Table(indexes = { + @Index(name = "person_createdby_index", columnList = "createdBy_id"), + @Index(name = "person_updatedby_index", columnList = "updatedBy_id"), + @Index(name = "person_uniqueid_index", columnList = "uniqueid"), + @Index(name = "person_allianceMember_index", columnList = "allianceMember_id"), }) public class Person extends Agent { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java b/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java index ecab844f4..482ef07c4 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/PersonSetting.java @@ -27,8 +27,10 @@ @JsonIgnoreProperties(ignoreUnknown = true) @AGRCurationSchemaVersion(min = "1.3.2", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Table(indexes = { - @Index(name = "personsetting_person_index", columnList = "person_id"), - @Index(name = "personsetting_settingskey_index", columnList = "settingskey") + @Index(name = "personsetting_createdby_index", columnList = "createdBy_id"), + @Index(name = "personsetting_updatedby_index", columnList = "updatedBy_id"), + @Index(name = "personsetting_person_index", columnList = "person_id"), + @Index(name = "personsetting_settingskey_index", columnList = "settingskey") }) public class PersonSetting extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java index 7dbd78b50..220506e01 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Reagent.java @@ -21,12 +21,15 @@ import jakarta.persistence.ElementCollection; import jakarta.persistence.Entity; import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +@Inheritance(strategy = InheritanceType.JOINED) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonSubTypes({ @JsonSubTypes.Type(value = Construct.class, name = "Construct") }) @Entity @@ -36,7 +39,7 @@ @Schema(name = "reagent", description = "POJO that represents a reagent") @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SubmittedObject.class }) @Table(indexes = { - @Index(name = "reagent_uniqueId_index", columnList = "uniqueId") + @Index(name = "reagent_uniqueId_index", columnList = "uniqueId") }) public class Reagent extends SubmittedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java index 586962685..151f1cc1a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptor.java @@ -26,6 +26,7 @@ import jakarta.persistence.Index; import jakarta.persistence.JoinTable; import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @@ -36,6 +37,10 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(exclude = {"resourcePages"}, callSuper = true) @AGRCurationSchemaVersion(min = "1.5.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) +@Table(indexes = { + @Index(name = "resourcedescriptor_createdby_index", columnList = "createdBy_id"), + @Index(name = "resourcedescriptor_updatedby_index", columnList = "updatedBy_id") +}) @Schema(name = "ResourceDescriptor", description = "Annotation class representing a resource descriptor") public class ResourceDescriptor extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java index 57a8ab6dd..bc372d555 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ResourceDescriptorPage.java @@ -31,7 +31,11 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "1.5.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -@Table(indexes = { @Index(name = "resourcedescriptorpage_resourcedescriptor_id_index", columnList = "resourcedescriptor_id")}) +@Table(indexes = { + @Index(name = "resourcedescriptorpage_resourcedescriptor_id_index", columnList = "resourcedescriptor_id"), + @Index(name = "resourcedescriptorpage_createdby_id_index", columnList = "createdby_id"), + @Index(name = "resourcedescriptorpage_updatedby_id_index", columnList = "updatedby_id") +}) @Schema(name = "ResourceDescriptorPage", description = "Annotation class representing a resource descriptor page") public class ResourceDescriptorPage extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java index 07d968f70..5686fb5ab 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Species.java @@ -28,6 +28,7 @@ import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToOne; +import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; @@ -39,6 +40,10 @@ @NoArgsConstructor @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) +@Table(indexes = { + @Index(name = "species_createdby_index", columnList = "createdBy_id"), + @Index(name = "species_updatedby_index", columnList = "updatedBy_id") +}) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE,dependencies = { AuditedObject.class }) public class Species extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java index 4a986b2bf..7801adc1d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java @@ -14,6 +14,8 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; @@ -24,6 +26,10 @@ @NoArgsConstructor @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) +@Table(indexes = { + @Index(name = "synonym_createdby_index", columnList = "createdBy_id"), + @Index(name = "synonym_updatedby_index", columnList = "updatedBy_id") +}) @AGRCurationSchemaVersion(min = "1.2.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) public class Synonym extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java index aa8170bee..857e9b883 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Vocabulary.java @@ -37,6 +37,8 @@ @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Table( indexes = { + @Index(name = "vocabulary_createdby_index", columnList = "createdBy_id"), + @Index(name = "vocabulary_updatedby_index", columnList = "updatedBy_id"), @Index(name = "vocabulary_name_index", columnList = "name"), @Index(name = "vocabulary_vocabularylabel_index", columnList = "vocabularylabel") }, diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java index e382f6568..b43f46218 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTerm.java @@ -38,7 +38,9 @@ @ToString(exclude = { "vocabulary", "vocabularyTermSets" }, callSuper = true) @Table(indexes = { @Index(name = "vocabularyterm_name_index", columnList = "name"), - @Index(name = "vocabularyterm_vocabulary_id_index", columnList = "vocabulary_id") + @Index(name = "vocabularyterm_vocabulary_id_index", columnList = "vocabulary_id"), + @Index(name = "vocabularyterm_createdby_index", columnList = "createdBy_id"), + @Index(name = "vocabularyterm_updatedby_index", columnList = "updatedBy_id") }) @Schema(name = "VocabularyTerm", description = "POJO that represents the Vocabulary Term") @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java index 20a75c29b..8824a7769 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/VocabularyTermSet.java @@ -40,6 +40,8 @@ indexes = { @Index(name = "vocabularytermset_name_index", columnList = "name"), @Index(name = "vocabularytermset_vocabularylabel_index", columnList = "vocabularylabel"), + @Index(name = "vocabularytermset_createdby_id_index", columnList = "createdby_id"), + @Index(name = "vocabularytermset_updatedby_id_index", columnList = "updatedby_id"), @Index(name = "vocabularytermset_vocabularytermsetvocabulary_id_index", columnList = "vocabularytermsetvocabulary_id") }, uniqueConstraints = { @UniqueConstraint(name = "vocabularytermset_vocabularyLabel_uk", columnNames = "vocabularyLabel"), diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java index be00434b0..0c0fd48f3 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/AuditedObject.java @@ -29,41 +29,28 @@ import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; -import jakarta.persistence.DiscriminatorColumn; -import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; -import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; +import jakarta.persistence.MappedSuperclass; import jakarta.persistence.SequenceGenerator; -import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@Entity @ToString(exclude = { "createdBy", "updatedBy" }) @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE) -@Inheritance(strategy = InheritanceType.JOINED) -@Table(indexes = { - @Index(name = "auditedobject_createdby_index", columnList = "createdBy_id"), - @Index(name = "auditedobject_updatedby_index", columnList = "updatedBy_id"), - @Index(name = "auditedobject_auditedObjectType_index", columnList = "auditedObjectType"), -}) -@DiscriminatorColumn(name = "auditedObjectType") +@MappedSuperclass @Schema(name = "AuditedObject", description = "POJO that represents the AuditedObject") public class AuditedObject extends BaseEntity { @Id @DocumentId @GenericField(aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES) - @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "auditedobject_seq_generator") - @SequenceGenerator(name = "auditedobject_seq_generator", sequenceName = "auditedobject_seq", allocationSize = 1) + @GeneratedValue(strategy = GenerationType.SEQUENCE) @JsonView({ View.FieldsOnly.class, View.PersonSettingView.class, VocabularyTermSetView.class }) @EqualsAndHashCode.Include protected Long id; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java index ce2d80a5c..17febb9fe 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java @@ -13,26 +13,16 @@ import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; -import jakarta.persistence.Index; -import jakarta.persistence.Table; -import jakarta.persistence.UniqueConstraint; +import jakarta.persistence.MappedSuperclass; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; @Data @EqualsAndHashCode(callSuper = true) -@Entity @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -@Table( - indexes = { - @Index(name = "curieobject_curie_index", columnList = "curie") - }, - uniqueConstraints = { - @UniqueConstraint(name = "curieobject_curie_uk", columnNames = "curie") - } -) +@MappedSuperclass @Schema(name = "CurieObject", description = "POJO that represents the CurieObject") public class CurieObject extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java index cdf6de7bc..2d7b8b17e 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java @@ -20,8 +20,11 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonView; +import jakarta.persistence.DiscriminatorColumn; import jakarta.persistence.Entity; import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; import jakarta.persistence.Transient; @@ -30,19 +33,26 @@ import lombok.EqualsAndHashCode; import lombok.ToString; +@Inheritance(strategy = InheritanceType.JOINED) +@DiscriminatorColumn(name = "submittedObjectType") @Entity @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { CurieObject.class }) @Table(indexes = { + @Index(name = "submittedobject_curie_index", columnList = "curie"), @Index(name = "submittedobject_modentityid_index", columnList = "modentityid"), @Index(name = "submittedobject_modinternalid_index", columnList = "modinternalid"), - @Index(name = "submittedobject_dataprovider_index", columnList = "dataprovider_id") + @Index(name = "submittedobject_dataprovider_index", columnList = "dataprovider_id"), + @Index(name = "submittedobject_createdby_index", columnList = "createdBy_id"), + @Index(name = "submittedobject_updatedby_index", columnList = "updatedBy_id"), + @Index(name = "submittedobject_submittedObjectType_index", columnList = "submittedObjectType") }, uniqueConstraints = { @UniqueConstraint(name = "submittedobject_modentityid_uk", columnNames = "modentityid"), @UniqueConstraint(name = "submittedobject_modinternalid_uk", columnNames = "modinternalid"), + @UniqueConstraint(name = "submittedobject_curie_uk", columnNames = "curie") } ) @Schema(name = "SubmittedObject", description = "POJO that represents the SubmittedObject") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java index 468f7e7e4..8a5a50982 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/bulkloads/BulkLoad.java @@ -20,6 +20,8 @@ import jakarta.persistence.EnumType; import jakarta.persistence.Enumerated; import jakarta.persistence.FetchType; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; import jakarta.persistence.OrderBy; @@ -29,6 +31,7 @@ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonSubTypes({ @Type(value = BulkFMSLoad.class, name = "BulkFMSLoad"), @Type(value = BulkURLLoad.class, name = "BulkURLLoad"), @Type(value = BulkManualLoad.class, name = "BulkManualLoad") }) @Entity +@Inheritance(strategy = InheritanceType.JOINED) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(exclude = { "group" }, callSuper = true) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java index a741150f5..681a39401 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/curationreports/CurationReport.java @@ -14,6 +14,8 @@ import jakarta.persistence.Entity; import jakarta.persistence.EnumType; import jakarta.persistence.Enumerated; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; import jakarta.persistence.OrderBy; @@ -24,6 +26,7 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@Inheritance(strategy = InheritanceType.JOINED) @ToString(exclude = { "curationReportGroup", "curationReportHistory" }, callSuper = true) @AGRCurationSchemaVersion(min = "1.2.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) public class CurationReport extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java index 06d345d2c..8caf16a59 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java @@ -26,18 +26,26 @@ import jakarta.persistence.ElementCollection; import jakarta.persistence.Entity; import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; +import jakarta.persistence.Table; import jakarta.persistence.Transient; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +@Inheritance(strategy = InheritanceType.JOINED) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @Entity @ToString(exclude = { "isaParents", "isaChildren", "isaAncestors", "isaDescendants", "crossReferences", "synonyms", "secondaryIdentifiers", "subsets" }, callSuper = true) @AGRCurationSchemaVersion(min = LinkMLSchemaConstants.MIN_ONTOLOGY_RELEASE, max = LinkMLSchemaConstants.MAX_ONTOLOGY_RELEASE, dependencies = { AuditedObject.class }) +@Table(indexes = { + @Index(name = "ontologyterm_createdby_index", columnList = "createdBy_id"), + @Index(name = "ontologyterm_updatedby_index", columnList = "updatedBy_id") +}) public class OntologyTerm extends CurieObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java index 78dee014c..09350dbc7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/orthology/GeneToGeneOrthology.java @@ -14,12 +14,15 @@ import jakarta.persistence.Entity; import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +@Inheritance(strategy = InheritanceType.JOINED) @Entity @Data @EqualsAndHashCode(callSuper = true) @@ -27,6 +30,8 @@ @Schema(name = "GeneToGeneOrthology", description = "POJO that represents orthology between two genes") @AGRCurationSchemaVersion(min = "1.7.4", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) @Table(indexes = { + @Index(name = "genetogeneorthology_createdby_index", columnList = "createdBy_id"), + @Index(name = "genetogeneorthology_updatedby_index", columnList = "updatedBy_id"), @Index(name = "genetogeneorthology_subjectgene_index", columnList = "subjectgene_id"), @Index(name = "genetogeneorthology_objectgene_index", columnList = "objectgene_id") }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java index fd5b86a88..4bcfa0423 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/slotAnnotations/SlotAnnotation.java @@ -16,17 +16,25 @@ import jakarta.persistence.Entity; import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; +import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +@Inheritance(strategy = InheritanceType.JOINED) @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @Schema(name = "SlotAnnotation", description = "POJO that represents a SlotAnnotation") @ToString(callSuper = true) +@Table(indexes = { + @Index(name = "slotannotation_createdby_index", columnList = "createdBy_id"), + @Index(name = "slotannotation_updatedby_index", columnList = "updatedBy_id") +}) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) public class SlotAnnotation extends AuditedObject { diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index 7e91f01d1..39f4b0f29 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -491,11 +491,14 @@ ALTER TABLE zfsterm DROP CONSTRAINT zfsterm_pkey; -- Create tables -CREATE TABLE auditedobject ( +CREATE TABLE submittedobject ( id bigint PRIMARY KEY, old_id bigint, - old_curie varchar(255), + curie varchar(255), tablename varchar(255), + modentityid varchar(255), + modinternalid varchar(255), + dataprovider_id bigint, createdby_id bigint, updatedby_id bigint, datecreated timestamp without time zone, @@ -504,50 +507,12 @@ CREATE TABLE auditedobject ( dbdateupdated timestamp without time zone, internal boolean NOT NULL DEFAULT false, obsolete boolean NOT NULL DEFAULT false, - auditedobjecttype varchar(64) - ); - -CREATE TABLE curieobject ( - id bigint PRIMARY KEY, - curie varchar(255) - ); - -CREATE TABLE submittedobject ( - id bigint PRIMARY KEY, - modentityid varchar(255), - modinternalid varchar(255), - dataprovider_id bigint + submittedobjecttype varchar(64) ); -CREATE SEQUENCE auditedobject_seq START WITH 200250000 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; - -DROP SEQUENCE association_seq; -DROP SEQUENCE bulkload_seq; -DROP SEQUENCE bulkloadfile_seq; -DROP SEQUENCE bulkloadfileexception_seq; -DROP SEQUENCE bulkloadfilehistory_seq; -DROP SEQUENCE bulkloadgroup_seq; -DROP SEQUENCE conditionrelation_seq; -DROP SEQUENCE crossreference_seq; -DROP SEQUENCE curationreport_seq; -DROP SEQUENCE curationreportgroup_seq; -DROP SEQUENCE curationreporthistory_seq; -DROP SEQUENCE dataprovider_seq; -DROP SEQUENCE experimentalcondition_seq; -DROP SEQUENCE genetogeneorthology_seq; -DROP SEQUENCE note_seq; -DROP SEQUENCE organization_seq; -DROP SEQUENCE person_seq; -DROP SEQUENCE personsetting_seq; -DROP SEQUENCE reagent_seq; -DROP SEQUENCE resourcedescriptor_seq; -DROP SEQUENCE resourcedescriptorpage_seq; -DROP SEQUENCE slotannotation_seq; -DROP SEQUENCE species_seq; -DROP SEQUENCE synonym_seq; -DROP SEQUENCE vocabulary_seq; -DROP SEQUENCE vocabularyterm_seq; -DROP SEQUENCE vocabularytermset_seq; +CREATE SEQUENCE submittedobject_seq START WITH 200250000 INCREMENT BY 50 NO MINVALUE NO MAXVALUE CACHE 1; +CREATE SEQUENCE ontologyterm_seq START WITH 200250000 INCREMENT BY 50 NO MINVALUE NO MAXVALUE CACHE 1; +CREATE SEQUENCE informationcontententity_seq START WITH 20025000 INCREMENT BY 50 NO MINVALUE NO MAXVALUE CACHE 1; -- Add id equivalents of curie columns @@ -684,503 +649,167 @@ ALTER TABLE zfsterm ADD COLUMN id bigint; -- Move data around -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'association', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM association; - -INSERT INTO auditedobject (tablename, id, old_curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'biologicalentity', nextval('auditedobject_seq'), curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete +INSERT INTO submittedobject (id, modentityid, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT nextval('submittedobject_seq'), curie, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete FROM biologicalentity; -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'bulkload', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM bulkload; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'bulkloadfile', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM bulkloadfile; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'bulkloadfileexception', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM bulkloadfileexception; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'bulkloadfilehistory', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM bulkloadfilehistory; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'bulkloadgroup', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM bulkloadgroup; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'conditionrelation', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM conditionrelation; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'crossreference', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM crossreference; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'dataprovider', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM dataprovider; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'experimentalcondition', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM experimentalcondition; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'genetogeneorthology', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM genetogeneorthology; - -INSERT INTO auditedobject (tablename, id, old_curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'informationcontententity', nextval('auditedobject_seq'), curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM informationcontententity; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'note', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM note; - -INSERT INTO auditedobject (tablename, id, old_curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'ontologyterm', nextval('auditedobject_seq'), curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM ontologyterm; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'organization', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM organization; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'person', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM person; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'personsetting', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM personsetting; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'reagent', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM reagent; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'resourcedescriptor', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM resourcedescriptor; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'resourcedescriptorpage', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM resourcedescriptorpage; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'slotannotation', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM slotannotation; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'species', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM species; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'synonym', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM synonym; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'vocabulary', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM vocabulary; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'vocabularyterm', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM vocabularyterm; - -INSERT INTO auditedobject (tablename, id, old_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT 'vocabularytermset', nextval('auditedobject_seq'), id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM vocabularytermset; - -CREATE INDEX old_id_index ON auditedobject USING btree (old_id, tablename); -CREATE INDEX old_curie_index ON auditedobject USING btree (old_curie, tablename); - -UPDATE auditedobject t SET createdby_id = a.id FROM auditedobject a WHERE t.createdby_id = a.old_id AND a.tablename = 'person'; -UPDATE auditedobject t SET updatedby_id = a.id FROM auditedobject a WHERE t.updatedby_id = a.old_id AND a.tablename = 'person'; +INSERT INTO submittedobject (id, old_id, modentityid, modinternalid, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT nextval('submittedobject_seq'), id, modentityid, modinternalid, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM reagent; -UPDATE affectedgenomicmodel t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE affectedgenomicmodel t SET subtype_id = a.id FROM auditedobject a WHERE t.subtype_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE agmdiseaseannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -UPDATE agmdiseaseannotation t SET inferredallele_id = a.id FROM auditedobject a WHERE t.inferredallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE agmdiseaseannotation t SET assertedallele_id = a.id FROM auditedobject a WHERE t.assertedallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE agmdiseaseannotation t SET inferredgene_id = a.id FROM auditedobject a WHERE t.inferredgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE agmdiseaseannotation t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE agmdiseaseannotation_gene t SET agmdiseaseannotation_id = a.id FROM auditedobject a WHERE t.agmdiseaseannotation_id = a.old_id AND a.tablename = 'association'; -UPDATE agmdiseaseannotation_gene t SET assertedgenes_id = a.id FROM auditedobject a WHERE t.assertedgenes_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allele t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allele t SET incollection_id = a.id FROM auditedobject a WHERE t.incollection_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE allele_note t SET allele_id = a.id FROM auditedobject a WHERE t.allele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allele_note t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; -UPDATE allele_reference t SET allele_id = a.id FROM auditedobject a WHERE t.allele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allele_reference t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE alleledatabasestatusslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE alleledatabasestatusslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE alleledatabasestatusslotannotation t SET databasestatus_id = a.id FROM auditedobject a WHERE t.databasestatus_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE allelediseaseannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -UPDATE allelediseaseannotation t SET inferredgene_id = a.id FROM auditedobject a WHERE t.inferredgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelediseaseannotation t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelediseaseannotation_gene t SET allelediseaseannotation_id = a.id FROM auditedobject a WHERE t.allelediseaseannotation_id = a.old_id AND a.tablename = 'association'; -UPDATE allelediseaseannotation_gene t SET assertedgenes_id = a.id FROM auditedobject a WHERE t.assertedgenes_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelefullnameslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE allelefullnameslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelefunctionalimpactslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE allelefunctionalimpactslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelefunctionalimpactslotannotation t SET phenotypeterm_id = a.id FROM auditedobject a WHERE t.phenotypeterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE allelefunctionalimpactslotannotation_vocabularyterm t SET allelefunctionalimpactslotannotation_id = a.id FROM auditedobject a WHERE t.allelefunctionalimpactslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE allelefunctionalimpactslotannotation_vocabularyterm t SET functionalimpacts_id = a.id FROM auditedobject a WHERE t.functionalimpacts_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE allelegeneassociation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -UPDATE allelegeneassociation t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelegeneassociation t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelegenomicentityassociation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -UPDATE allelegenomicentityassociation t SET evidencecode_id = a.id FROM auditedobject a WHERE t.evidencecode_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE allelegenomicentityassociation t SET relatednote_id = a.id FROM auditedobject a WHERE t.relatednote_id = a.old_id AND a.tablename = 'note'; -UPDATE allelegenomicentityassociation t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE allelegermlinetransmissionstatusslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE allelegermlinetransmissionstatusslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelegermlinetransmissionstatusslotannotation t SET germlinetransmissionstatus_id = a.id FROM auditedobject a WHERE t.germlinetransmissionstatus_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE alleleinheritancemodeslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE alleleinheritancemodeslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE alleleinheritancemodeslotannotation t SET inheritancemode_id = a.id FROM auditedobject a WHERE t.inheritancemode_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE alleleinheritancemodeslotannotation t SET phenotypeterm_id = a.id FROM auditedobject a WHERE t.phenotypeterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE allelemutationtypeslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE allelemutationtypeslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelemutationtypeslotannotation_soterm t SET allelemutationtypeslotannotation_id = a.id FROM auditedobject a WHERE t.allelemutationtypeslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE allelemutationtypeslotannotation_soterm t SET mutationtypes_id = a.id FROM auditedobject a WHERE t.mutationtypes_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE allelenomenclatureeventslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE allelenomenclatureeventslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelenomenclatureeventslotannotation t SET nomenclatureevent_id = a.id FROM auditedobject a WHERE t.nomenclatureevent_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE allelesecondaryidslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE allelesecondaryidslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelesymbolslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE allelesymbolslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE allelesynonymslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE allelesynonymslotannotation t SET singleallele_id = a.id FROM auditedobject a WHERE t.singleallele_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE alliancemember t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'organization'; -UPDATE anatomicalterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE annotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -UPDATE annotation t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; -UPDATE annotation_conditionrelation t SET annotation_id = a.id FROM auditedobject a WHERE t.annotation_id = a.old_id AND a.tablename = 'association'; -UPDATE annotation_conditionrelation t SET conditionrelations_id = a.id FROM auditedobject a WHERE t.conditionrelations_id = a.old_id AND a.tablename = 'conditionrelation'; -UPDATE annotation_note t SET annotation_id = a.id FROM auditedobject a WHERE t.annotation_id = a.old_id AND a.tablename = 'association'; -UPDATE annotation_note t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; -UPDATE apoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE association t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -UPDATE atpterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE biologicalentity t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE biologicalentity t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE biologicalentity t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; -UPDATE bspoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE bulkfmsload t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; -UPDATE bulkload t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; -UPDATE bulkload t SET group_id = a.id FROM auditedobject a WHERE t.group_id = a.old_id AND a.tablename = 'bulkloadgroup'; -UPDATE bulkloadfile t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfile'; -UPDATE bulkloadfile t SET bulkload_id = a.id FROM auditedobject a WHERE t.bulkload_id = a.old_id AND a.tablename = 'bulkload'; -UPDATE bulkloadfileexception t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfileexception'; -UPDATE bulkloadfileexception t SET bulkloadfilehistory_id = a.id FROM auditedobject a WHERE t.bulkloadfilehistory_id = a.old_id AND a.tablename = 'bulkloadfilehistory'; -UPDATE bulkloadfilehistory t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadfilehistory'; -UPDATE bulkloadfilehistory t SET bulkloadfile_id = a.id FROM auditedobject a WHERE t.bulkloadfile_id = a.old_id AND a.tablename = 'bulkloadfile'; -UPDATE bulkloadgroup t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkloadgroup'; -UPDATE bulkmanualload t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; -UPDATE bulkscheduledload t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; -UPDATE bulkurlload t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'bulkload'; -UPDATE chebiterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE chemicalterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE clterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE cmoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE conditionrelation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'conditionrelation'; -UPDATE conditionrelation t SET conditionrelationtype_id = a.id FROM auditedobject a WHERE t.conditionrelationtype_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE conditionrelation t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE conditionrelation_experimentalcondition t SET conditionrelation_id = a.id FROM auditedobject a WHERE t.conditionrelation_id = a.old_id AND a.tablename = 'conditionrelation'; -UPDATE conditionrelation_experimentalcondition t SET conditions_id = a.id FROM auditedobject a WHERE t.conditions_id = a.old_id AND a.tablename = 'experimentalcondition'; -UPDATE construct t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'reagent'; -UPDATE construct_reference t SET construct_id = a.id FROM auditedobject a WHERE t.construct_id = a.old_id AND a.tablename = 'reagent'; -UPDATE construct_reference t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE constructcomponentslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE constructcomponentslotannotation t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; -UPDATE constructcomponentslotannotation t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE constructcomponentslotannotation t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE constructcomponentslotannotation_note t SET constructcomponentslotannotation_id = a.id FROM auditedobject a WHERE t.constructcomponentslotannotation_id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE constructcomponentslotannotation_note t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; -UPDATE constructfullnameslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE constructfullnameslotannotation t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; -UPDATE constructgenomicentityassociation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -UPDATE constructgenomicentityassociation t SET subject_id = a.id FROM auditedobject a WHERE t.subject_id = a.old_id AND a.tablename = 'reagent'; -UPDATE constructgenomicentityassociation t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE constructgenomicentityassociation t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE constructgenomicentityassociation_note t SET constructgenomicentityassociation_id = a.id FROM auditedobject a WHERE t.constructgenomicentityassociation_id = a.old_id AND a.tablename = 'association'; -UPDATE constructgenomicentityassociation_note t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; -UPDATE constructsymbolslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE constructsymbolslotannotation t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; -UPDATE constructsynonymslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE constructsynonymslotannotation t SET singleconstruct_id = a.id FROM auditedobject a WHERE t.singleconstruct_id = a.old_id AND a.tablename = 'reagent'; -UPDATE crossreference t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'crossreference'; -UPDATE crossreference t SET resourcedescriptorpage_id = a.id FROM auditedobject a WHERE t.resourcedescriptorpage_id = a.old_id AND a.tablename = 'resourcedescriptorpage'; -UPDATE daoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE dataprovider t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'dataprovider'; -UPDATE dataprovider t SET sourceorganization_id = a.id FROM auditedobject a WHERE t.sourceorganization_id = a.old_id AND a.tablename = 'organization'; -UPDATE dataprovider t SET crossreference_id = a.id FROM auditedobject a WHERE t.crossreference_id = a.old_id AND a.tablename = 'crossreference'; -UPDATE diseaseannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -UPDATE diseaseannotation t SET object_id = a.id FROM auditedobject a WHERE t.object_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE diseaseannotation t SET relation_id = a.id FROM auditedobject a WHERE t.relation_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE diseaseannotation t SET diseasegeneticmodifierrelation_id = a.id FROM auditedobject a WHERE t.diseasegeneticmodifierrelation_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE diseaseannotation t SET annotationtype_id = a.id FROM auditedobject a WHERE t.annotationtype_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE diseaseannotation t SET geneticsex_id = a.id FROM auditedobject a WHERE t.geneticsex_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE diseaseannotation t SET secondarydataprovider_id = a.id FROM auditedobject a WHERE t.secondarydataprovider_id = a.old_id AND a.tablename = 'dataprovider'; -UPDATE diseaseannotation_biologicalentity t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; -UPDATE diseaseannotation_biologicalentity t SET diseasegeneticmodifiers_id = a.id FROM auditedobject a WHERE t.diseasegeneticmodifiers_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE diseaseannotation_ecoterm t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; -UPDATE diseaseannotation_ecoterm t SET evidencecodes_id = a.id FROM auditedobject a WHERE t.evidencecodes_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE diseaseannotation_gene t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; -UPDATE diseaseannotation_gene t SET with_id = a.id FROM auditedobject a WHERE t.with_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE diseaseannotation_vocabularyterm t SET diseaseannotation_id = a.id FROM auditedobject a WHERE t.diseaseannotation_id = a.old_id AND a.tablename = 'association'; -UPDATE diseaseannotation_vocabularyterm t SET diseasequalifiers_id = a.id FROM auditedobject a WHERE t.diseasequalifiers_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE doterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE dpoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ecoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE emapaterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE evidenceassociation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -UPDATE evidenceassociation_informationcontententity t SET evidenceassociation_id = a.id FROM auditedobject a WHERE t.evidenceassociation_id = a.old_id AND a.tablename = 'association'; -UPDATE evidenceassociation_informationcontententity t SET evidence_id = a.id FROM auditedobject a WHERE t.evidence_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE experimentalcondition t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'experimentalcondition'; -UPDATE experimentalcondition t SET conditionanatomy_id = a.id FROM auditedobject a WHERE t.conditionanatomy_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE experimentalcondition t SET conditionchemical_id = a.id FROM auditedobject a WHERE t.conditionchemical_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE experimentalcondition t SET conditionclass_id = a.id FROM auditedobject a WHERE t.conditionclass_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE experimentalcondition t SET conditiongeneontology_id = a.id FROM auditedobject a WHERE t.conditiongeneontology_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE experimentalcondition t SET conditionid_id = a.id FROM auditedobject a WHERE t.conditionid_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE experimentalcondition t SET conditiontaxon_id = a.id FROM auditedobject a WHERE t.conditiontaxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE experimentalconditionontologyterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE fbdvterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE gene t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE gene t SET genetype_id = a.id FROM auditedobject a WHERE t.genetype_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE genediseaseannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -UPDATE genediseaseannotation t SET sgdstrainbackground_id = a.id FROM auditedobject a WHERE t.sgdstrainbackground_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genediseaseannotation t SET subject_id = a.id FROM auditedobject a WHERE t.subject_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genefullnameslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE genefullnameslotannotation t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genesecondaryidslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE genesecondaryidslotannotation t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genesymbolslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE genesymbolslotannotation t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genesynonymslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE genesynonymslotannotation t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genesystematicnameslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE genesystematicnameslotannotation t SET singlegene_id = a.id FROM auditedobject a WHERE t.singlegene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genetogeneorthology t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; -UPDATE genetogeneorthology t SET subjectgene_id = a.id FROM auditedobject a WHERE t.subjectgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genetogeneorthology t SET objectgene_id = a.id FROM auditedobject a WHERE t.objectgene_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genetogeneorthologycurated t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; -UPDATE genetogeneorthologycurated t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE genetogeneorthologycurated t SET evidencecode_id = a.id FROM auditedobject a WHERE t.evidencecode_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE genetogeneorthologygenerated t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'genetogeneorthology'; -UPDATE genetogeneorthologygenerated t SET isbestscore_id = a.id FROM auditedobject a WHERE t.isbestscore_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE genetogeneorthologygenerated t SET isbestscorereverse_id = a.id FROM auditedobject a WHERE t.isbestscorereverse_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE genetogeneorthologygenerated t SET confidence_id = a.id FROM auditedobject a WHERE t.confidence_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE genetogeneorthologygenerated_predictionmethodsmatched t SET genetogeneorthologygenerated_id = a.id FROM auditedobject a WHERE t.genetogeneorthologygenerated_id = a.old_id AND a.tablename = 'genetogeneorthology'; -UPDATE genetogeneorthologygenerated_predictionmethodsmatched t SET predictionmethodsmatched_id = a.id FROM auditedobject a WHERE t.predictionmethodsmatched_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE genetogeneorthologygenerated_predictionmethodsnotcalled t SET genetogeneorthologygenerated_id = a.id FROM auditedobject a WHERE t.genetogeneorthologygenerated_id = a.old_id AND a.tablename = 'genetogeneorthology'; -UPDATE genetogeneorthologygenerated_predictionmethodsnotcalled t SET predictionmethodsnotcalled_id = a.id FROM auditedobject a WHERE t.predictionmethodsnotcalled_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE genetogeneorthologygenerated_predictionmethodsnotmatched t SET genetogeneorthologygenerated_id = a.id FROM auditedobject a WHERE t.genetogeneorthologygenerated_id = a.old_id AND a.tablename = 'genetogeneorthology'; -UPDATE genetogeneorthologygenerated_predictionmethodsnotmatched t SET predictionmethodsnotmatched_id = a.id FROM auditedobject a WHERE t.predictionmethodsnotmatched_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE genomicentity t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genomicentity_crossreference t SET genomicentity_id = a.id FROM auditedobject a WHERE t.genomicentity_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE genomicentity_crossreference t SET crossreferences_id = a.id FROM auditedobject a WHERE t.crossreferences_id = a.old_id AND a.tablename = 'crossreference'; -UPDATE goterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE hpterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE informationcontententity t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE materm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE miterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE mmoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE mmusdvterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE modterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE molecule t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE mpathterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE mpterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE nameslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE nameslotannotation t SET nametype_id = a.id FROM auditedobject a WHERE t.nametype_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE nameslotannotation t SET synonymscope_id = a.id FROM auditedobject a WHERE t.synonymscope_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE ncbitaxonterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE note t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'note'; -UPDATE note t SET notetype_id = a.id FROM auditedobject a WHERE t.notetype_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE note_reference t SET note_id = a.id FROM auditedobject a WHERE t.note_id = a.old_id AND a.tablename = 'note'; -UPDATE note_reference t SET references_id = a.id FROM auditedobject a WHERE t.references_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE obiterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ontologyterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ontologyterm_crossreference t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ontologyterm_crossreference t SET crossreferences_id = a.id FROM auditedobject a WHERE t.crossreferences_id = a.old_id AND a.tablename = 'crossreference'; -UPDATE ontologyterm_definitionurls t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ontologyterm_isa_ancestor_descendant t SET isadescendants_id = a.id FROM auditedobject a WHERE t.isadescendants_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ontologyterm_isa_ancestor_descendant t SET isaancestors_id = a.id FROM auditedobject a WHERE t.isaancestors_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ontologyterm_isa_parent_children t SET isachildren_id = a.id FROM auditedobject a WHERE t.isachildren_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ontologyterm_isa_parent_children t SET isaparents_id = a.id FROM auditedobject a WHERE t.isaparents_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ontologyterm_secondaryidentifiers t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ontologyterm_subsets t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ontologyterm_synonym t SET ontologyterm_id = a.id FROM auditedobject a WHERE t.ontologyterm_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE ontologyterm_synonym t SET synonyms_id = a.id FROM auditedobject a WHERE t.synonyms_id = a.old_id AND a.tablename = 'synonym'; -UPDATE organization t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'organization'; -UPDATE organization t SET homepageresourcedescriptorpage_id = a.id FROM auditedobject a WHERE t.homepageresourcedescriptorpage_id = a.old_id AND a.tablename = 'resourcedescriptorpage'; -UPDATE patoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE person t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'person'; -UPDATE person t SET alliancemember_id = a.id FROM auditedobject a WHERE t.alliancemember_id = a.old_id AND a.tablename = 'organization'; -UPDATE person_emails t SET person_id = a.id FROM auditedobject a WHERE t.person_id = a.old_id AND a.tablename = 'person'; -UPDATE person_oldemails t SET person_id = a.id FROM auditedobject a WHERE t.person_id = a.old_id AND a.tablename = 'person'; -UPDATE personsetting t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'personsetting'; -UPDATE personsetting t SET person_id = a.id FROM auditedobject a WHERE t.person_id = a.old_id AND a.tablename = 'person'; -UPDATE phenotypeterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE pwterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE reagent t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'reagent'; -UPDATE reagent t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; -UPDATE reagent_secondaryidentifiers t SET reagent_id = a.id FROM auditedobject a WHERE t.reagent_id = a.old_id AND a.tablename = 'reagent'; -UPDATE reference t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE reference_crossreference t SET reference_id = a.id FROM auditedobject a WHERE t.reference_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE reference_crossreference t SET crossreferences_id = a.id FROM auditedobject a WHERE t.crossreferences_id = a.old_id AND a.tablename = 'crossreference'; -UPDATE resourcedescriptor t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'resourcedescriptor'; -UPDATE resourcedescriptor_synonyms t SET resourcedescriptor_id = a.id FROM auditedobject a WHERE t.resourcedescriptor_id = a.old_id AND a.tablename = 'resourcedescriptor'; -UPDATE resourcedescriptorpage t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'resourcedescriptorpage'; -UPDATE resourcedescriptorpage t SET resourcedescriptor_id = a.id FROM auditedobject a WHERE t.resourcedescriptor_id = a.old_id AND a.tablename = 'resourcedescriptor'; -UPDATE roterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE rsterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE secondaryidslotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE singlereferenceassociation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'association'; -UPDATE singlereferenceassociation t SET singlereference_id = a.id FROM auditedobject a WHERE t.singlereference_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE slotannotation t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE slotannotation_informationcontententity t SET slotannotation_id = a.id FROM auditedobject a WHERE t.slotannotation_id = a.old_id AND a.tablename = 'slotannotation'; -UPDATE slotannotation_informationcontententity t SET evidence_id = a.id FROM auditedobject a WHERE t.evidence_curie = a.old_curie AND a.tablename = 'informationcontententity'; -UPDATE soterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE species t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'species'; -UPDATE species t SET dataprovider_id = a.id FROM auditedobject a WHERE t.dataprovider_id = a.old_id AND a.tablename = 'dataprovider'; -UPDATE species t SET taxon_id = a.id FROM auditedobject a WHERE t.taxon_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE species_commonnames t SET species_id = a.id FROM auditedobject a WHERE t.species_id = a.old_id AND a.tablename = 'species'; -UPDATE stageterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE synonym t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'synonym'; -UPDATE uberonterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE variant t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE variant t SET varianttype_id = a.id FROM auditedobject a WHERE t.varianttype_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE variant t SET sourcegeneralconsequence_id = a.id FROM auditedobject a WHERE t.sourcegeneralconsequence_curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE variant t SET variantstatus_id = a.id FROM auditedobject a WHERE t.variantstatus_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE variant_note t SET variant_id = a.id FROM auditedobject a WHERE t.variant_curie = a.old_curie AND a.tablename = 'biologicalentity'; -UPDATE variant_note t SET relatednotes_id = a.id FROM auditedobject a WHERE t.relatednotes_id = a.old_id AND a.tablename = 'note'; -UPDATE vocabulary t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabulary'; -UPDATE vocabularyterm t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE vocabularyterm t SET vocabulary_id = a.id FROM auditedobject a WHERE t.vocabulary_id = a.old_id AND a.tablename = 'vocabulary'; -UPDATE vocabularyterm_synonyms t SET vocabularyterm_id = a.id FROM auditedobject a WHERE t.vocabularyterm_id = a.old_id AND a.tablename = 'vocabularyterm'; -UPDATE vocabularytermset t SET id = a.id FROM auditedobject a WHERE t.id = a.old_id AND a.tablename = 'vocabularytermset'; -UPDATE vocabularytermset t SET vocabularytermsetvocabulary_id = a.id FROM auditedobject a WHERE t.vocabularytermsetvocabulary_id = a.old_id AND a.tablename = 'vocabulary'; -UPDATE vocabularytermset_vocabularyterm t SET vocabularytermsets_id = a.id FROM auditedobject a WHERE t.vocabularytermsets_id = a.old_id AND a.tablename = 'vocabularytermset'; -UPDATE vocabularytermset_vocabularyterm t SET memberterms_id = a.id FROM auditedobject a WHERE t.memberterms_id = a.old_id AND a.tablename = 'vocabularyterm';; -UPDATE vtterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE wbbtterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE wblsterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE wbphenotypeterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE xbaterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE xbedterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE xbsterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE xcoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE xpoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE xsmoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE zecoterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE zfaterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; -UPDATE zfsterm t SET id = a.id FROM auditedobject a WHERE t.curie = a.old_curie AND a.tablename = 'ontologyterm'; - -INSERT INTO submittedobject (id, modentityid, dataprovider_id) SELECT id, curie, dataprovider_id FROM biologicalentity; -INSERT INTO submittedobject (id, modentityid, modinternalid, dataprovider_id) SELECT id, modentityid, modinternalid, dataprovider_id FROM reagent; +UPDATE ontologyterm SET id = nextval('ontologyterm_seq'); +ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_pkey PRIMARY KEY (id); -INSERT INTO curieobject (id) SELECT id FROM submittedobject; -INSERT INTO curieobject (id, curie) SELECT id, curie FROM ontologyterm; -INSERT INTO curieobject (id, curie) SELECT id, curie FROM informationcontententity; +UPDATE informationcontententity SET id = nextval('informationcontententity_seq'); +ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_pkey PRIMARY KEY (id); + +CREATE INDEX old_id_index ON submittedobject USING btree (old_id, tablename); +CREATE INDEX submittedobject_modentityid_index ON submittedobject USING btree (modentityid); +UPDATE affectedgenomicmodel t SET id = s.id FROM submittedobject s WHERE t.curie = s.modentityid; +UPDATE agmdiseaseannotation t SET inferredallele_id = s.id FROM submittedobject s WHERE t.inferredallele_curie = s.modentityid; +UPDATE agmdiseaseannotation t SET assertedallele_id = s.id FROM submittedobject s WHERE t.assertedallele_curie = s.modentityid; +UPDATE agmdiseaseannotation t SET inferredgene_id = s.id FROM submittedobject s WHERE t.inferredgene_curie = s.modentityid; +UPDATE agmdiseaseannotation t SET subject_id = s.id FROM submittedobject s WHERE t.subject_curie = s.modentityid; +UPDATE agmdiseaseannotation_gene t SET assertedgenes_id = s.id FROM submittedobject s WHERE t.assertedgenes_curie = s.modentityid; +UPDATE allele t SET id = s.id FROM submittedobject s WHERE t.curie = s.modentityid; +UPDATE allele_note t SET allele_id = s.id FROM submittedobject s WHERE t.allele_curie = s.modentityid; +UPDATE allele_reference t SET allele_id = s.id FROM submittedobject s WHERE t.allele_curie = s.modentityid; +UPDATE allele_reference t SET references_id = i.id FROM informationcontententity i WHERE t.references_curie = i.curie; +UPDATE alleledatabasestatusslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; +UPDATE allelediseaseannotation t SET inferredgene_id = s.id FROM submittedobject s WHERE t.inferredgene_curie = s.modentityid; +UPDATE allelediseaseannotation t SET subject_id = s.id FROM submittedobject s WHERE t.subject_curie = s.modentityid; +UPDATE allelediseaseannotation_gene t SET assertedgenes_id = s.id FROM submittedobject s WHERE t.assertedgenes_curie = s.modentityid; +UPDATE allelefullnameslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; +UPDATE allelefunctionalimpactslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; +UPDATE allelefunctionalimpactslotannotation t SET phenotypeterm_id = o.id FROM ontologyterm o WHERE t.phenotypeterm_curie = o.curie; +UPDATE allelegeneassociation t SET subject_id = s.id FROM submittedobject s WHERE t.subject_curie = s.modentityid; +UPDATE allelegeneassociation t SET object_id = s.id FROM submittedobject s WHERE t.object_curie = s.modentityid; +UPDATE allelegenomicentityassociation t SET evidencecode_id = o.id FROM ontologyterm o WHERE t.evidencecode_curie = o.curie; +UPDATE allelegermlinetransmissionstatusslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; +UPDATE alleleinheritancemodeslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; +UPDATE alleleinheritancemodeslotannotation t SET phenotypeterm_id = o.id FROM ontologyterm o WHERE t.phenotypeterm_curie = o.curie; +UPDATE allelemutationtypeslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; +UPDATE allelemutationtypeslotannotation_soterm t SET mutationtypes_id = o.id FROM ontologyterm o WHERE t.mutationtypes_curie = o.curie; +UPDATE allelenomenclatureeventslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; +UPDATE allelesecondaryidslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; +UPDATE allelesymbolslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; +UPDATE allelesynonymslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; +UPDATE anatomicalterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE apoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE atpterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE biologicalentity t SET id = s.id FROM submittedobject s WHERE t.curie = s.modentityid; +UPDATE biologicalentity t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie; +UPDATE bspoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE chebiterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE chemicalterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE clterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE cmoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE conditionrelation t SET singlereference_id = i.id FROM informationcontententity i WHERE t.singlereference_curie = i.curie; +UPDATE construct t SET id = s.id FROM submittedobject s WHERE t.id = s.old_id; +UPDATE construct_reference t SET construct_id = s.id FROM submittedobject s WHERE t.construct_id = s.old_id; +UPDATE construct_reference t SET references_id = i.id FROM informationcontententity i WHERE t.references_curie = i.curie; +UPDATE constructcomponentslotannotation t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie; +UPDATE constructfullnameslotannotation t SET singleconstruct_id = s.id FROM submittedobject s WHERE t.singleconstruct_id = s.old_id; +UPDATE constructgenomicentityassociation t SET subject_id = s.id FROM submittedobject s WHERE t.subject_id = s.old_id; +UPDATE constructgenomicentityassociation t SET object_id = s.id FROM submittedobject s WHERE t.object_curie = s.modentityid; +UPDATE constructsymbolslotannotation t SET singleconstruct_id = s.id FROM submittedobject s WHERE t.singleconstruct_id = s.old_id; +UPDATE constructsynonymslotannotation t SET singleconstruct_id = s.id FROM submittedobject s WHERE t.singleconstruct_id = s.old_id; +UPDATE daoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE diseaseannotation t SET object_id = o.id FROM ontologyterm o WHERE t.object_curie = o.curie; +UPDATE diseaseannotation_biologicalentity t SET diseasegeneticmodifiers_id = o.id FROM ontologyterm o WHERE t.diseasegeneticmodifiers_curie = o.curie; +UPDATE diseaseannotation_ecoterm t SET evidencecodes_id = s.id FROM submittedobject s WHERE t.evidencecodes_curie = s.modentityid; +UPDATE diseaseannotation_gene t SET with_id = s.id FROM submittedobject s WHERE t.with_curie = s.modentityid; +UPDATE doterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE dpoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE ecoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE emapaterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE evidenceassociation_informationcontententity t SET evidence_id = i.id FROM informationcontententity i WHERE t.evidence_curie = i.curie; +UPDATE experimentalcondition t SET conditionanatomy_id = o.id FROM ontologyterm o WHERE t.conditionanatomy_curie = o.curie; +UPDATE experimentalcondition t SET conditionchemical_id = o.id FROM ontologyterm o WHERE t.conditionchemical_curie = o.curie; +UPDATE experimentalcondition t SET conditionclass_id = o.id FROM ontologyterm o WHERE t.conditionclass_curie = o.curie; +UPDATE experimentalcondition t SET conditiongeneontology_id = o.id FROM ontologyterm o WHERE t.conditiongeneontology_curie = o.curie; +UPDATE experimentalcondition t SET conditionid_id = o.id FROM ontologyterm o WHERE t.conditionid_curie = o.curie; +UPDATE experimentalcondition t SET conditiontaxon_id = o.id FROM ontologyterm o WHERE t.conditiontaxon_curie = o.curie; +UPDATE experimentalconditionontologyterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE fbdvterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE gene t SET id = s.id FROM submittedobject s WHERE t.curie = s.modentityid; +UPDATE gene t SET genetype_id = o.id FROM ontologyterm o WHERE t.genetype_curie = o.curie; +UPDATE genediseaseannotation t SET sgdstrainbackground_id = s.id FROM submittedobject s WHERE t.sgdstrainbackground_curie = s.modentityid; +UPDATE genediseaseannotation t SET subject_id = s.id FROM submittedobject s WHERE t.subject_curie = s.modentityid; +UPDATE genefullnameslotannotation t SET singlegene_id = s.id FROM submittedobject s WHERE t.singlegene_curie = s.modentityid; +UPDATE genesecondaryidslotannotation t SET singlegene_id = s.id FROM submittedobject s WHERE t.singlegene_curie = s.modentityid; +UPDATE genesymbolslotannotation t SET singlegene_id = s.id FROM submittedobject s WHERE t.singlegene_curie = s.modentityid; +UPDATE genesynonymslotannotation t SET singlegene_id = s.id FROM submittedobject s WHERE t.singlegene_curie = s.modentityid; +UPDATE genesystematicnameslotannotation t SET singlegene_id = s.id FROM submittedobject s WHERE t.singlegene_curie = s.modentityid; +UPDATE genetogeneorthology t SET subjectgene_id = s.id FROM submittedobject s WHERE t.subjectgene_curie = s.modentityid; +UPDATE genetogeneorthology t SET objectgene_id = s.id FROM submittedobject s WHERE t.objectgene_curie = s.modentityid; +UPDATE genetogeneorthologycurated t SET evidencecode_id = o.id FROM ontologyterm o WHERE t.evidencecode_curie = o.curie; +UPDATE genetogeneorthologycurated t SET singlereference_id = i.id FROM informationcontententity i WHERE t.singlereference_curie = i.curie; +UPDATE genomicentity t SET id = s.id FROM submittedobject s WHERE t.curie = s.modentityid; +UPDATE genomicentity_crossreference t SET genomicentity_id = s.id FROM submittedobject s WHERE t.genomicentity_curie = s.modentityid; +UPDATE goterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE hpterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE materm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE miterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE mmoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE mmusdvterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE modterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE molecule t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE mpathterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE mpterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE ncbitaxonterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE note_reference t SET references_id = i.id FROM informationcontententity i WHERE t.references_curie = i.curie; +UPDATE obiterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE ontologyterm_crossreference t SET ontologyterm_id = o.id FROM ontologyterm o WHERE t.ontologyterm_curie = o.curie; +UPDATE ontologyterm_definitionurls t SET ontologyterm_id = o.id FROM ontologyterm o WHERE t.ontologyterm_curie = o.curie; +UPDATE ontologyterm_isa_ancestor_descendant t SET isadescendants_id = o.id FROM ontologyterm o WHERE t.isadescendants_curie = o.curie; +UPDATE ontologyterm_isa_ancestor_descendant t SET isaancestors_id = o.id FROM ontologyterm o WHERE t.isaancestors_curie = o.curie; +UPDATE ontologyterm_isa_parent_children t SET isachildren_id = o.id FROM ontologyterm o WHERE t.isachildren_curie = o.curie; +UPDATE ontologyterm_isa_parent_children t SET isaparents_id = o.id FROM ontologyterm o WHERE t.isaparents_curie = o.curie; +UPDATE ontologyterm_secondaryidentifiers t SET ontologyterm_id = o.id FROM ontologyterm o WHERE t.ontologyterm_curie = o.curie; +UPDATE ontologyterm_subsets t SET ontologyterm_id = o.id FROM ontologyterm o WHERE t.ontologyterm_curie = o.curie; +UPDATE ontologyterm_synonym t SET ontologyterm_id = o.id FROM ontologyterm o WHERE t.ontologyterm_curie = o.curie; +UPDATE patoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE phenotypeterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE pwterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE reagent t SET id = s.id FROM submittedobject s WHERE t.id = s.old_id; +UPDATE reagent_secondaryidentifiers t SET reagent_id = s.id FROM submittedobject s WHERE t.reagent_id = s.old_id; +UPDATE reference t SET id = i.id FROM informationcontententity i WHERE t.curie = i.curie; +UPDATE reference_crossreference t SET reference_id = i.id FROM informationcontententity i WHERE t.reference_curie = i.curie; +UPDATE roterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE rsterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE soterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE singlereferenceassociation t SET singlereference_id = i.id FROM informationcontententity i WHERE t.singlereference_curie = i.curie; +UPDATE slotannotation_informationcontententity t SET evidence_id = i.id FROM informationcontententity i WHERE t.evidence_curie = i.curie; +UPDATE species t SET id = s.id FROM submittedobject s WHERE t.id = s.old_id; +UPDATE species t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie; +UPDATE stageterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE uberonterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE variant t SET id = s.id FROM submittedobject s WHERE t.curie = s.modentityid; +UPDATE variant t SET varianttype_id = o.id FROM ontologyterm o WHERE t.varianttype_curie = o.curie; +UPDATE variant t SET sourcegeneralconsequence_id = o.id FROM ontologyterm o WHERE t.sourcegeneralconsequence_curie = o.curie; +UPDATE variant_note t SET variant_id = s.id FROM submittedobject s WHERE t.variant_curie = s.modentityid; +UPDATE vtterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE wbbtterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE wblsterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE wbphenotypeterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE xbaterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE xbedterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE xbsterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE xcoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE xpoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE xsmoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE zecoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE zfaterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; +UPDATE zfsterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; --- Update Entity Types in the auditedobject table ... this needs to be done for all "leaf" nodes of the class tree -update AuditedObject a SET auditedObjectType = 'AGMDiseaseAnnotation' from AGMDiseaseAnnotation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'APOTerm' from APOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'ATPTerm' from ATPTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'AffectedGenomicModel' from AffectedGenomicModel t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'Allele' from Allele t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'AlleleDatabaseStatusSlotAnnotation' from AlleleDatabaseStatusSlotAnnotation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'AlleleDiseaseAnnotation' from AlleleDiseaseAnnotation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'AlleleFullNameSlotAnnotation' from AlleleFullNameSlotAnnotation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'AlleleFunctionalImpactSlotAnnotation' from AlleleFunctionalImpactSlotAnnotation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'AlleleGeneAssociation' from AlleleGeneAssociation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'AlleleGermlineTransmissionStatusSlotAnnotation' from AlleleGermlineTransmissionStatusSlotAnnotation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'AlleleInheritanceModeSlotAnnotation' from AlleleInheritanceModeSlotAnnotation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'AlleleMutationTypeSlotAnnotation' from AlleleMutationTypeSlotAnnotation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'AlleleNomenclatureEventSlotAnnotation' from AlleleNomenclatureEventSlotAnnotation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'AlleleSecondaryIdSlotAnnotation' from AlleleSecondaryIdSlotAnnotation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'AlleleSymbolSlotAnnotation' from AlleleSymbolSlotAnnotation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'AlleleSynonymSlotAnnotation' from AlleleSynonymSlotAnnotation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'AllianceMember' from AllianceMember t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'BSPOTerm' from BSPOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'BulkFMSLoad' from BulkFMSLoad t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'BulkLoadFile' from BulkLoadFile t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'BulkLoadFileException' from BulkLoadFileException t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'BulkLoadFileHistory' from BulkLoadFileHistory t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'BulkLoadGroup' from BulkLoadGroup t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'BulkManualLoad' from BulkManualLoad t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'BulkURLLoad' from BulkURLLoad t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'CHEBITerm' from CHEBITerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'CLTerm' from CLTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'CMOTerm' from CMOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'ConditionRelation' from ConditionRelation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'Construct' from Construct t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'ConstructGenomicEntityAssociation' from ConstructGenomicEntityAssociation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'CrossReference' from CrossReference t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'CurationReport' from CurationReport t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'CurationReportGroup' from CurationReportGroup t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'CurationReportHistory' from CurationReportHistory t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'DAOTerm' from DAOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'DOTerm' from DOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'DPOTerm' from DPOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'DataProvider' from DataProvider t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'ECOTerm' from ECOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'EMAPATerm' from EMAPATerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'ExperimentalCondition' from ExperimentalCondition t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'FBDVTerm' from FBDVTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'GOTerm' from GOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'Gene' from Gene t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'GeneDiseaseAnnotation' from GeneDiseaseAnnotation t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'GeneToGeneOrthologyCurated' from GeneToGeneOrthologyCurated t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'GeneToGeneOrthologyGenerated' from GeneToGeneOrthologyGenerated t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'HPTerm' from HPTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'MATerm' from MATerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'MITerm' from MITerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'MMOTerm' from MMOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'MMUSDVTerm' from MMUSDVTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'MODTerm' from MODTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'MPATHTerm' from MPATHTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'MPTerm' from MPTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'Molecule' from Molecule t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'NCBITaxonTerm' from NCBITaxonTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'Note' from Note t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'OBITerm' from OBITerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'PATOTerm' from PATOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'PWTerm' from PWTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'Person' from Person t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'PersonSetting' from PersonSetting t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'ROTerm' from ROTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'RSTerm' from RSTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'Reference' from Reference t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'ResourceDescriptor' from ResourceDescriptor t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'ResourceDescriptorPage' from ResourceDescriptorPage t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'SOTerm' from SOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'Species' from Species t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'Synonym' from Synonym t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'UBERONTerm' from UBERONTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'VTTerm' from VTTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'Variant' from Variant t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'Vocabulary' from Vocabulary t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'VocabularyTerm' from VocabularyTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'VocabularyTermSet' from VocabularyTermSet t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'WBBTTerm' from WBBTTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'WBLSTerm' from WBLSTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'WBPhenotypeTerm' from WBPhenotypeTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'XBATerm' from XBATerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'XBEDTerm' from XBEDTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'XBSTerm' from XBSTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'XCOTerm' from XCOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'XPOTerm' from XPOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'XSMOTerm' from XSMOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'ZECOTerm' from ZECOTerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'ZFATerm' from ZFATerm t where a.id = t.id; -update AuditedObject a SET auditedObjectType = 'ZFSTerm' from ZFSTerm t where a.id = t.id; +-- Update Entity Types in the auditedobject table ... this needs to be done for all "leaf" nodes of the SubmittedObject class tree +UPDATE submittedobject s SET submittedobjecttype = 'AffectedGenomicModel' FROM affectedgenomicmodel t WHERE s.id = t.id; +UPDATE submittedobject s SET submittedobjecttype = 'Allele' FROM allele t WHERE s.id = t.id; +UPDATE submittedobject s SET submittedobjecttype = 'Construct' FROM construct t WHERE s.id = t.id; +UPDATE submittedobject s SET submittedobjecttype = 'Gene' FROM gene t WHERE s.id = t.id; +UPDATE submittedobject s SET submittedobjecttype = 'Variant' FROM variant t WHERE s.id = t.id; ALTER TABLE affectedgenomicmodel DROP COLUMN curie; ALTER TABLE agmdiseaseannotation DROP COLUMN inferredallele_curie; @@ -1212,14 +841,6 @@ ALTER TABLE allelesecondaryidslotannotation DROP COLUMN singleallele_curie; ALTER TABLE allelesymbolslotannotation DROP COLUMN singleallele_curie; ALTER TABLE allelesynonymslotannotation DROP COLUMN singleallele_curie; ALTER TABLE anatomicalterm DROP COLUMN curie; -ALTER TABLE association DROP COLUMN createdby_id; -ALTER TABLE association DROP COLUMN updatedby_id; -ALTER TABLE association DROP COLUMN datecreated; -ALTER TABLE association DROP COLUMN dateupdated; -ALTER TABLE association DROP COLUMN dbdatecreated; -ALTER TABLE association DROP COLUMN dbdateupdated; -ALTER TABLE association DROP COLUMN internal; -ALTER TABLE association DROP COLUMN obsolete; ALTER TABLE apoterm DROP COLUMN curie; ALTER TABLE atpterm DROP COLUMN curie; ALTER TABLE biologicalentity DROP COLUMN curie; @@ -1233,80 +854,16 @@ ALTER TABLE biologicalentity DROP COLUMN dbdatecreated; ALTER TABLE biologicalentity DROP COLUMN dbdateupdated; ALTER TABLE biologicalentity DROP COLUMN internal; ALTER TABLE biologicalentity DROP COLUMN obsolete; -ALTER TABLE bulkload DROP COLUMN createdby_id; -ALTER TABLE bulkload DROP COLUMN updatedby_id; -ALTER TABLE bulkload DROP COLUMN datecreated; -ALTER TABLE bulkload DROP COLUMN dateupdated; -ALTER TABLE bulkload DROP COLUMN dbdatecreated; -ALTER TABLE bulkload DROP COLUMN dbdateupdated; -ALTER TABLE bulkload DROP COLUMN internal; -ALTER TABLE bulkload DROP COLUMN obsolete; -ALTER TABLE bulkloadfile DROP COLUMN createdby_id; -ALTER TABLE bulkloadfile DROP COLUMN updatedby_id; -ALTER TABLE bulkloadfile DROP COLUMN datecreated; -ALTER TABLE bulkloadfile DROP COLUMN dateupdated; -ALTER TABLE bulkloadfile DROP COLUMN dbdatecreated; -ALTER TABLE bulkloadfile DROP COLUMN dbdateupdated; -ALTER TABLE bulkloadfile DROP COLUMN internal; -ALTER TABLE bulkloadfile DROP COLUMN obsolete; -ALTER TABLE bulkloadfileexception DROP COLUMN createdby_id; -ALTER TABLE bulkloadfileexception DROP COLUMN updatedby_id; -ALTER TABLE bulkloadfileexception DROP COLUMN datecreated; -ALTER TABLE bulkloadfileexception DROP COLUMN dateupdated; -ALTER TABLE bulkloadfileexception DROP COLUMN dbdatecreated; -ALTER TABLE bulkloadfileexception DROP COLUMN dbdateupdated; -ALTER TABLE bulkloadfileexception DROP COLUMN internal; -ALTER TABLE bulkloadfileexception DROP COLUMN obsolete; -ALTER TABLE bulkloadfilehistory DROP COLUMN createdby_id; -ALTER TABLE bulkloadfilehistory DROP COLUMN updatedby_id; -ALTER TABLE bulkloadfilehistory DROP COLUMN datecreated; -ALTER TABLE bulkloadfilehistory DROP COLUMN dateupdated; -ALTER TABLE bulkloadfilehistory DROP COLUMN dbdatecreated; -ALTER TABLE bulkloadfilehistory DROP COLUMN dbdateupdated; -ALTER TABLE bulkloadfilehistory DROP COLUMN internal; -ALTER TABLE bulkloadfilehistory DROP COLUMN obsolete; -ALTER TABLE bulkloadgroup DROP COLUMN createdby_id; -ALTER TABLE bulkloadgroup DROP COLUMN updatedby_id; -ALTER TABLE bulkloadgroup DROP COLUMN datecreated; -ALTER TABLE bulkloadgroup DROP COLUMN dateupdated; -ALTER TABLE bulkloadgroup DROP COLUMN dbdatecreated; -ALTER TABLE bulkloadgroup DROP COLUMN dbdateupdated; -ALTER TABLE bulkloadgroup DROP COLUMN internal; -ALTER TABLE bulkloadgroup DROP COLUMN obsolete; ALTER TABLE bspoterm DROP COLUMN curie; ALTER TABLE chebiterm DROP COLUMN curie; ALTER TABLE chemicalterm DROP COLUMN curie; ALTER TABLE clterm DROP COLUMN curie; ALTER TABLE cmoterm DROP COLUMN curie; ALTER TABLE conditionrelation DROP COLUMN singlereference_curie; -ALTER TABLE conditionrelation DROP COLUMN createdby_id; -ALTER TABLE conditionrelation DROP COLUMN updatedby_id; -ALTER TABLE conditionrelation DROP COLUMN datecreated; -ALTER TABLE conditionrelation DROP COLUMN dateupdated; -ALTER TABLE conditionrelation DROP COLUMN dbdatecreated; -ALTER TABLE conditionrelation DROP COLUMN dbdateupdated; -ALTER TABLE conditionrelation DROP COLUMN internal; -ALTER TABLE conditionrelation DROP COLUMN obsolete; ALTER TABLE construct_reference DROP COLUMN references_curie; ALTER TABLE constructcomponentslotannotation DROP COLUMN taxon_curie; ALTER TABLE constructgenomicentityassociation DROP COLUMN object_curie; -ALTER TABLE crossreference DROP COLUMN createdby_id; -ALTER TABLE crossreference DROP COLUMN updatedby_id; -ALTER TABLE crossreference DROP COLUMN datecreated; -ALTER TABLE crossreference DROP COLUMN dateupdated; -ALTER TABLE crossreference DROP COLUMN dbdatecreated; -ALTER TABLE crossreference DROP COLUMN dbdateupdated; -ALTER TABLE crossreference DROP COLUMN internal; -ALTER TABLE crossreference DROP COLUMN obsolete; ALTER TABLE daoterm DROP COLUMN curie; -ALTER TABLE dataprovider DROP COLUMN createdby_id; -ALTER TABLE dataprovider DROP COLUMN updatedby_id; -ALTER TABLE dataprovider DROP COLUMN datecreated; -ALTER TABLE dataprovider DROP COLUMN dateupdated; -ALTER TABLE dataprovider DROP COLUMN dbdatecreated; -ALTER TABLE dataprovider DROP COLUMN dbdateupdated; -ALTER TABLE dataprovider DROP COLUMN internal; -ALTER TABLE dataprovider DROP COLUMN obsolete; ALTER TABLE diseaseannotation DROP COLUMN object_curie; ALTER TABLE diseaseannotation_biologicalentity DROP COLUMN diseasegeneticmodifiers_curie; ALTER TABLE diseaseannotation_ecoterm DROP COLUMN evidencecodes_curie; @@ -1322,14 +879,6 @@ ALTER TABLE experimentalcondition DROP COLUMN conditionclass_curie; ALTER TABLE experimentalcondition DROP COLUMN conditiongeneontology_curie; ALTER TABLE experimentalcondition DROP COLUMN conditionid_curie; ALTER TABLE experimentalcondition DROP COLUMN conditiontaxon_curie; -ALTER TABLE experimentalcondition DROP COLUMN createdby_id; -ALTER TABLE experimentalcondition DROP COLUMN updatedby_id; -ALTER TABLE experimentalcondition DROP COLUMN datecreated; -ALTER TABLE experimentalcondition DROP COLUMN dateupdated; -ALTER TABLE experimentalcondition DROP COLUMN dbdatecreated; -ALTER TABLE experimentalcondition DROP COLUMN dbdateupdated; -ALTER TABLE experimentalcondition DROP COLUMN internal; -ALTER TABLE experimentalcondition DROP COLUMN obsolete; ALTER TABLE experimentalconditionontologyterm DROP COLUMN curie; ALTER TABLE fbdvterm DROP COLUMN curie; ALTER TABLE gene DROP COLUMN curie; @@ -1347,25 +896,8 @@ ALTER TABLE genetogeneorthologycurated DROP COLUMN singlereference_curie; ALTER TABLE genetogeneorthologycurated DROP COLUMN evidencecode_curie; ALTER TABLE genomicentity DROP COLUMN curie; ALTER TABLE genomicentity_crossreference DROP COLUMN genomicentity_curie; -ALTER TABLE genetogeneorthology DROP COLUMN createdby_id; -ALTER TABLE genetogeneorthology DROP COLUMN updatedby_id; -ALTER TABLE genetogeneorthology DROP COLUMN datecreated; -ALTER TABLE genetogeneorthology DROP COLUMN dateupdated; -ALTER TABLE genetogeneorthology DROP COLUMN dbdatecreated; -ALTER TABLE genetogeneorthology DROP COLUMN dbdateupdated; -ALTER TABLE genetogeneorthology DROP COLUMN internal; -ALTER TABLE genetogeneorthology DROP COLUMN obsolete; ALTER TABLE goterm DROP COLUMN curie; ALTER TABLE hpterm DROP COLUMN curie; -ALTER TABLE informationcontententity DROP COLUMN curie; -ALTER TABLE informationcontententity DROP COLUMN createdby_id; -ALTER TABLE informationcontententity DROP COLUMN updatedby_id; -ALTER TABLE informationcontententity DROP COLUMN datecreated; -ALTER TABLE informationcontententity DROP COLUMN dateupdated; -ALTER TABLE informationcontententity DROP COLUMN dbdatecreated; -ALTER TABLE informationcontententity DROP COLUMN dbdateupdated; -ALTER TABLE informationcontententity DROP COLUMN internal; -ALTER TABLE informationcontententity DROP COLUMN obsolete; ALTER TABLE materm DROP COLUMN curie; ALTER TABLE miterm DROP COLUMN curie; ALTER TABLE mmoterm DROP COLUMN curie; @@ -1375,25 +907,8 @@ ALTER TABLE molecule DROP COLUMN curie; ALTER TABLE mpathterm DROP COLUMN curie; ALTER TABLE mpterm DROP COLUMN curie; ALTER TABLE ncbitaxonterm DROP COLUMN curie; -ALTER TABLE note DROP COLUMN createdby_id; -ALTER TABLE note DROP COLUMN updatedby_id; -ALTER TABLE note DROP COLUMN datecreated; -ALTER TABLE note DROP COLUMN dateupdated; -ALTER TABLE note DROP COLUMN dbdatecreated; -ALTER TABLE note DROP COLUMN dbdateupdated; -ALTER TABLE note DROP COLUMN internal; -ALTER TABLE note DROP COLUMN obsolete; ALTER TABLE note_reference DROP COLUMN references_curie; ALTER TABLE obiterm DROP COLUMN curie; -ALTER TABLE ontologyterm DROP COLUMN curie; -ALTER TABLE ontologyterm DROP COLUMN createdby_id; -ALTER TABLE ontologyterm DROP COLUMN updatedby_id; -ALTER TABLE ontologyterm DROP COLUMN datecreated; -ALTER TABLE ontologyterm DROP COLUMN dateupdated; -ALTER TABLE ontologyterm DROP COLUMN dbdatecreated; -ALTER TABLE ontologyterm DROP COLUMN dbdateupdated; -ALTER TABLE ontologyterm DROP COLUMN internal; -ALTER TABLE ontologyterm DROP COLUMN obsolete; ALTER TABLE ontologyterm_crossreference DROP COLUMN ontologyterm_curie; ALTER TABLE ontologyterm_definitionurls DROP COLUMN ontologyterm_curie; ALTER TABLE ontologyterm_isa_ancestor_descendant DROP COLUMN isadescendants_curie; @@ -1403,33 +918,10 @@ ALTER TABLE ontologyterm_isa_parent_children DROP COLUMN isaparents_curie; ALTER TABLE ontologyterm_secondaryidentifiers DROP COLUMN ontologyterm_curie; ALTER TABLE ontologyterm_subsets DROP COLUMN ontologyterm_curie; ALTER TABLE ontologyterm_synonym DROP COLUMN ontologyterm_curie; -ALTER TABLE organization DROP COLUMN createdby_id; -ALTER TABLE organization DROP COLUMN updatedby_id; -ALTER TABLE organization DROP COLUMN datecreated; -ALTER TABLE organization DROP COLUMN dateupdated; -ALTER TABLE organization DROP COLUMN dbdatecreated; -ALTER TABLE organization DROP COLUMN dbdateupdated; -ALTER TABLE organization DROP COLUMN internal; -ALTER TABLE organization DROP COLUMN obsolete; ALTER TABLE patoterm DROP COLUMN curie; ALTER TABLE phenotypeterm DROP COLUMN curie; -ALTER TABLE person DROP COLUMN createdby_id; -ALTER TABLE person DROP COLUMN updatedby_id; -ALTER TABLE person DROP COLUMN datecreated; -ALTER TABLE person DROP COLUMN dateupdated; -ALTER TABLE person DROP COLUMN dbdatecreated; -ALTER TABLE person DROP COLUMN dbdateupdated; -ALTER TABLE person DROP COLUMN internal; -ALTER TABLE person DROP COLUMN obsolete; -ALTER TABLE personsetting DROP COLUMN createdby_id; -ALTER TABLE personsetting DROP COLUMN updatedby_id; -ALTER TABLE personsetting DROP COLUMN datecreated; -ALTER TABLE personsetting DROP COLUMN dateupdated; -ALTER TABLE personsetting DROP COLUMN dbdatecreated; -ALTER TABLE personsetting DROP COLUMN dbdateupdated; -ALTER TABLE personsetting DROP COLUMN internal; -ALTER TABLE personsetting DROP COLUMN obsolete; ALTER TABLE pwterm DROP COLUMN curie; +ALTER TABLE reference DROP COLUMN curie; ALTER TABLE reagent DROP COLUMN curie; ALTER TABLE reagent DROP COLUMN modentityid; ALTER TABLE reagent DROP COLUMN modinternalid; @@ -1442,84 +934,19 @@ ALTER TABLE reagent DROP COLUMN dbdatecreated; ALTER TABLE reagent DROP COLUMN dbdateupdated; ALTER TABLE reagent DROP COLUMN internal; ALTER TABLE reagent DROP COLUMN obsolete; -ALTER TABLE reference DROP COLUMN curie; ALTER TABLE reference_crossreference DROP COLUMN reference_curie; -ALTER TABLE resourcedescriptor DROP COLUMN createdby_id; -ALTER TABLE resourcedescriptor DROP COLUMN updatedby_id; -ALTER TABLE resourcedescriptor DROP COLUMN datecreated; -ALTER TABLE resourcedescriptor DROP COLUMN dateupdated; -ALTER TABLE resourcedescriptor DROP COLUMN dbdatecreated; -ALTER TABLE resourcedescriptor DROP COLUMN dbdateupdated; -ALTER TABLE resourcedescriptor DROP COLUMN internal; -ALTER TABLE resourcedescriptor DROP COLUMN obsolete; -ALTER TABLE resourcedescriptorpage DROP COLUMN createdby_id; -ALTER TABLE resourcedescriptorpage DROP COLUMN updatedby_id; -ALTER TABLE resourcedescriptorpage DROP COLUMN datecreated; -ALTER TABLE resourcedescriptorpage DROP COLUMN dateupdated; -ALTER TABLE resourcedescriptorpage DROP COLUMN dbdatecreated; -ALTER TABLE resourcedescriptorpage DROP COLUMN dbdateupdated; -ALTER TABLE resourcedescriptorpage DROP COLUMN internal; -ALTER TABLE resourcedescriptorpage DROP COLUMN obsolete; ALTER TABLE roterm DROP COLUMN curie; ALTER TABLE rsterm DROP COLUMN curie; ALTER TABLE singlereferenceassociation DROP COLUMN singlereference_curie; -ALTER TABLE slotannotation DROP COLUMN createdby_id; -ALTER TABLE slotannotation DROP COLUMN updatedby_id; -ALTER TABLE slotannotation DROP COLUMN datecreated; -ALTER TABLE slotannotation DROP COLUMN dateupdated; -ALTER TABLE slotannotation DROP COLUMN dbdatecreated; -ALTER TABLE slotannotation DROP COLUMN dbdateupdated; -ALTER TABLE slotannotation DROP COLUMN internal; -ALTER TABLE slotannotation DROP COLUMN obsolete; ALTER TABLE slotannotation_informationcontententity DROP COLUMN evidence_curie; ALTER TABLE soterm DROP COLUMN curie; ALTER TABLE species DROP COLUMN taxon_curie; -ALTER TABLE species DROP COLUMN createdby_id; -ALTER TABLE species DROP COLUMN updatedby_id; -ALTER TABLE species DROP COLUMN datecreated; -ALTER TABLE species DROP COLUMN dateupdated; -ALTER TABLE species DROP COLUMN dbdatecreated; -ALTER TABLE species DROP COLUMN dbdateupdated; -ALTER TABLE species DROP COLUMN internal; -ALTER TABLE species DROP COLUMN obsolete; ALTER TABLE stageterm DROP COLUMN curie; -ALTER TABLE synonym DROP COLUMN createdby_id; -ALTER TABLE synonym DROP COLUMN updatedby_id; -ALTER TABLE synonym DROP COLUMN datecreated; -ALTER TABLE synonym DROP COLUMN dateupdated; -ALTER TABLE synonym DROP COLUMN dbdatecreated; -ALTER TABLE synonym DROP COLUMN dbdateupdated; -ALTER TABLE synonym DROP COLUMN internal; -ALTER TABLE synonym DROP COLUMN obsolete; ALTER TABLE uberonterm DROP COLUMN curie; ALTER TABLE variant DROP COLUMN curie; ALTER TABLE variant DROP COLUMN varianttype_curie; ALTER TABLE variant DROP COLUMN sourcegeneralconsequence_curie; ALTER TABLE variant_note DROP COLUMN variant_curie; -ALTER TABLE vocabulary DROP COLUMN createdby_id; -ALTER TABLE vocabulary DROP COLUMN updatedby_id; -ALTER TABLE vocabulary DROP COLUMN datecreated; -ALTER TABLE vocabulary DROP COLUMN dateupdated; -ALTER TABLE vocabulary DROP COLUMN dbdatecreated; -ALTER TABLE vocabulary DROP COLUMN dbdateupdated; -ALTER TABLE vocabulary DROP COLUMN internal; -ALTER TABLE vocabulary DROP COLUMN obsolete; -ALTER TABLE vocabularyterm DROP COLUMN createdby_id; -ALTER TABLE vocabularyterm DROP COLUMN updatedby_id; -ALTER TABLE vocabularyterm DROP COLUMN datecreated; -ALTER TABLE vocabularyterm DROP COLUMN dateupdated; -ALTER TABLE vocabularyterm DROP COLUMN dbdatecreated; -ALTER TABLE vocabularyterm DROP COLUMN dbdateupdated; -ALTER TABLE vocabularyterm DROP COLUMN internal; -ALTER TABLE vocabularyterm DROP COLUMN obsolete; -ALTER TABLE vocabularytermset DROP COLUMN createdby_id; -ALTER TABLE vocabularytermset DROP COLUMN updatedby_id; -ALTER TABLE vocabularytermset DROP COLUMN datecreated; -ALTER TABLE vocabularytermset DROP COLUMN dateupdated; -ALTER TABLE vocabularytermset DROP COLUMN dbdatecreated; -ALTER TABLE vocabularytermset DROP COLUMN dbdateupdated; -ALTER TABLE vocabularytermset DROP COLUMN internal; -ALTER TABLE vocabularytermset DROP COLUMN obsolete; ALTER TABLE vtterm DROP COLUMN curie; ALTER TABLE wbbtterm DROP COLUMN curie; ALTER TABLE wblsterm DROP COLUMN curie; @@ -1534,29 +961,29 @@ ALTER TABLE zecoterm DROP COLUMN curie; ALTER TABLE zfaterm DROP COLUMN curie; ALTER TABLE zfsterm DROP COLUMN curie; -ALTER TABLE auditedobject DROP COLUMN old_id; -ALTER TABLE auditedobject DROP COLUMN old_curie; -ALTER TABLE auditedobject DROP COLUMN tablename; +ALTER TABLE submittedobject DROP COLUMN old_id; SET session_replication_role = 'origin'; -- Add constraints and indexes -ALTER TABLE auditedobject ADD CONSTRAINT auditedobject_createdby_id_fk FOREIGN KEY (createdby_id) REFERENCES person (id); -ALTER TABLE auditedobject ADD CONSTRAINT auditedobject_updatedby_id_fk FOREIGN KEY (updatedby_id) REFERENCES person (id); -CREATE INDEX auditedobject_createdby_index ON auditedobject USING btree (createdby_id); -CREATE INDEX auditedobject_updatedby_index ON auditedobject USING btree (updatedby_id); -ALTER TABLE curieobject ADD CONSTRAINT curieobject_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -CREATE INDEX curieobject_curie_index ON curieobject USING btree (curie); -ALTER TABLE curieobject ADD CONSTRAINT curieobject_curie_uk UNIQUE (curie); - -ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); +ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_createdby_id_fk FOREIGN KEY (createdby_id) REFERENCES person (id); +ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_updatedby_id_fk FOREIGN KEY (updatedby_id) REFERENCES person (id); +CREATE INDEX submittedobject_createdby_index ON submittedobject USING btree (createdby_id); +CREATE INDEX submittedobject_updatedby_index ON submittedobject USING btree (updatedby_id); ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_dataprovider_id_fk FOREIGN KEY (dataprovider_id) REFERENCES dataprovider (id); -CREATE INDEX submittedobject_modentityid_index ON submittedobject USING btree (modentityid); +CREATE INDEX submittedobject_curie_index ON submittedobject USING btree (curie); CREATE INDEX submittedobject_modinternalid_index ON submittedobject USING btree (modinternalid); CREATE INDEX submittedobject_dataprovider_index ON submittedobject USING btree (dataprovider_id); ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_modentityid_uk UNIQUE (modentityid); ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_modinternalid_uk UNIQUE (modinternalid); +ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_curie_uk UNIQUE (curie); + +CREATE INDEX experimentalcondition_createdby_index ON experimentalcondition USING btree (createdby_id); +CREATE INDEX experimentalcondition_updatedby_index ON experimentalcondition USING btree (updatedby_id); + +CREATE INDEX conditionrelation_createdby_index ON conditionrelation USING btree (createdby_id); +CREATE INDEX conditionrelation_updatedby_index ON conditionrelation USING btree (updatedby_id); ALTER TABLE affectedgenomicmodel ADD CONSTRAINT affectedgenomicmodel_pkey PRIMARY KEY (id); ALTER TABLE allele ADD CONSTRAINT allele_pkey PRIMARY KEY (id); @@ -1580,7 +1007,6 @@ ALTER TABLE gene ADD CONSTRAINT gene_pkey PRIMARY KEY (id); ALTER TABLE genomicentity ADD CONSTRAINT genomicentity_pkey PRIMARY KEY (id); ALTER TABLE goterm ADD CONSTRAINT goterm_pkey PRIMARY KEY (id); ALTER TABLE hpterm ADD CONSTRAINT hpterm_pkey PRIMARY KEY (id); -ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_pkey PRIMARY KEY (id); ALTER TABLE materm ADD CONSTRAINT materm_pkey PRIMARY KEY (id); ALTER TABLE miterm ADD CONSTRAINT miterm_pkey PRIMARY KEY (id); ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_pkey PRIMARY KEY (id); @@ -1591,7 +1017,6 @@ ALTER TABLE mpathterm ADD CONSTRAINT mpathterm_pkey PRIMARY KEY (id); ALTER TABLE mpterm ADD CONSTRAINT mpterm_pkey PRIMARY KEY (id); ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_pkey PRIMARY KEY (id); ALTER TABLE obiterm ADD CONSTRAINT obiterm_pkey PRIMARY KEY (id); -ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_pkey PRIMARY KEY (id); ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_pkey PRIMARY KEY (isachildren_id, isaparents_id); ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_pkey PRIMARY KEY (isadescendants_id, isaancestors_id); ALTER TABLE patoterm ADD CONSTRAINT patoterm_pkey PRIMARY KEY (id); @@ -1675,16 +1100,10 @@ ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_id_fk FOREIGN KEY ( ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); CREATE INDEX biologicalentity_taxon_index ON biologicalentity USING btree (taxon_id); ALTER TABLE bspoterm ADD CONSTRAINT bspoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE bulkload ADD CONSTRAINT bulkload_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE bulkloadfile ADD CONSTRAINT bulkloadfile_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE bulkloadfileexception ADD CONSTRAINT bulkloadfileexception_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE bulkloadfilehistory ADD CONSTRAINT bulkloadfilehistory_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE bulkloadgroup ADD CONSTRAINT bulkloadgroup_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); ALTER TABLE chebiterm ADD CONSTRAINT chebiterm_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id); ALTER TABLE chemicalterm ADD CONSTRAINT chemicalterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE clterm ADD CONSTRAINT clterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); ALTER TABLE cmoterm ADD CONSTRAINT cmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE conditionrelation ADD CONSTRAINT conditionrelation_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); ALTER TABLE conditionrelation ADD CONSTRAINT conditionrelation_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); ALTER TABLE construct_reference ADD CONSTRAINT construct_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); CREATE INDEX construct_reference_references_index ON construct_reference USING btree (references_id); @@ -1692,12 +1111,7 @@ ALTER TABLE constructcomponentslotannotation ADD CONSTRAINT constructcomponentsl CREATE INDEX constructcomponentslotannotation_taxon_index ON constructcomponentslotannotation USING btree (taxon_id); ALTER TABLE constructgenomicentityassociation ADD CONSTRAINT constructgenomicentityassociation_object_id_fk FOREIGN KEY (object_id) REFERENCES genomicentity (id); CREATE INDEX constructgenomicentityassociation_object_index ON constructgenomicentityassociation USING btree (object_id); -ALTER TABLE crossreference ADD CONSTRAINT crossreference_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE curationreport ADD CONSTRAINT curationreport_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE curationreportgroup ADD CONSTRAINT curationreportgroup_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE curationreporthistory ADD CONSTRAINT curationreporthistory_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); ALTER TABLE daoterm ADD CONSTRAINT daoterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE dataprovider ADD CONSTRAINT dataprovider_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); ALTER TABLE diseaseannotation ADD CONSTRAINT diseaseannotation_object_id_fk FOREIGN KEY (object_id) REFERENCES doterm (id); CREATE INDEX diseaseannotation_object_index ON diseaseannotation USING btree (object_id); ALTER TABLE diseaseannotation_biologicalentity ADD CONSTRAINT diseaseannotation_biologicalentity_dgm_id_fk FOREIGN KEY (diseasegeneticmodifiers_id) REFERENCES biologicalentity (id); @@ -1735,7 +1149,6 @@ ALTER TABLE genesynonymslotannotation ADD CONSTRAINT genesynonymslotannotation_s CREATE INDEX genesynonym_singlegene_index ON genesynonymslotannotation USING btree (singlegene_id); ALTER TABLE genesystematicnameslotannotation ADD CONSTRAINT genesystematicnameslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); CREATE INDEX genesystematicname_singlegene_index ON genesystematicnameslotannotation USING btree (singlegene_id); -ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_objectgene_id_fk FOREIGN KEY (objectgene_id) REFERENCES gene (id); ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_subjectgene_id_fk FOREIGN KEY (subjectgene_id) REFERENCES gene (id); CREATE INDEX genetogeneorthology_object_index ON genetogeneorthology USING btree (objectgene_id); @@ -1750,7 +1163,6 @@ CREATE INDEX genomicentity_crossreference_ge_xref_index ON genomicentity_crossre CREATE INDEX genomicentity_crossreference_genomicentity_index ON genomicentity_crossreference USING btree (genomicentity_id); ALTER TABLE goterm ADD CONSTRAINT goterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE hpterm ADD CONSTRAINT hpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); -ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); ALTER TABLE materm ADD CONSTRAINT materm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); ALTER TABLE miterm ADD CONSTRAINT miterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); @@ -1760,11 +1172,9 @@ ALTER TABLE molecule ADD CONSTRAINT molecule_id_fk FOREIGN KEY (id) REFERENCES c ALTER TABLE mpathterm ADD CONSTRAINT mpathterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE mpterm ADD CONSTRAINT mpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE note ADD CONSTRAINT note_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); ALTER TABLE note_reference ADD CONSTRAINT note_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); CREATE INDEX note_reference_references_index ON note_reference USING btree (references_id); ALTER TABLE obiterm ADD CONSTRAINT obiterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); ALTER TABLE ontologyterm_crossreference ADD CONSTRAINT ontologyterm_crossreference_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); CREATE INDEX ontologyterm_crossreference_ontologyterm_index ON ontologyterm_crossreference USING btree (ontologyterm_id); ALTER TABLE ontologyterm_definitionurls ADD CONSTRAINT ontologyterm_definitionurls_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); @@ -1783,26 +1193,20 @@ ALTER TABLE ontologyterm_subsets ADD CONSTRAINT ontologyterm_subsets_ontologyter CREATE INDEX ontologyterm_subsets_ontologyterm_index ON ontologyterm_subsets USING btree (ontologyterm_id); ALTER TABLE ontologyterm_synonym ADD CONSTRAINT ontologyterm_synonym_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); CREATE INDEX ontologyterm_synonym_ontologyterm_index ON ontologyterm_synonym USING btree (ontologyterm_id); -ALTER TABLE organization ADD CONSTRAINT organization_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); ALTER TABLE patoterm ADD CONSTRAINT patoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE person ADD CONSTRAINT person_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); ALTER TABLE phenotypeterm ADD CONSTRAINT phenotypeterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE pwterm ADD CONSTRAINT pwterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE reagent ADD CONSTRAINT reagent_id_fk FOREIGN KEY (id) REFERENCES submittedobject (id); ALTER TABLE reference ADD CONSTRAINT reference_id_fk FOREIGN KEY (id) REFERENCES informationcontententity (id); ALTER TABLE reference_crossreference ADD CONSTRAINT reference_crossreference_reference_id_fk FOREIGN KEY (reference_id) REFERENCES reference (id); CREATE INDEX reference_crossreference_reference_index ON reference_crossreference USING btree (reference_id); -ALTER TABLE resourcedescriptor ADD CONSTRAINT resourcedescriptor_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE resourcedescriptorpage ADD CONSTRAINT resourcedescriptorpage_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); ALTER TABLE roterm ADD CONSTRAINT roterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE rsterm ADD CONSTRAINT rsterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE singlereferenceassociation ADD CONSTRAINT singlereferenceassociation_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); CREATE INDEX singlereferenceassociation_singlereference_index ON singlereferenceassociation USING btree (singlereference_id); -ALTER TABLE slotannotation ADD CONSTRAINT slotannotation_id_fk FOREIGN KEY (id) REFERENCES auditedobject(id); ALTER TABLE slotannotation_informationcontententity ADD CONSTRAINT slotannotation_informationcontententity_evidence_id_fk FOREIGN KEY (evidence_id) REFERENCES informationcontententity (id); CREATE INDEX slotannotation_informationcontententity_evidence_index ON slotannotation_informationcontententity USING btree (evidence_id); ALTER TABLE soterm ADD CONSTRAINT soterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE species ADD CONSTRAINT species_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); ALTER TABLE species ADD CONSTRAINT species_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); ALTER TABLE stageterm ADD CONSTRAINT stageterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE uberonterm ADD CONSTRAINT uberonterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); @@ -1813,9 +1217,6 @@ CREATE INDEX variant_sourcegeneralconsequence_index ON variant USING btree (sour CREATE INDEX variant_varianttype_index ON variant USING btree (varianttype_id); ALTER TABLE variant_note ADD CONSTRAINT variant_note_variant_id_fk FOREIGN KEY (variant_id) REFERENCES variant (id); CREATE INDEX variant_note_variant_index ON variant_note USING btree (variant_id); -ALTER TABLE vocabulary ADD CONSTRAINT vocabulary_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE vocabularyterm ADD CONSTRAINT vocabularyterm_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); -ALTER TABLE vocabularytermset ADD CONSTRAINT vocabularytermset_id_fk FOREIGN KEY (id) REFERENCES auditedobject (id); ALTER TABLE vtterm ADD CONSTRAINT vtterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE wbbtterm ADD CONSTRAINT wbbtterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); ALTER TABLE wblsterm ADD CONSTRAINT wblsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); From 1f72d09011699375ec6f7ae633c49c50d55ce9cd Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Sat, 27 Jan 2024 11:39:16 +0000 Subject: [PATCH 045/159] Fix missed merge conflict --- .../model/entities/InformationContentEntity.java | 2 -- .../services/AlleleDiseaseAnnotationService.java | 5 ----- .../services/validation/dto/ConstructDTOValidator.java | 4 ++++ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java index f0ade6be3..47336c415 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java @@ -12,7 +12,6 @@ import jakarta.persistence.Index; import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; -import jakarta.persistence.SequenceGenerator; import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; @@ -24,7 +23,6 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @JsonIgnoreProperties(ignoreUnknown = true) @ToString(callSuper = true) -@JsonIgnoreProperties(ignoreUnknown = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Reference.class, name = "Reference") }) @Table(indexes = { @Index(name = "informationcontent_createdby_index", columnList = "createdBy_id"), diff --git a/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java index c9a26e241..b0ce0b2b2 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/AlleleDiseaseAnnotationService.java @@ -1,11 +1,6 @@ package org.alliancegenome.curation_api.services; import java.util.List; -<<<<<<< HEAD -import java.util.Map; -import java.util.Objects; -======= ->>>>>>> alpha import org.alliancegenome.curation_api.dao.AlleleDiseaseAnnotationDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConstructDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConstructDTOValidator.java index b7a99a6c4..00da4b08f 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConstructDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConstructDTOValidator.java @@ -79,6 +79,10 @@ public Construct validateConstructDTO(ConstructDTO dto, BackendBulkDataProvider construct = constructList.getResults().get(0); } construct.setUniqueId(uniqueId); + + ObjectResponse reagentResponse = validateReagentDTO(construct, dto); + constructResponse.addErrorMessages(reagentResponse.getErrorMessages()); + construct = reagentResponse.getEntity(); if (CollectionUtils.isNotEmpty(dto.getReferenceCuries())) { List references = new ArrayList<>(); From d2ec1f9f6ec0117603f00cbe6ebc31f9f6582c27 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 1 Feb 2024 17:15:40 +0000 Subject: [PATCH 046/159] Make CurieObject base table, UI and indexing fixes --- .../Autocomplete/AutocompleteEditor.js | 3 +- .../Autocomplete/AutocompleteFormEditor.js | 3 +- .../AutocompleteFormMultiEditor.js | 3 +- .../Autocomplete/AutocompleteMultiEditor.js | 3 +- .../SubjectAutocompleteTemplate.js | 1 - .../src/components/Editors/GeneEditor.js | 5 +- .../AlleleGeneAssociationsFormTable.js | 4 +- .../DiseaseAnnotationsTable.js | 14 +- .../NewAnnotationForm.js | 6 + .../useNewAnnotationReducer.js | 2 +- .../ontologies/GeneralOntologyComponent.js | 8 + .../containers/variantsPage/VariantsTable.js | 24 +- src/main/cliapp/src/routes.js | 2 +- src/main/cliapp/src/service/AlleleService.js | 6 +- src/main/cliapp/src/utils/utils.js | 8 +- .../model/entities/AGMDiseaseAnnotation.java | 2 +- .../entities/AlleleDiseaseAnnotation.java | 2 +- .../model/entities/Annotation.java | 4 +- .../model/entities/DiseaseAnnotation.java | 13 +- .../model/entities/GeneDiseaseAnnotation.java | 2 +- .../entities/InformationContentEntity.java | 9 - .../entities/SingleReferenceAssociation.java | 4 +- .../model/entities/base/CurieObject.java | 20 +- .../model/entities/base/SubmittedObject.java | 14 +- .../model/entities/ontology/OntologyTerm.java | 8 - .../v0.30.0.1__linkml_v2.0.0_update.sql | 246 ++++++++++++------ 26 files changed, 271 insertions(+), 145 deletions(-) diff --git a/src/main/cliapp/src/components/Autocomplete/AutocompleteEditor.js b/src/main/cliapp/src/components/Autocomplete/AutocompleteEditor.js index 5ba0a1917..be0ea5073 100644 --- a/src/main/cliapp/src/components/Autocomplete/AutocompleteEditor.js +++ b/src/main/cliapp/src/components/Autocomplete/AutocompleteEditor.js @@ -2,6 +2,7 @@ import React, { useRef, useState } from 'react'; import { AutoComplete } from "primereact/autocomplete"; import { onSelectionOver } from '../../utils/utils'; import { EditorTooltip } from "./EditorTooltip"; +import { getIdentifier } from '../../utils/utils'; export const AutocompleteEditor = ( { @@ -29,7 +30,7 @@ export const AutocompleteEditor = ( return (
onSelectionOver(event, item, query, op, setAutocompleteHoverItem)} - dangerouslySetInnerHTML={{ __html: item.name + ' (' + item.curie + ') ' }} /> + dangerouslySetInnerHTML={{ __html: item.name + ' (' + getIdentifier(item) + ') ' }} />
); }; diff --git a/src/main/cliapp/src/components/Autocomplete/AutocompleteFormEditor.js b/src/main/cliapp/src/components/Autocomplete/AutocompleteFormEditor.js index 855f35e5d..6ccb791de 100644 --- a/src/main/cliapp/src/components/Autocomplete/AutocompleteFormEditor.js +++ b/src/main/cliapp/src/components/Autocomplete/AutocompleteFormEditor.js @@ -2,6 +2,7 @@ import React, { useRef, useState } from 'react'; import { AutoComplete } from "primereact/autocomplete"; import { onSelectionOver } from '../../utils/utils'; import { EditorTooltip } from "./EditorTooltip"; +import { getIdentifier } from '../../utils/utils'; export const AutocompleteFormEditor = ( { @@ -29,7 +30,7 @@ export const AutocompleteFormEditor = ( return (
onSelectionOver(event, item, query, op, setAutocompleteHoverItem)} - dangerouslySetInnerHTML={{__html: item.name + ' (' + item.curie + ') '}}/> + dangerouslySetInnerHTML={{__html: item.name + ' (' + getIdentifier(item) + ') '}}/>
); }; diff --git a/src/main/cliapp/src/components/Autocomplete/AutocompleteFormMultiEditor.js b/src/main/cliapp/src/components/Autocomplete/AutocompleteFormMultiEditor.js index cc4387839..b61284b6f 100644 --- a/src/main/cliapp/src/components/Autocomplete/AutocompleteFormMultiEditor.js +++ b/src/main/cliapp/src/components/Autocomplete/AutocompleteFormMultiEditor.js @@ -2,6 +2,7 @@ import React, { useRef, useState } from 'react'; import { AutoComplete } from "primereact/autocomplete"; import { onSelectionOver } from '../../utils/utils'; import { EditorTooltip } from "./EditorTooltip"; +import { getIdentifier } from '../../utils/utils'; export const AutocompleteFormMultiEditor = ( { @@ -29,7 +30,7 @@ export const AutocompleteFormMultiEditor = ( return (
onSelectionOver(event, item, inputValue, op, setAutocompleteHoverItem)} - dangerouslySetInnerHTML={{__html: item.name + ' (' + item.curie + ') '}}/> + dangerouslySetInnerHTML={{__html: item.name + ' (' + getIdentifier(item) + ') '}}/>
); }; diff --git a/src/main/cliapp/src/components/Autocomplete/AutocompleteMultiEditor.js b/src/main/cliapp/src/components/Autocomplete/AutocompleteMultiEditor.js index babadcb99..e6a083a2a 100644 --- a/src/main/cliapp/src/components/Autocomplete/AutocompleteMultiEditor.js +++ b/src/main/cliapp/src/components/Autocomplete/AutocompleteMultiEditor.js @@ -2,6 +2,7 @@ import React, { useRef, useState } from 'react'; import { AutoComplete } from "primereact/autocomplete"; import { onSelectionOver } from '../../utils/utils'; import { EditorTooltip } from "./EditorTooltip"; +import { getIdentifier } from '../../utils/utils'; export const AutocompleteMultiEditor = ( { @@ -30,7 +31,7 @@ export const AutocompleteMultiEditor = ( return (
onSelectionOver(event, item, inputValue, op, setAutocompleteHoverItem)} - dangerouslySetInnerHTML={{__html: item.name + ' (' + item.curie + ') '}}/> + dangerouslySetInnerHTML={{__html: item.name + ' (' + getIdentifier(item) + ') '}}/>
); }; diff --git a/src/main/cliapp/src/components/Autocomplete/SubjectAutocompleteTemplate.js b/src/main/cliapp/src/components/Autocomplete/SubjectAutocompleteTemplate.js index f5c3a7879..a1651fa6b 100644 --- a/src/main/cliapp/src/components/Autocomplete/SubjectAutocompleteTemplate.js +++ b/src/main/cliapp/src/components/Autocomplete/SubjectAutocompleteTemplate.js @@ -2,7 +2,6 @@ import React from 'react'; import { onSelectionOver, getIdentifier } from '../../utils/utils'; export const SubjectAutocompleteTemplate = ({ item, setAutocompleteHoverItem, op, query }) => { - if (item.geneSymbol) { return (
diff --git a/src/main/cliapp/src/components/Editors/GeneEditor.js b/src/main/cliapp/src/components/Editors/GeneEditor.js index f706fdc88..457ae1d81 100644 --- a/src/main/cliapp/src/components/Editors/GeneEditor.js +++ b/src/main/cliapp/src/components/Editors/GeneEditor.js @@ -8,7 +8,7 @@ import { getIdentifier } from "../../utils/utils"; const geneSearch = (event, setFiltered, setInputValue) => { const searchService = new SearchService(); const autocompleteFields = [ - "curie", "crossReferences.referencedCurie", "geneFullName.formatText", "geneFullName.displayText", + "curie", "modEntityId", "crossReferences.referencedCurie", "geneFullName.formatText", "geneFullName.displayText", "geneSymbol.formatText", "geneSymbol.displayText", "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSecondaryIds.secondaryId" ]; @@ -27,7 +27,8 @@ export const GeneEditor = ({ props, errorMessages, onChange, dataKey }) => { search={geneSearch} initialValue={getIdentifier(props?.rowData?.object)} rowProps={props} - fieldName='object' + fieldName="object" + subField="modEntityId" valueDisplay={(item, setAutocompleteHoverItem, op, query) => } onValueChangeHandler={onChange} diff --git a/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js b/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js index a910eb958..7b1d467c8 100644 --- a/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js +++ b/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js @@ -28,7 +28,7 @@ export const AlleleGeneAssociationsFormTable = ({ const [first, setFirst] = useState(0); const [filters, setFilters] = useState({ "relation.name": { value: null, matchMode: "in" }, - "objectGene.curie": { value: null, matchMode: "contains" }, + "object.modEntityId": { value: null, matchMode: "contains" }, "relatedNote.freeText": { value: null, matchMode: "contains" }, "evidenceCode.curie": { value: null, matchMode: "contains" }, "evidenceCurieSearchFilter": { value: null, matchMode: "contains" }, @@ -96,7 +96,7 @@ export const AlleleGeneAssociationsFormTable = ({ dataKey={props?.rowData?.dataKey} />; }} - field="object" + field="object.modEntityId" header="Gene" headerClassName='surface-0' filter diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 9a24b9a48..a1734dba9 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -700,7 +700,7 @@ export const DiseaseAnnotationsTable = () => { }; const onSubjectValueChange = (event, setFieldValue, props) => { - defaultAutocompleteOnChange(props, event, "subject", setFieldValue); + defaultAutocompleteOnChange(props, event, "subject", setFieldValue, "modEntityId"); }; const subjectSearch = (event, setFiltered, setQuery, props) => { @@ -716,10 +716,11 @@ export const DiseaseAnnotationsTable = () => { return ( <> } @@ -756,7 +757,7 @@ export const DiseaseAnnotationsTable = () => { return subjectFields; }; const onSgdStrainBackgroundValueChange = (event, setFieldValue, props) => { - defaultAutocompleteOnChange(props, event, "sgdStrainBackground", setFieldValue); + defaultAutocompleteOnChange(props, event, "sgdStrainBackground", setFieldValue, "modEntityId"); }; const sgdStrainBackgroundSearch = (event, setFiltered, setQuery) => { @@ -784,6 +785,7 @@ export const DiseaseAnnotationsTable = () => { search={sgdStrainBackgroundSearch} searchService={searchService} fieldName='sgdStrainBackground' + subField='modEntityId' valueDisplay={(item, setAutocompleteHoverItem, op, query) => } onValueChangeHandler={onSgdStrainBackgroundValueChange} @@ -821,6 +823,7 @@ export const DiseaseAnnotationsTable = () => { initialValue={props.rowData.diseaseGeneticModifiers} rowProps={props} fieldName='diseaseGeneticModifiers' + subField='modEntityId' valueDisplay={(item, setAutocompleteHoverItem, op, query) => } onValueChangeHandler={onGeneticModifiersValueChange} @@ -838,7 +841,7 @@ export const DiseaseAnnotationsTable = () => { }; const onAssertedAlleleValueChange = (event, setFieldValue, props) => { - defaultAutocompleteOnChange(props, event, "assertedAllele", setFieldValue); + defaultAutocompleteOnChange(props, event, "assertedAllele", setFieldValue, "modEntityId"); }; const assertedAlleleSearch = (event, setFiltered, setQuery) => { @@ -859,6 +862,7 @@ export const DiseaseAnnotationsTable = () => { initialValue={getIdentifier(props.rowData.assertedAllele)} rowProps={props} fieldName='assertedAllele' + subField='modEntityId' valueDisplay={(item, setAutocompleteHoverItem, op, query) => } onValueChangeHandler={onAssertedAlleleValueChange} @@ -941,6 +945,7 @@ export const DiseaseAnnotationsTable = () => { initialValue={props.rowData.assertedGenes} rowProps={props} fieldName='assertedGenes' + subField='modEntityId' valueDisplay={(item, setAutocompleteHoverItem, op, query) => } onValueChangeHandler={onAssertedGeneValueChange} @@ -982,6 +987,7 @@ export const DiseaseAnnotationsTable = () => { initialValue={props.rowData.with} rowProps={props} fieldName='with' + subField='modEntityId' valueDisplay={(item, setAutocompleteHoverItem, op, query) => } onValueChangeHandler={onWithValueChange} diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js index 5d439b3e6..58488c48d 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js @@ -457,6 +457,7 @@ export const NewAnnotationForm = ({ initialValue={newAnnotation.subject} search={subjectSearch} fieldName='subject' + subField="modEntityId" name="subject" searchService={searchService} onValueChangeHandler={onSubjectChange} @@ -483,6 +484,7 @@ export const NewAnnotationForm = ({ customRef={assertedGenesRef} search={assertedGenesSearch} name="assertedGenes" + subField="modEntityId" label="Asserted Genes" fieldName='assertedGenes' disabled = {!isAssertedGeneEnabled} @@ -514,6 +516,7 @@ export const NewAnnotationForm = ({ name="assertedAllele" label="Asserted Allele" fieldName='assertedAllele' + subField="modEntityId" disabled = {!isAssertedAlleleEnabled} initialValue={newAnnotation.assertedAllele} onValueChangeHandler={onSingleReferenceChange} @@ -655,6 +658,7 @@ export const NewAnnotationForm = ({ name="with" label="With" fieldName='with' + subField="modEntityId" initialValue={newAnnotation.with} onValueChangeHandler={onArrayFieldChange} valueDisplay={(item, setAutocompleteHoverItem, op, query) => @@ -797,6 +801,7 @@ export const NewAnnotationForm = ({ fieldName='sgdStrainBackground' name="sgdStrainBackground" label="SGD Strain Background" + subField="modEntityId" valueDisplay={(item, setAutocompleteHoverItem, op, query) => } onValueChangeHandler={onSingleReferenceChange} @@ -873,6 +878,7 @@ export const NewAnnotationForm = ({ initialValue={newAnnotation.diseaseGeneticModifiers} fieldName='diseaseGeneticModifiers' name="diseaseGeneticModifiers" + subField="modEntityId" valueDisplay={(item, setAutocompleteHoverItem, op, query) => } onValueChangeHandler={onArrayFieldChange} diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/useNewAnnotationReducer.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/useNewAnnotationReducer.js index da42dff46..6744c1e41 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/useNewAnnotationReducer.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/useNewAnnotationReducer.js @@ -3,7 +3,7 @@ import 'core-js/features/structured-clone'; const DEFAULT_ANNOTATION = { subject: { - curie: "", + modEntityId: "", }, assertedGenes : [], assertedAllele : null, diff --git a/src/main/cliapp/src/containers/ontologies/GeneralOntologyComponent.js b/src/main/cliapp/src/containers/ontologies/GeneralOntologyComponent.js index a425519d9..140235a1c 100644 --- a/src/main/cliapp/src/containers/ontologies/GeneralOntologyComponent.js +++ b/src/main/cliapp/src/containers/ontologies/GeneralOntologyComponent.js @@ -72,6 +72,7 @@ export const GeneralOntologyComponent = ({name, endpoint, showNamespace, showAbb { field: "curie", header: "Curie", + sortable: true, filterConfig: FILTER_CONFIGS.curieFilterConfig } ); @@ -79,6 +80,7 @@ export const GeneralOntologyComponent = ({name, endpoint, showNamespace, showAbb { field: "name", header: "Name", + sortable: true, body: (rowData) => , filterConfig: FILTER_CONFIGS.nameFilterConfig }, @@ -88,6 +90,7 @@ export const GeneralOntologyComponent = ({name, endpoint, showNamespace, showAbb { field: "definition", header: "Definition", + sortable: true, body: (rowData) => , filterConfig: FILTER_CONFIGS.definitionFilterConfig }, @@ -98,6 +101,7 @@ export const GeneralOntologyComponent = ({name, endpoint, showNamespace, showAbb { field: "abbreviation", header: "Abbreviation", + sortable: true, filterConfig: FILTER_CONFIGS.abbreviationFilterConfig } ); @@ -107,6 +111,7 @@ export const GeneralOntologyComponent = ({name, endpoint, showNamespace, showAbb { field: "namespace", header: "Name Space", + sortable: true, filterConfig: FILTER_CONFIGS.namespaceFilterConfig } ); @@ -116,6 +121,7 @@ export const GeneralOntologyComponent = ({name, endpoint, showNamespace, showAbb field: "synonyms.name", header: "Synonyms", body: synonymsTemplate, + sortable: true, filterConfig: FILTER_CONFIGS.ontologySynonymsFilterConfig } ); @@ -123,6 +129,7 @@ export const GeneralOntologyComponent = ({name, endpoint, showNamespace, showAbb { field: "secondaryIdentifiers", header: "Secondary IDs", + sortable: true, body: secondaryIdsTemplate, filterConfig: FILTER_CONFIGS.secondaryIdsFilterConfig } @@ -131,6 +138,7 @@ export const GeneralOntologyComponent = ({name, endpoint, showNamespace, showAbb { field: "obsolete", header: "Obsolete", + sortable: true, body: (rowData) => , filterConfig: FILTER_CONFIGS.obsoleteFilterConfig } diff --git a/src/main/cliapp/src/containers/variantsPage/VariantsTable.js b/src/main/cliapp/src/containers/variantsPage/VariantsTable.js index 447c317dc..74495d323 100644 --- a/src/main/cliapp/src/containers/variantsPage/VariantsTable.js +++ b/src/main/cliapp/src/containers/variantsPage/VariantsTable.js @@ -53,10 +53,10 @@ export const VariantsTable = () => { if (rowData?.taxon) { return ( <> - + {rowData.taxon.name} ({rowData.taxon.curie}) - + ); } @@ -66,10 +66,10 @@ export const VariantsTable = () => { if (rowData?.sourceGeneralConsequence) { return ( <> - + {rowData.sourceGeneralConsequence?.name} ({rowData.sourceGeneralConsequence?.curie}) - + ); } @@ -79,10 +79,10 @@ export const VariantsTable = () => { if (rowData?.variantType) { return ( <> - + {rowData.variantType?.name} ({rowData.variantType?.curie}) - + ); } @@ -190,6 +190,18 @@ export const VariantsTable = () => { sortable: { isInEditMode }, filterConfig: FILTER_CONFIGS.curieFilterConfig, }, + { + field: "modEntityId", + header: "MOD Entity ID", + sortable: true, + filterConfig: FILTER_CONFIGS.modentityidFilterConfig, + }, + { + field: "modInternalId", + header: "MOD Internal ID", + sortable: true, + filterConfig: FILTER_CONFIGS.modinternalidFilterConfig, + }, { field: "taxon.name", header: "Taxon", diff --git a/src/main/cliapp/src/routes.js b/src/main/cliapp/src/routes.js index 5e777330b..77615fa6f 100644 --- a/src/main/cliapp/src/routes.js +++ b/src/main/cliapp/src/routes.js @@ -49,7 +49,7 @@ export default ( } /> } /> } /> - } /> + } /> } /> } /> } /> diff --git a/src/main/cliapp/src/service/AlleleService.js b/src/main/cliapp/src/service/AlleleService.js index fb4a3d699..754d9fbc3 100644 --- a/src/main/cliapp/src/service/AlleleService.js +++ b/src/main/cliapp/src/service/AlleleService.js @@ -16,11 +16,11 @@ export class AlleleService extends BaseAuthService { async deleteAllele(allele) { const deletionService = new DeletionService(); - return await deletionService.delete(`allele`, allele.curie); + return await deletionService.delete(`allele`, allele.id); } - async getAllele(curie) { - return this.api.get(`/allele/${curie}`); + async getAllele(identifier) { + return this.api.get(`/allele/${identifier}`); } } diff --git a/src/main/cliapp/src/utils/utils.js b/src/main/cliapp/src/utils/utils.js index 12ac30b79..999a07aef 100644 --- a/src/main/cliapp/src/utils/utils.js +++ b/src/main/cliapp/src/utils/utils.js @@ -109,6 +109,9 @@ export function getEntityType(entity) { } export function getIdentifier(data) { + if (!data) { + return null; + } if (data.modEntityId) { return data.modEntityId; } @@ -325,8 +328,7 @@ export function multipleAutocompleteOnChange(rowProps, event, fieldName, setFiel } let nonDuplicateRows = []; if (event.target.value.length > 0) { - const identifier = event.target.value[0].curie ? "curie" : "id"; - nonDuplicateRows = getUniqueItemsByProperty(event.target.value, identifier); + nonDuplicateRows = getUniqueItemsByProperty(event.target.value, "id"); } updatedRows[index][fieldName] = nonDuplicateRows; setFieldValue(updatedRows[index][fieldName]); @@ -372,7 +374,7 @@ export function validateFormBioEntityFields(newAnnotationForm, uiErrorMessages, const bioEntityFieldNames = ["subject", "sgdStrainBackground", "assertedAllele"]; bioEntityFieldNames.forEach((field) => { - if(newAnnotationForm[field] && !Object.keys(newAnnotationForm['subject']).includes("curie")){ + if(newAnnotationForm[field] && !Object.keys(newAnnotationForm['subject']).includes("curie") && !Object.keys(newAnnotationForm['subject']).includes("modEntityId") && !Object.keys(newAnnotationForm['subject']).includes("modInternalId")){ const _uiErrorMessages = {}; _uiErrorMessages[field] = "Must select from autosuggest"; setUiErrorMessages({..._uiErrorMessages}); diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java index 5fcb4d136..29175913f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java @@ -52,7 +52,7 @@ public class AGMDiseaseAnnotation extends DiseaseAnnotation { "geneFullName.formatText", "geneFullName.displayText", "geneFullName.formatText_keyword", "geneFullName.displayText_keyword", "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSystematicName.formatText_keyword", "geneSystematicName.displayText_keyword", "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSynonyms.formatText_keyword", "geneSynonyms.displayText_keyword", - "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword" + "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword", "name", "name_keyword", "symbol", "symbol_keyword" }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java index bbef336c3..143ac563a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java @@ -45,7 +45,7 @@ public class AlleleDiseaseAnnotation extends DiseaseAnnotation { "alleleSymbol.formatText", "alleleSymbol.displayText", "alleleSymbol.formatText_keyword", "alleleSymbol.displayText_keyword", "alleleFullName.formatText", "alleleFullName.displayText", "alleleFullName.formatText_keyword", "alleleFullName.displayText_keyword", "alleleSynonyms.formatText", "alleleSynonyms.displayText", "alleleSynonyms.formatText_keyword", "alleleSynonyms.displayText_keyword", - "alleleSecondaryIds.secondaryId", "alleleSecondaryIds.secondaryId_keyword" + "alleleSecondaryIds.secondaryId", "alleleSecondaryIds.secondaryId_keyword", "name", "name_keyword", "symbol", "symbol_keyword" }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java index 418a61c3d..07ccf9e81 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java @@ -79,9 +79,9 @@ public class Annotation extends SingleReferenceAssociation { @EqualsAndHashCode.Include private String modInternalId; - @IndexedEmbedded(includePaths = {"handle", "conditionRelationType.name", "singleReference.curie", + @IndexedEmbedded(includePaths = {"handle", "uniqueId", "conditionRelationType.name", "singleReference.curie", "singleReference.crossReferences.referencedCurie", "conditions.conditionSummary", "conditions.uniqueId", - "handle_keyword", "conditionRelationType.name_keyword", "singleReference.curie_keyword", + "handle_keyword", "uniqueId_keyword", "conditionRelationType.name_keyword", "singleReference.curie_keyword", "singleReference.crossReferences.referencedCurie_keyword", "conditions.conditionSummary_keyword", "conditions.uniqueId_keyword" }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java index f0c976d5f..19cb992bd 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java @@ -58,8 +58,8 @@ public abstract class DiseaseAnnotation extends Annotation { - @IndexedEmbedded(includePaths = {"curie", "name", "secondaryIdentifiers", "synonyms.name", - "curie_keyword", "name_keyword", "secondaryIdentifiers_keyword", "synonyms.name_keyword" }) + @IndexedEmbedded(includePaths = {"curie", "name", "secondaryIdentifiers", "synonyms.name", "namespace", + "curie_keyword", "name_keyword", "secondaryIdentifiers_keyword", "synonyms.name_keyword", "namespace_keyword" }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @Fetch(FetchMode.SELECT) @@ -89,7 +89,14 @@ public abstract class DiseaseAnnotation extends Annotation { }) private List evidenceCodes; - @IndexedEmbedded(includeDepth = 2) + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "geneSymbol.formatText", "geneSymbol.displayText", "geneSymbol.formatText_keyword", "geneSymbol.displayText_keyword", + "geneFullName.formatText", "geneFullName.displayText", "geneFullName.formatText_keyword", "geneFullName.displayText_keyword", + "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSystematicName.formatText_keyword", "geneSystematicName.displayText_keyword", + "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSynonyms.formatText_keyword", "geneSynonyms.displayText_keyword", + "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword", "name", "name_keyword", "symbol", "symbol_keyword" + }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @Fetch(FetchMode.SELECT) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java index f37c5f7fc..b9b575cb2 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java @@ -37,7 +37,7 @@ public class GeneDiseaseAnnotation extends DiseaseAnnotation { "geneFullName.formatText", "geneFullName.displayText", "geneFullName.formatText_keyword", "geneFullName.displayText_keyword", "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSystematicName.formatText_keyword", "geneSystematicName.displayText_keyword", "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSynonyms.formatText_keyword", "geneSynonyms.displayText_keyword", - "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword" + "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword", "name", "name_keyword", "symbol", "symbol_keyword" }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java index 47336c415..f0d3e3bf5 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java @@ -9,25 +9,16 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import jakarta.persistence.Entity; -import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; -import jakarta.persistence.Table; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@Inheritance(strategy = InheritanceType.JOINED) @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @JsonIgnoreProperties(ignoreUnknown = true) @ToString(callSuper = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Reference.class, name = "Reference") }) -@Table(indexes = { - @Index(name = "informationcontent_createdby_index", columnList = "createdBy_id"), - @Index(name = "informationcontent_updatedby_index", columnList = "updatedBy_id") -}) @AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) public class InformationContentEntity extends CurieObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java index bd84ca70f..b46812644 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/SingleReferenceAssociation.java @@ -29,8 +29,8 @@ public class SingleReferenceAssociation extends Association { - @IndexedEmbedded(includePaths = {"curie", "primaryCrossReferenceCurie", - "curie_keyword", "primaryCrossReferenceCurie_keyword"}) + @IndexedEmbedded(includePaths = {"curie", "primaryCrossReferenceCurie", "crossReferences.referencedCurie", + "curie_keyword", "primaryCrossReferenceCurie_keyword", "crossReferences.referencedCurie_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToOne @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java index 17febb9fe..fc7cd4852 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java @@ -12,17 +12,35 @@ import com.fasterxml.jackson.annotation.JsonView; +import jakarta.persistence.DiscriminatorColumn; import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; import jakarta.persistence.MappedSuperclass; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +@Inheritance(strategy = InheritanceType.JOINED) +@DiscriminatorColumn(name = "curieObjectType") +@Entity @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -@MappedSuperclass +@Table(indexes = { + @Index(name = "curieobject_curie_index", columnList = "curie"), + @Index(name = "curieobject_createdby_index", columnList = "createdBy_id"), + @Index(name = "curieobject_updatedby_index", columnList = "updatedBy_id"), + @Index(name = "curieobject_curieObjectType_index", columnList = "curieObjectType") + }, + uniqueConstraints = { + @UniqueConstraint(name = "curieobject_curie_uk", columnNames = "curie") + } +) @Schema(name = "CurieObject", description = "POJO that represents the CurieObject") public class CurieObject extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java index 2d7b8b17e..f6aa32f87 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java @@ -20,11 +20,8 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonView; -import jakarta.persistence.DiscriminatorColumn; import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; import jakarta.persistence.Transient; @@ -33,26 +30,19 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Inheritance(strategy = InheritanceType.JOINED) -@DiscriminatorColumn(name = "submittedObjectType") @Entity @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { CurieObject.class }) @Table(indexes = { - @Index(name = "submittedobject_curie_index", columnList = "curie"), @Index(name = "submittedobject_modentityid_index", columnList = "modentityid"), @Index(name = "submittedobject_modinternalid_index", columnList = "modinternalid"), @Index(name = "submittedobject_dataprovider_index", columnList = "dataprovider_id"), - @Index(name = "submittedobject_createdby_index", columnList = "createdBy_id"), - @Index(name = "submittedobject_updatedby_index", columnList = "updatedBy_id"), - @Index(name = "submittedobject_submittedObjectType_index", columnList = "submittedObjectType") }, uniqueConstraints = { @UniqueConstraint(name = "submittedobject_modentityid_uk", columnNames = "modentityid"), - @UniqueConstraint(name = "submittedobject_modinternalid_uk", columnNames = "modinternalid"), - @UniqueConstraint(name = "submittedobject_curie_uk", columnNames = "curie") + @UniqueConstraint(name = "submittedobject_modinternalid_uk", columnNames = "modinternalid") } ) @Schema(name = "SubmittedObject", description = "POJO that represents the SubmittedObject") @@ -60,7 +50,7 @@ public class SubmittedObject extends CurieObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "modEntityId_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") - @JsonView({ View.FieldsOnly.class }) + @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) private String modEntityId; @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java index 8caf16a59..06d345d2c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java @@ -26,26 +26,18 @@ import jakarta.persistence.ElementCollection; import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; -import jakarta.persistence.Table; import jakarta.persistence.Transient; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@Inheritance(strategy = InheritanceType.JOINED) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @Entity @ToString(exclude = { "isaParents", "isaChildren", "isaAncestors", "isaDescendants", "crossReferences", "synonyms", "secondaryIdentifiers", "subsets" }, callSuper = true) @AGRCurationSchemaVersion(min = LinkMLSchemaConstants.MIN_ONTOLOGY_RELEASE, max = LinkMLSchemaConstants.MAX_ONTOLOGY_RELEASE, dependencies = { AuditedObject.class }) -@Table(indexes = { - @Index(name = "ontologyterm_createdby_index", columnList = "createdBy_id"), - @Index(name = "ontologyterm_updatedby_index", columnList = "updatedBy_id") -}) public class OntologyTerm extends CurieObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index 39f4b0f29..d60cdd5ff 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -491,11 +491,10 @@ ALTER TABLE zfsterm DROP CONSTRAINT zfsterm_pkey; -- Create tables -CREATE TABLE submittedobject ( +CREATE TABLE curieobject ( id bigint PRIMARY KEY, old_id bigint, curie varchar(255), - tablename varchar(255), modentityid varchar(255), modinternalid varchar(255), dataprovider_id bigint, @@ -507,11 +506,17 @@ CREATE TABLE submittedobject ( dbdateupdated timestamp without time zone, internal boolean NOT NULL DEFAULT false, obsolete boolean NOT NULL DEFAULT false, - submittedobjecttype varchar(64) + curieobjecttype varchar(64) + ); + +CREATE TABLE submittedobject ( + id bigint PRIMARY KEY, + modentityid varchar(255), + modinternalid varchar(255), + dataprovider_id bigint ); -CREATE SEQUENCE submittedobject_seq START WITH 200250000 INCREMENT BY 50 NO MINVALUE NO MAXVALUE CACHE 1; -CREATE SEQUENCE ontologyterm_seq START WITH 200250000 INCREMENT BY 50 NO MINVALUE NO MAXVALUE CACHE 1; +CREATE SEQUENCE curieobject_seq START WITH 200250000 INCREMENT BY 50 NO MINVALUE NO MAXVALUE CACHE 1; CREATE SEQUENCE informationcontententity_seq START WITH 20025000 INCREMENT BY 50 NO MINVALUE NO MAXVALUE CACHE 1; -- Add id equivalents of curie columns @@ -649,56 +654,68 @@ ALTER TABLE zfsterm ADD COLUMN id bigint; -- Move data around -INSERT INTO submittedobject (id, modentityid, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT nextval('submittedobject_seq'), curie, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete +INSERT INTO curieobject (id, modentityid, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT nextval('curieobject_seq'), curie, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete FROM biologicalentity; -INSERT INTO submittedobject (id, old_id, modentityid, modinternalid, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT nextval('submittedobject_seq'), id, modentityid, modinternalid, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete +INSERT INTO curieobject (id, old_id, modentityid, modinternalid, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT nextval('curieobject_seq'), id, modentityid, modinternalid, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete FROM reagent; + +INSERT INTO submittedobject(id, modentityid, modinternalid, dataprovider_id) + SELECT id, modentityid, modinternalid, dataprovider_id + FROM curieobject; -UPDATE ontologyterm SET id = nextval('ontologyterm_seq'); +UPDATE ontologyterm SET id = nextval('curieobject_seq'); ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_pkey PRIMARY KEY (id); -UPDATE informationcontententity SET id = nextval('informationcontententity_seq'); +INSERT INTO curieobject (id, curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT id, curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM ontologyterm; + +UPDATE informationcontententity SET id = nextval('curieobject_seq'); ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_pkey PRIMARY KEY (id); + +INSERT INTO curieobject (id, curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) + SELECT id, curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete + FROM informationcontententity; -CREATE INDEX old_id_index ON submittedobject USING btree (old_id, tablename); -CREATE INDEX submittedobject_modentityid_index ON submittedobject USING btree (modentityid); +CREATE INDEX old_id_index ON curieobject USING btree (old_id); +CREATE INDEX curieobject_modentityid_index ON curieobject USING btree (modentityid); -UPDATE affectedgenomicmodel t SET id = s.id FROM submittedobject s WHERE t.curie = s.modentityid; -UPDATE agmdiseaseannotation t SET inferredallele_id = s.id FROM submittedobject s WHERE t.inferredallele_curie = s.modentityid; -UPDATE agmdiseaseannotation t SET assertedallele_id = s.id FROM submittedobject s WHERE t.assertedallele_curie = s.modentityid; -UPDATE agmdiseaseannotation t SET inferredgene_id = s.id FROM submittedobject s WHERE t.inferredgene_curie = s.modentityid; -UPDATE agmdiseaseannotation t SET subject_id = s.id FROM submittedobject s WHERE t.subject_curie = s.modentityid; -UPDATE agmdiseaseannotation_gene t SET assertedgenes_id = s.id FROM submittedobject s WHERE t.assertedgenes_curie = s.modentityid; -UPDATE allele t SET id = s.id FROM submittedobject s WHERE t.curie = s.modentityid; -UPDATE allele_note t SET allele_id = s.id FROM submittedobject s WHERE t.allele_curie = s.modentityid; -UPDATE allele_reference t SET allele_id = s.id FROM submittedobject s WHERE t.allele_curie = s.modentityid; +UPDATE affectedgenomicmodel t SET id = c.id FROM curieobject c WHERE t.curie = c.modentityid; +UPDATE agmdiseaseannotation t SET inferredallele_id = c.id FROM curieobject c WHERE t.inferredallele_curie = c.modentityid; +UPDATE agmdiseaseannotation t SET assertedallele_id = c.id FROM curieobject c WHERE t.assertedallele_curie = c.modentityid; +UPDATE agmdiseaseannotation t SET inferredgene_id = c.id FROM curieobject c WHERE t.inferredgene_curie = c.modentityid; +UPDATE agmdiseaseannotation t SET subject_id = c.id FROM curieobject c WHERE t.subject_curie = c.modentityid; +UPDATE agmdiseaseannotation_gene t SET assertedgenes_id = c.id FROM curieobject c WHERE t.assertedgenes_curie = c.modentityid; +UPDATE allele t SET id = c.id FROM curieobject c WHERE t.curie = c.modentityid; +UPDATE allele_note t SET allele_id = c.id FROM curieobject c WHERE t.allele_curie = c.modentityid; +UPDATE allele_reference t SET allele_id = c.id FROM curieobject c WHERE t.allele_curie = c.modentityid; UPDATE allele_reference t SET references_id = i.id FROM informationcontententity i WHERE t.references_curie = i.curie; -UPDATE alleledatabasestatusslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; -UPDATE allelediseaseannotation t SET inferredgene_id = s.id FROM submittedobject s WHERE t.inferredgene_curie = s.modentityid; -UPDATE allelediseaseannotation t SET subject_id = s.id FROM submittedobject s WHERE t.subject_curie = s.modentityid; -UPDATE allelediseaseannotation_gene t SET assertedgenes_id = s.id FROM submittedobject s WHERE t.assertedgenes_curie = s.modentityid; -UPDATE allelefullnameslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; -UPDATE allelefunctionalimpactslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; +UPDATE alleledatabasestatusslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; +UPDATE allelediseaseannotation t SET inferredgene_id = c.id FROM curieobject c WHERE t.inferredgene_curie = c.modentityid; +UPDATE allelediseaseannotation t SET subject_id = c.id FROM curieobject c WHERE t.subject_curie = c.modentityid; +UPDATE allelediseaseannotation_gene t SET assertedgenes_id = c.id FROM curieobject c WHERE t.assertedgenes_curie = c.modentityid; +UPDATE allelefullnameslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; +UPDATE allelefunctionalimpactslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; UPDATE allelefunctionalimpactslotannotation t SET phenotypeterm_id = o.id FROM ontologyterm o WHERE t.phenotypeterm_curie = o.curie; -UPDATE allelegeneassociation t SET subject_id = s.id FROM submittedobject s WHERE t.subject_curie = s.modentityid; -UPDATE allelegeneassociation t SET object_id = s.id FROM submittedobject s WHERE t.object_curie = s.modentityid; +UPDATE allelegeneassociation t SET subject_id = c.id FROM curieobject c WHERE t.subject_curie = c.modentityid; +UPDATE allelegeneassociation t SET object_id = c.id FROM curieobject c WHERE t.object_curie = c.modentityid; UPDATE allelegenomicentityassociation t SET evidencecode_id = o.id FROM ontologyterm o WHERE t.evidencecode_curie = o.curie; -UPDATE allelegermlinetransmissionstatusslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; -UPDATE alleleinheritancemodeslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; +UPDATE allelegermlinetransmissionstatusslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; +UPDATE alleleinheritancemodeslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; UPDATE alleleinheritancemodeslotannotation t SET phenotypeterm_id = o.id FROM ontologyterm o WHERE t.phenotypeterm_curie = o.curie; -UPDATE allelemutationtypeslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; +UPDATE allelemutationtypeslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; UPDATE allelemutationtypeslotannotation_soterm t SET mutationtypes_id = o.id FROM ontologyterm o WHERE t.mutationtypes_curie = o.curie; -UPDATE allelenomenclatureeventslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; -UPDATE allelesecondaryidslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; -UPDATE allelesymbolslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; -UPDATE allelesynonymslotannotation t SET singleallele_id = s.id FROM submittedobject s WHERE t.singleallele_curie = s.modentityid; +UPDATE allelenomenclatureeventslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; +UPDATE allelesecondaryidslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; +UPDATE allelesymbolslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; +UPDATE allelesynonymslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; UPDATE anatomicalterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE apoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE atpterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; -UPDATE biologicalentity t SET id = s.id FROM submittedobject s WHERE t.curie = s.modentityid; +UPDATE biologicalentity t SET id = c.id FROM curieobject c WHERE t.curie = c.modentityid; UPDATE biologicalentity t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie; UPDATE bspoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE chebiterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; @@ -706,20 +723,20 @@ UPDATE chemicalterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE clterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE cmoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE conditionrelation t SET singlereference_id = i.id FROM informationcontententity i WHERE t.singlereference_curie = i.curie; -UPDATE construct t SET id = s.id FROM submittedobject s WHERE t.id = s.old_id; -UPDATE construct_reference t SET construct_id = s.id FROM submittedobject s WHERE t.construct_id = s.old_id; +UPDATE construct t SET id = c.id FROM curieobject c WHERE t.id = c.old_id; +UPDATE construct_reference t SET construct_id = c.id FROM curieobject c WHERE t.construct_id = c.old_id; UPDATE construct_reference t SET references_id = i.id FROM informationcontententity i WHERE t.references_curie = i.curie; UPDATE constructcomponentslotannotation t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie; -UPDATE constructfullnameslotannotation t SET singleconstruct_id = s.id FROM submittedobject s WHERE t.singleconstruct_id = s.old_id; -UPDATE constructgenomicentityassociation t SET subject_id = s.id FROM submittedobject s WHERE t.subject_id = s.old_id; -UPDATE constructgenomicentityassociation t SET object_id = s.id FROM submittedobject s WHERE t.object_curie = s.modentityid; -UPDATE constructsymbolslotannotation t SET singleconstruct_id = s.id FROM submittedobject s WHERE t.singleconstruct_id = s.old_id; -UPDATE constructsynonymslotannotation t SET singleconstruct_id = s.id FROM submittedobject s WHERE t.singleconstruct_id = s.old_id; +UPDATE constructfullnameslotannotation t SET singleconstruct_id = c.id FROM curieobject c WHERE t.singleconstruct_id = c.old_id; +UPDATE constructgenomicentityassociation t SET subject_id = c.id FROM curieobject c WHERE t.subject_id = c.old_id; +UPDATE constructgenomicentityassociation t SET object_id = c.id FROM curieobject c WHERE t.object_curie = c.modentityid; +UPDATE constructsymbolslotannotation t SET singleconstruct_id = c.id FROM curieobject c WHERE t.singleconstruct_id = c.old_id; +UPDATE constructsynonymslotannotation t SET singleconstruct_id = c.id FROM curieobject c WHERE t.singleconstruct_id = c.old_id; UPDATE daoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE diseaseannotation t SET object_id = o.id FROM ontologyterm o WHERE t.object_curie = o.curie; -UPDATE diseaseannotation_biologicalentity t SET diseasegeneticmodifiers_id = o.id FROM ontologyterm o WHERE t.diseasegeneticmodifiers_curie = o.curie; -UPDATE diseaseannotation_ecoterm t SET evidencecodes_id = s.id FROM submittedobject s WHERE t.evidencecodes_curie = s.modentityid; -UPDATE diseaseannotation_gene t SET with_id = s.id FROM submittedobject s WHERE t.with_curie = s.modentityid; +UPDATE diseaseannotation_biologicalentity t SET diseasegeneticmodifiers_id = c.id FROM curieobject c WHERE t.diseasegeneticmodifiers_curie = c.modentityid; +UPDATE diseaseannotation_ecoterm t SET evidencecodes_id = o.id FROM ontologyterm o WHERE t.evidencecodes_curie = o.curie; +UPDATE diseaseannotation_gene t SET with_id = c.id FROM curieobject c WHERE t.with_curie = c.modentityid; UPDATE doterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE dpoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE ecoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; @@ -733,21 +750,21 @@ UPDATE experimentalcondition t SET conditionid_id = o.id FROM ontologyterm o WHE UPDATE experimentalcondition t SET conditiontaxon_id = o.id FROM ontologyterm o WHERE t.conditiontaxon_curie = o.curie; UPDATE experimentalconditionontologyterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE fbdvterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; -UPDATE gene t SET id = s.id FROM submittedobject s WHERE t.curie = s.modentityid; +UPDATE gene t SET id = c.id FROM curieobject c WHERE t.curie = c.modentityid; UPDATE gene t SET genetype_id = o.id FROM ontologyterm o WHERE t.genetype_curie = o.curie; -UPDATE genediseaseannotation t SET sgdstrainbackground_id = s.id FROM submittedobject s WHERE t.sgdstrainbackground_curie = s.modentityid; -UPDATE genediseaseannotation t SET subject_id = s.id FROM submittedobject s WHERE t.subject_curie = s.modentityid; -UPDATE genefullnameslotannotation t SET singlegene_id = s.id FROM submittedobject s WHERE t.singlegene_curie = s.modentityid; -UPDATE genesecondaryidslotannotation t SET singlegene_id = s.id FROM submittedobject s WHERE t.singlegene_curie = s.modentityid; -UPDATE genesymbolslotannotation t SET singlegene_id = s.id FROM submittedobject s WHERE t.singlegene_curie = s.modentityid; -UPDATE genesynonymslotannotation t SET singlegene_id = s.id FROM submittedobject s WHERE t.singlegene_curie = s.modentityid; -UPDATE genesystematicnameslotannotation t SET singlegene_id = s.id FROM submittedobject s WHERE t.singlegene_curie = s.modentityid; -UPDATE genetogeneorthology t SET subjectgene_id = s.id FROM submittedobject s WHERE t.subjectgene_curie = s.modentityid; -UPDATE genetogeneorthology t SET objectgene_id = s.id FROM submittedobject s WHERE t.objectgene_curie = s.modentityid; +UPDATE genediseaseannotation t SET sgdstrainbackground_id = c.id FROM curieobject c WHERE t.sgdstrainbackground_curie = c.modentityid; +UPDATE genediseaseannotation t SET subject_id = c.id FROM curieobject c WHERE t.subject_curie = c.modentityid; +UPDATE genefullnameslotannotation t SET singlegene_id = c.id FROM curieobject c WHERE t.singlegene_curie = c.modentityid; +UPDATE genesecondaryidslotannotation t SET singlegene_id = c.id FROM curieobject c WHERE t.singlegene_curie = c.modentityid; +UPDATE genesymbolslotannotation t SET singlegene_id = c.id FROM curieobject c WHERE t.singlegene_curie = c.modentityid; +UPDATE genesynonymslotannotation t SET singlegene_id = c.id FROM curieobject c WHERE t.singlegene_curie = c.modentityid; +UPDATE genesystematicnameslotannotation t SET singlegene_id = c.id FROM curieobject c WHERE t.singlegene_curie = c.modentityid; +UPDATE genetogeneorthology t SET subjectgene_id = c.id FROM curieobject c WHERE t.subjectgene_curie = c.modentityid; +UPDATE genetogeneorthology t SET objectgene_id = c.id FROM curieobject c WHERE t.objectgene_curie = c.modentityid; UPDATE genetogeneorthologycurated t SET evidencecode_id = o.id FROM ontologyterm o WHERE t.evidencecode_curie = o.curie; UPDATE genetogeneorthologycurated t SET singlereference_id = i.id FROM informationcontententity i WHERE t.singlereference_curie = i.curie; -UPDATE genomicentity t SET id = s.id FROM submittedobject s WHERE t.curie = s.modentityid; -UPDATE genomicentity_crossreference t SET genomicentity_id = s.id FROM submittedobject s WHERE t.genomicentity_curie = s.modentityid; +UPDATE genomicentity t SET id = c.id FROM curieobject c WHERE t.curie = c.modentityid; +UPDATE genomicentity_crossreference t SET genomicentity_id = c.id FROM curieobject c WHERE t.genomicentity_curie = c.modentityid; UPDATE goterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE hpterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE materm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; @@ -773,8 +790,8 @@ UPDATE ontologyterm_synonym t SET ontologyterm_id = o.id FROM ontologyterm o WHE UPDATE patoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE phenotypeterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE pwterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; -UPDATE reagent t SET id = s.id FROM submittedobject s WHERE t.id = s.old_id; -UPDATE reagent_secondaryidentifiers t SET reagent_id = s.id FROM submittedobject s WHERE t.reagent_id = s.old_id; +UPDATE reagent t SET id = c.id FROM curieobject c WHERE t.id = c.old_id; +UPDATE reagent_secondaryidentifiers t SET reagent_id = c.id FROM curieobject c WHERE t.reagent_id = c.old_id; UPDATE reference t SET id = i.id FROM informationcontententity i WHERE t.curie = i.curie; UPDATE reference_crossreference t SET reference_id = i.id FROM informationcontententity i WHERE t.reference_curie = i.curie; UPDATE roterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; @@ -782,14 +799,14 @@ UPDATE rsterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE soterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE singlereferenceassociation t SET singlereference_id = i.id FROM informationcontententity i WHERE t.singlereference_curie = i.curie; UPDATE slotannotation_informationcontententity t SET evidence_id = i.id FROM informationcontententity i WHERE t.evidence_curie = i.curie; -UPDATE species t SET id = s.id FROM submittedobject s WHERE t.id = s.old_id; +UPDATE species t SET id = c.id FROM curieobject c WHERE t.id = c.old_id; UPDATE species t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie; UPDATE stageterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE uberonterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; -UPDATE variant t SET id = s.id FROM submittedobject s WHERE t.curie = s.modentityid; +UPDATE variant t SET id = c.id FROM curieobject c WHERE t.curie = c.modentityid; UPDATE variant t SET varianttype_id = o.id FROM ontologyterm o WHERE t.varianttype_curie = o.curie; UPDATE variant t SET sourcegeneralconsequence_id = o.id FROM ontologyterm o WHERE t.sourcegeneralconsequence_curie = o.curie; -UPDATE variant_note t SET variant_id = s.id FROM submittedobject s WHERE t.variant_curie = s.modentityid; +UPDATE variant_note t SET variant_id = c.id FROM curieobject c WHERE t.variant_curie = c.modentityid; UPDATE vtterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE wbbtterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE wblsterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; @@ -804,12 +821,58 @@ UPDATE zecoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE zfaterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE zfsterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; --- Update Entity Types in the auditedobject table ... this needs to be done for all "leaf" nodes of the SubmittedObject class tree -UPDATE submittedobject s SET submittedobjecttype = 'AffectedGenomicModel' FROM affectedgenomicmodel t WHERE s.id = t.id; -UPDATE submittedobject s SET submittedobjecttype = 'Allele' FROM allele t WHERE s.id = t.id; -UPDATE submittedobject s SET submittedobjecttype = 'Construct' FROM construct t WHERE s.id = t.id; -UPDATE submittedobject s SET submittedobjecttype = 'Gene' FROM gene t WHERE s.id = t.id; -UPDATE submittedobject s SET submittedobjecttype = 'Variant' FROM variant t WHERE s.id = t.id; +-- Update Entity Types in the auditedobject table ... this needs to be done for all "leaf" nodes of the CurieObject class tree +UPDATE curieobject c SET curieobjecttype = 'APOTerm' FROM APOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'ATPTerm' FROM ATPTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'AffectedGenomicModel' FROM AffectedGenomicModel t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'Allele' FROM Allele t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'BSPOTerm' FROM BSPOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'CHEBITerm' FROM CHEBITerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'CLTerm' FROM CLTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'CMOTerm' FROM CMOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'Construct' FROM Construct t WHERE c.id = t.id;; +UPDATE curieobject c SET curieobjecttype = 'DAOTerm' FROM DAOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'DOTerm' FROM DOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'DPOTerm' FROM DPOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'ECOTerm' FROM ECOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'EMAPATerm' FROM EMAPATerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'FBDVTerm' FROM FBDVTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'GOTerm' FROM GOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'Gene' FROM Gene t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'HPTerm' FROM HPTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'MATerm' FROM MATerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'MITerm' FROM MITerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'MMOTerm' FROM MMOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'MMUSDVTerm' FROM MMUSDVTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'MODTerm' FROM MODTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'MPATHTerm' FROM MPATHTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'MPTerm' FROM MPTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'Molecule' FROM Molecule t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'NCBITaxonTerm' FROM NCBITaxonTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'OBITerm' FROM OBITerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'PATOTerm' FROM PATOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'PWTerm' FROM PWTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'ROTerm' FROM ROTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'RSTerm' FROM RSTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'Reference' FROM Reference t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'SOTerm' FROM SOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'Species' FROM Species t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'Synonym' FROM Synonym t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'UBERONTerm' FROM UBERONTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'VTTerm' FROM VTTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'Variant' FROM Variant t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'WBBTTerm' FROM WBBTTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'WBLSTerm' FROM WBLSTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'WBPhenotypeTerm' FROM WBPhenotypeTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'XBATerm' FROM XBATerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'XBEDTerm' FROM XBEDTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'XBSTerm' FROM XBSTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'XCOTerm' FROM XCOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'XPOTerm' FROM XPOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'XSMOTerm' FROM XSMOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'ZECOTerm' FROM ZECOTerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'ZFATerm' FROM ZFATerm t WHERE c.id = t.id; +UPDATE curieobject c SET curieobjecttype = 'ZFSTerm' FROM ZFSTerm t WHERE c.id = t.id; ALTER TABLE affectedgenomicmodel DROP COLUMN curie; ALTER TABLE agmdiseaseannotation DROP COLUMN inferredallele_curie; @@ -898,6 +961,15 @@ ALTER TABLE genomicentity DROP COLUMN curie; ALTER TABLE genomicentity_crossreference DROP COLUMN genomicentity_curie; ALTER TABLE goterm DROP COLUMN curie; ALTER TABLE hpterm DROP COLUMN curie; +ALTER TABLE informationcontententity DROP COLUMN curie; +ALTER TABLE informationcontententity DROP COLUMN createdby_id; +ALTER TABLE informationcontententity DROP COLUMN updatedby_id; +ALTER TABLE informationcontententity DROP COLUMN datecreated; +ALTER TABLE informationcontententity DROP COLUMN dateupdated; +ALTER TABLE informationcontententity DROP COLUMN dbdatecreated; +ALTER TABLE informationcontententity DROP COLUMN dbdateupdated; +ALTER TABLE informationcontententity DROP COLUMN internal; +ALTER TABLE informationcontententity DROP COLUMN obsolete; ALTER TABLE materm DROP COLUMN curie; ALTER TABLE miterm DROP COLUMN curie; ALTER TABLE mmoterm DROP COLUMN curie; @@ -909,6 +981,15 @@ ALTER TABLE mpterm DROP COLUMN curie; ALTER TABLE ncbitaxonterm DROP COLUMN curie; ALTER TABLE note_reference DROP COLUMN references_curie; ALTER TABLE obiterm DROP COLUMN curie; +ALTER TABLE ontologyterm DROP COLUMN curie; +ALTER TABLE ontologyterm DROP COLUMN createdby_id; +ALTER TABLE ontologyterm DROP COLUMN updatedby_id; +ALTER TABLE ontologyterm DROP COLUMN datecreated; +ALTER TABLE ontologyterm DROP COLUMN dateupdated; +ALTER TABLE ontologyterm DROP COLUMN dbdatecreated; +ALTER TABLE ontologyterm DROP COLUMN dbdateupdated; +ALTER TABLE ontologyterm DROP COLUMN internal; +ALTER TABLE ontologyterm DROP COLUMN obsolete; ALTER TABLE ontologyterm_crossreference DROP COLUMN ontologyterm_curie; ALTER TABLE ontologyterm_definitionurls DROP COLUMN ontologyterm_curie; ALTER TABLE ontologyterm_isa_ancestor_descendant DROP COLUMN isadescendants_curie; @@ -961,23 +1042,30 @@ ALTER TABLE zecoterm DROP COLUMN curie; ALTER TABLE zfaterm DROP COLUMN curie; ALTER TABLE zfsterm DROP COLUMN curie; -ALTER TABLE submittedobject DROP COLUMN old_id; +ALTER TABLE curieobject DROP COLUMN old_id; +ALTER TABLE curieobject DROP COLUMN modentityid; +ALTER TABLE curieobject DROP COLUMN modinternalid; +ALTER TABLE curieobject DROP COLUMN dataprovider_id; SET session_replication_role = 'origin'; -- Add constraints and indexes -ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_createdby_id_fk FOREIGN KEY (createdby_id) REFERENCES person (id); -ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_updatedby_id_fk FOREIGN KEY (updatedby_id) REFERENCES person (id); -CREATE INDEX submittedobject_createdby_index ON submittedobject USING btree (createdby_id); -CREATE INDEX submittedobject_updatedby_index ON submittedobject USING btree (updatedby_id); +ALTER TABLE curieobject ADD CONSTRAINT curieobject_createdby_id_fk FOREIGN KEY (createdby_id) REFERENCES person (id); +ALTER TABLE curieobject ADD CONSTRAINT curieobject_updatedby_id_fk FOREIGN KEY (updatedby_id) REFERENCES person (id); +CREATE INDEX curieobject_createdby_index ON curieobject USING btree (createdby_id); +CREATE INDEX curieobject_updatedby_index ON curieobject USING btree (updatedby_id); +CREATE INDEX curieobject_curie_index ON curieobject USING btree (curie); +CREATE INDEX curieobject_curieobjecttype_index ON curieobject USING btree (curieobjecttype); +ALTER TABLE curieobject ADD CONSTRAINT curieobject_curie_uk UNIQUE (curie); + +ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_dataprovider_id_fk FOREIGN KEY (dataprovider_id) REFERENCES dataprovider (id); -CREATE INDEX submittedobject_curie_index ON submittedobject USING btree (curie); +CREATE INDEX submittedobject_modentityid_index ON submittedobject USING btree (modentityid); CREATE INDEX submittedobject_modinternalid_index ON submittedobject USING btree (modinternalid); CREATE INDEX submittedobject_dataprovider_index ON submittedobject USING btree (dataprovider_id); ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_modentityid_uk UNIQUE (modentityid); ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_modinternalid_uk UNIQUE (modinternalid); -ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_curie_uk UNIQUE (curie); CREATE INDEX experimentalcondition_createdby_index ON experimentalcondition USING btree (createdby_id); CREATE INDEX experimentalcondition_updatedby_index ON experimentalcondition USING btree (updatedby_id); @@ -1163,6 +1251,7 @@ CREATE INDEX genomicentity_crossreference_ge_xref_index ON genomicentity_crossre CREATE INDEX genomicentity_crossreference_genomicentity_index ON genomicentity_crossreference USING btree (genomicentity_id); ALTER TABLE goterm ADD CONSTRAINT goterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE hpterm ADD CONSTRAINT hpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); +ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); ALTER TABLE materm ADD CONSTRAINT materm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); ALTER TABLE miterm ADD CONSTRAINT miterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); @@ -1175,6 +1264,7 @@ ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_id_fk FOREIGN KEY (id) RE ALTER TABLE note_reference ADD CONSTRAINT note_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); CREATE INDEX note_reference_references_index ON note_reference USING btree (references_id); ALTER TABLE obiterm ADD CONSTRAINT obiterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); +ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); ALTER TABLE ontologyterm_crossreference ADD CONSTRAINT ontologyterm_crossreference_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); CREATE INDEX ontologyterm_crossreference_ontologyterm_index ON ontologyterm_crossreference USING btree (ontologyterm_id); ALTER TABLE ontologyterm_definitionurls ADD CONSTRAINT ontologyterm_definitionurls_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); From 468dd01b93c269b81fb9dd158d424989cf5914c5 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 2 Feb 2024 10:31:42 +0000 Subject: [PATCH 047/159] Change sequence increment for migration --- .../curation_api/model/entities/base/CurieObject.java | 1 - .../db/migration/v0.30.0.1__linkml_v2.0.0_update.sql | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java index fc7cd4852..e12315ab2 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java @@ -17,7 +17,6 @@ import jakarta.persistence.Index; import jakarta.persistence.Inheritance; import jakarta.persistence.InheritanceType; -import jakarta.persistence.MappedSuperclass; import jakarta.persistence.Table; import jakarta.persistence.UniqueConstraint; import lombok.Data; diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index d60cdd5ff..0c24380c0 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -516,8 +516,8 @@ CREATE TABLE submittedobject ( dataprovider_id bigint ); -CREATE SEQUENCE curieobject_seq START WITH 200250000 INCREMENT BY 50 NO MINVALUE NO MAXVALUE CACHE 1; -CREATE SEQUENCE informationcontententity_seq START WITH 20025000 INCREMENT BY 50 NO MINVALUE NO MAXVALUE CACHE 1; +CREATE SEQUENCE curieobject_seq START WITH 200250000 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; +CREATE SEQUENCE informationcontententity_seq START WITH 20025000 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- Add id equivalents of curie columns @@ -1320,3 +1320,6 @@ ALTER TABLE xsmoterm ADD CONSTRAINT xsmoterm_id_fk FOREIGN KEY (id) REFERENCES c ALTER TABLE zecoterm ADD CONSTRAINT zecoterm_id_fk FOREIGN KEY (id) REFERENCES experimentalconditionontologyterm (id); ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); + +ALTER SEQUENCE curieobject_seq INCREMENT BY 50; +ALTER SEQUENCE informationcontententity_seq INCREMENT BY 50; From 643da897b70570a434974feaa0d379be4725fb20 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Wed, 7 Feb 2024 21:36:32 +0000 Subject: [PATCH 048/159] Fix migration --- .../resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index 0c24380c0..57cdea485 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -726,6 +726,7 @@ UPDATE conditionrelation t SET singlereference_id = i.id FROM informationcontent UPDATE construct t SET id = c.id FROM curieobject c WHERE t.id = c.old_id; UPDATE construct_reference t SET construct_id = c.id FROM curieobject c WHERE t.construct_id = c.old_id; UPDATE construct_reference t SET references_id = i.id FROM informationcontententity i WHERE t.references_curie = i.curie; +UPDATE constructcomponentslotannotation t SET singleconstruct_id = c.id FROM curieobject c WHERE t.singleconstruct_id = o.old_id; UPDATE constructcomponentslotannotation t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie; UPDATE constructfullnameslotannotation t SET singleconstruct_id = c.id FROM curieobject c WHERE t.singleconstruct_id = c.old_id; UPDATE constructgenomicentityassociation t SET subject_id = c.id FROM curieobject c WHERE t.subject_id = c.old_id; From f201e9ab96ba21f78895f748c1e4a549e9981cde Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 8 Feb 2024 08:19:28 +0000 Subject: [PATCH 049/159] Fix migration fix --- .../resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql index 57cdea485..933fa867b 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql @@ -726,7 +726,7 @@ UPDATE conditionrelation t SET singlereference_id = i.id FROM informationcontent UPDATE construct t SET id = c.id FROM curieobject c WHERE t.id = c.old_id; UPDATE construct_reference t SET construct_id = c.id FROM curieobject c WHERE t.construct_id = c.old_id; UPDATE construct_reference t SET references_id = i.id FROM informationcontententity i WHERE t.references_curie = i.curie; -UPDATE constructcomponentslotannotation t SET singleconstruct_id = c.id FROM curieobject c WHERE t.singleconstruct_id = o.old_id; +UPDATE constructcomponentslotannotation t SET singleconstruct_id = c.id FROM curieobject c WHERE t.singleconstruct_id = c.old_id; UPDATE constructcomponentslotannotation t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie; UPDATE constructfullnameslotannotation t SET singleconstruct_id = c.id FROM curieobject c WHERE t.singleconstruct_id = c.old_id; UPDATE constructgenomicentityassociation t SET subject_id = c.id FROM curieobject c WHERE t.subject_id = c.old_id; From 0ed871e572af2dd52dd6485ea54acc6e5e0f4e28 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 8 Feb 2024 09:38:27 +0000 Subject: [PATCH 050/159] Use displayText for construct fields --- .../src/containers/constructsPage/ConstructsTable.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/cliapp/src/containers/constructsPage/ConstructsTable.js b/src/main/cliapp/src/containers/constructsPage/ConstructsTable.js index 76abdc862..3f5cc4c1e 100644 --- a/src/main/cliapp/src/containers/constructsPage/ConstructsTable.js +++ b/src/main/cliapp/src/containers/constructsPage/ConstructsTable.js @@ -94,10 +94,10 @@ export const ConstructsTable = () => { <> @@ -157,10 +157,10 @@ export const ConstructsTable = () => { From de19c88d053804abf76341f568a167ecd2eee04c Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Wed, 14 Feb 2024 09:28:28 +0000 Subject: [PATCH 051/159] Refactor association slots and revert to original base tables --- src/main/cliapp/src/constants/FilterFields.js | 8 +- src/main/cliapp/src/constants/SortFields.js | 2 +- .../constructsPage/mockData/mockData.js | 2 +- .../DiseaseAnnotationsTable.js | 22 +- .../mockData/mockData.js | 2 +- .../useNewAnnotationReducer.js | 4 +- .../constants/EntityFieldConstants.java | 5 +- .../dao/AffectedGenomicModelDAO.java | 2 +- .../curation_api/dao/AlleleDAO.java | 2 +- .../curation_api/dao/GeneDAO.java | 2 +- .../model/entities/AGMDiseaseAnnotation.java | 29 +- .../model/entities/AffectedGenomicModel.java | 2 +- .../curation_api/model/entities/Allele.java | 10 +- .../entities/AlleleDiseaseAnnotation.java | 27 +- .../model/entities/BiologicalEntity.java | 23 +- .../model/entities/Construct.java | 6 +- .../model/entities/DiseaseAnnotation.java | 4 +- .../curation_api/model/entities/Gene.java | 10 +- .../model/entities/GeneDiseaseAnnotation.java | 27 +- .../model/entities/GenomicEntity.java | 10 +- .../entities/InformationContentEntity.java | 18 +- .../AlleleGeneAssociation.java | 8 +- .../ConstructGenomicEntityAssociation.java | 8 +- .../model/entities/base/CurieObject.java | 19 +- .../model/entities/base/SubmittedObject.java | 17 +- .../model/entities/ontology/OntologyTerm.java | 17 +- .../services/DiseaseAnnotationService.java | 4 +- .../AlleleGeneAssociationService.java | 10 +- ...structGenomicEntityAssociationService.java | 10 +- .../DiseaseAnnotationUniqueIdHelper.java | 4 +- .../AGMDiseaseAnnotationValidator.java | 16 +- .../AlleleDiseaseAnnotationValidator.java | 16 +- .../services/validation/AlleleValidator.java | 4 +- .../validation/ConstructValidator.java | 2 +- .../DiseaseAnnotationValidator.java | 16 +- .../GeneDiseaseAnnotationValidator.java | 22 +- .../AlleleGeneAssociationValidator.java | 29 +- ...ructGenomicEntityAssociationValidator.java | 32 +- .../dto/AGMDiseaseAnnotationDTOValidator.java | 2 +- .../AlleleDiseaseAnnotationDTOValidator.java | 2 +- .../dto/DiseaseAnnotationDTOValidator.java | 2 +- .../GeneDiseaseAnnotationDTOValidator.java | 2 +- .../AlleleGeneAssociationDTOValidator.java | 8 +- ...tGenomicEntityAssociationDTOValidator.java | 8 +- ...ql => v0.30.0.1__linkml_v2.1.0_update.sql} | 346 +++++------------- .../DiseaseAnnotationBulkUploadITCase.java | 24 +- ...AlleleGeneAssociationBulkUploadITCase.java | 14 +- ...omicEntityAssociationBulkUploadITCase.java | 14 +- .../crud/controllers/AlleleITCase.java | 6 +- .../crud/controllers/ConstructITCase.java | 8 +- .../controllers/DiseaseAnnotationITCase.java | 236 ++++++------ .../AlleleGeneAssociationITCase.java | 76 ++-- ...nstructGenomicEntityAssociationITCase.java | 76 ++-- 53 files changed, 578 insertions(+), 697 deletions(-) rename src/main/resources/db/migration/{v0.30.0.1__linkml_v2.0.0_update.sql => v0.30.0.1__linkml_v2.1.0_update.sql} (80%) diff --git a/src/main/cliapp/src/constants/FilterFields.js b/src/main/cliapp/src/constants/FilterFields.js index 659e5ebd8..ae041d711 100644 --- a/src/main/cliapp/src/constants/FilterFields.js +++ b/src/main/cliapp/src/constants/FilterFields.js @@ -316,14 +316,10 @@ export const FIELD_SETS = Object.freeze({ filterName: "negatedFilter", fields: ["negated"], }, - objectFieldSet: { + objectTermFieldSet: { filterName: "objectFilter", fields: ["object.curie", "object.name"], }, - objectGeneFieldSet: { - filterName: "objectGeneFilter", - fields: ["object.geneSymbol.displayText", "object.geneSymbol.formatText", "object.curie", "object.modEntityId", "object.modInternalId"], - }, obsoleteFieldSet: { filterName: "obsoleteFilter", fields: ["obsolete"], @@ -541,7 +537,7 @@ export const FILTER_CONFIGS = Object.freeze({ modinternalidFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.modinternalidFieldSet] }, nameFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.nameFieldSet] }, namespaceFilterConfig: { filterComponentType: 'input', fieldSets: [FIELD_SETS.namespaceFieldSet] }, - objectFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.objectFieldSet] }, + objectTermFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.objectTermFieldSet] }, ontologySynonymsFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.ontologySynonymsFieldSet] }, pageDescriptionFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.pageDescriptionFieldSet] }, prefixFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.prefixFieldSet]}, diff --git a/src/main/cliapp/src/constants/SortFields.js b/src/main/cliapp/src/constants/SortFields.js index dae432ae8..e46369d7b 100644 --- a/src/main/cliapp/src/constants/SortFields.js +++ b/src/main/cliapp/src/constants/SortFields.js @@ -5,7 +5,7 @@ export const SORT_FIELDS = Object.freeze([ "subject.symbol", "relation.name", "negated", - "object.name", + "objectTerm.name", "singleReference.primaryCrossReferenceCurie", "evidenceCodes.abbreviation", "with.geneSymbol.displayText", diff --git a/src/main/cliapp/src/containers/constructsPage/mockData/mockData.js b/src/main/cliapp/src/containers/constructsPage/mockData/mockData.js index 086c0cd94..d95d67087 100644 --- a/src/main/cliapp/src/containers/constructsPage/mockData/mockData.js +++ b/src/main/cliapp/src/containers/constructsPage/mockData/mockData.js @@ -297,7 +297,7 @@ export const data = { "internal": false, "obsolete": false, "id": 135641224, - "subject": { + "subjectReagent": { "createdBy": { "internal": false, "obsolete": false, diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index a1734dba9..8da27d2c2 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -75,7 +75,7 @@ export const DiseaseAnnotationsTable = () => { let diseaseAnnotationService = new DiseaseAnnotationService(); const sortMapping = { - 'object.name': ['object.curie', 'object.namespace'], + 'objectTerm.name': ['objectTerm.curie', 'objectTerm.namespace'], 'subject.symbol': ['subject.name', 'subject.modEntityId'], 'with.geneSymbol.displayText': ['with.geneFullName.displayText', 'with.modEntityId'], 'sgdStrainBackground.name': ['sgdStrainBackground.modEntityId'], @@ -506,7 +506,7 @@ export const DiseaseAnnotationsTable = () => { const onConditionRelationHandleEditorValueChange = (props, event) => { let updatedAnnotations = [...props.props.value]; - if (typeof event.value === "object") { + if (typeof event.value === "objectTerm") { updatedAnnotations[props.rowIndex].conditionRelations[0] = event.value; } else { updatedAnnotations[props.rowIndex].conditionRelations[0].handle = event.value; @@ -514,11 +514,11 @@ export const DiseaseAnnotationsTable = () => { }; const diseaseBodyTemplate = (rowData) => { - if (rowData.object) { + if (rowData.objectTerm) { return ( <> - {rowData.object.name} ({rowData.object.curie}) - + {rowData.objectTerm.name} ({rowData.objectTerm.curie}) + ) } @@ -883,7 +883,7 @@ export const DiseaseAnnotationsTable = () => { }; const onDiseaseValueChange = (event, setFieldValue, props) => { - defaultAutocompleteOnChange(props, event, "object", setFieldValue); + defaultAutocompleteOnChange(props, event, "objectTerm", setFieldValue); }; const diseaseSearch = (event, setFiltered, setQuery) => { @@ -907,14 +907,14 @@ export const DiseaseAnnotationsTable = () => { <> ); @@ -1323,11 +1323,11 @@ export const DiseaseAnnotationsTable = () => { editor: (props) => negatedEditor(props) }, { - field: "object.name", + field: "objectTerm.name", header: "Disease", body: diseaseBodyTemplate, sortable: true, - filterConfig: FILTER_CONFIGS.objectFilterConfig, + filterConfig: FILTER_CONFIGS.objectTermFilterConfig, editor: (props) => diseaseEditorTemplate(props), }, { diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js index 943c3007a..47ecdba39 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js @@ -67,7 +67,7 @@ export const data = { "dbDateUpdated": "2023-03-16T15:24:38.954678Z", "id": 18394375, "uniqueId": "MGI:5560505|DOID:0050545|AGRKB:101000000827851", - "object": { + "objectTerm": { "internal": false, "obsolete": false, "dbDateUpdated": "2023-04-02T22:02:52.730635Z", diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/useNewAnnotationReducer.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/useNewAnnotationReducer.js index 6744c1e41..b4314705a 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/useNewAnnotationReducer.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/useNewAnnotationReducer.js @@ -11,7 +11,7 @@ const DEFAULT_ANNOTATION = { name: "", }, negated: false, - object: { + objectTerm: { curie: "", }, singleReference: { @@ -52,7 +52,7 @@ const buildAnnotation = (rowData) => { assertedAllele : global.structuredClone(rowData.assertedAllele) || DEFAULT_ANNOTATION.assertedAllele, relation: global.structuredClone(rowData.relation) || DEFAULT_ANNOTATION.relation, negated: rowData.negated || DEFAULT_ANNOTATION.negated, - object: global.structuredClone(rowData.object) || DEFAULT_ANNOTATION.object, + objectTerm: global.structuredClone(rowData.objectTerm) || DEFAULT_ANNOTATION.objectTerm, singleReference: global.structuredClone(rowData.singleReference) || DEFAULT_ANNOTATION.singleReference, evidenceCodes: global.structuredClone(rowData.evidenceCodes) || DEFAULT_ANNOTATION.subject, with: global.structuredClone(rowData.with) || DEFAULT_ANNOTATION.with, diff --git a/src/main/java/org/alliancegenome/curation_api/constants/EntityFieldConstants.java b/src/main/java/org/alliancegenome/curation_api/constants/EntityFieldConstants.java index 2166483da..0e25ec907 100644 --- a/src/main/java/org/alliancegenome/curation_api/constants/EntityFieldConstants.java +++ b/src/main/java/org/alliancegenome/curation_api/constants/EntityFieldConstants.java @@ -4,8 +4,9 @@ public final class EntityFieldConstants { public static final String DATA_PROVIDER = "dataProvider.sourceOrganization.abbreviation"; public static final String SECONDARY_DATA_PROVIDER = "secondaryDataProvider.sourceOrganization.abbreviation"; - public static final String SUBJECT_DATA_PROVIDER = "subject." + DATA_PROVIDER; - public static final String SUBJECT_TAXON = "subject.taxon.curie"; + public static final String SUBJECT_BIOLOGICAL_ENTITY_DATA_PROVIDER = "subjectBiologicalEntity." + DATA_PROVIDER; + public static final String SUBJECT_REAGENT_DATA_PROVIDER = "subjectReagent." + DATA_PROVIDER; + public static final String SUBJECT_BIOLOGICAL_ENTITY_TAXON = "subjectBiologicalEntity.taxon.curie"; public static final String TAXON = "taxon.curie"; } \ No newline at end of file diff --git a/src/main/java/org/alliancegenome/curation_api/dao/AffectedGenomicModelDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/AffectedGenomicModelDAO.java index 45531015e..86aaa016d 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/AffectedGenomicModelDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/AffectedGenomicModelDAO.java @@ -20,7 +20,7 @@ protected AffectedGenomicModelDAO() { public List findReferencingDiseaseAnnotations(Long agmId) { List results = new ArrayList<>(); - Query jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AGMDiseaseAnnotation ada WHERE ada.subject.id = :agmId"); + Query jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AGMDiseaseAnnotation ada WHERE ada.subjectBiologicalEntity.id = :agmId"); jpqlQuery.setParameter("agmId", agmId); for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) results.add(nativeResult.longValue()); diff --git a/src/main/java/org/alliancegenome/curation_api/dao/AlleleDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/AlleleDAO.java index 3a3e75085..9a82f61a8 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/AlleleDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/AlleleDAO.java @@ -19,7 +19,7 @@ protected AlleleDAO() { public List findReferencingDiseaseAnnotationIds(Long alleleId) { List results = new ArrayList<>(); - Query jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AlleleDiseaseAnnotation ada WHERE ada.subject.id = :alleleId"); + Query jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AlleleDiseaseAnnotation ada WHERE ada.subjectBiologicalEntity.id = :alleleId"); jpqlQuery.setParameter("alleleId", alleleId); for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) results.add(nativeResult.longValue()); diff --git a/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java index 7a8ec6eef..b3268b9cb 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java @@ -17,7 +17,7 @@ protected GeneDAO() { } public List findReferencingDiseaseAnnotations(Long geneId) { - Query jpqlQuery = entityManager.createQuery("SELECT gda.id FROM GeneDiseaseAnnotation gda WHERE gda.subject.id = :geneId"); + Query jpqlQuery = entityManager.createQuery("SELECT gda.id FROM GeneDiseaseAnnotation gda WHERE gda.subjectBiologicalEntity.id = :geneId"); jpqlQuery.setParameter("geneId", geneId); List results = (List) jpqlQuery.getResultList(); diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java index 29175913f..9d9580b01 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java @@ -24,6 +24,7 @@ import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import jakarta.persistence.Transient; import lombok.Data; import lombok.EqualsAndHashCode; @@ -36,6 +37,12 @@ @JsonTypeName("AGMDiseaseAnnotation") @OnDelete(action = OnDeleteAction.CASCADE) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotation.class }) +@Table(indexes = { + @Index(name = "AGMDiseaseAnnotation_inferredGene_index", columnList = "inferredGene_id"), + @Index(name = "AGMDiseaseAnnotation_inferredAllele_index", columnList = "inferredAllele_id"), + @Index(name = "AGMDiseaseAnnotation_assertedAllele_index", columnList = "assertedAllele_id"), + @Index(name = "AGMDiseaseAnnotation_SubjectBiologicalEntity_index", columnList = "subjectbiologicalentity_id") +}) public class AGMDiseaseAnnotation extends DiseaseAnnotation { @IndexedEmbedded(includePaths = {"name", "name_keyword", "curie", "curie_keyword", "modEntityId", "modEntityId_keyword", "modInternalId", "modInternalId_keyword"}) @@ -44,7 +51,7 @@ public class AGMDiseaseAnnotation extends DiseaseAnnotation { @Fetch(FetchMode.SELECT) @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) - private AffectedGenomicModel subject; + private AffectedGenomicModel subjectBiologicalEntity; @IndexedEmbedded(includePaths = { "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", @@ -105,39 +112,39 @@ public class AGMDiseaseAnnotation extends DiseaseAnnotation { @Override @JsonIgnore public String getSubjectCurie() { - if (subject == null) + if (subjectBiologicalEntity == null) return null; - return subject.getCurie(); + return subjectBiologicalEntity.getCurie(); } @Transient @Override @JsonIgnore public String getSubjectTaxonCurie() { - if (subject == null) + if (subjectBiologicalEntity == null) return null; - if (subject.getTaxon() == null) + if (subjectBiologicalEntity.getTaxon() == null) return null; - return subject.getTaxon().getCurie(); + return subjectBiologicalEntity.getTaxon().getCurie(); } @Transient @Override @JsonIgnore public String getSubjectIdentifier() { - if (subject == null) + if (subjectBiologicalEntity == null) return null; - return subject.getIdentifier(); + return subjectBiologicalEntity.getIdentifier(); } @Transient @Override @JsonIgnore public String getSubjectSpeciesName() { - if (subject == null) + if (subjectBiologicalEntity == null) return null; - if (subject.getTaxon() == null) + if (subjectBiologicalEntity.getTaxon() == null) return null; - return subject.getTaxon().getGenusSpecies(); + return subjectBiologicalEntity.getTaxon().getGenusSpecies(); } } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java index 92891c4b1..e724af809 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java @@ -35,7 +35,7 @@ public class AffectedGenomicModel extends GenomicEntity { @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) private String name; - @OneToMany(mappedBy = "subject", cascade = CascadeType.ALL, orphanRemoval = true) + @OneToMany(mappedBy = "subjectBiologicalEntity", cascade = CascadeType.ALL, orphanRemoval = true) private List agmDiseaseAnnotations; @IndexedEmbedded(includePaths = {"name", "name_keyword"}) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java index be26e3b20..3a87afd84 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java @@ -79,7 +79,7 @@ public class Allele extends GenomicEntity { @JsonView({ View.FieldsOnly.class }) private Boolean isExtinct; - @OneToMany(mappedBy = "subject", cascade = CascadeType.ALL) + @OneToMany(mappedBy = "subjectBiologicalEntity", cascade = CascadeType.ALL) private List alleleDiseaseAnnotations; @IndexedEmbedded(includePaths = { "mutationTypes.curie", "mutationTypes.name", "evidence.curie", "mutationTypes.curie_keyword", "mutationTypes.name_keyword", "evidence.curie_keyword"}) @@ -142,10 +142,10 @@ public class Allele extends GenomicEntity { @JsonView({ View.FieldsAndLists.class, View.AlleleView.class }) private List alleleNomenclatureEvents; - @IndexedEmbedded(includePaths = {"object.curie", "object.geneSymbol.displayText", "object.geneSymbol.formatText", "object.geneFullName.displayText", "object.geneFullName.formatText", - "object.curie_keyword", "object.geneSymbol.displayText_keyword", "object.geneSymbol.formatText_keyword", "object.geneFullName.displayText_keyword", "object.geneFullName.formatText_keyword", - "object.modEntityId", "object.modInternalId", "object.modEntityId_keyword", "object.modInternalId_keyword" }) - @OneToMany(mappedBy = "subject", cascade = CascadeType.ALL, orphanRemoval = true) + @IndexedEmbedded(includePaths = {"objectBiologicalEntity.curie", "objectBiologicalEntity.geneSymbol.displayText", "objectBiologicalEntity.geneSymbol.formatText", "objectBiologicalEntity.geneFullName.displayText", "objectBiologicalEntity.geneFullName.formatText", + "objectBiologicalEntity.curie_keyword", "objectBiologicalEntity.geneSymbol.displayText_keyword", "objectBiologicalEntity.geneSymbol.formatText_keyword", "objectBiologicalEntity.geneFullName.displayText_keyword", "objectBiologicalEntity.geneFullName.formatText_keyword", + "objectBiologicalEntity.modEntityId", "objectBiologicalEntity.modInternalId", "objectBiologicalEntity.modEntityId_keyword", "objectBiologicalEntity.modInternalId_keyword" }) + @OneToMany(mappedBy = "subjectBiologicalEntity", cascade = CascadeType.ALL, orphanRemoval = true) @JsonView({ View.FieldsAndLists.class, View.AlleleDetailView.class }) private List alleleGeneAssociations; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java index 143ac563a..fc7777f45 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java @@ -37,7 +37,10 @@ @JsonTypeName("AlleleDiseaseAnnotation") @OnDelete(action = OnDeleteAction.CASCADE) @AGRCurationSchemaVersion(min = "1.3.2", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotation.class }) -@Table(indexes = { @Index(name = "AlleleDiseaseAnnotation_inferredGene_index", columnList = "inferredGene_id"), @Index(name = "AlleleDiseaseAnnotation_Subject_index", columnList = "subject_id")}) +@Table(indexes = { + @Index(name = "AlleleDiseaseAnnotation_inferredGene_index", columnList = "inferredGene_id"), + @Index(name = "AlleleDiseaseAnnotation_SubjectBiologicalEntity_index", columnList = "subjectbiologicalentity_id") +}) public class AlleleDiseaseAnnotation extends DiseaseAnnotation { @IndexedEmbedded(includePaths = { @@ -52,7 +55,7 @@ public class AlleleDiseaseAnnotation extends DiseaseAnnotation { @Fetch(FetchMode.SELECT) @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) - private Allele subject; + private Allele subjectBiologicalEntity; @IndexedEmbedded(includePaths = { "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", @@ -90,39 +93,39 @@ public class AlleleDiseaseAnnotation extends DiseaseAnnotation { @Override @JsonIgnore public String getSubjectCurie() { - if (subject == null) + if (subjectBiologicalEntity == null) return null; - return subject.getCurie(); + return subjectBiologicalEntity.getCurie(); } @Transient @Override @JsonIgnore public String getSubjectTaxonCurie() { - if (subject == null) + if (subjectBiologicalEntity == null) return null; - if (subject.getTaxon() == null) + if (subjectBiologicalEntity.getTaxon() == null) return null; - return subject.getTaxon().getCurie(); + return subjectBiologicalEntity.getTaxon().getCurie(); } @Transient @Override @JsonIgnore public String getSubjectIdentifier() { - if (subject == null) + if (subjectBiologicalEntity == null) return null; - return subject.getIdentifier(); + return subjectBiologicalEntity.getIdentifier(); } @Transient @Override @JsonIgnore public String getSubjectSpeciesName() { - if (subject == null) + if (subjectBiologicalEntity == null) return null; - if (subject.getTaxon() == null) + if (subjectBiologicalEntity.getTaxon() == null) return null; - return subject.getTaxon().getGenusSpecies(); + return subjectBiologicalEntity.getTaxon().getGenusSpecies(); } } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java index 54ede0bf9..dfe6f3891 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/BiologicalEntity.java @@ -18,12 +18,16 @@ import jakarta.persistence.Entity; import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +@Inheritance(strategy = InheritanceType.JOINED) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") @JsonSubTypes({ @JsonSubTypes.Type(value = AffectedGenomicModel.class, name = "AffectedGenomicModel"), @JsonSubTypes.Type(value = Allele.class, name = "Allele"), @JsonSubTypes.Type(value = Gene.class, name = "Gene"), @JsonSubTypes.Type(value = Variant.class, name = "Variant") }) @@ -33,9 +37,22 @@ @EqualsAndHashCode(callSuper = true, onlyExplicitlyIncluded = true) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { SubmittedObject.class }) -@Table(indexes = { - @Index(name = "biologicalentity_taxon_index", columnList = "taxon_id") -}) +@Table( + indexes = { + @Index(name = "biologicalentity_taxon_index", columnList = "taxon_id"), + @Index(name = "biologicalentity_curie_index", columnList = "curie"), + @Index(name = "biologicalentity_createdby_index", columnList = "createdBy_id"), + @Index(name = "biologicalentity_updatedby_index", columnList = "updatedBy_id"), + @Index(name = "biologicalentity_modentityid_index", columnList = "modentityid"), + @Index(name = "biologicalentity_modinternalid_index", columnList = "modinternalid"), + @Index(name = "biologicalentity_dataprovider_index", columnList = "dataprovider_id"), + }, + uniqueConstraints = { + @UniqueConstraint(name = "biologicalentity_curie_uk", columnNames = "curie"), + @UniqueConstraint(name = "biologicalentity_modentityid_uk", columnNames = "modentityid"), + @UniqueConstraint(name = "biologicalentity_modinternalid_uk", columnNames = "modinternalid") + } +) public class BiologicalEntity extends SubmittedObject { @IndexedEmbedded(includePaths = {"name", "curie", "name_keyword", "curie_keyword"}) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java index cce768085..0e5c5b416 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java @@ -74,9 +74,9 @@ public class Construct extends Reagent { @JsonView({ View.FieldsAndLists.class, View.ConstructView.class }) private List constructComponents; - @IndexedEmbedded(includePaths = {"object.curie", "object.name", "object.symbol", "relation.name", - "object.curie_keyword", "object.name_keyword", "object.symbol_keyword", "relation.name_keyword"}) - @OneToMany(mappedBy = "subject", cascade = CascadeType.ALL, orphanRemoval = true) + @IndexedEmbedded(includePaths = {"objectBiologicalEntity.curie", "objectBiologicalEntity.name", "objectBiologicalEntity.symbol", "relation.name", + "objectBiologicalEntity.curie_keyword", "objectBiologicalEntity.name_keyword", "objectBiologicalEntity.symbol_keyword", "relation.name_keyword"}) + @OneToMany(mappedBy = "subjectReagent", cascade = CascadeType.ALL, orphanRemoval = true) @JsonView({ View.FieldsAndLists.class, View.ConstructView.class }) private List constructGenomicEntityAssociations; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java index 19cb992bd..a5fd8e684 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java @@ -48,7 +48,7 @@ @Schema(name = "Disease_Annotation", description = "Annotation class representing a disease annotation") @Table(indexes = { - @Index(name = "DiseaseAnnotation_object_index", columnList = "object_id"), + @Index(name = "DiseaseAnnotation_objectontologyterm_index", columnList = "objectontologyterm_id"), @Index(name = "DiseaseAnnotation_relation_index", columnList = "relation_id"), @Index(name = "DiseaseAnnotation_annotationType_index", columnList = "annotationType_id"), @Index(name = "DiseaseAnnotation_geneticSex_index", columnList = "geneticSex_id"), @@ -64,7 +64,7 @@ public abstract class DiseaseAnnotation extends Annotation { @ManyToOne @Fetch(FetchMode.SELECT) @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) - private DOTerm object; + private DOTerm objectOntologyTerm; @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer", valueBridge = @ValueBridgeRef(type = BooleanValueBridge.class)) @KeywordField(name = "negated_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, valueBridge = @ValueBridgeRef(type = BooleanValueBridge.class)) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java index 7f6ea8094..3864532e6 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java @@ -44,7 +44,7 @@ public class Gene extends GenomicEntity { @JsonView({ View.FieldsOnly.class }) private SOTerm geneType; - @OneToMany(mappedBy = "subject", cascade = CascadeType.ALL, orphanRemoval = true) + @OneToMany(mappedBy = "subjectBiologicalEntity", cascade = CascadeType.ALL, orphanRemoval = true) private List geneDiseaseAnnotations; @IndexedEmbedded(includePaths = { "displayText", "formatText", "nameType.name", "synonymScope.name", "evidence.curie", "displayText_keyword", "formatText_keyword", "nameType.name_keyword", "synonymScope.name_keyword", "evidence.curie_keyword"}) @@ -77,10 +77,10 @@ public class Gene extends GenomicEntity { @JsonView({ View.FieldsAndLists.class, View.GeneView.class }) private List geneSecondaryIds; - @IndexedEmbedded(includePaths = {"subject.curie", "subject.alleleSymbol.displayText", "subject.alleleSymbol.formatText", "subject.alleleFullName.displayText", "subject.alleleFullName.formatText", - "subject.curie_keyword", "subject.alleleSymbol.displayText_keyword", "subject.alleleSymbol.formatText_keyword", "subject.alleleFullName.displayText_keyword", "subject.alleleFullName.formatText_keyword", - "subject.modEntityId", "subject.modInternalId", "subject.modEntityId_keyword", "subject.modInternalId_keyword"}) - @OneToMany(mappedBy = "object", cascade = CascadeType.ALL, orphanRemoval = true) + @IndexedEmbedded(includePaths = {"subjectBiologicalEntity.curie", "subjectBiologicalEntity.alleleSymbol.displayText", "subjectBiologicalEntity.alleleSymbol.formatText", "subjectBiologicalEntity.alleleFullName.displayText", "subjectBiologicalEntity.alleleFullName.formatText", + "subjectBiologicalEntity.curie_keyword", "subjectBiologicalEntity.alleleSymbol.displayText_keyword", "subjectBiologicalEntity.alleleSymbol.formatText_keyword", "subjectBiologicalEntity.alleleFullName.displayText_keyword", "subjectBiologicalEntity.alleleFullName.formatText_keyword", + "subjectBiologicalEntity.modEntityId", "subjectBiologicalEntity.modInternalId", "subjectBiologicalEntity.modEntityId_keyword", "subjectBiologicalEntity.modInternalId_keyword"}) + @OneToMany(mappedBy = "objectBiologicalEntity", cascade = CascadeType.ALL, orphanRemoval = true) @JsonView({ View.FieldsAndLists.class, View.GeneDetailView.class }) private List alleleGeneAssociations; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java index b9b575cb2..21ead0348 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java @@ -16,7 +16,9 @@ import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Entity; +import jakarta.persistence.Index; import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import jakarta.persistence.Transient; import lombok.Data; import lombok.EqualsAndHashCode; @@ -29,6 +31,9 @@ @JsonTypeName("GeneDiseaseAnnotation") @OnDelete(action = OnDeleteAction.CASCADE) @AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotation.class }) +@Table(indexes = { + @Index(name = "GeneDiseaseAnnotation_SubjectBiologicalEntity_index", columnList = "subjectbiologicalentity_id") +}) public class GeneDiseaseAnnotation extends DiseaseAnnotation { @IndexedEmbedded(includePaths = { @@ -43,7 +48,7 @@ public class GeneDiseaseAnnotation extends DiseaseAnnotation { @ManyToOne @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) - private Gene subject; + private Gene subjectBiologicalEntity; @IndexedEmbedded(includePaths = {"name", "name_keyword", "curie", "curie_keyword", "modEntityId", "modEntityId_keyword", "modInternalId", "modInternalId_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @@ -55,39 +60,39 @@ public class GeneDiseaseAnnotation extends DiseaseAnnotation { @Override @JsonIgnore public String getSubjectCurie() { - if (subject == null) + if (subjectBiologicalEntity == null) return null; - return subject.getCurie(); + return subjectBiologicalEntity.getCurie(); } @Transient @Override @JsonIgnore public String getSubjectTaxonCurie() { - if (subject == null) + if (subjectBiologicalEntity == null) return null; - if (subject.getTaxon() == null) + if (subjectBiologicalEntity.getTaxon() == null) return null; - return subject.getTaxon().getCurie(); + return subjectBiologicalEntity.getTaxon().getCurie(); } @Transient @Override @JsonIgnore public String getSubjectIdentifier() { - if (subject == null) + if (subjectBiologicalEntity == null) return null; - return subject.getIdentifier(); + return subjectBiologicalEntity.getIdentifier(); } @Transient @Override @JsonIgnore public String getSubjectSpeciesName() { - if (subject == null) + if (subjectBiologicalEntity == null) return null; - if (subject.getTaxon() == null) + if (subjectBiologicalEntity.getTaxon() == null) return null; - return subject.getTaxon().getGenusSpecies(); + return subjectBiologicalEntity.getTaxon().getGenusSpecies(); } } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java index e4b2707f5..5baacdb92 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java @@ -40,11 +40,11 @@ public class GenomicEntity extends BiologicalEntity { private List crossReferences; - @IndexedEmbedded(includePaths = {"subject.curie", "subject.constructSymbol.displayText", "subject.constructSymbol.formatText", - "subject.constructFullName.displayText", "subject.constructFullName.formatText", "subject.modEntityId", - "subject.curie_keyword", "subject.constructSymbol.displayText_keyword", "subject.constructSymbol.formatText_keyword", - "subject.constructFullName.displayText_keyword", "subject.constructFullName.formatText_keyword", "subject.modEntityId_keyword",}) - @OneToMany(mappedBy = "object", cascade = CascadeType.ALL, orphanRemoval = true) + @IndexedEmbedded(includePaths = {"subjectReagent.curie", "subjectReagent.constructSymbol.displayText", "subjectReagent.constructSymbol.formatText", + "subjectReagent.constructFullName.displayText", "subjectReagent.constructFullName.formatText", "subjectReagent.modEntityId", + "subjectReagent.curie_keyword", "subjectReagent.constructSymbol.displayText_keyword", "subjectReagent.constructSymbol.formatText_keyword", + "subjectReagent.constructFullName.displayText_keyword", "subjectReagent.constructFullName.formatText_keyword", "subjectReagent.modEntityId_keyword",}) + @OneToMany(mappedBy = "objectBiologicalEntity", cascade = CascadeType.ALL, orphanRemoval = true) @JsonView({ View.FieldsAndLists.class, View.GeneDetailView.class }) private List constructGenomicEntityAssociations; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java index f0d3e3bf5..10443d8b7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/InformationContentEntity.java @@ -9,17 +9,33 @@ import com.fasterxml.jackson.annotation.JsonSubTypes; import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +@Inheritance(strategy = InheritanceType.JOINED) @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @JsonIgnoreProperties(ignoreUnknown = true) @ToString(callSuper = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Reference.class, name = "Reference") }) -@AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) +@AGRCurationSchemaVersion(min = "1.4.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { CurieObject.class }) +@Table( + indexes = { + @Index(name = "informationcontententity_curie_index", columnList = "curie"), + @Index(name = "informationcontententity_createdby_index", columnList = "createdBy_id"), + @Index(name = "informationcontententity_updatedby_index", columnList = "updatedBy_id"), + }, + uniqueConstraints = { + @UniqueConstraint(name = "informationcontententity_curie_uk", columnNames = "curie") + } +) public class InformationContentEntity extends CurieObject { } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java index 321f121c6..e452fcbe7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java @@ -30,8 +30,8 @@ @AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AlleleGenomicEntityAssociation.class }) @Schema(name = "AlleleGeneAssociation", description = "POJO representing an association between an allele and a gene") @Table(indexes = { - @Index(name = "allelegeneassociation_subject_index", columnList = "subject_id"), - @Index(name = "allelegeneassociation_object_index", columnList = "object_id") + @Index(name = "allelegeneassociation_subjectbiologicalentity_index", columnList = "subjectbiologicalentity_id"), + @Index(name = "allelegeneassociation_objectbiologicalentity_index", columnList = "objectbiologicalentity_id") }) public class AlleleGeneAssociation extends AlleleGenomicEntityAssociation { @@ -42,7 +42,7 @@ public class AlleleGeneAssociation extends AlleleGenomicEntityAssociation { @JsonView({ View.FieldsOnly.class }) @JsonIgnoreProperties("alleleGeneAssociations") @Fetch(FetchMode.JOIN) - private Allele subject; + private Allele subjectBiologicalEntity; @IndexedEmbedded(includePaths = {"curie", "geneSymbol.displayText", "geneSymbol.formatText", "geneFullName.displayText", "geneFullName.formatText", "curie_keyword", "geneSymbol.displayText_keyword", "geneSymbol.formatText_keyword", "geneFullName.displayText_keyword", "geneFullName.formatText_keyword", @@ -51,5 +51,5 @@ public class AlleleGeneAssociation extends AlleleGenomicEntityAssociation { @ManyToOne @JsonView({ View.FieldsOnly.class }) @JsonIgnoreProperties({"alleleGeneAssociations", "constructGenomicEntityAssociations"}) - private Gene object; + private Gene objectBiologicalEntity; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java index 121e4142a..737ea0e41 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java @@ -39,8 +39,8 @@ @AGRCurationSchemaVersion(min = "1.11.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { EvidenceAssociation.class }) @Schema(name = "ConstructGenomicEntityAssociation", description = "POJO representing an association between a construct and a genomic entity") @Table(indexes = { - @Index(name = "constructgenomicentityassociation_subject_index", columnList = "subject_id"), - @Index(name = "constructgenomicentityassociation_object_index", columnList = "object_id"), + @Index(name = "constructgenomicentityassociation_subjectreagent_index", columnList = "subjectreagent_id"), + @Index(name = "constructgenomicentityassociation_objectbiologicalentity_index", columnList = "objectbiologicalentity_id"), @Index(name = "constructgenomicentityassociation_relation_index", columnList = "relation_id") }) public class ConstructGenomicEntityAssociation extends EvidenceAssociation { @@ -53,7 +53,7 @@ public class ConstructGenomicEntityAssociation extends EvidenceAssociation { @JsonView({ View.FieldsOnly.class }) @JsonIgnoreProperties("constructGenomicEntityAssociations") @Fetch(FetchMode.JOIN) - private Construct subject; + private Construct subjectReagent; @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @@ -66,7 +66,7 @@ public class ConstructGenomicEntityAssociation extends EvidenceAssociation { @OneToOne @JsonView({ View.FieldsOnly.class }) @JsonIgnoreProperties({"alleleGeneAssociations", "constructGenomicEntityAssociations"}) - private GenomicEntity object; + private GenomicEntity objectBiologicalEntity; @IndexedEmbedded(includePaths = {"freeText", "noteType.name", "references.curie", "references.primaryCrossReferenceCurie", "freeText_keyword", "noteType.name_keyword", "references.curie_keyword", diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java index e12315ab2..c98d77d8d 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/CurieObject.java @@ -12,34 +12,19 @@ import com.fasterxml.jackson.annotation.JsonView; -import jakarta.persistence.DiscriminatorColumn; -import jakarta.persistence.Entity; import jakarta.persistence.Index; -import jakarta.persistence.Inheritance; -import jakarta.persistence.InheritanceType; +import jakarta.persistence.MappedSuperclass; import jakarta.persistence.Table; import jakarta.persistence.UniqueConstraint; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@Inheritance(strategy = InheritanceType.JOINED) -@DiscriminatorColumn(name = "curieObjectType") -@Entity +@MappedSuperclass @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AuditedObject.class }) -@Table(indexes = { - @Index(name = "curieobject_curie_index", columnList = "curie"), - @Index(name = "curieobject_createdby_index", columnList = "createdBy_id"), - @Index(name = "curieobject_updatedby_index", columnList = "updatedBy_id"), - @Index(name = "curieobject_curieObjectType_index", columnList = "curieObjectType") - }, - uniqueConstraints = { - @UniqueConstraint(name = "curieobject_curie_uk", columnNames = "curie") - } -) @Schema(name = "CurieObject", description = "POJO that represents the CurieObject") public class CurieObject extends AuditedObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java index f6aa32f87..620aec042 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/base/SubmittedObject.java @@ -20,31 +20,18 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonView; -import jakarta.persistence.Entity; -import jakarta.persistence.Index; import jakarta.persistence.ManyToOne; -import jakarta.persistence.Table; +import jakarta.persistence.MappedSuperclass; import jakarta.persistence.Transient; -import jakarta.persistence.UniqueConstraint; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -@Entity +@MappedSuperclass @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { CurieObject.class }) -@Table(indexes = { - @Index(name = "submittedobject_modentityid_index", columnList = "modentityid"), - @Index(name = "submittedobject_modinternalid_index", columnList = "modinternalid"), - @Index(name = "submittedobject_dataprovider_index", columnList = "dataprovider_id"), - }, - uniqueConstraints = { - @UniqueConstraint(name = "submittedobject_modentityid_uk", columnNames = "modentityid"), - @UniqueConstraint(name = "submittedobject_modinternalid_uk", columnNames = "modinternalid") - } -) @Schema(name = "SubmittedObject", description = "POJO that represents the SubmittedObject") public class SubmittedObject extends CurieObject { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java index 06d345d2c..49ab3da5a 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java @@ -26,18 +26,33 @@ import jakarta.persistence.ElementCollection; import jakarta.persistence.Entity; import jakarta.persistence.Index; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; +import jakarta.persistence.Table; import jakarta.persistence.Transient; +import jakarta.persistence.UniqueConstraint; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; +@Inheritance(strategy = InheritanceType.JOINED) @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @Entity @ToString(exclude = { "isaParents", "isaChildren", "isaAncestors", "isaDescendants", "crossReferences", "synonyms", "secondaryIdentifiers", "subsets" }, callSuper = true) -@AGRCurationSchemaVersion(min = LinkMLSchemaConstants.MIN_ONTOLOGY_RELEASE, max = LinkMLSchemaConstants.MAX_ONTOLOGY_RELEASE, dependencies = { AuditedObject.class }) +@AGRCurationSchemaVersion(min = LinkMLSchemaConstants.MIN_ONTOLOGY_RELEASE, max = LinkMLSchemaConstants.MAX_ONTOLOGY_RELEASE, dependencies = { CurieObject.class }) +@Table( + indexes = { + @Index(name = "ontologyterm_curie_index", columnList = "curie"), + @Index(name = "ontologyterm_createdby_index", columnList = "createdBy_id"), + @Index(name = "ontologyterm_updatedby_index", columnList = "updatedBy_id"), + }, + uniqueConstraints = { + @UniqueConstraint(name = "ontologyterm_curie_uk", columnNames = "curie") + } +) public class OntologyTerm extends CurieObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") diff --git a/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java index 4c7dae1ff..a9aa8378f 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java @@ -141,7 +141,7 @@ protected > List getAnnotationIdsByDataProvider(D params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider.sourceOrganization); if(StringUtils.equals(dataProvider.sourceOrganization, "RGD")) - params.put(EntityFieldConstants.SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); + params.put(EntityFieldConstants.SUBJECT_BIOLOGICAL_ENTITY_TAXON, dataProvider.canonicalTaxonCurie); List annotationIds = dao.findFilteredIds(params); annotationIds.removeIf(Objects::isNull); @@ -149,7 +149,7 @@ protected > List getAnnotationIdsByDataProvider(D if (StringUtils.equals(dataProvider.toString(), "HUMAN")) { Map newParams = new HashMap<>(); newParams.put(EntityFieldConstants.SECONDARY_DATA_PROVIDER, dataProvider.sourceOrganization); - newParams.put(EntityFieldConstants.SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); + newParams.put(EntityFieldConstants.SUBJECT_BIOLOGICAL_ENTITY_TAXON, dataProvider.canonicalTaxonCurie); List additionalIds = dao.findFilteredIds(newParams); annotationIds.addAll(additionalIds); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java b/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java index b71fa256f..be227349f 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java @@ -96,7 +96,7 @@ public AlleleGeneAssociation upsert(AlleleGeneAssociationDTO dto, BackendBulkDat public List getAssociationsByDataProvider(BackendBulkDataProvider dataProvider) { Map params = new HashMap<>(); - params.put(EntityFieldConstants.SUBJECT_DATA_PROVIDER, dataProvider.sourceOrganization); + params.put(EntityFieldConstants.SUBJECT_BIOLOGICAL_ENTITY_DATA_PROVIDER, dataProvider.sourceOrganization); List associationIds = alleleGeneAssociationDAO.findFilteredIds(params); associationIds.removeIf(Objects::isNull); @@ -145,9 +145,9 @@ public ObjectResponse getAssociation(Long alleleId, Strin AlleleGeneAssociation association = null; Map params = new HashMap<>(); - params.put("subject.id", alleleId); + params.put("subjectBiologicalEntity.id", alleleId); params.put("relation.name", relationName); - params.put("object.id", geneId); + params.put("objectBiologicalEntity.id", geneId); SearchResponse resp = alleleGeneAssociationDAO.findByParams(params); if (resp != null && resp.getSingleResult() != null) @@ -160,7 +160,7 @@ public ObjectResponse getAssociation(Long alleleId, Strin } private void addAssociationToAllele(AlleleGeneAssociation association) { - Allele allele = association.getSubject(); + Allele allele = association.getSubjectBiologicalEntity(); List currentAssociations = allele.getAlleleGeneAssociations(); if (currentAssociations == null) currentAssociations = new ArrayList<>(); @@ -172,7 +172,7 @@ private void addAssociationToAllele(AlleleGeneAssociation association) { } private void addAssociationToGene(AlleleGeneAssociation association) { - Gene gene = association.getObject(); + Gene gene = association.getObjectBiologicalEntity(); List currentAssociations = gene.getAlleleGeneAssociations(); if (currentAssociations == null) currentAssociations = new ArrayList<>(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java b/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java index 517ccbb41..db9ba6d37 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java @@ -87,7 +87,7 @@ public ConstructGenomicEntityAssociation upsert(ConstructGenomicEntityAssociatio public List getAssociationsByDataProvider(BackendBulkDataProvider dataProvider) { Map params = new HashMap<>(); - params.put(EntityFieldConstants.SUBJECT_DATA_PROVIDER, dataProvider.sourceOrganization); + params.put(EntityFieldConstants.SUBJECT_REAGENT_DATA_PROVIDER, dataProvider.sourceOrganization); List associationIds = constructGenomicEntityAssociationDAO.findFilteredIds(params); associationIds.removeIf(Objects::isNull); @@ -130,9 +130,9 @@ public ObjectResponse getAssociation(Long con ConstructGenomicEntityAssociation association = null; Map params = new HashMap<>(); - params.put("subject.id", constructId); + params.put("subjectReagent.id", constructId); params.put("relation.name", relationName); - params.put("object.id", genomicEntityId); + params.put("objectBiologicalEntity.id", genomicEntityId); SearchResponse resp = constructGenomicEntityAssociationDAO.findByParams(params); if (resp != null && resp.getSingleResult() != null) @@ -145,7 +145,7 @@ public ObjectResponse getAssociation(Long con } private void addAssociationToConstruct(ConstructGenomicEntityAssociation association) { - Construct construct = association.getSubject(); + Construct construct = association.getSubjectReagent(); List currentAssociations = construct.getConstructGenomicEntityAssociations(); if (currentAssociations == null) currentAssociations = new ArrayList<>(); @@ -157,7 +157,7 @@ private void addAssociationToConstruct(ConstructGenomicEntityAssociation associa } private void addAssociationToGenomicEntity(ConstructGenomicEntityAssociation association) { - GenomicEntity genomicEntity = association.getObject(); + GenomicEntity genomicEntity = association.getObjectBiologicalEntity(); List currentAssociations = genomicEntity.getConstructGenomicEntityAssociations(); if (currentAssociations == null) currentAssociations = new ArrayList<>(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java index 5c5a4175c..bb120f6c3 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java @@ -82,8 +82,8 @@ public static String getDiseaseAnnotationUniqueId(DiseaseAnnotation annotation) uniqueId.add(annotation.getRelation().getName()); if (annotation.getNegated() != null) uniqueId.add(annotation.getNegated().toString()); - if (annotation.getObject() != null) - uniqueId.add(annotation.getObject().getCurie()); + if (annotation.getObjectOntologyTerm() != null) + uniqueId.add(annotation.getObjectOntologyTerm().getCurie()); if (annotation.getSingleReference()!= null) uniqueId.add(annotation.getSingleReference().getCurie()); if (CollectionUtils.isNotEmpty(annotation.getEvidenceCodes())) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java index 8eca03f0b..5a17ead07 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java @@ -72,7 +72,7 @@ public AGMDiseaseAnnotation validateAnnotationCreate(AGMDiseaseAnnotation uiEnti public AGMDiseaseAnnotation validateAnnotation(AGMDiseaseAnnotation uiEntity, AGMDiseaseAnnotation dbEntity) { AffectedGenomicModel subject = validateSubject(uiEntity, dbEntity); - dbEntity.setSubject(subject); + dbEntity.setSubjectBiologicalEntity(subject); Gene inferredGene = validateInferredGene(uiEntity, dbEntity); dbEntity.setInferredGene(inferredGene); @@ -100,21 +100,21 @@ public AGMDiseaseAnnotation validateAnnotation(AGMDiseaseAnnotation uiEntity, AG } private AffectedGenomicModel validateSubject(AGMDiseaseAnnotation uiEntity, AGMDiseaseAnnotation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getSubject())) { - addMessageResponse("subject", ValidationConstants.REQUIRED_MESSAGE); + if (ObjectUtils.isEmpty(uiEntity.getSubjectBiologicalEntity())) { + addMessageResponse("subjectBiologicalEntity", ValidationConstants.REQUIRED_MESSAGE); return null; } AffectedGenomicModel subjectEntity = null; - if (uiEntity.getSubject().getId() != null) - subjectEntity = affectedGenomicModelDAO.find(uiEntity.getSubject().getId()); + if (uiEntity.getSubjectBiologicalEntity().getId() != null) + subjectEntity = affectedGenomicModelDAO.find(uiEntity.getSubjectBiologicalEntity().getId()); if (subjectEntity == null) { - addMessageResponse("subject", ValidationConstants.INVALID_MESSAGE); + addMessageResponse("subjectBiologicalEntity", ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubject() == null || !subjectEntity.getId().equals(dbEntity.getSubject().getId()))) { - addMessageResponse("subject", ValidationConstants.OBSOLETE_MESSAGE); + if (subjectEntity.getObsolete() && (dbEntity.getSubjectBiologicalEntity() == null || !subjectEntity.getId().equals(dbEntity.getSubjectBiologicalEntity().getId()))) { + addMessageResponse("subjectBiologicalEntity", ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java index 4d4fc4aed..9194bde87 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java @@ -67,7 +67,7 @@ public AlleleDiseaseAnnotation validateAnnotationCreate(AlleleDiseaseAnnotation public AlleleDiseaseAnnotation validateAnnotation(AlleleDiseaseAnnotation uiEntity, AlleleDiseaseAnnotation dbEntity) { Allele subject = validateSubject(uiEntity, dbEntity); - dbEntity.setSubject(subject); + dbEntity.setSubjectBiologicalEntity(subject); Gene inferredGene = validateInferredGene(uiEntity, dbEntity); dbEntity.setInferredGene(inferredGene); @@ -89,21 +89,21 @@ public AlleleDiseaseAnnotation validateAnnotation(AlleleDiseaseAnnotation uiEnti } private Allele validateSubject(AlleleDiseaseAnnotation uiEntity, AlleleDiseaseAnnotation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getSubject())) { - addMessageResponse("subject", ValidationConstants.REQUIRED_MESSAGE); + if (ObjectUtils.isEmpty(uiEntity.getSubjectBiologicalEntity())) { + addMessageResponse("subjectBiologicalEntity", ValidationConstants.REQUIRED_MESSAGE); return null; } Allele subjectEntity = null; - if (uiEntity.getSubject().getId() != null) - subjectEntity = alleleDAO.find(uiEntity.getSubject().getId()); + if (uiEntity.getSubjectBiologicalEntity().getId() != null) + subjectEntity = alleleDAO.find(uiEntity.getSubjectBiologicalEntity().getId()); if (subjectEntity == null) { - addMessageResponse("subject", ValidationConstants.INVALID_MESSAGE); + addMessageResponse("subjectBiologicalEntity", ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubject() == null || !subjectEntity.getId().equals(dbEntity.getSubject().getId()))) { - addMessageResponse("subject", ValidationConstants.OBSOLETE_MESSAGE); + if (subjectEntity.getObsolete() && (dbEntity.getSubjectBiologicalEntity() == null || !subjectEntity.getId().equals(dbEntity.getSubjectBiologicalEntity().getId()))) { + addMessageResponse("subjectBiologicalEntity", ValidationConstants.OBSOLETE_MESSAGE); return null; } return subjectEntity; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java index d09df0f0a..2d804a3f2 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java @@ -614,7 +614,7 @@ private List validateAlleleGeneAssociations(Allele uiEnti response.addErrorMessages(field, ix, gaResponse.getErrorMessages()); } else { ga = gaResponse.getEntity(); - ga.setSubject(dbEntity); + ga.setSubjectBiologicalEntity(dbEntity); validatedGeneAssociations.add(ga); } } @@ -627,7 +627,7 @@ private List validateAlleleGeneAssociations(Allele uiEnti idsToDelete.removeAll(uiIDs); for(AlleleGeneAssociation ga: dbAssociations){ if(idsToDelete.contains(ga.getId())){ - Gene gene = ga.getObject(); + Gene gene = ga.getObjectBiologicalEntity(); List geneAssociations = gene.getAlleleGeneAssociations(); geneAssociations.removeIf(geneAGA -> { return idsToDelete.contains(geneAGA.getId()); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ConstructValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ConstructValidator.java index a62d515ec..5c760dfb5 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ConstructValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ConstructValidator.java @@ -293,7 +293,7 @@ private List validateConstructGenomicEntityAs response.addErrorMessages(field, ix, geaResponse.getErrorMessages()); } else { gea = geaResponse.getEntity(); - gea.setSubject(dbEntity); + gea.setSubjectReagent(dbEntity); validatedAssociations.add(gea); } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java index da536a96f..2318a42db 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java @@ -48,20 +48,20 @@ public class DiseaseAnnotationValidator extends AnnotationValidator { @Inject DataProviderValidator dataProviderValidator; - public DOTerm validateObject(DiseaseAnnotation uiEntity, DiseaseAnnotation dbEntity) { - String field = "object"; - if (ObjectUtils.isEmpty(uiEntity.getObject())) { + public DOTerm validateObjectOntologyTerm(DiseaseAnnotation uiEntity, DiseaseAnnotation dbEntity) { + String field = "objectOntologyTerm"; + if (ObjectUtils.isEmpty(uiEntity.getObjectOntologyTerm())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } DOTerm diseaseTerm = null; - if (uiEntity.getObject().getId() != null) - diseaseTerm = doTermDAO.find(uiEntity.getObject().getId()); + if (uiEntity.getObjectOntologyTerm().getId() != null) + diseaseTerm = doTermDAO.find(uiEntity.getObjectOntologyTerm().getId()); if (diseaseTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; - } else if (diseaseTerm.getObsolete() && (dbEntity.getObject() == null || !diseaseTerm.getId().equals(dbEntity.getObject().getId()))) { + } else if (diseaseTerm.getObsolete() && (dbEntity.getObjectOntologyTerm() == null || !diseaseTerm.getId().equals(dbEntity.getObjectOntologyTerm().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -299,8 +299,8 @@ public String validateUniqueId(DiseaseAnnotation uiEntity, DiseaseAnnotation dbE public DiseaseAnnotation validateCommonDiseaseAnnotationFields(DiseaseAnnotation uiEntity, DiseaseAnnotation dbEntity) { - DOTerm term = validateObject(uiEntity, dbEntity); - dbEntity.setObject(term); + DOTerm term = validateObjectOntologyTerm(uiEntity, dbEntity); + dbEntity.setObjectOntologyTerm(term); List terms = validateEvidenceCodes(uiEntity, dbEntity); dbEntity.setEvidenceCodes(terms); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java index 9da323c37..a299cc3f0 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java @@ -63,7 +63,7 @@ public GeneDiseaseAnnotation validateAnnotationCreate(GeneDiseaseAnnotation uiEn public GeneDiseaseAnnotation validateAnnotation(GeneDiseaseAnnotation uiEntity, GeneDiseaseAnnotation dbEntity) { Gene subject = validateSubject(uiEntity, dbEntity); - dbEntity.setSubject(subject); + dbEntity.setSubjectBiologicalEntity(subject); VocabularyTerm relation = validateDiseaseRelation(uiEntity, dbEntity); dbEntity.setRelation(relation); @@ -82,21 +82,22 @@ public GeneDiseaseAnnotation validateAnnotation(GeneDiseaseAnnotation uiEntity, } private Gene validateSubject(GeneDiseaseAnnotation uiEntity, GeneDiseaseAnnotation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getSubject())) { - addMessageResponse("subject", ValidationConstants.REQUIRED_MESSAGE); + String field = "subjectBiologicalEntity"; + if (ObjectUtils.isEmpty(uiEntity.getSubjectBiologicalEntity())) { + addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } Gene subjectEntity = null; - if (uiEntity.getSubject().getId() != null) - subjectEntity = geneDAO.find(uiEntity.getSubject().getId()); + if (uiEntity.getSubjectBiologicalEntity().getId() != null) + subjectEntity = geneDAO.find(uiEntity.getSubjectBiologicalEntity().getId()); if (subjectEntity == null) { - addMessageResponse("subject", ValidationConstants.INVALID_MESSAGE); + addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubject() == null || !subjectEntity.getId().equals(dbEntity.getSubject().getId()))) { - addMessageResponse("subject", ValidationConstants.OBSOLETE_MESSAGE); + if (subjectEntity.getObsolete() && (dbEntity.getSubjectBiologicalEntity() == null || !subjectEntity.getId().equals(dbEntity.getSubjectBiologicalEntity().getId()))) { + addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -127,6 +128,7 @@ private VocabularyTerm validateDiseaseRelation(GeneDiseaseAnnotation uiEntity, G } private AffectedGenomicModel validateSgdStrainBackground(GeneDiseaseAnnotation uiEntity, GeneDiseaseAnnotation dbEntity) { + String field = "sgdStrainBackground"; if (ObjectUtils.isEmpty(uiEntity.getSgdStrainBackground())) return null; @@ -134,12 +136,12 @@ private AffectedGenomicModel validateSgdStrainBackground(GeneDiseaseAnnotation u if (uiEntity.getSgdStrainBackground().getId() != null) sgdStrainBackground = agmDAO.find(uiEntity.getSgdStrainBackground().getId()); if (sgdStrainBackground == null || !sgdStrainBackground.getTaxon().getName().startsWith("Saccharomyces cerevisiae")) { - addMessageResponse("sgdStrainBackground", ValidationConstants.INVALID_MESSAGE); + addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } if (sgdStrainBackground.getObsolete() && (dbEntity.getSgdStrainBackground() == null || !sgdStrainBackground.getId().equals(dbEntity.getSgdStrainBackground().getId()))) { - addMessageResponse("sgdStrainBackground", ValidationConstants.OBSOLETE_MESSAGE); + addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java index 069b6922e..aee796f92 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java @@ -56,11 +56,11 @@ public AlleleGeneAssociation validateAlleleGeneAssociation(AlleleGeneAssociation if (validateAllele) { Allele subject = validateSubject(uiEntity, dbEntity); - dbEntity.setSubject(subject); + dbEntity.setSubjectBiologicalEntity(subject); } Gene object = validateObject(uiEntity, dbEntity); - dbEntity.setObject(object); + dbEntity.setObjectBiologicalEntity(object); VocabularyTerm relation = validateRelation(uiEntity, dbEntity); dbEntity.setRelation(relation); @@ -78,21 +78,21 @@ public AlleleGeneAssociation validateAlleleGeneAssociation(AlleleGeneAssociation } private Allele validateSubject(AlleleGeneAssociation uiEntity, AlleleGeneAssociation dbEntity) { - String field = "subject"; - if (ObjectUtils.isEmpty(uiEntity.getSubject())) { + String field = "subjectBiologicalEntity"; + if (ObjectUtils.isEmpty(uiEntity.getSubjectBiologicalEntity())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } Allele subjectEntity = null; - if (uiEntity.getSubject().getId() != null) - subjectEntity = alleleDAO.find(uiEntity.getSubject().getId()); + if (uiEntity.getSubjectBiologicalEntity().getId() != null) + subjectEntity = alleleDAO.find(uiEntity.getSubjectBiologicalEntity().getId()); if (subjectEntity == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubject() == null || !subjectEntity.getId().equals(dbEntity.getSubject().getId()))) { + if (subjectEntity.getObsolete() && (dbEntity.getSubjectBiologicalEntity() == null || !subjectEntity.getId().equals(dbEntity.getSubjectBiologicalEntity().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -102,21 +102,22 @@ private Allele validateSubject(AlleleGeneAssociation uiEntity, AlleleGeneAssocia } private Gene validateObject(AlleleGeneAssociation uiEntity, AlleleGeneAssociation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getObject())) { - addMessageResponse("object", ValidationConstants.REQUIRED_MESSAGE); + String field = "objectBiologicalEntity"; + if (ObjectUtils.isEmpty(uiEntity.getObjectBiologicalEntity())) { + addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } Gene objectEntity = null; - if (uiEntity.getObject().getId() != null) - objectEntity = geneDAO.find(uiEntity.getObject().getId()); + if (uiEntity.getObjectBiologicalEntity().getId() != null) + objectEntity = geneDAO.find(uiEntity.getObjectBiologicalEntity().getId()); if (objectEntity == null) { - addMessageResponse("object", ValidationConstants.INVALID_MESSAGE); + addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (objectEntity.getObsolete() && (dbEntity.getObject() == null || !objectEntity.getId().equals(dbEntity.getObject().getId()))) { - addMessageResponse("object", ValidationConstants.OBSOLETE_MESSAGE); + if (objectEntity.getObsolete() && (dbEntity.getObjectBiologicalEntity() == null || !objectEntity.getId().equals(dbEntity.getObjectBiologicalEntity().getId()))) { + addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java index 22fd123c0..b873950aa 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java @@ -71,12 +71,12 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati dbEntity = (ConstructGenomicEntityAssociation) validateEvidenceAssociationFields(uiEntity, dbEntity); if (validateConstruct) { - Construct subject = validateSubject(uiEntity, dbEntity); - dbEntity.setSubject(subject); + Construct subject = validateSubjectReagent(uiEntity, dbEntity); + dbEntity.setSubjectReagent(subject); } GenomicEntity object = validateObject(uiEntity, dbEntity); - dbEntity.setObject(object); + dbEntity.setObjectBiologicalEntity(object); VocabularyTerm relation = validateRelation(uiEntity, dbEntity); dbEntity.setRelation(relation); @@ -102,22 +102,22 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati return dbEntity; } - private Construct validateSubject(ConstructGenomicEntityAssociation uiEntity, ConstructGenomicEntityAssociation dbEntity) { - String field = "subject"; - if (ObjectUtils.isEmpty(uiEntity.getSubject())) { + private Construct validateSubjectReagent(ConstructGenomicEntityAssociation uiEntity, ConstructGenomicEntityAssociation dbEntity) { + String field = "subjectReagent"; + if (ObjectUtils.isEmpty(uiEntity.getSubjectReagent())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } Construct subjectEntity = null; - if (uiEntity.getSubject().getId() != null) - subjectEntity = constructDAO.find(uiEntity.getSubject().getId()); + if (uiEntity.getSubjectReagent().getId() != null) + subjectEntity = constructDAO.find(uiEntity.getSubjectReagent().getId()); if (subjectEntity == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubject() == null || !subjectEntity.getId().equals(dbEntity.getSubject().getId()))) { + if (subjectEntity.getObsolete() && (dbEntity.getSubjectReagent() == null || !subjectEntity.getId().equals(dbEntity.getSubjectReagent().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -127,21 +127,21 @@ private Construct validateSubject(ConstructGenomicEntityAssociation uiEntity, Co } private GenomicEntity validateObject(ConstructGenomicEntityAssociation uiEntity, ConstructGenomicEntityAssociation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getObject())) { - addMessageResponse("object", ValidationConstants.REQUIRED_MESSAGE); + if (ObjectUtils.isEmpty(uiEntity.getObjectBiologicalEntity())) { + addMessageResponse("objectBiologicalEntity", ValidationConstants.REQUIRED_MESSAGE); return null; } GenomicEntity objectEntity = null; - if (uiEntity.getObject().getId() != null) - objectEntity = genomicEntityDAO.find(uiEntity.getObject().getId()); + if (uiEntity.getObjectBiologicalEntity().getId() != null) + objectEntity = genomicEntityDAO.find(uiEntity.getObjectBiologicalEntity().getId()); if (objectEntity == null) { - addMessageResponse("object", ValidationConstants.INVALID_MESSAGE); + addMessageResponse("objectBiologicalEntity", ValidationConstants.INVALID_MESSAGE); return null; } - if (objectEntity.getObsolete() && (dbEntity.getObject() == null || !objectEntity.getId().equals(dbEntity.getObject().getId()))) { - addMessageResponse("object", ValidationConstants.OBSOLETE_MESSAGE); + if (objectEntity.getObsolete() && (dbEntity.getObjectBiologicalEntity() == null || !objectEntity.getId().equals(dbEntity.getObjectBiologicalEntity().getId()))) { + addMessageResponse("objectBiologicalEntity", ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java index 6f757c6c8..e5f432797 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java @@ -83,7 +83,7 @@ public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotation SearchResponse annotationList = agmDiseaseAnnotationDAO.findByField(identifyingField, annotationId); annotation = DiseaseAnnotationRetrievalHelper.getCurrentDiseaseAnnotation(annotation, annotationList); annotation.setUniqueId(uniqueId); - annotation.setSubject(agm); + annotation.setSubjectBiologicalEntity(agm); if (dataProvider != null && (dataProvider.name().equals("RGD") || dataProvider.name().equals("HUMAN")) && !agm.getTaxon().getCurie().equals(dataProvider.canonicalTaxonCurie) || !dataProvider.sourceOrganization.equals(agm.getDataProvider().getSourceOrganization().getAbbreviation())) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java index 4c991804c..1e4b7eca1 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java @@ -78,7 +78,7 @@ public AlleleDiseaseAnnotation validateAlleleDiseaseAnnotationDTO(AlleleDiseaseA SearchResponse annotationList = alleleDiseaseAnnotationDAO.findByField(identifyingField, annotationId); annotation = DiseaseAnnotationRetrievalHelper.getCurrentDiseaseAnnotation(annotation, annotationList); annotation.setUniqueId(uniqueId); - annotation.setSubject(allele); + annotation.setSubjectBiologicalEntity(allele); if (dataProvider != null && (dataProvider.name().equals("RGD") || dataProvider.name().equals("HUMAN")) && !allele.getTaxon().getCurie().equals(dataProvider.canonicalTaxonCurie) || !dataProvider.sourceOrganization.equals(allele.getDataProvider().getSourceOrganization().getAbbreviation())) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java index f5ec45aea..d33d4ff42 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java @@ -58,7 +58,7 @@ public ObjectRespo DOTerm disease = doTermService.findByCurieOrSecondaryId(dto.getDoTermCurie()); if (disease == null) daResponse.addErrorMessage("do_term_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getDoTermCurie() + ")"); - annotation.setObject(disease); + annotation.setObjectOntologyTerm(disease); } if (CollectionUtils.isEmpty(dto.getEvidenceCodeCuries())) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java index 1450ea8fc..348165e8e 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java @@ -76,7 +76,7 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat SearchResponse annotationList = geneDiseaseAnnotationDAO.findByField(identifyingField, annotationId); annotation = DiseaseAnnotationRetrievalHelper.getCurrentDiseaseAnnotation(annotation, annotationList); annotation.setUniqueId(uniqueId); - annotation.setSubject(gene); + annotation.setSubjectBiologicalEntity(gene); if (dataProvider != null && (dataProvider.name().equals("RGD") || dataProvider.name().equals("HUMAN")) && !gene.getTaxon().getCurie().equals(dataProvider.canonicalTaxonCurie) || !dataProvider.sourceOrganization.equals(gene.getDataProvider().getSourceOrganization().getAbbreviation())) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java index 291df3ad0..7b83cbb1a 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java @@ -65,9 +65,9 @@ public AlleleGeneAssociation validateAlleleGeneAssociationDTO(AlleleGeneAssociat AlleleGeneAssociation association = null; if (subject != null && object != null && StringUtils.isNotBlank(dto.getRelationName())) { HashMap params = new HashMap<>(); - params.put("subject.id", subject.getId()); + params.put("subjectBiologicalEntity.id", subject.getId()); params.put("relation.name", dto.getRelationName()); - params.put("object.id", object.getId()); + params.put("objectBiologicalEntity.id", object.getId()); SearchResponse searchResponse = alleleGeneAssociationDAO.findByParams(params); if (searchResponse != null && searchResponse.getResults().size() == 1) { @@ -77,8 +77,8 @@ public AlleleGeneAssociation validateAlleleGeneAssociationDTO(AlleleGeneAssociat if (association == null) association = new AlleleGeneAssociation(); - association.setSubject(subject); - association.setObject(object); + association.setSubjectBiologicalEntity(subject); + association.setObjectBiologicalEntity(object); ObjectResponse ageaResponse = validateAlleleGenomicEntityAssociationDTO(association, dto); agaResponse.addErrorMessages(ageaResponse.getErrorMessages()); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java index 430f2c718..66ad108cc 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java @@ -75,9 +75,9 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati ConstructGenomicEntityAssociation association = null; if (construct != null && StringUtils.isNotBlank(dto.getGenomicEntityRelationName()) && genomicEntity != null) { HashMap params = new HashMap<>(); - params.put("subject.id", construct.getId()); + params.put("subjectReagent.id", construct.getId()); params.put("relation.name", dto.getGenomicEntityRelationName()); - params.put("object.id", genomicEntity.getId()); + params.put("objectBiologicalEntity.id", genomicEntity.getId()); SearchResponse searchResponse = constructGenomicEntityAssociationDAO.findByParams(params); if (searchResponse != null && searchResponse.getResults().size() == 1) { @@ -87,8 +87,8 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati if (association == null) association = new ConstructGenomicEntityAssociation(); - association.setSubject(construct); - association.setObject(genomicEntity); + association.setSubjectReagent(construct); + association.setObjectBiologicalEntity(genomicEntity); ObjectResponse eviResponse = validateEvidenceAssociationDTO(association, dto); assocResponse.addErrorMessages(eviResponse.getErrorMessages()); diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.1.0_update.sql similarity index 80% rename from src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql rename to src/main/resources/db/migration/v0.30.0.1__linkml_v2.1.0_update.sql index 933fa867b..e5bc32e34 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.0.0_update.sql +++ b/src/main/resources/db/migration/v0.30.0.1__linkml_v2.1.0_update.sql @@ -1,8 +1,8 @@ --- Revert temporary changes to association table columns +-- Update association column names for non-biological entity fields -ALTER TABLE constructgenomicentityassociation RENAME subjectconstruct_id TO subject_id; ALTER TABLE constructgenomicentityassociation RENAME objectgenomicentity_curie TO object_curie; +ALTER TABLE constructgenomicentityassociation RENAME subjectconstruct_id TO subjectreagent_id; ALTER TABLE allelegeneassociation RENAME objectgene_curie TO object_curie; @@ -284,6 +284,8 @@ ALTER INDEX constructcomponentsa_note_relatednotes_id_index RENAME TO constructc ALTER INDEX constructfullname_singleconstruct_id_index RENAME TO constructfullname_singleconstruct_index; ALTER TABLE constructgenomicentityassociation DROP CONSTRAINT constructgenomicentityassociation_object_curie_fk; ALTER TABLE constructgenomicentityassociation RENAME CONSTRAINT fkgrhw9gxslaub14x4b0mc7v9mk TO constructgenomicentityassociation_id_fk; +ALTER TABLE constructgenomicentityassociation RENAME CONSTRAINT constructgenomicentityassociation_subject_id_fk TO constructgenomicentityassociation_subjectreagent_id_fk; +ALTER INDEX constructgenomicentityassociation_subject_index RENAME TO constructgenomicentityassociation_subjectreagent_index; DROP INDEX constructgenomicentityassociation_object_index; ALTER INDEX cgeassociation_note_cgeassociation_id_index RENAME TO cgeassociation_note_cgeassociation_index; ALTER INDEX cgeassociation_note_relatednotes_id_index RENAME TO cgeassociation_note_relatednotes_index; @@ -354,6 +356,8 @@ DROP INDEX genomicentity_crossreference_ge_curie_xref_id_index; DROP INDEX genomicentity_crossreference_genomicentity_curie_index; ALTER TABLE goterm DROP CONSTRAINT fk4gf262ba8btx03wi3vl5vhfao; ALTER TABLE hpterm DROP CONSTRAINT hpterm_curie_fk; +DROP INDEX informationcontent_createdby_index; +DROP INDEX informationcontent_updatedby_index; ALTER TABLE materm DROP CONSTRAINT fktlgqvrv4vuh8gqihevh6adya4; ALTER TABLE miterm DROP CONSTRAINT miterm_curie_fk; ALTER TABLE mmoterm DROP CONSTRAINT mmoterm_curie_fk; @@ -437,6 +441,7 @@ ALTER TABLE anatomicalterm DROP CONSTRAINT anatomicalterm_pkey; ALTER TABLE apoterm DROP CONSTRAINT apoterm_pkey; ALTER TABLE atpterm DROP CONSTRAINT atpterm_pkey; ALTER TABLE biologicalentity DROP CONSTRAINT biologicalentity_pkey; +ALTER TABLE biologicalentity ALTER COLUMN curie DROP NOT NULL; ALTER TABLE bspoterm DROP CONSTRAINT bspoterm_pkey; ALTER TABLE chebiterm DROP CONSTRAINT chebiterm_pkey; ALTER TABLE chemicalterm DROP CONSTRAINT chemicalterm_pkey; @@ -489,35 +494,11 @@ ALTER TABLE zecoterm DROP CONSTRAINT zecoterm_pkey; ALTER TABLE zfaterm DROP CONSTRAINT zfaterm_pkey; ALTER TABLE zfsterm DROP CONSTRAINT zfsterm_pkey; --- Create tables +-- Create sequences -CREATE TABLE curieobject ( - id bigint PRIMARY KEY, - old_id bigint, - curie varchar(255), - modentityid varchar(255), - modinternalid varchar(255), - dataprovider_id bigint, - createdby_id bigint, - updatedby_id bigint, - datecreated timestamp without time zone, - dateupdated timestamp without time zone, - dbdatecreated timestamp without time zone, - dbdateupdated timestamp without time zone, - internal boolean NOT NULL DEFAULT false, - obsolete boolean NOT NULL DEFAULT false, - curieobjecttype varchar(64) - ); - -CREATE TABLE submittedobject ( - id bigint PRIMARY KEY, - modentityid varchar(255), - modinternalid varchar(255), - dataprovider_id bigint - ); - -CREATE SEQUENCE curieobject_seq START WITH 200250000 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -CREATE SEQUENCE informationcontententity_seq START WITH 20025000 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; +CREATE SEQUENCE biologicalentity_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; +CREATE SEQUENCE informationcontententity_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; +CREATE SEQUENCE ontologyterm_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- Add id equivalents of curie columns @@ -525,7 +506,7 @@ ALTER TABLE affectedgenomicmodel ADD COLUMN id bigint; ALTER TABLE agmdiseaseannotation ADD COLUMN inferredallele_id bigint; ALTER TABLE agmdiseaseannotation ADD COLUMN inferredgene_id bigint; ALTER TABLE agmdiseaseannotation ADD COLUMN assertedallele_id bigint; -ALTER TABLE agmdiseaseannotation ADD COLUMN subject_id bigint; +ALTER TABLE agmdiseaseannotation ADD COLUMN subjectbiologicalentity_id bigint; ALTER TABLE agmdiseaseannotation_gene ADD COLUMN assertedgenes_id bigint; ALTER TABLE allele ADD COLUMN id bigint; ALTER TABLE allele_note ADD COLUMN allele_id bigint; @@ -533,13 +514,13 @@ ALTER TABLE allele_reference ADD COLUMN allele_id bigint; ALTER TABLE allele_reference ADD COLUMN references_id bigint; ALTER TABLE alleledatabasestatusslotannotation ADD COLUMN singleallele_id bigint; ALTER TABLE allelediseaseannotation ADD COLUMN inferredgene_id bigint; -ALTER TABLE allelediseaseannotation ADD COLUMN subject_id bigint; +ALTER TABLE allelediseaseannotation ADD COLUMN subjectbiologicalentity_id bigint; ALTER TABLE allelediseaseannotation_gene ADD COLUMN assertedgenes_id bigint; ALTER TABLE allelefullnameslotannotation ADD COLUMN singleallele_id bigint; ALTER TABLE allelefunctionalimpactslotannotation ADD COLUMN singleallele_id bigint; ALTER TABLE allelefunctionalimpactslotannotation ADD COLUMN phenotypeterm_id bigint; -ALTER TABLE allelegeneassociation ADD COLUMN subject_id bigint; -ALTER TABLE allelegeneassociation ADD COLUMN object_id bigint; +ALTER TABLE allelegeneassociation ADD COLUMN subjectbiologicalentity_id bigint; +ALTER TABLE allelegeneassociation ADD COLUMN objectbiologicalentity_id bigint; ALTER TABLE allelegenomicentityassociation ADD COLUMN evidencecode_id bigint; ALTER TABLE allelegermlinetransmissionstatusslotannotation ADD COLUMN singleallele_id bigint; ALTER TABLE alleleinheritancemodeslotannotation ADD COLUMN singleallele_id bigint; @@ -554,6 +535,8 @@ ALTER TABLE anatomicalterm ADD COLUMN id bigint; ALTER TABLE apoterm ADD COLUMN id bigint; ALTER TABLE atpterm ADD COLUMN id bigint; ALTER TABLE biologicalentity ADD COLUMN id bigint; +ALTER TABLE biologicalentity ADD COLUMN modentityid varchar(255); +ALTER TABLE biologicalentity ADD COLUMN modinternalid varchar(255); ALTER TABLE biologicalentity ADD COLUMN taxon_id bigint; ALTER TABLE bspoterm ADD COLUMN id bigint; ALTER TABLE chebiterm ADD COLUMN id bigint; @@ -563,9 +546,9 @@ ALTER TABLE cmoterm ADD COLUMN id bigint; ALTER TABLE conditionrelation ADD COLUMN singlereference_id bigint; ALTER TABLE construct_reference ADD COLUMN references_id bigint; ALTER TABLE constructcomponentslotannotation ADD COLUMN taxon_id bigint; -ALTER TABLE constructgenomicentityassociation ADD COLUMN object_id bigint; +ALTER TABLE constructgenomicentityassociation ADD COLUMN objectbiologicalentity_id bigint; ALTER TABLE daoterm ADD COLUMN id bigint; -ALTER TABLE diseaseannotation ADD COLUMN object_id bigint; +ALTER TABLE diseaseannotation ADD COLUMN objectontologyterm_id bigint; ALTER TABLE diseaseannotation_biologicalentity ADD COLUMN diseasegeneticmodifiers_id bigint; ALTER TABLE diseaseannotation_ecoterm ADD COLUMN evidencecodes_id bigint; ALTER TABLE diseaseannotation_gene ADD COLUMN with_id bigint; @@ -585,7 +568,7 @@ ALTER TABLE fbdvterm ADD COLUMN id bigint; ALTER TABLE gene ADD COLUMN id bigint; ALTER TABLE gene ADD COLUMN genetype_id bigint; ALTER TABLE genediseaseannotation ADD COLUMN sgdstrainbackground_id bigint; -ALTER TABLE genediseaseannotation ADD COLUMN subject_id bigint; +ALTER TABLE genediseaseannotation ADD COLUMN subjectbiologicalentity_id bigint; ALTER TABLE genefullnameslotannotation ADD COLUMN singlegene_id bigint; ALTER TABLE genesecondaryidslotannotation ADD COLUMN singlegene_id bigint; ALTER TABLE genesymbolslotannotation ADD COLUMN singlegene_id bigint; @@ -654,68 +637,56 @@ ALTER TABLE zfsterm ADD COLUMN id bigint; -- Move data around -INSERT INTO curieobject (id, modentityid, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT nextval('curieobject_seq'), curie, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM biologicalentity; - -INSERT INTO curieobject (id, old_id, modentityid, modinternalid, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT nextval('curieobject_seq'), id, modentityid, modinternalid, dataprovider_id, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM reagent; - -INSERT INTO submittedobject(id, modentityid, modinternalid, dataprovider_id) - SELECT id, modentityid, modinternalid, dataprovider_id - FROM curieobject; - -UPDATE ontologyterm SET id = nextval('curieobject_seq'); -ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_pkey PRIMARY KEY (id); - -INSERT INTO curieobject (id, curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT id, curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM ontologyterm; +UPDATE biologicalentity SET id = nextval('biologicalentity_seq'); +UPDATE biologicalentity SET modentityid = curie; +UPDATE biologicalentity SET curie = null; +ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_pkey PRIMARY KEY (id); +ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_curie_uk UNIQUE (curie); +ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_modentityid_uk UNIQUE (modentityid); +ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_modinternalid_uk UNIQUE (modinternalid); +CREATE INDEX biologicalentity_modentityid_index ON biologicalentity USING btree (modentityid); -UPDATE informationcontententity SET id = nextval('curieobject_seq'); +UPDATE informationcontententity SET id = nextval('informationcontententity_seq'); +ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_curie_uk UNIQUE (curie); ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_pkey PRIMARY KEY (id); -INSERT INTO curieobject (id, curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete) - SELECT id, curie, createdby_id, updatedby_id, datecreated, dateupdated, dbdatecreated, dbdateupdated, internal, obsolete - FROM informationcontententity; - -CREATE INDEX old_id_index ON curieobject USING btree (old_id); -CREATE INDEX curieobject_modentityid_index ON curieobject USING btree (modentityid); +UPDATE ontologyterm SET id = nextval('ontologyterm_seq'); +ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_curie_uk UNIQUE (curie); +ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_pkey PRIMARY KEY (id); -UPDATE affectedgenomicmodel t SET id = c.id FROM curieobject c WHERE t.curie = c.modentityid; -UPDATE agmdiseaseannotation t SET inferredallele_id = c.id FROM curieobject c WHERE t.inferredallele_curie = c.modentityid; -UPDATE agmdiseaseannotation t SET assertedallele_id = c.id FROM curieobject c WHERE t.assertedallele_curie = c.modentityid; -UPDATE agmdiseaseannotation t SET inferredgene_id = c.id FROM curieobject c WHERE t.inferredgene_curie = c.modentityid; -UPDATE agmdiseaseannotation t SET subject_id = c.id FROM curieobject c WHERE t.subject_curie = c.modentityid; -UPDATE agmdiseaseannotation_gene t SET assertedgenes_id = c.id FROM curieobject c WHERE t.assertedgenes_curie = c.modentityid; -UPDATE allele t SET id = c.id FROM curieobject c WHERE t.curie = c.modentityid; -UPDATE allele_note t SET allele_id = c.id FROM curieobject c WHERE t.allele_curie = c.modentityid; -UPDATE allele_reference t SET allele_id = c.id FROM curieobject c WHERE t.allele_curie = c.modentityid; +UPDATE affectedgenomicmodel t SET id = b.id FROM biologicalentity b WHERE t.curie = b.modentityid; +UPDATE agmdiseaseannotation t SET inferredallele_id = b.id FROM biologicalentity b WHERE t.inferredallele_curie = b.modentityid; +UPDATE agmdiseaseannotation t SET assertedallele_id = b.id FROM biologicalentity b WHERE t.assertedallele_curie = b.modentityid; +UPDATE agmdiseaseannotation t SET inferredgene_id = b.id FROM biologicalentity b WHERE t.inferredgene_curie = b.modentityid; +UPDATE agmdiseaseannotation t SET subjectbiologicalentity_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid; +UPDATE agmdiseaseannotation_gene t SET assertedgenes_id = b.id FROM biologicalentity b WHERE t.assertedgenes_curie = b.modentityid; +UPDATE allele t SET id = b.id FROM biologicalentity b WHERE t.curie = b.modentityid; +UPDATE allele_note t SET allele_id = b.id FROM biologicalentity b WHERE t.allele_curie = b.modentityid; +UPDATE allele_reference t SET allele_id = b.id FROM biologicalentity b WHERE t.allele_curie = b.modentityid; UPDATE allele_reference t SET references_id = i.id FROM informationcontententity i WHERE t.references_curie = i.curie; -UPDATE alleledatabasestatusslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; -UPDATE allelediseaseannotation t SET inferredgene_id = c.id FROM curieobject c WHERE t.inferredgene_curie = c.modentityid; -UPDATE allelediseaseannotation t SET subject_id = c.id FROM curieobject c WHERE t.subject_curie = c.modentityid; -UPDATE allelediseaseannotation_gene t SET assertedgenes_id = c.id FROM curieobject c WHERE t.assertedgenes_curie = c.modentityid; -UPDATE allelefullnameslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; -UPDATE allelefunctionalimpactslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; +UPDATE alleledatabasestatusslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; +UPDATE allelediseaseannotation t SET inferredgene_id = b.id FROM biologicalentity b WHERE t.inferredgene_curie = b.modentityid; +UPDATE allelediseaseannotation t SET subjectbiologicalentity_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid; +UPDATE allelediseaseannotation_gene t SET assertedgenes_id = b.id FROM biologicalentity b WHERE t.assertedgenes_curie = b.modentityid; +UPDATE allelefullnameslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; +UPDATE allelefunctionalimpactslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; UPDATE allelefunctionalimpactslotannotation t SET phenotypeterm_id = o.id FROM ontologyterm o WHERE t.phenotypeterm_curie = o.curie; -UPDATE allelegeneassociation t SET subject_id = c.id FROM curieobject c WHERE t.subject_curie = c.modentityid; -UPDATE allelegeneassociation t SET object_id = c.id FROM curieobject c WHERE t.object_curie = c.modentityid; +UPDATE allelegeneassociation t SET subjectbiologicalentity_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid; +UPDATE allelegeneassociation t SET objectbiologicalentity_id = b.id FROM biologicalentity b WHERE t.object_curie = b.modentityid; UPDATE allelegenomicentityassociation t SET evidencecode_id = o.id FROM ontologyterm o WHERE t.evidencecode_curie = o.curie; -UPDATE allelegermlinetransmissionstatusslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; -UPDATE alleleinheritancemodeslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; +UPDATE allelegermlinetransmissionstatusslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; +UPDATE alleleinheritancemodeslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; UPDATE alleleinheritancemodeslotannotation t SET phenotypeterm_id = o.id FROM ontologyterm o WHERE t.phenotypeterm_curie = o.curie; -UPDATE allelemutationtypeslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; +UPDATE allelemutationtypeslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; UPDATE allelemutationtypeslotannotation_soterm t SET mutationtypes_id = o.id FROM ontologyterm o WHERE t.mutationtypes_curie = o.curie; -UPDATE allelenomenclatureeventslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; -UPDATE allelesecondaryidslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; -UPDATE allelesymbolslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; -UPDATE allelesynonymslotannotation t SET singleallele_id = c.id FROM curieobject c WHERE t.singleallele_curie = c.modentityid; +UPDATE allelenomenclatureeventslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; +UPDATE allelesecondaryidslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; +UPDATE allelesymbolslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; +UPDATE allelesynonymslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; UPDATE anatomicalterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE apoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE atpterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; -UPDATE biologicalentity t SET id = c.id FROM curieobject c WHERE t.curie = c.modentityid; +UPDATE biologicalentity t SET id = b.id FROM biologicalentity b WHERE t.curie = b.modentityid; UPDATE biologicalentity t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie; UPDATE bspoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE chebiterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; @@ -723,21 +694,14 @@ UPDATE chemicalterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE clterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE cmoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE conditionrelation t SET singlereference_id = i.id FROM informationcontententity i WHERE t.singlereference_curie = i.curie; -UPDATE construct t SET id = c.id FROM curieobject c WHERE t.id = c.old_id; -UPDATE construct_reference t SET construct_id = c.id FROM curieobject c WHERE t.construct_id = c.old_id; UPDATE construct_reference t SET references_id = i.id FROM informationcontententity i WHERE t.references_curie = i.curie; -UPDATE constructcomponentslotannotation t SET singleconstruct_id = c.id FROM curieobject c WHERE t.singleconstruct_id = c.old_id; UPDATE constructcomponentslotannotation t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie; -UPDATE constructfullnameslotannotation t SET singleconstruct_id = c.id FROM curieobject c WHERE t.singleconstruct_id = c.old_id; -UPDATE constructgenomicentityassociation t SET subject_id = c.id FROM curieobject c WHERE t.subject_id = c.old_id; -UPDATE constructgenomicentityassociation t SET object_id = c.id FROM curieobject c WHERE t.object_curie = c.modentityid; -UPDATE constructsymbolslotannotation t SET singleconstruct_id = c.id FROM curieobject c WHERE t.singleconstruct_id = c.old_id; -UPDATE constructsynonymslotannotation t SET singleconstruct_id = c.id FROM curieobject c WHERE t.singleconstruct_id = c.old_id; +UPDATE constructgenomicentityassociation t SET objectbiologicalentity_id = b.id FROM biologicalentity b WHERE t.object_curie = b.modentityid; UPDATE daoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; -UPDATE diseaseannotation t SET object_id = o.id FROM ontologyterm o WHERE t.object_curie = o.curie; -UPDATE diseaseannotation_biologicalentity t SET diseasegeneticmodifiers_id = c.id FROM curieobject c WHERE t.diseasegeneticmodifiers_curie = c.modentityid; +UPDATE diseaseannotation t SET objectontologyterm_id = o.id FROM ontologyterm o WHERE t.object_curie = o.curie; +UPDATE diseaseannotation_biologicalentity t SET diseasegeneticmodifiers_id = b.id FROM biologicalentity b WHERE t.diseasegeneticmodifiers_curie = b.modentityid; UPDATE diseaseannotation_ecoterm t SET evidencecodes_id = o.id FROM ontologyterm o WHERE t.evidencecodes_curie = o.curie; -UPDATE diseaseannotation_gene t SET with_id = c.id FROM curieobject c WHERE t.with_curie = c.modentityid; +UPDATE diseaseannotation_gene t SET with_id = b.id FROM biologicalentity b WHERE t.with_curie = b.modentityid; UPDATE doterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE dpoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE ecoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; @@ -751,21 +715,21 @@ UPDATE experimentalcondition t SET conditionid_id = o.id FROM ontologyterm o WHE UPDATE experimentalcondition t SET conditiontaxon_id = o.id FROM ontologyterm o WHERE t.conditiontaxon_curie = o.curie; UPDATE experimentalconditionontologyterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE fbdvterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; -UPDATE gene t SET id = c.id FROM curieobject c WHERE t.curie = c.modentityid; +UPDATE gene t SET id = b.id FROM biologicalentity b WHERE t.curie = b.modentityid; UPDATE gene t SET genetype_id = o.id FROM ontologyterm o WHERE t.genetype_curie = o.curie; -UPDATE genediseaseannotation t SET sgdstrainbackground_id = c.id FROM curieobject c WHERE t.sgdstrainbackground_curie = c.modentityid; -UPDATE genediseaseannotation t SET subject_id = c.id FROM curieobject c WHERE t.subject_curie = c.modentityid; -UPDATE genefullnameslotannotation t SET singlegene_id = c.id FROM curieobject c WHERE t.singlegene_curie = c.modentityid; -UPDATE genesecondaryidslotannotation t SET singlegene_id = c.id FROM curieobject c WHERE t.singlegene_curie = c.modentityid; -UPDATE genesymbolslotannotation t SET singlegene_id = c.id FROM curieobject c WHERE t.singlegene_curie = c.modentityid; -UPDATE genesynonymslotannotation t SET singlegene_id = c.id FROM curieobject c WHERE t.singlegene_curie = c.modentityid; -UPDATE genesystematicnameslotannotation t SET singlegene_id = c.id FROM curieobject c WHERE t.singlegene_curie = c.modentityid; -UPDATE genetogeneorthology t SET subjectgene_id = c.id FROM curieobject c WHERE t.subjectgene_curie = c.modentityid; -UPDATE genetogeneorthology t SET objectgene_id = c.id FROM curieobject c WHERE t.objectgene_curie = c.modentityid; +UPDATE genediseaseannotation t SET sgdstrainbackground_id = b.id FROM biologicalentity b WHERE t.sgdstrainbackground_curie = b.modentityid; +UPDATE genediseaseannotation t SET subjectbiologicalentity_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid; +UPDATE genefullnameslotannotation t SET singlegene_id = b.id FROM biologicalentity b WHERE t.singlegene_curie = b.modentityid; +UPDATE genesecondaryidslotannotation t SET singlegene_id = b.id FROM biologicalentity b WHERE t.singlegene_curie = b.modentityid; +UPDATE genesymbolslotannotation t SET singlegene_id = b.id FROM biologicalentity b WHERE t.singlegene_curie = b.modentityid; +UPDATE genesynonymslotannotation t SET singlegene_id = b.id FROM biologicalentity b WHERE t.singlegene_curie = b.modentityid; +UPDATE genesystematicnameslotannotation t SET singlegene_id = b.id FROM biologicalentity b WHERE t.singlegene_curie = b.modentityid; +UPDATE genetogeneorthology t SET subjectgene_id = b.id FROM biologicalentity b WHERE t.subjectgene_curie = b.modentityid; +UPDATE genetogeneorthology t SET objectgene_id = b.id FROM biologicalentity b WHERE t.objectgene_curie = b.modentityid; UPDATE genetogeneorthologycurated t SET evidencecode_id = o.id FROM ontologyterm o WHERE t.evidencecode_curie = o.curie; UPDATE genetogeneorthologycurated t SET singlereference_id = i.id FROM informationcontententity i WHERE t.singlereference_curie = i.curie; -UPDATE genomicentity t SET id = c.id FROM curieobject c WHERE t.curie = c.modentityid; -UPDATE genomicentity_crossreference t SET genomicentity_id = c.id FROM curieobject c WHERE t.genomicentity_curie = c.modentityid; +UPDATE genomicentity t SET id = b.id FROM biologicalentity b WHERE t.curie = b.modentityid; +UPDATE genomicentity_crossreference t SET genomicentity_id = b.id FROM biologicalentity b WHERE t.genomicentity_curie = b.modentityid; UPDATE goterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE hpterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE materm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; @@ -791,8 +755,6 @@ UPDATE ontologyterm_synonym t SET ontologyterm_id = o.id FROM ontologyterm o WHE UPDATE patoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE phenotypeterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE pwterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; -UPDATE reagent t SET id = c.id FROM curieobject c WHERE t.id = c.old_id; -UPDATE reagent_secondaryidentifiers t SET reagent_id = c.id FROM curieobject c WHERE t.reagent_id = c.old_id; UPDATE reference t SET id = i.id FROM informationcontententity i WHERE t.curie = i.curie; UPDATE reference_crossreference t SET reference_id = i.id FROM informationcontententity i WHERE t.reference_curie = i.curie; UPDATE roterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; @@ -800,14 +762,13 @@ UPDATE rsterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE soterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE singlereferenceassociation t SET singlereference_id = i.id FROM informationcontententity i WHERE t.singlereference_curie = i.curie; UPDATE slotannotation_informationcontententity t SET evidence_id = i.id FROM informationcontententity i WHERE t.evidence_curie = i.curie; -UPDATE species t SET id = c.id FROM curieobject c WHERE t.id = c.old_id; UPDATE species t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie; UPDATE stageterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE uberonterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; -UPDATE variant t SET id = c.id FROM curieobject c WHERE t.curie = c.modentityid; +UPDATE variant t SET id = b.id FROM biologicalentity b WHERE t.curie = b.modentityid; UPDATE variant t SET varianttype_id = o.id FROM ontologyterm o WHERE t.varianttype_curie = o.curie; UPDATE variant t SET sourcegeneralconsequence_id = o.id FROM ontologyterm o WHERE t.sourcegeneralconsequence_curie = o.curie; -UPDATE variant_note t SET variant_id = c.id FROM curieobject c WHERE t.variant_curie = c.modentityid; +UPDATE variant_note t SET variant_id = b.id FROM biologicalentity b WHERE t.variant_curie = b.modentityid; UPDATE vtterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE wbbtterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE wblsterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; @@ -822,59 +783,6 @@ UPDATE zecoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE zfaterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE zfsterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; --- Update Entity Types in the auditedobject table ... this needs to be done for all "leaf" nodes of the CurieObject class tree -UPDATE curieobject c SET curieobjecttype = 'APOTerm' FROM APOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'ATPTerm' FROM ATPTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'AffectedGenomicModel' FROM AffectedGenomicModel t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'Allele' FROM Allele t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'BSPOTerm' FROM BSPOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'CHEBITerm' FROM CHEBITerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'CLTerm' FROM CLTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'CMOTerm' FROM CMOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'Construct' FROM Construct t WHERE c.id = t.id;; -UPDATE curieobject c SET curieobjecttype = 'DAOTerm' FROM DAOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'DOTerm' FROM DOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'DPOTerm' FROM DPOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'ECOTerm' FROM ECOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'EMAPATerm' FROM EMAPATerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'FBDVTerm' FROM FBDVTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'GOTerm' FROM GOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'Gene' FROM Gene t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'HPTerm' FROM HPTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'MATerm' FROM MATerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'MITerm' FROM MITerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'MMOTerm' FROM MMOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'MMUSDVTerm' FROM MMUSDVTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'MODTerm' FROM MODTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'MPATHTerm' FROM MPATHTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'MPTerm' FROM MPTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'Molecule' FROM Molecule t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'NCBITaxonTerm' FROM NCBITaxonTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'OBITerm' FROM OBITerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'PATOTerm' FROM PATOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'PWTerm' FROM PWTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'ROTerm' FROM ROTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'RSTerm' FROM RSTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'Reference' FROM Reference t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'SOTerm' FROM SOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'Species' FROM Species t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'Synonym' FROM Synonym t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'UBERONTerm' FROM UBERONTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'VTTerm' FROM VTTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'Variant' FROM Variant t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'WBBTTerm' FROM WBBTTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'WBLSTerm' FROM WBLSTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'WBPhenotypeTerm' FROM WBPhenotypeTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'XBATerm' FROM XBATerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'XBEDTerm' FROM XBEDTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'XBSTerm' FROM XBSTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'XCOTerm' FROM XCOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'XPOTerm' FROM XPOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'XSMOTerm' FROM XSMOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'ZECOTerm' FROM ZECOTerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'ZFATerm' FROM ZFATerm t WHERE c.id = t.id; -UPDATE curieobject c SET curieobjecttype = 'ZFSTerm' FROM ZFSTerm t WHERE c.id = t.id; - ALTER TABLE affectedgenomicmodel DROP COLUMN curie; ALTER TABLE agmdiseaseannotation DROP COLUMN inferredallele_curie; ALTER TABLE agmdiseaseannotation DROP COLUMN inferredgene_curie; @@ -907,17 +815,7 @@ ALTER TABLE allelesynonymslotannotation DROP COLUMN singleallele_curie; ALTER TABLE anatomicalterm DROP COLUMN curie; ALTER TABLE apoterm DROP COLUMN curie; ALTER TABLE atpterm DROP COLUMN curie; -ALTER TABLE biologicalentity DROP COLUMN curie; ALTER TABLE biologicalentity DROP COLUMN taxon_curie; -ALTER TABLE biologicalentity DROP COLUMN dataprovider_id; -ALTER TABLE biologicalentity DROP COLUMN createdby_id; -ALTER TABLE biologicalentity DROP COLUMN updatedby_id; -ALTER TABLE biologicalentity DROP COLUMN datecreated; -ALTER TABLE biologicalentity DROP COLUMN dateupdated; -ALTER TABLE biologicalentity DROP COLUMN dbdatecreated; -ALTER TABLE biologicalentity DROP COLUMN dbdateupdated; -ALTER TABLE biologicalentity DROP COLUMN internal; -ALTER TABLE biologicalentity DROP COLUMN obsolete; ALTER TABLE bspoterm DROP COLUMN curie; ALTER TABLE chebiterm DROP COLUMN curie; ALTER TABLE chemicalterm DROP COLUMN curie; @@ -962,15 +860,6 @@ ALTER TABLE genomicentity DROP COLUMN curie; ALTER TABLE genomicentity_crossreference DROP COLUMN genomicentity_curie; ALTER TABLE goterm DROP COLUMN curie; ALTER TABLE hpterm DROP COLUMN curie; -ALTER TABLE informationcontententity DROP COLUMN curie; -ALTER TABLE informationcontententity DROP COLUMN createdby_id; -ALTER TABLE informationcontententity DROP COLUMN updatedby_id; -ALTER TABLE informationcontententity DROP COLUMN datecreated; -ALTER TABLE informationcontententity DROP COLUMN dateupdated; -ALTER TABLE informationcontententity DROP COLUMN dbdatecreated; -ALTER TABLE informationcontententity DROP COLUMN dbdateupdated; -ALTER TABLE informationcontententity DROP COLUMN internal; -ALTER TABLE informationcontententity DROP COLUMN obsolete; ALTER TABLE materm DROP COLUMN curie; ALTER TABLE miterm DROP COLUMN curie; ALTER TABLE mmoterm DROP COLUMN curie; @@ -982,15 +871,6 @@ ALTER TABLE mpterm DROP COLUMN curie; ALTER TABLE ncbitaxonterm DROP COLUMN curie; ALTER TABLE note_reference DROP COLUMN references_curie; ALTER TABLE obiterm DROP COLUMN curie; -ALTER TABLE ontologyterm DROP COLUMN curie; -ALTER TABLE ontologyterm DROP COLUMN createdby_id; -ALTER TABLE ontologyterm DROP COLUMN updatedby_id; -ALTER TABLE ontologyterm DROP COLUMN datecreated; -ALTER TABLE ontologyterm DROP COLUMN dateupdated; -ALTER TABLE ontologyterm DROP COLUMN dbdatecreated; -ALTER TABLE ontologyterm DROP COLUMN dbdateupdated; -ALTER TABLE ontologyterm DROP COLUMN internal; -ALTER TABLE ontologyterm DROP COLUMN obsolete; ALTER TABLE ontologyterm_crossreference DROP COLUMN ontologyterm_curie; ALTER TABLE ontologyterm_definitionurls DROP COLUMN ontologyterm_curie; ALTER TABLE ontologyterm_isa_ancestor_descendant DROP COLUMN isadescendants_curie; @@ -1004,18 +884,6 @@ ALTER TABLE patoterm DROP COLUMN curie; ALTER TABLE phenotypeterm DROP COLUMN curie; ALTER TABLE pwterm DROP COLUMN curie; ALTER TABLE reference DROP COLUMN curie; -ALTER TABLE reagent DROP COLUMN curie; -ALTER TABLE reagent DROP COLUMN modentityid; -ALTER TABLE reagent DROP COLUMN modinternalid; -ALTER TABLE reagent DROP COLUMN dataprovider_id; -ALTER TABLE reagent DROP COLUMN createdby_id; -ALTER TABLE reagent DROP COLUMN updatedby_id; -ALTER TABLE reagent DROP COLUMN datecreated; -ALTER TABLE reagent DROP COLUMN dateupdated; -ALTER TABLE reagent DROP COLUMN dbdatecreated; -ALTER TABLE reagent DROP COLUMN dbdateupdated; -ALTER TABLE reagent DROP COLUMN internal; -ALTER TABLE reagent DROP COLUMN obsolete; ALTER TABLE reference_crossreference DROP COLUMN reference_curie; ALTER TABLE roterm DROP COLUMN curie; ALTER TABLE rsterm DROP COLUMN curie; @@ -1043,31 +911,10 @@ ALTER TABLE zecoterm DROP COLUMN curie; ALTER TABLE zfaterm DROP COLUMN curie; ALTER TABLE zfsterm DROP COLUMN curie; -ALTER TABLE curieobject DROP COLUMN old_id; -ALTER TABLE curieobject DROP COLUMN modentityid; -ALTER TABLE curieobject DROP COLUMN modinternalid; -ALTER TABLE curieobject DROP COLUMN dataprovider_id; - SET session_replication_role = 'origin'; -- Add constraints and indexes -ALTER TABLE curieobject ADD CONSTRAINT curieobject_createdby_id_fk FOREIGN KEY (createdby_id) REFERENCES person (id); -ALTER TABLE curieobject ADD CONSTRAINT curieobject_updatedby_id_fk FOREIGN KEY (updatedby_id) REFERENCES person (id); -CREATE INDEX curieobject_createdby_index ON curieobject USING btree (createdby_id); -CREATE INDEX curieobject_updatedby_index ON curieobject USING btree (updatedby_id); -CREATE INDEX curieobject_curie_index ON curieobject USING btree (curie); -CREATE INDEX curieobject_curieobjecttype_index ON curieobject USING btree (curieobjecttype); -ALTER TABLE curieobject ADD CONSTRAINT curieobject_curie_uk UNIQUE (curie); - -ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); -ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_dataprovider_id_fk FOREIGN KEY (dataprovider_id) REFERENCES dataprovider (id); -CREATE INDEX submittedobject_modentityid_index ON submittedobject USING btree (modentityid); -CREATE INDEX submittedobject_modinternalid_index ON submittedobject USING btree (modinternalid); -CREATE INDEX submittedobject_dataprovider_index ON submittedobject USING btree (dataprovider_id); -ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_modentityid_uk UNIQUE (modentityid); -ALTER TABLE submittedobject ADD CONSTRAINT submittedobject_modinternalid_uk UNIQUE (modinternalid); - CREATE INDEX experimentalcondition_createdby_index ON experimentalcondition USING btree (createdby_id); CREATE INDEX experimentalcondition_updatedby_index ON experimentalcondition USING btree (updatedby_id); @@ -1079,7 +926,6 @@ ALTER TABLE allele ADD CONSTRAINT allele_pkey PRIMARY KEY (id); ALTER TABLE anatomicalterm ADD CONSTRAINT anatomicalterm_pkey PRIMARY KEY (id); ALTER TABLE apoterm ADD CONSTRAINT apoterm_pkey PRIMARY KEY (id); ALTER TABLE atpterm ADD CONSTRAINT atpterm_pkey PRIMARY KEY (id); -ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_pkey PRIMARY KEY (id); ALTER TABLE bspoterm ADD CONSTRAINT bspoterm_pkey PRIMARY KEY (id); ALTER TABLE chebiterm ADD CONSTRAINT chebiterm_pkey PRIMARY KEY (id); ALTER TABLE chemicalterm ADD CONSTRAINT chemicalterm_pkey PRIMARY KEY (id); @@ -1133,11 +979,15 @@ ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_pkey PRIMARY KEY (id); ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_pkey PRIMARY KEY (id); ALTER TABLE affectedgenomicmodel ADD CONSTRAINT affectedgenomicmodel_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); -ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES affectedgenomicmodel (id); +ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_subjectbiologicalentity_id_fk FOREIGN KEY (subjectbiologicalentity_id) REFERENCES affectedgenomicmodel (id); ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_assertedallele_id_fk FOREIGN KEY (assertedallele_id) REFERENCES allele (id); ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredallele_id_fk FOREIGN KEY (inferredallele_id) REFERENCES allele (id); ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id); ALTER TABLE agmdiseaseannotation_gene ADD CONSTRAINT agmdiseaseannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); +CREATE INDEX agmdiseaseannotation_subjectbiologicalentity_index ON agmdiseaseannotation USING btree (subjectbiologicalentity_id); +CREATE INDEX agmdiseaseannotation_assertedallele_index ON agmdiseaseannotation USING btree (assertedallele_id); +CREATE INDEX agmdiseaseannotation_inferredallele_index ON agmdiseaseannotation USING btree (inferredallele_id); +CREATE INDEX agmdiseaseannotation_inferredgene_index ON agmdiseaseannotation USING btree (inferredgene_id); ALTER TABLE allele ADD CONSTRAINT allele_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); ALTER TABLE allele_note ADD CONSTRAINT allele_note_allele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id); CREATE INDEX allele_note_allele_index ON allele_note USING btree (allele_id); @@ -1148,10 +998,10 @@ CREATE INDEX allele_reference_references_index ON allele_reference USING btree ( CREATE INDEX allele_reference_allele_references_index ON allele_reference USING btree (allele_id, references_id); ALTER TABLE alleledatabasestatusslotannotation ADD CONSTRAINT alleledatabasestatus_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); CREATE INDEX alleledatabasestatus_singleallele_index ON alleledatabasestatusslotannotation USING btree (singleallele_id); -ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannoation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES allele (id); +ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannoation_subjectbiologicalentity_id_fk FOREIGN KEY (subjectbiologicalentity_id) REFERENCES allele (id); ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id); CREATE INDEX allelediseaseannotation_inferredgene_index ON allelediseaseannotation USING btree (inferredgene_id); -CREATE INDEX allelediseaseannotation_subject_index ON allelediseaseannotation USING btree (subject_id); +CREATE INDEX allelediseaseannotation_subjectbiologicalentity_index ON allelediseaseannotation USING btree (subjectbiologicalentity_id); ALTER TABLE allelediseaseannotation_gene ADD CONSTRAINT allelediseaseannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); CREATE INDEX allelediseaseannotationgene_assertedgenes_index ON allelediseaseannotation_gene USING btree (assertedgenes_id); CREATE INDEX allelefullname_singleallele_index ON allelefullnameslotannotation USING btree (singleallele_id); @@ -1159,10 +1009,10 @@ ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctional ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctionalimpactslotannotation_phenotypeterm_id_fk FOREIGN KEY (phenotypeterm_id) REFERENCES phenotypeterm (id); CREATE INDEX allelefunctionalimpact_singleallele_index ON allelefunctionalimpactslotannotation USING btree (singleallele_id); CREATE INDEX allelefunctionalimpact_phenotypeterm_index ON allelefunctionalimpactslotannotation USING btree (phenotypeterm_id); -ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_object_id_fk FOREIGN KEY (object_id) REFERENCES gene (id); -ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES allele (id); -CREATE INDEX allelegeneassociation_object_index ON allelegeneassociation USING btree (object_id); -CREATE INDEX allelegeneassociation_subject_index ON allelegeneassociation USING btree (subject_id); +ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_objectbiologicalentity_id_fk FOREIGN KEY (objectbiologicalentity_id) REFERENCES gene (id); +ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_subjectbiologicalentity_id_fk FOREIGN KEY (subjectbiologicalentity_id) REFERENCES allele (id); +CREATE INDEX allelegeneassociation_objectbiologicalentity_index ON allelegeneassociation USING btree (objectbiologicalentity_id); +CREATE INDEX allelegeneassociation_subjectbiologicalentity_index ON allelegeneassociation USING btree (subjectbiologicalentity_id); ALTER TABLE allelegenomicentityassociation ADD CONSTRAINT allelegenomicentityassociation_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES ecoterm (id); ALTER TABLE allelegermlinetransmissionstatusslotannotation ADD CONSTRAINT allelegermlinetransmissionstatus_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); CREATE INDEX allelegermlinetransmissionstatus_singleallele_index ON allelegermlinetransmissionstatusslotannotation USING btree (singleallele_id); @@ -1185,7 +1035,6 @@ CREATE INDEX allelesynonym_singleallele_index ON allelesynonymslotannotation USI ALTER TABLE anatomicalterm ADD CONSTRAINT anatomicalterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE apoterm ADD CONSTRAINT apoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); ALTER TABLE atpterm ADD CONSTRAINT atpterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_id_fk FOREIGN KEY (id) REFERENCES submittedobject (id); ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); CREATE INDEX biologicalentity_taxon_index ON biologicalentity USING btree (taxon_id); ALTER TABLE bspoterm ADD CONSTRAINT bspoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); @@ -1198,11 +1047,11 @@ ALTER TABLE construct_reference ADD CONSTRAINT construct_reference_references_id CREATE INDEX construct_reference_references_index ON construct_reference USING btree (references_id); ALTER TABLE constructcomponentslotannotation ADD CONSTRAINT constructcomponentslotannotation_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); CREATE INDEX constructcomponentslotannotation_taxon_index ON constructcomponentslotannotation USING btree (taxon_id); -ALTER TABLE constructgenomicentityassociation ADD CONSTRAINT constructgenomicentityassociation_object_id_fk FOREIGN KEY (object_id) REFERENCES genomicentity (id); -CREATE INDEX constructgenomicentityassociation_object_index ON constructgenomicentityassociation USING btree (object_id); +ALTER TABLE constructgenomicentityassociation ADD CONSTRAINT constructgenomicentityassociation_objectbiologicalentity_id_fk FOREIGN KEY (objectbiologicalentity_id) REFERENCES genomicentity (id); +CREATE INDEX constructgenomicentityassociation_objectbiologicalentity_index ON constructgenomicentityassociation USING btree (objectbiologicalentity_id); ALTER TABLE daoterm ADD CONSTRAINT daoterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE diseaseannotation ADD CONSTRAINT diseaseannotation_object_id_fk FOREIGN KEY (object_id) REFERENCES doterm (id); -CREATE INDEX diseaseannotation_object_index ON diseaseannotation USING btree (object_id); +ALTER TABLE diseaseannotation ADD CONSTRAINT diseaseannotation_objectontologyterm_id_fk FOREIGN KEY (objectontologyterm_id) REFERENCES doterm (id); +CREATE INDEX diseaseannotation_objectontologyterm_index ON diseaseannotation USING btree (objectontologyterm_id); ALTER TABLE diseaseannotation_biologicalentity ADD CONSTRAINT diseaseannotation_biologicalentity_dgm_id_fk FOREIGN KEY (diseasegeneticmodifiers_id) REFERENCES biologicalentity (id); CREATE INDEX diseaseannotation_biologicalentity_dgms_index ON diseaseannotation_biologicalentity USING btree (diseasegeneticmodifiers_id); ALTER TABLE diseaseannotation_ecoterm ADD CONSTRAINT diseaseannotation_ecoterm_evidencecodes_id_fk FOREIGN KEY (evidencecodes_id) REFERENCES ecoterm (id); @@ -1226,8 +1075,9 @@ ALTER TABLE fbdvterm ADD CONSTRAINT fbdvterm_id_fk FOREIGN KEY (id) REFERENCES s ALTER TABLE gene ADD CONSTRAINT gene_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); ALTER TABLE gene ADD CONSTRAINT gene_genetype_id_fk FOREIGN KEY (genetype_id) REFERENCES soterm (id); CREATE INDEX gene_genetype_index ON gene USING btree (genetype_id); -ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_subject_id_fk FOREIGN KEY (subject_id) REFERENCES gene (id); +ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_subjectbiologicalentity_id_fk FOREIGN KEY (subjectbiologicalentity_id) REFERENCES gene (id); ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_sgdstrainbackground_id_fk FOREIGN KEY (sgdstrainbackground_id) REFERENCES affectedgenomicmodel (id); +CREATE INDEX genediseaseannotation_subjectbiologicalentity_index ON genediseaseannotation USING btree (subjectbiologicalentity_id); ALTER TABLE genefullnameslotannotation ADD CONSTRAINT genefullnameslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); CREATE INDEX genefullname_singlegene_index ON genefullnameslotannotation USING btree (singlegene_id); ALTER TABLE genesecondaryidslotannotation ADD CONSTRAINT genesecondaryidslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); @@ -1240,8 +1090,8 @@ ALTER TABLE genesystematicnameslotannotation ADD CONSTRAINT genesystematicnamesl CREATE INDEX genesystematicname_singlegene_index ON genesystematicnameslotannotation USING btree (singlegene_id); ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_objectgene_id_fk FOREIGN KEY (objectgene_id) REFERENCES gene (id); ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_subjectgene_id_fk FOREIGN KEY (subjectgene_id) REFERENCES gene (id); -CREATE INDEX genetogeneorthology_object_index ON genetogeneorthology USING btree (objectgene_id); -CREATE INDEX genetogeneorthology_subject_index ON genetogeneorthology USING btree (subjectgene_id); +CREATE INDEX genetogeneorthology_objectgene_index ON genetogeneorthology USING btree (objectgene_id); +CREATE INDEX genetogeneorthology_subjectgene_index ON genetogeneorthology USING btree (subjectgene_id); ALTER TABLE genetogeneorthologycurated ADD CONSTRAINT genetogeneorthologycurated_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES ecoterm (id); ALTER TABLE genetogeneorthologycurated ADD CONSTRAINT genetogeneorthologycurated_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id); CREATE INDEX genetogeneorthologycurated_evidencecode_index ON genetogeneorthologycurated USING btree (evidencecode_id); @@ -1252,7 +1102,6 @@ CREATE INDEX genomicentity_crossreference_ge_xref_index ON genomicentity_crossre CREATE INDEX genomicentity_crossreference_genomicentity_index ON genomicentity_crossreference USING btree (genomicentity_id); ALTER TABLE goterm ADD CONSTRAINT goterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE hpterm ADD CONSTRAINT hpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id); -ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); ALTER TABLE materm ADD CONSTRAINT materm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); ALTER TABLE miterm ADD CONSTRAINT miterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); @@ -1265,7 +1114,6 @@ ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_id_fk FOREIGN KEY (id) RE ALTER TABLE note_reference ADD CONSTRAINT note_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id); CREATE INDEX note_reference_references_index ON note_reference USING btree (references_id); ALTER TABLE obiterm ADD CONSTRAINT obiterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_id_fk FOREIGN KEY (id) REFERENCES curieobject (id); ALTER TABLE ontologyterm_crossreference ADD CONSTRAINT ontologyterm_crossreference_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); CREATE INDEX ontologyterm_crossreference_ontologyterm_index ON ontologyterm_crossreference USING btree (ontologyterm_id); ALTER TABLE ontologyterm_definitionurls ADD CONSTRAINT ontologyterm_definitionurls_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id); @@ -1287,7 +1135,6 @@ CREATE INDEX ontologyterm_synonym_ontologyterm_index ON ontologyterm_synonym USI ALTER TABLE patoterm ADD CONSTRAINT patoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE phenotypeterm ADD CONSTRAINT phenotypeterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); ALTER TABLE pwterm ADD CONSTRAINT pwterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id); -ALTER TABLE reagent ADD CONSTRAINT reagent_id_fk FOREIGN KEY (id) REFERENCES submittedobject (id); ALTER TABLE reference ADD CONSTRAINT reference_id_fk FOREIGN KEY (id) REFERENCES informationcontententity (id); ALTER TABLE reference_crossreference ADD CONSTRAINT reference_crossreference_reference_id_fk FOREIGN KEY (reference_id) REFERENCES reference (id); CREATE INDEX reference_crossreference_reference_index ON reference_crossreference USING btree (reference_id); @@ -1322,5 +1169,6 @@ ALTER TABLE zecoterm ADD CONSTRAINT zecoterm_id_fk FOREIGN KEY (id) REFERENCES e ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id); -ALTER SEQUENCE curieobject_seq INCREMENT BY 50; +ALTER SEQUENCE biologicalentity_seq INCREMENT BY 50; ALTER SEQUENCE informationcontententity_seq INCREMENT BY 50; +ALTER SEQUENCE ontologyterm_seq INCREMENT BY 50; diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java index cc7fabf44..2b7b56dd7 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java @@ -203,8 +203,8 @@ public void geneDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-10T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-09T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:Gene0001|is_implicated_in|true|DATEST:Disease0001|AGRKB:000000002|DATEST:Evidence0001|HGNC:0001|exacerbated_by|DATEST:ExpCondTerm0001|DATEST:ExpCondTerm0002|DATEST:AnatomyTerm0001|DATEST:ChemicalTerm0001|DATEST:GOTerm0001|NCBITaxon:6239|Some amount|Free text|susceptibility|ameliorated_by|DATEST:Gene0002")). - body("entity.subject.modEntityId", is(gene)). - body("entity.object.curie", is(doTerm)). + body("entity.subjectBiologicalEntity.modEntityId", is(gene)). + body("entity.objectOntologyTerm.curie", is(doTerm)). body("entity.relation.name", is(alleleAndGeneRelation)). body("entity.geneticSex.name", is(geneticSex)). body("entity.conditionRelations", hasSize(1)). @@ -283,8 +283,8 @@ public void alleleDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-10T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-09T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:Allele0001|is_implicated_in|true|DATEST:Disease0001|AGRKB:000000002|DATEST:Evidence0001|HGNC:0001|exacerbated_by|DATEST:ExpCondTerm0001|DATEST:ExpCondTerm0002|DATEST:AnatomyTerm0001|DATEST:ChemicalTerm0001|DATEST:GOTerm0001|NCBITaxon:6239|Some amount|Free text|susceptibility|ameliorated_by|DATEST:Gene0002")). - body("entity.subject.modEntityId", is(allele)). - body("entity.object.curie", is(doTerm)). + body("entity.subjectBiologicalEntity.modEntityId", is(allele)). + body("entity.objectOntologyTerm.curie", is(doTerm)). body("entity.relation.name", is(alleleAndGeneRelation)). body("entity.geneticSex.name", is(geneticSex)). body("entity.conditionRelations", hasSize(1)). @@ -364,8 +364,8 @@ public void agmDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-10T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-09T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:AGM0001|is_model_of|true|DATEST:Disease0001|AGRKB:000000002|DATEST:Evidence0001|HGNC:0001|exacerbated_by|DATEST:ExpCondTerm0001|DATEST:ExpCondTerm0002|DATEST:AnatomyTerm0001|DATEST:ChemicalTerm0001|DATEST:GOTerm0001|NCBITaxon:6239|Some amount|Free text|susceptibility|ameliorated_by|DATEST:Gene0002")). - body("entity.subject.modEntityId", is(agm)). - body("entity.object.curie", is(doTerm)). + body("entity.subjectBiologicalEntity.modEntityId", is(agm)). + body("entity.objectOntologyTerm.curie", is(doTerm)). body("entity.relation.name", is(agmRelation)). body("entity.geneticSex.name", is(geneticSex)). body("entity.conditionRelations", hasSize(1)). @@ -447,8 +447,8 @@ public void geneDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exception body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-20T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-19T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:Gene0002|is_marker_for|false|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). - body("entity.subject.modEntityId", is(gene2)). - body("entity.object.curie", is(doTerm2)). + body("entity.subjectBiologicalEntity.modEntityId", is(gene2)). + body("entity.objectOntologyTerm.curie", is(doTerm2)). body("entity.relation.name", is(geneRelation)). body("entity.geneticSex.name", is(geneticSex2)). body("entity.conditionRelations", hasSize(1)). @@ -527,8 +527,8 @@ public void alleleDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exceptio body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-20T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-19T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:Allele0002|is_implicated_in|false|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). - body("entity.subject.modEntityId", is(allele2)). - body("entity.object.curie", is(doTerm2)). + body("entity.subjectBiologicalEntity.modEntityId", is(allele2)). + body("entity.objectOntologyTerm.curie", is(doTerm2)). body("entity.relation.name", is(alleleAndGeneRelation)). body("entity.geneticSex.name", is(geneticSex2)). body("entity.conditionRelations", hasSize(1)). @@ -608,8 +608,8 @@ public void agmDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exception { body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-20T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-19T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:AGM0002|is_exacerbated_model_of|false|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). - body("entity.subject.modEntityId", is(agm2)). - body("entity.object.curie", is(doTerm2)). + body("entity.subjectBiologicalEntity.modEntityId", is(agm2)). + body("entity.objectOntologyTerm.curie", is(doTerm2)). body("entity.relation.name", is(agmRelation2)). body("entity.geneticSex.name", is(geneticSex2)). body("entity.conditionRelations", hasSize(1)). diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java index a0c7cd4c9..6fd7bf54a 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java @@ -82,8 +82,8 @@ public void alleleGeneAssociationBulkUploadCheckFields() throws Exception { then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.object.modEntityId", is(geneCurie)). - body("entity.subject.modEntityId", is(alleleCurie)). + body("entity.objectBiologicalEntity.modEntityId", is(geneCurie)). + body("entity.subjectBiologicalEntity.modEntityId", is(alleleCurie)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference)). body("entity.evidenceCode.curie", is(evidenceCodeCurie)). @@ -110,8 +110,8 @@ public void alleleGeneAssociationBulkUploadCheckFields() throws Exception { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relationName)). - body("entity.alleleGeneAssociations[0].object.modEntityId", is(geneCurie)). - body("entity.alleleGeneAssociations[0].subject", not(hasKey("alleleGeneAssociations"))); + body("entity.alleleGeneAssociations[0].objectBiologicalEntity.modEntityId", is(geneCurie)). + body("entity.alleleGeneAssociations[0].subjectBiologicalEntity", not(hasKey("alleleGeneAssociations"))); RestAssured.given(). when(). @@ -120,8 +120,8 @@ public void alleleGeneAssociationBulkUploadCheckFields() throws Exception { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relationName)). - body("entity.alleleGeneAssociations[0].object.modEntityId", is(geneCurie)). - body("entity.alleleGeneAssociations[0].object", not(hasKey("alleleGeneAssociations"))); + body("entity.alleleGeneAssociations[0].objectBiologicalEntity.modEntityId", is(geneCurie)). + body("entity.alleleGeneAssociations[0].objectBiologicalEntity", not(hasKey("alleleGeneAssociations"))); } @Test @@ -137,7 +137,7 @@ public void alleleGeneAssociationBulkUploadUpdateCheckFields() throws Exception then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.object.modEntityId", is(geneCurie)). + body("entity.objectBiologicalEntity.modEntityId", is(geneCurie)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2)). body("entity.evidenceCode.curie", is(evidenceCodeCurie2)). diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java index 0d75e39c3..3b12f7b1e 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java @@ -76,8 +76,8 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.object.modEntityId", is(geneModEntityId)). - body("entity.subject.modEntityId", is(constructModEntityId)). + body("entity.objectBiologicalEntity.modEntityId", is(geneModEntityId)). + body("entity.subjectReagent.modEntityId", is(constructModEntityId)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference)). body("entity.internal", is(true)). @@ -104,8 +104,8 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce body("entity.modEntityId", is(constructModEntityId)). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relationName)). - body("entity.constructGenomicEntityAssociations[0].object.modEntityId", is(geneModEntityId)). - body("entity.constructGenomicEntityAssociations[0].subject", not(hasKey("constructGenomicEntityAssociations"))); + body("entity.constructGenomicEntityAssociations[0].objectBiologicalEntity.modEntityId", is(geneModEntityId)). + body("entity.constructGenomicEntityAssociations[0].subjectReagent", not(hasKey("constructGenomicEntityAssociations"))); RestAssured.given(). when(). @@ -114,8 +114,8 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relationName)). - body("entity.constructGenomicEntityAssociations[0].object.modEntityId", is(geneModEntityId)). - body("entity.constructGenomicEntityAssociations[0].object", not(hasKey("constructGenomicEntityAssociations"))); + body("entity.constructGenomicEntityAssociations[0].objectBiologicalEntity.modEntityId", is(geneModEntityId)). + body("entity.constructGenomicEntityAssociations[0].objectBiologicalEntity", not(hasKey("constructGenomicEntityAssociations"))); } @Test @@ -129,7 +129,7 @@ public void constructGenomicEntityAssociationBulkUploadUpdateCheckFields() throw then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.object.modEntityId", is(geneModEntityId)). + body("entity.objectBiologicalEntity.modEntityId", is(geneModEntityId)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2)). body("entity.internal", is(false)). diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java index 4e26bad01..e27569f17 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java @@ -1453,7 +1453,7 @@ public void updateAlleleDetailWithNewAssociations() { Allele allele = getAllele(ALLELE); AlleleGeneAssociation geneAssociation = new AlleleGeneAssociation(); - geneAssociation.setObject(gene); + geneAssociation.setObjectBiologicalEntity(gene); geneAssociation.setRelation(geneAssociationRelation); Reference reference = createReference("AGRKB:AssocTest1", false); geneAssociation.setEvidence(List.of(reference)); @@ -1473,7 +1473,7 @@ public void updateAlleleDetailWithNewAssociations() { then(). statusCode(200). body("entity", hasKey("alleleGeneAssociations")). - body("entity.alleleGeneAssociations[0].object.modEntityId", is(gene.getModEntityId())); + body("entity.alleleGeneAssociations[0].objectBiologicalEntity.modEntityId", is(gene.getModEntityId())); } @Test @@ -1505,7 +1505,7 @@ public void updateAlleleDetailWithInvalidAssociations() { Allele allele = getAllele(ALLELE); AlleleGeneAssociation geneAssociation = new AlleleGeneAssociation(); - geneAssociation.setObject(gene); + geneAssociation.setObjectBiologicalEntity(gene); geneAssociation.setRelation(dominantInheritanceMode); allele.setAlleleGeneAssociations(List.of(geneAssociation)); diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java index 7d3a4bdbb..ac02f2a1e 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java @@ -88,7 +88,6 @@ public class ConstructITCase extends BaseITCase { private ConstructFullNameSlotAnnotation constructFullName; private ConstructSynonymSlotAnnotation constructSynonym; private Gene gene; - private Gene gene2; private VocabularyTerm geAssociationRelation; private void loadRequiredEntities() { @@ -133,7 +132,6 @@ private void loadRequiredEntities() { constructSynonym = createConstructSynonymSlotAnnotation(List.of(reference), "Test synonym", systematicNameType, exactSynonymScope, "https://test.org"); VocabularyTerm symbolNameType = getVocabularyTerm(nameTypeVocabulary, "nomenclature_symbol"); gene = createGene("TEST:AssociatedGenomicEntity1", "NCBITaxon:6239", false, symbolNameType); - gene2 = createGene("TEST:AssociatedGenomicEntity2", "NCBITaxon:6239", false, symbolNameType); Vocabulary relationVocabulary = getVocabulary(VocabularyConstants.CONSTRUCT_RELATION_VOCABULARY); geAssociationRelation = getVocabularyTerm(relationVocabulary, "is_regulated_by"); } @@ -936,7 +934,7 @@ public void updateConstructWithNewAssociations() { Construct construct = getConstruct(CONSTRUCT); ConstructGenomicEntityAssociation geAssociation = new ConstructGenomicEntityAssociation(); - geAssociation.setObject(gene); + geAssociation.setObjectBiologicalEntity(gene); geAssociation.setRelation(geAssociationRelation); construct.setConstructGenomicEntityAssociations(List.of(geAssociation)); @@ -954,7 +952,7 @@ public void updateConstructWithNewAssociations() { then(). statusCode(200). body("entity", hasKey("constructGenomicEntityAssociations")). - body("entity.constructGenomicEntityAssociations[0].object.modEntityId", is(gene.getModEntityId())); + body("entity.constructGenomicEntityAssociations[0].objectBiologicalEntity.modEntityId", is(gene.getModEntityId())); } @Test @@ -986,7 +984,7 @@ public void updateConstructWithInvalidAssociations() { Construct construct = getConstruct(CONSTRUCT); ConstructGenomicEntityAssociation geneAssociation = new ConstructGenomicEntityAssociation(); - geneAssociation.setObject(gene); + geneAssociation.setObjectBiologicalEntity(gene); geneAssociation.setRelation(systematicNameType); construct.setConstructGenomicEntityAssociations(List.of(geneAssociation)); diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java index ceb75b44a..55a1ce6ca 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java @@ -223,10 +223,10 @@ public void createGeneDiseaseAnnotation() { diseaseAnnotation.setModEntityId(GENE_DISEASE_ANNOTATION); diseaseAnnotation.setDateCreated(datetime); diseaseAnnotation.setNegated(false); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider2); - diseaseAnnotation.setSubject(gene); + diseaseAnnotation.setSubjectBiologicalEntity(gene); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); diseaseAnnotation.setConditionRelations(List.of(conditionRelation)); @@ -253,8 +253,8 @@ public void createGeneDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("GENE:da0001|is_implicated_in|false|DOID:da0001|AGRKB:100000005|ECO:da00001|HGNC:1|has_condition|ZECO:da001|severity|ameliorated_by|SGD:da0002")). body("entity.modEntityId", is(GENE_DISEASE_ANNOTATION)). - body("entity.subject.modEntityId", is(gene.getModEntityId())). - body("entity.object.curie", is(doTerm.getCurie())). + body("entity.subjectBiologicalEntity.modEntityId", is(gene.getModEntityId())). + body("entity.objectOntologyTerm.curie", is(doTerm.getCurie())). body("entity.relation.name", is(alleleAndGeneRelation.getName())). body("entity.negated", is(false)). body("entity.internal", is(false)). @@ -293,10 +293,10 @@ public void createAlleleDiseaseAnnotation() { diseaseAnnotation.setModEntityId(ALLELE_DISEASE_ANNOTATION); diseaseAnnotation.setDateCreated(datetime); diseaseAnnotation.setNegated(false); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider2); - diseaseAnnotation.setSubject(allele); + diseaseAnnotation.setSubjectBiologicalEntity(allele); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); diseaseAnnotation.setConditionRelations(List.of(conditionRelation)); @@ -324,8 +324,8 @@ public void createAlleleDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("ALLELE:da0001|is_implicated_in|false|DOID:da0001|AGRKB:100000005|ECO:da00001|HGNC:1|has_condition|ZECO:da001|severity|ameliorated_by|SGD:da0002")). body("entity.modEntityId", is(ALLELE_DISEASE_ANNOTATION)). - body("entity.subject.modEntityId", is(allele.getModEntityId())). - body("entity.object.curie", is(doTerm.getCurie())). + body("entity.subjectBiologicalEntity.modEntityId", is(allele.getModEntityId())). + body("entity.objectOntologyTerm.curie", is(doTerm.getCurie())). body("entity.relation.name", is(alleleAndGeneRelation.getName())). body("entity.negated", is(false)). body("entity.internal", is(false)). @@ -366,10 +366,10 @@ public void createAgmDiseaseAnnotation() { diseaseAnnotation.setModEntityId(AGM_DISEASE_ANNOTATION); diseaseAnnotation.setDateCreated(datetime); diseaseAnnotation.setNegated(false); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider2); - diseaseAnnotation.setSubject(agm); + diseaseAnnotation.setSubjectBiologicalEntity(agm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); diseaseAnnotation.setConditionRelations(List.of(conditionRelation)); @@ -399,8 +399,8 @@ public void createAgmDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("SGD:da0001|is_model_of|false|DOID:da0001|AGRKB:100000005|ECO:da00001|HGNC:1|has_condition|ZECO:da001|severity|ameliorated_by|SGD:da0002")). body("entity.modEntityId", is(AGM_DISEASE_ANNOTATION)). - body("entity.subject.modEntityId", is(agm.getModEntityId())). - body("entity.object.curie", is(doTerm.getCurie())). + body("entity.subjectBiologicalEntity.modEntityId", is(agm.getModEntityId())). + body("entity.objectOntologyTerm.curie", is(doTerm.getCurie())). body("entity.relation.name", is(agmRelation.getName())). body("entity.negated", is(false)). body("entity.internal", is(false)). @@ -445,10 +445,10 @@ public void editGeneDiseaseAnnotation() { diseaseAnnotation.setInternal(true); diseaseAnnotation.setCreatedBy(person); diseaseAnnotation.setNegated(true); - diseaseAnnotation.setObject(doTerm2); + diseaseAnnotation.setObjectOntologyTerm(doTerm2); diseaseAnnotation.setDataProvider(dataProvider2); diseaseAnnotation.setSecondaryDataProvider(dataProvider); - diseaseAnnotation.setSubject(gene2); + diseaseAnnotation.setSubjectBiologicalEntity(gene2); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm2)); diseaseAnnotation.setSingleReference(reference2); diseaseAnnotation.setSgdStrainBackground(agm2); @@ -487,8 +487,8 @@ public void editGeneDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("GENE:da0002|is_marker_for|true|DOID:da0002|AGRKB:100000006|ECO:da00002|HGNC:2|induced_by|ZECO:da002|onset|exacerbated_by|SGD:da0001")). body("entity.modEntityId", is(GENE_DISEASE_ANNOTATION)). - body("entity.subject.modEntityId", is(gene2.getModEntityId())). - body("entity.object.curie", is(doTerm2.getCurie())). + body("entity.subjectBiologicalEntity.modEntityId", is(gene2.getModEntityId())). + body("entity.objectOntologyTerm.curie", is(doTerm2.getCurie())). body("entity.relation.name", is(geneRelation.getName())). body("entity.negated", is(true)). body("entity.internal", is(true)). @@ -528,10 +528,10 @@ public void editAlleleDiseaseAnnotation() { diseaseAnnotation.setInternal(true); diseaseAnnotation.setCreatedBy(person); diseaseAnnotation.setNegated(true); - diseaseAnnotation.setObject(doTerm2); + diseaseAnnotation.setObjectOntologyTerm(doTerm2); diseaseAnnotation.setDataProvider(dataProvider2); diseaseAnnotation.setSecondaryDataProvider(dataProvider); - diseaseAnnotation.setSubject(allele2); + diseaseAnnotation.setSubjectBiologicalEntity(allele2); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm2)); diseaseAnnotation.setSingleReference(reference2); diseaseAnnotation.setWith(List.of(withGene2)); @@ -571,8 +571,8 @@ public void editAlleleDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("ALLELE:da0002|is_implicated_in|true|DOID:da0002|AGRKB:100000006|ECO:da00002|HGNC:2|induced_by|ZECO:da002|onset|exacerbated_by|SGD:da0001")). body("entity.modEntityId", is(ALLELE_DISEASE_ANNOTATION)). - body("entity.subject.modEntityId", is(allele2.getModEntityId())). - body("entity.object.curie", is(doTerm2.getCurie())). + body("entity.subjectBiologicalEntity.modEntityId", is(allele2.getModEntityId())). + body("entity.objectOntologyTerm.curie", is(doTerm2.getCurie())). body("entity.relation.name", is(alleleAndGeneRelation.getName())). body("entity.negated", is(true)). body("entity.internal", is(true)). @@ -615,10 +615,10 @@ public void editAgmDiseaseAnnotation() { diseaseAnnotation.setInternal(true); diseaseAnnotation.setCreatedBy(person); diseaseAnnotation.setNegated(true); - diseaseAnnotation.setObject(doTerm2); + diseaseAnnotation.setObjectOntologyTerm(doTerm2); diseaseAnnotation.setDataProvider(dataProvider2); diseaseAnnotation.setSecondaryDataProvider(dataProvider); - diseaseAnnotation.setSubject(agm2); + diseaseAnnotation.setSubjectBiologicalEntity(agm2); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm2)); diseaseAnnotation.setSingleReference(reference2); diseaseAnnotation.setWith(List.of(withGene2)); @@ -660,8 +660,8 @@ public void editAgmDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("SGD:da0002|is_exacerbated_model_of|true|DOID:da0002|AGRKB:100000006|ECO:da00002|HGNC:2|induced_by|ZECO:da002|onset|exacerbated_by|SGD:da0001")). body("entity.modEntityId", is(AGM_DISEASE_ANNOTATION)). - body("entity.subject.modEntityId", is(agm2.getModEntityId())). - body("entity.object.curie", is(doTerm2.getCurie())). + body("entity.subjectBiologicalEntity.modEntityId", is(agm2.getModEntityId())). + body("entity.objectOntologyTerm.curie", is(doTerm2.getCurie())). body("entity.relation.name", is(agmRelation2.getName())). body("entity.negated", is(true)). body("entity.internal", is(true)). @@ -709,8 +709,8 @@ public void createGeneDiseaseAnnotationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subject", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.evidenceCodes", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.singleReference", is(ValidationConstants.REQUIRED_MESSAGE)); @@ -729,8 +729,8 @@ public void createAlleleDiseaseAnnotationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subject", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.evidenceCodes", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.singleReference", is(ValidationConstants.REQUIRED_MESSAGE)); @@ -749,8 +749,8 @@ public void createAgmDiseaseAnnotationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subject", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.evidenceCodes", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.singleReference", is(ValidationConstants.REQUIRED_MESSAGE)); @@ -760,8 +760,8 @@ public void createAgmDiseaseAnnotationWithMissingRequiredFieldsLevel1() { @Order(10) public void editGeneDiseaseAnnotationWithMissingRequiredFieldsLevel1() { GeneDiseaseAnnotation diseaseAnnotation = getGeneDiseaseAnnotation(GENE_DISEASE_ANNOTATION); - diseaseAnnotation.setSubject(null); - diseaseAnnotation.setObject(null); + diseaseAnnotation.setSubjectBiologicalEntity(null); + diseaseAnnotation.setObjectOntologyTerm(null); diseaseAnnotation.setRelation(null); diseaseAnnotation.setEvidenceCodes(null); diseaseAnnotation.setSingleReference(null); @@ -775,8 +775,8 @@ public void editGeneDiseaseAnnotationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(6))). - body("errorMessages.subject", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.evidenceCodes", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.singleReference", is(ValidationConstants.REQUIRED_MESSAGE)). @@ -787,8 +787,8 @@ public void editGeneDiseaseAnnotationWithMissingRequiredFieldsLevel1() { @Order(11) public void editAlleleDiseaseAnnotationWithMissingRequiredFieldsLevel1() { AlleleDiseaseAnnotation diseaseAnnotation = getAlleleDiseaseAnnotation(ALLELE_DISEASE_ANNOTATION); - diseaseAnnotation.setSubject(null); - diseaseAnnotation.setObject(null); + diseaseAnnotation.setSubjectBiologicalEntity(null); + diseaseAnnotation.setObjectOntologyTerm(null); diseaseAnnotation.setRelation(null); diseaseAnnotation.setEvidenceCodes(null); diseaseAnnotation.setSingleReference(null); @@ -802,8 +802,8 @@ public void editAlleleDiseaseAnnotationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(6))). - body("errorMessages.subject", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.evidenceCodes", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.singleReference", is(ValidationConstants.REQUIRED_MESSAGE)). @@ -814,8 +814,8 @@ public void editAlleleDiseaseAnnotationWithMissingRequiredFieldsLevel1() { @Order(12) public void editAgmDiseaseAnnotationWithMissingRequiredFieldsLevel1() { AGMDiseaseAnnotation diseaseAnnotation = getAgmDiseaseAnnotation(AGM_DISEASE_ANNOTATION); - diseaseAnnotation.setSubject(null); - diseaseAnnotation.setObject(null); + diseaseAnnotation.setSubjectBiologicalEntity(null); + diseaseAnnotation.setObjectOntologyTerm(null); diseaseAnnotation.setRelation(null); diseaseAnnotation.setEvidenceCodes(null); diseaseAnnotation.setSingleReference(null); @@ -829,8 +829,8 @@ public void editAgmDiseaseAnnotationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(6))). - body("errorMessages.subject", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.evidenceCodes", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.singleReference", is(ValidationConstants.REQUIRED_MESSAGE)). @@ -844,8 +844,8 @@ public void createGeneDiseaseAnnotationWithMissingRequiredFieldsLevel2() { diseaseAnnotation.setModEntityId("GeneDisease:0013"); diseaseAnnotation.setRelation(geneRelation); diseaseAnnotation.setSingleReference(reference); - diseaseAnnotation.setSubject(gene); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setSubjectBiologicalEntity(gene); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); DataProvider newDataProvider = new DataProvider(); @@ -881,8 +881,8 @@ public void createAlleleDiseaseAnnotationWithMissingRequiredFieldsLevel2() { diseaseAnnotation.setModEntityId("AlleleDisease:0014"); diseaseAnnotation.setRelation(alleleAndGeneRelation); diseaseAnnotation.setSingleReference(reference); - diseaseAnnotation.setSubject(allele); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setSubjectBiologicalEntity(allele); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); DataProvider newDataProvider = new DataProvider(); @@ -918,8 +918,8 @@ public void createAgmDiseaseAnnotationWithMissingRequiredFieldsLevel2() { diseaseAnnotation.setModEntityId("AGMDisease:0016"); diseaseAnnotation.setRelation(agmRelation); diseaseAnnotation.setSingleReference(reference); - diseaseAnnotation.setSubject(agm); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setSubjectBiologicalEntity(agm); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); DataProvider newDataProvider = new DataProvider(); @@ -1075,8 +1075,8 @@ public void createGeneDiseaseAnnotationWithEmptyRequiredFieldsLevel2() { diseaseAnnotation.setModEntityId("GeneDisease:0019"); diseaseAnnotation.setRelation(geneRelation); diseaseAnnotation.setSingleReference(reference); - diseaseAnnotation.setSubject(gene); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setSubjectBiologicalEntity(gene); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setDataProvider(dataProvider); @@ -1103,8 +1103,8 @@ public void createAlleleDiseaseAnnotationWithEmptyRequiredFieldsLevel2() { diseaseAnnotation.setModEntityId("AlleleDisease:0020"); diseaseAnnotation.setRelation(alleleAndGeneRelation); diseaseAnnotation.setSingleReference(reference); - diseaseAnnotation.setSubject(allele); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setSubjectBiologicalEntity(allele); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setDataProvider(dataProvider); @@ -1131,8 +1131,8 @@ public void createAgmDiseaseAnnotationWithEmptyRequiredFieldsLevel2() { diseaseAnnotation.setModEntityId("AgmDisease:0021"); diseaseAnnotation.setRelation(agmRelation); diseaseAnnotation.setSingleReference(reference); - diseaseAnnotation.setSubject(agm); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setSubjectBiologicalEntity(agm); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setDataProvider(dataProvider); @@ -1217,12 +1217,12 @@ public void editAgmDiseaseAnnotationWithEmptyRequiredFieldsLevel2() { public void createGeneDiseaseAnnotationWithInvalidFields() { GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); diseaseAnnotation.setRelation(agmRelation); - diseaseAnnotation.setObject(nonPersistedDoTerm); + diseaseAnnotation.setObjectOntologyTerm(nonPersistedDoTerm); DataProvider invalidDataProvider = new DataProvider(); invalidDataProvider.setSourceOrganization(nonPersistedOrganization); diseaseAnnotation.setDataProvider(invalidDataProvider); diseaseAnnotation.setSecondaryDataProvider(invalidDataProvider); - diseaseAnnotation.setSubject(nonPersistedGene); + diseaseAnnotation.setSubjectBiologicalEntity(nonPersistedGene); diseaseAnnotation.setEvidenceCodes(List.of(nonPersistedEcoTerm)); diseaseAnnotation.setSingleReference(nonPersistedReference); diseaseAnnotation.setSgdStrainBackground(nonSgdAgm); @@ -1253,8 +1253,8 @@ public void createGeneDiseaseAnnotationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(16))). - body("errorMessages.subject", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.dataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). body("errorMessages.secondaryDataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). @@ -1281,12 +1281,12 @@ public void createGeneDiseaseAnnotationWithInvalidFields() { public void createAlleleDiseaseAnnotationWithInvalidFields() { AlleleDiseaseAnnotation diseaseAnnotation = new AlleleDiseaseAnnotation(); diseaseAnnotation.setRelation(agmRelation); - diseaseAnnotation.setObject(nonPersistedDoTerm); + diseaseAnnotation.setObjectOntologyTerm(nonPersistedDoTerm); DataProvider invalidDataProvider = new DataProvider(); invalidDataProvider.setSourceOrganization(nonPersistedOrganization); diseaseAnnotation.setDataProvider(invalidDataProvider); diseaseAnnotation.setSecondaryDataProvider(invalidDataProvider); - diseaseAnnotation.setSubject(nonPersistedAllele); + diseaseAnnotation.setSubjectBiologicalEntity(nonPersistedAllele); diseaseAnnotation.setEvidenceCodes(List.of(nonPersistedEcoTerm)); diseaseAnnotation.setSingleReference(nonPersistedReference); diseaseAnnotation.setWith(List.of(gene)); @@ -1318,8 +1318,8 @@ public void createAlleleDiseaseAnnotationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(17))). - body("errorMessages.subject", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.dataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). body("errorMessages.secondaryDataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). @@ -1347,12 +1347,12 @@ public void createAlleleDiseaseAnnotationWithInvalidFields() { public void createAgmDiseaseAnnotationWithInvalidFields() { AGMDiseaseAnnotation diseaseAnnotation = new AGMDiseaseAnnotation(); diseaseAnnotation.setRelation(geneRelation); - diseaseAnnotation.setObject(nonPersistedDoTerm); + diseaseAnnotation.setObjectOntologyTerm(nonPersistedDoTerm); DataProvider invalidDataProvider = new DataProvider(); invalidDataProvider.setSourceOrganization(nonPersistedOrganization); diseaseAnnotation.setDataProvider(invalidDataProvider); diseaseAnnotation.setSecondaryDataProvider(invalidDataProvider); - diseaseAnnotation.setSubject(nonPersistedAgm); + diseaseAnnotation.setSubjectBiologicalEntity(nonPersistedAgm); diseaseAnnotation.setEvidenceCodes(List.of(nonPersistedEcoTerm)); diseaseAnnotation.setSingleReference(nonPersistedReference); diseaseAnnotation.setWith(List.of(gene)); @@ -1386,8 +1386,8 @@ public void createAgmDiseaseAnnotationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(19))). - body("errorMessages.subject", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.dataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). body("errorMessages.secondaryDataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). @@ -1417,12 +1417,12 @@ public void createAgmDiseaseAnnotationWithInvalidFields() { public void editGeneDiseaseAnnotationWithInvalidFields() { GeneDiseaseAnnotation diseaseAnnotation = getGeneDiseaseAnnotation(GENE_DISEASE_ANNOTATION); diseaseAnnotation.setRelation(agmRelation); - diseaseAnnotation.setObject(nonPersistedDoTerm); + diseaseAnnotation.setObjectOntologyTerm(nonPersistedDoTerm); DataProvider invalidDataProvider = new DataProvider(); invalidDataProvider.setSourceOrganization(nonPersistedOrganization); diseaseAnnotation.setDataProvider(invalidDataProvider); diseaseAnnotation.setSecondaryDataProvider(invalidDataProvider); - diseaseAnnotation.setSubject(nonPersistedGene); + diseaseAnnotation.setSubjectBiologicalEntity(nonPersistedGene); diseaseAnnotation.setEvidenceCodes(List.of(nonPersistedEcoTerm)); diseaseAnnotation.setSingleReference(nonPersistedReference); diseaseAnnotation.setSgdStrainBackground(nonSgdAgm); @@ -1452,8 +1452,8 @@ public void editGeneDiseaseAnnotationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(16))). - body("errorMessages.subject", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.dataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). body("errorMessages.secondaryDataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). @@ -1480,12 +1480,12 @@ public void editGeneDiseaseAnnotationWithInvalidFields() { public void editAlleleDiseaseAnnotationWithInvalidFields() { AlleleDiseaseAnnotation diseaseAnnotation = getAlleleDiseaseAnnotation(ALLELE_DISEASE_ANNOTATION); diseaseAnnotation.setRelation(agmRelation); - diseaseAnnotation.setObject(nonPersistedDoTerm); + diseaseAnnotation.setObjectOntologyTerm(nonPersistedDoTerm); DataProvider invalidDataProvider = new DataProvider(); invalidDataProvider.setSourceOrganization(nonPersistedOrganization); diseaseAnnotation.setDataProvider(invalidDataProvider); diseaseAnnotation.setSecondaryDataProvider(invalidDataProvider); - diseaseAnnotation.setSubject(nonPersistedAllele); + diseaseAnnotation.setSubjectBiologicalEntity(nonPersistedAllele); diseaseAnnotation.setEvidenceCodes(List.of(nonPersistedEcoTerm)); diseaseAnnotation.setSingleReference(nonPersistedReference); diseaseAnnotation.setWith(List.of(gene)); @@ -1516,8 +1516,8 @@ public void editAlleleDiseaseAnnotationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(17))). - body("errorMessages.subject", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.dataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). body("errorMessages.secondaryDataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). @@ -1545,12 +1545,12 @@ public void editAlleleDiseaseAnnotationWithInvalidFields() { public void editAgmDiseaseAnnotationWithInvalidFields() { AGMDiseaseAnnotation diseaseAnnotation = getAgmDiseaseAnnotation(AGM_DISEASE_ANNOTATION); diseaseAnnotation.setRelation(geneRelation); - diseaseAnnotation.setObject(nonPersistedDoTerm); + diseaseAnnotation.setObjectOntologyTerm(nonPersistedDoTerm); DataProvider invalidDataProvider = new DataProvider(); invalidDataProvider.setSourceOrganization(nonPersistedOrganization); diseaseAnnotation.setDataProvider(invalidDataProvider); diseaseAnnotation.setSecondaryDataProvider(invalidDataProvider); - diseaseAnnotation.setSubject(nonPersistedAgm); + diseaseAnnotation.setSubjectBiologicalEntity(nonPersistedAgm); diseaseAnnotation.setEvidenceCodes(List.of(nonPersistedEcoTerm)); diseaseAnnotation.setSingleReference(nonPersistedReference); diseaseAnnotation.setWith(List.of(gene)); @@ -1583,8 +1583,8 @@ public void editAgmDiseaseAnnotationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(19))). - body("errorMessages.subject", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.dataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). body("errorMessages.secondaryDataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). @@ -1615,10 +1615,10 @@ public void createGeneDiseaseAnnotationWithObsoleteFields() { dataProvider.setObsolete(true); GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); diseaseAnnotation.setRelation(obsoleteGeneRelation); - diseaseAnnotation.setObject(obsoleteDoTerm); + diseaseAnnotation.setObjectOntologyTerm(obsoleteDoTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider); - diseaseAnnotation.setSubject(obsoleteGene); + diseaseAnnotation.setSubjectBiologicalEntity(obsoleteGene); diseaseAnnotation.setEvidenceCodes(List.of(obsoleteEcoTerm)); diseaseAnnotation.setSingleReference(obsoleteReference); diseaseAnnotation.setSgdStrainBackground(obsoleteAgm); @@ -1649,8 +1649,8 @@ public void createGeneDiseaseAnnotationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(16))). - body("errorMessages.subject", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.dataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.secondaryDataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). @@ -1676,10 +1676,10 @@ public void createGeneDiseaseAnnotationWithObsoleteFields() { public void createAlleleDiseaseAnnotationWithObsoleteFields() { AlleleDiseaseAnnotation diseaseAnnotation = new AlleleDiseaseAnnotation(); diseaseAnnotation.setRelation(obsoleteAlleleRelation); - diseaseAnnotation.setObject(obsoleteDoTerm); + diseaseAnnotation.setObjectOntologyTerm(obsoleteDoTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider); - diseaseAnnotation.setSubject(obsoleteAllele); + diseaseAnnotation.setSubjectBiologicalEntity(obsoleteAllele); diseaseAnnotation.setEvidenceCodes(List.of(obsoleteEcoTerm)); diseaseAnnotation.setSingleReference(obsoleteReference); diseaseAnnotation.setWith(List.of(obsoleteGene)); @@ -1711,8 +1711,8 @@ public void createAlleleDiseaseAnnotationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(17))). - body("errorMessages.subject", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.dataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.secondaryDataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). @@ -1739,10 +1739,10 @@ public void createAlleleDiseaseAnnotationWithObsoleteFields() { public void createAgmDiseaseAnnotationWithObsoleteFields() { AGMDiseaseAnnotation diseaseAnnotation = new AGMDiseaseAnnotation(); diseaseAnnotation.setRelation(obsoleteAgmRelation); - diseaseAnnotation.setObject(obsoleteDoTerm); + diseaseAnnotation.setObjectOntologyTerm(obsoleteDoTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider); - diseaseAnnotation.setSubject(obsoleteAgm); + diseaseAnnotation.setSubjectBiologicalEntity(obsoleteAgm); diseaseAnnotation.setEvidenceCodes(List.of(obsoleteEcoTerm)); diseaseAnnotation.setSingleReference(obsoleteReference); diseaseAnnotation.setWith(List.of(obsoleteGene)); @@ -1776,8 +1776,8 @@ public void createAgmDiseaseAnnotationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(19))). - body("errorMessages.subject", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.dataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.secondaryDataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). @@ -1808,10 +1808,10 @@ public void editGeneDiseaseAnnotationWithObsoleteFields() { GeneDiseaseAnnotation diseaseAnnotation = getGeneDiseaseAnnotation(GENE_DISEASE_ANNOTATION); diseaseAnnotation.setRelation(obsoleteGeneRelation); - diseaseAnnotation.setObject(obsoleteDoTerm); + diseaseAnnotation.setObjectOntologyTerm(obsoleteDoTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider2); - diseaseAnnotation.setSubject(obsoleteGene); + diseaseAnnotation.setSubjectBiologicalEntity(obsoleteGene); diseaseAnnotation.setEvidenceCodes(List.of(obsoleteEcoTerm)); diseaseAnnotation.setSingleReference(obsoleteReference); diseaseAnnotation.setSgdStrainBackground(obsoleteAgm); @@ -1840,8 +1840,8 @@ public void editGeneDiseaseAnnotationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(16))). - body("errorMessages.subject", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.dataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.secondaryDataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). @@ -1867,10 +1867,10 @@ public void editGeneDiseaseAnnotationWithObsoleteFields() { public void editAlleleDiseaseAnnotationWithObsoleteFields() { AlleleDiseaseAnnotation diseaseAnnotation = getAlleleDiseaseAnnotation(ALLELE_DISEASE_ANNOTATION); diseaseAnnotation.setRelation(obsoleteAlleleRelation); - diseaseAnnotation.setObject(obsoleteDoTerm); + diseaseAnnotation.setObjectOntologyTerm(obsoleteDoTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider2); - diseaseAnnotation.setSubject(obsoleteAllele); + diseaseAnnotation.setSubjectBiologicalEntity(obsoleteAllele); diseaseAnnotation.setEvidenceCodes(List.of(obsoleteEcoTerm)); diseaseAnnotation.setSingleReference(obsoleteReference); diseaseAnnotation.setWith(List.of(obsoleteGene)); @@ -1900,8 +1900,8 @@ public void editAlleleDiseaseAnnotationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(17))). - body("errorMessages.subject", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.dataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.secondaryDataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). @@ -1928,10 +1928,10 @@ public void editAlleleDiseaseAnnotationWithObsoleteFields() { public void editAgmDiseaseAnnotationWithObsoleteFields() { AGMDiseaseAnnotation diseaseAnnotation = getAgmDiseaseAnnotation(AGM_DISEASE_ANNOTATION); diseaseAnnotation.setRelation(obsoleteAgmRelation); - diseaseAnnotation.setObject(obsoleteDoTerm); + diseaseAnnotation.setObjectOntologyTerm(obsoleteDoTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider2); - diseaseAnnotation.setSubject(obsoleteAgm); + diseaseAnnotation.setSubjectBiologicalEntity(obsoleteAgm); diseaseAnnotation.setEvidenceCodes(List.of(obsoleteEcoTerm)); diseaseAnnotation.setSingleReference(obsoleteReference); diseaseAnnotation.setWith(List.of(obsoleteGene)); @@ -1963,8 +1963,8 @@ public void editAgmDiseaseAnnotationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(19))). - body("errorMessages.subject", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.objectOntologyTerm", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.dataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.secondaryDataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). @@ -1995,8 +1995,8 @@ public void editAgmDiseaseAnnotationWithObsoleteFields() { @Order(37) public void createDiseaseAnnotationWithUnsupportedFields() { GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); - diseaseAnnotation.setSubject(gene); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setSubjectBiologicalEntity(gene); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setRelation(geneRelation); diseaseAnnotation.setEvidenceCodes(List.of(unsupportedEcoTerm)); diseaseAnnotation.setSingleReference(reference); @@ -2034,8 +2034,8 @@ public void editDiseaseAnnotationWithUnsupportedFields() { @Order(39) public void createDiseaseAnnotationWithMissingDependentFields() { GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); - diseaseAnnotation.setSubject(gene); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setSubjectBiologicalEntity(gene); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setRelation(geneRelation); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); @@ -2103,8 +2103,8 @@ public void editDiseaseAnnotationWithMissingDependentFields() { @Order(41) public void createDiseaseAnnotationConditionRelationWithHandleWithoutReference() { GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); - diseaseAnnotation.setSubject(gene); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setSubjectBiologicalEntity(gene); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setRelation(geneRelation); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); @@ -2151,8 +2151,8 @@ public void editDiseaseAnnotationConditionRelationWithHandleWithoutReference() { @Order(43) public void createDiseaseAnnotationWithConditionRelationReferenceMismatch() { GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); - diseaseAnnotation.setSubject(gene); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setSubjectBiologicalEntity(gene); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setRelation(geneRelation); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); @@ -2352,9 +2352,9 @@ public void editAgmDiseaseAnnotationWithNullNonRequiredFieldsLevel() { public void createGeneDiseaseAnnotationWithOnlyRequiredFields() { GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); diseaseAnnotation.setRelation(alleleAndGeneRelation); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setDataProvider(dataProvider); - diseaseAnnotation.setSubject(gene); + diseaseAnnotation.setSubjectBiologicalEntity(gene); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); @@ -2372,9 +2372,9 @@ public void createGeneDiseaseAnnotationWithOnlyRequiredFields() { public void createAlleleDiseaseAnnotationWithOnlyRequiredFields() { AlleleDiseaseAnnotation diseaseAnnotation = new AlleleDiseaseAnnotation(); diseaseAnnotation.setRelation(alleleAndGeneRelation); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setDataProvider(dataProvider); - diseaseAnnotation.setSubject(allele); + diseaseAnnotation.setSubjectBiologicalEntity(allele); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); @@ -2392,9 +2392,9 @@ public void createAlleleDiseaseAnnotationWithOnlyRequiredFields() { public void createAgmDiseaseAnnotationWithOnlyRequiredFields() { AGMDiseaseAnnotation diseaseAnnotation = new AGMDiseaseAnnotation(); diseaseAnnotation.setRelation(agmRelation); - diseaseAnnotation.setObject(doTerm); + diseaseAnnotation.setObjectOntologyTerm(doTerm); diseaseAnnotation.setDataProvider(dataProvider); - diseaseAnnotation.setSubject(agm); + diseaseAnnotation.setSubjectBiologicalEntity(agm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); @@ -2412,8 +2412,8 @@ public void createAgmDiseaseAnnotationWithOnlyRequiredFields() { public void createDiseaseAnnotationWithDuplicateNote() { GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); diseaseAnnotation.setRelation(geneRelation); - diseaseAnnotation.setObject(doTerm2); - diseaseAnnotation.setSubject(gene); + diseaseAnnotation.setObjectOntologyTerm(doTerm2); + diseaseAnnotation.setSubjectBiologicalEntity(gene); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference2); diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java index 99802ca47..f00a81e04 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java @@ -95,8 +95,8 @@ public void createValidAlleleGeneAssociation() { loadRequiredEntities(); AlleleGeneAssociation association = new AlleleGeneAssociation(); - association.setSubject(allele); - association.setObject(gene); + association.setSubjectBiologicalEntity(allele); + association.setObjectBiologicalEntity(gene); association.setRelation(relation); association.setEvidenceCode(ecoTerm); association.setInternal(true); @@ -118,8 +118,8 @@ public void createValidAlleleGeneAssociation() { then(). statusCode(200). body("entity.relation.name", is(relation.getName())). - body("entity.object.modEntityId", is(gene.getModEntityId())). - body("entity.subject.modEntityId", is(allele.getModEntityId())). + body("entity.objectBiologicalEntity.modEntityId", is(gene.getModEntityId())). + body("entity.subjectBiologicalEntity.modEntityId", is(allele.getModEntityId())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference.getCurie())). body("entity.evidenceCode.curie", is(ecoTerm.getCurie())). @@ -142,8 +142,8 @@ public void createValidAlleleGeneAssociation() { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relation.getName())). - body("entity.alleleGeneAssociations[0].object.modEntityId", is(gene.getModEntityId())). - body("entity.alleleGeneAssociations[0].subject", not(hasKey("alleleGeneAssociations"))); + body("entity.alleleGeneAssociations[0].objectBiologicalEntity.modEntityId", is(gene.getModEntityId())). + body("entity.alleleGeneAssociations[0].subjectBiologicalEntity", not(hasKey("alleleGeneAssociations"))); RestAssured.given(). when(). @@ -152,17 +152,17 @@ public void createValidAlleleGeneAssociation() { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relation.getName())). - body("entity.alleleGeneAssociations[0].object.modEntityId", is(gene.getModEntityId())). - body("entity.alleleGeneAssociations[0].object", not(hasKey("alleleGeneAssociations"))); + body("entity.alleleGeneAssociations[0].objectBiologicalEntity.modEntityId", is(gene.getModEntityId())). + body("entity.alleleGeneAssociations[0].objectBiologicalEntity", not(hasKey("alleleGeneAssociations"))); } @Test @Order(2) public void editAlleleGeneAssociation() { AlleleGeneAssociation association = getAlleleGeneAssociation(allele.getId(), relation.getName(), gene.getId()); - association.setSubject(allele2); + association.setSubjectBiologicalEntity(allele2); association.setRelation(relation2); - association.setObject(gene2); + association.setObjectBiologicalEntity(gene2); association.setEvidenceCode(ecoTerm2); association.setInternal(false); association.setObsolete(false); @@ -183,8 +183,8 @@ public void editAlleleGeneAssociation() { then(). statusCode(200). body("entity.relation.name", is(relation2.getName())). - body("entity.object.modEntityId", is(gene2.getModEntityId())). - body("entity.subject.modEntityId", is(allele2.getModEntityId())). + body("entity.objectBiologicalEntity.modEntityId", is(gene2.getModEntityId())). + body("entity.subjectBiologicalEntity.modEntityId", is(allele2.getModEntityId())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2.getCurie())). body("entity.evidenceCode.curie", is(ecoTerm2.getCurie())). @@ -214,18 +214,18 @@ public void createAlleleGeneAssociationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.subject", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.objectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @Order(4) public void createAlleleGeneAssociationWithMissingRequiredFieldsLevel2() { AlleleGeneAssociation association = new AlleleGeneAssociation(); - association.setSubject(allele2); + association.setSubjectBiologicalEntity(allele2); association.setRelation(relation); - association.setObject(gene); + association.setObjectBiologicalEntity(gene); Note emptyNote = new Note(); association.setRelatedNote(emptyNote); @@ -247,9 +247,9 @@ public void createAlleleGeneAssociationWithMissingRequiredFieldsLevel2() { @Order(5) public void createAlleleGeneAssociationWithEmptyRequiredFieldsLevel2() { AlleleGeneAssociation association = new AlleleGeneAssociation(); - association.setSubject(allele2); + association.setSubjectBiologicalEntity(allele2); association.setRelation(relation); - association.setObject(gene); + association.setObjectBiologicalEntity(gene); Note invalidNote = new Note(); invalidNote.setNoteType(noteType); @@ -270,9 +270,9 @@ public void createAlleleGeneAssociationWithEmptyRequiredFieldsLevel2() { @Order(6) public void editAlleleGeneAssociationWithMissingRequiredFieldsLevel1() { AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getId(), relation2.getName(), gene2.getId()); - association.setSubject(null); + association.setSubjectBiologicalEntity(null); association.setRelation(null); - association.setObject(null); + association.setObjectBiologicalEntity(null); RestAssured.given(). contentType("application/json"). @@ -282,9 +282,9 @@ public void editAlleleGeneAssociationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.subject", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.objectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @@ -348,9 +348,9 @@ public void createAlleleGeneAssociationWithInvalidFields() { invalidNote.setFreeText("Invalid"); AlleleGeneAssociation association = new AlleleGeneAssociation(); - association.setSubject(nonPersistedAllele); + association.setSubjectBiologicalEntity(nonPersistedAllele); association.setRelation(noteType); - association.setObject(nonPersistedGene); + association.setObjectBiologicalEntity(nonPersistedGene); association.setEvidence(List.of(nonPersistedReference)); association.setRelatedNote(invalidNote); association.setEvidenceCode(nonPersistedEcoTerm); @@ -363,9 +363,9 @@ public void createAlleleGeneAssociationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(6))). - body("errorMessages.subject", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.objectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidenceCode", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relatedNote", is(String.join(" | ", List.of( @@ -391,9 +391,9 @@ public void editAlleleGeneAssociationWithInvalidFields() { invalidNote.setFreeText("Invalid"); AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getId(), relation2.getName(), gene2.getId()); - association.setSubject(nonPersistedAllele); + association.setSubjectBiologicalEntity(nonPersistedAllele); association.setRelation(noteType); - association.setObject(nonPersistedGene); + association.setObjectBiologicalEntity(nonPersistedGene); association.setEvidence(List.of(nonPersistedReference)); association.setRelatedNote(invalidNote); association.setEvidenceCode(nonPersistedEcoTerm); @@ -406,9 +406,9 @@ public void editAlleleGeneAssociationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(6))). - body("errorMessages.subject", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.objectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidenceCode", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relatedNote", is(String.join(" | ", List.of( @@ -421,9 +421,9 @@ public void editAlleleGeneAssociationWithInvalidFields() { public void createAlleleGeneAssociationWithObsoleteFields() { AlleleGeneAssociation association = new AlleleGeneAssociation(); - association.setSubject(obsoleteAllele); + association.setSubjectBiologicalEntity(obsoleteAllele); association.setRelation(obsoleteRelation); - association.setObject(obsoleteGene); + association.setObjectBiologicalEntity(obsoleteGene); association.setEvidenceCode(obsoleteEcoTerm); association.setEvidence(List.of(obsoleteReference)); @@ -442,9 +442,9 @@ public void createAlleleGeneAssociationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(6))). - body("errorMessages.subject", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.objectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidenceCode", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relatedNote", is(String.join(" | ", List.of( @@ -457,9 +457,9 @@ public void createAlleleGeneAssociationWithObsoleteFields() { public void editAlleleGeneAssociationWithObsoleteFields() { AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getId(), relation2.getName(), gene2.getId()); - association.setSubject(obsoleteAllele); + association.setSubjectBiologicalEntity(obsoleteAllele); association.setRelation(obsoleteRelation); - association.setObject(obsoleteGene); + association.setObjectBiologicalEntity(obsoleteGene); association.setEvidenceCode(obsoleteEcoTerm); association.setEvidence(List.of(obsoleteReference)); @@ -477,9 +477,9 @@ public void editAlleleGeneAssociationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(6))). - body("errorMessages.subject", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.objectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidenceCode", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relatedNote", is(String.join(" | ", List.of( diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java index b0031a079..529ef338e 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java @@ -89,8 +89,8 @@ public void createValidConstructGenomicEntityAssociation() { loadRequiredEntities(); ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubject(construct); - association.setObject(gene); + association.setSubjectReagent(construct); + association.setObjectBiologicalEntity(gene); association.setRelation(relation); association.setInternal(true); association.setObsolete(true); @@ -111,8 +111,8 @@ public void createValidConstructGenomicEntityAssociation() { then(). statusCode(200). body("entity.relation.name", is(relation.getName())). - body("entity.object.modEntityId", is(gene.getModEntityId())). - body("entity.subject.modEntityId", is(construct.getModEntityId())). + body("entity.objectBiologicalEntity.modEntityId", is(gene.getModEntityId())). + body("entity.subjectReagent.modEntityId", is(construct.getModEntityId())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference.getCurie())). body("entity.internal", is(true)). @@ -134,8 +134,8 @@ public void createValidConstructGenomicEntityAssociation() { statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relation.getName())). - body("entity.constructGenomicEntityAssociations[0].object.modEntityId", is(gene.getModEntityId())). - body("entity.constructGenomicEntityAssociations[0].subject", not(hasKey("constructGeneAssociations"))); + body("entity.constructGenomicEntityAssociations[0].objectBiologicalEntity.modEntityId", is(gene.getModEntityId())). + body("entity.constructGenomicEntityAssociations[0].subjectReagent", not(hasKey("constructGeneAssociations"))); RestAssured.given(). when(). @@ -144,17 +144,17 @@ public void createValidConstructGenomicEntityAssociation() { statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relation.getName())). - body("entity.constructGenomicEntityAssociations[0].object.modEntityId", is(gene.getModEntityId())). - body("entity.constructGenomicEntityAssociations[0].subject", not(hasKey("constructGeneAssociations"))); + body("entity.constructGenomicEntityAssociations[0].objectBiologicalEntity.modEntityId", is(gene.getModEntityId())). + body("entity.constructGenomicEntityAssociations[0].subjectReagent", not(hasKey("constructGeneAssociations"))); } @Test @Order(2) public void editConstructGenomicEntityAssociation() { ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct.getId(), relation.getName(), gene.getId()); - association.setSubject(construct2); + association.setSubjectReagent(construct2); association.setRelation(relation2); - association.setObject(gene2); + association.setObjectBiologicalEntity(gene2); association.setInternal(false); association.setObsolete(false); association.setEvidence(List.of(reference2)); @@ -174,8 +174,8 @@ public void editConstructGenomicEntityAssociation() { then(). statusCode(200). body("entity.relation.name", is(relation2.getName())). - body("entity.object.curie", is(gene2.getCurie())). - body("entity.subject.modEntityId", is(construct2.getModEntityId())). + body("entity.objectBiologicalEntity.curie", is(gene2.getCurie())). + body("entity.subjectReagent.modEntityId", is(construct2.getModEntityId())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2.getCurie())). body("entity.internal", is(false)). @@ -204,18 +204,18 @@ public void createConstructGenomicEntityAssociationWithMissingRequiredFieldsLeve then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.subject", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.subjectReagent", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.objectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @Order(4) public void createConstructGenomicEntityAssociationWithMissingRequiredFieldsLevel2() { ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubject(construct2); + association.setSubjectReagent(construct2); association.setRelation(relation); - association.setObject(gene); + association.setObjectBiologicalEntity(gene); Note emptyNote = new Note(); association.setRelatedNotes(List.of(emptyNote)); @@ -237,9 +237,9 @@ public void createConstructGenomicEntityAssociationWithMissingRequiredFieldsLeve @Order(5) public void createConstructGenomicEntityAssociationWithEmptyRequiredFieldsLevel2() { ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubject(construct2); + association.setSubjectReagent(construct2); association.setRelation(relation); - association.setObject(gene); + association.setObjectBiologicalEntity(gene); Note invalidNote = new Note(); invalidNote.setNoteType(noteType); @@ -260,9 +260,9 @@ public void createConstructGenomicEntityAssociationWithEmptyRequiredFieldsLevel2 @Order(6) public void editConstructGenomicEntityAssociationWithMissingRequiredFieldsLevel1() { ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getId()); - association.setSubject(null); + association.setSubjectReagent(null); association.setRelation(null); - association.setObject(null); + association.setObjectBiologicalEntity(null); RestAssured.given(). contentType("application/json"). @@ -272,9 +272,9 @@ public void editConstructGenomicEntityAssociationWithMissingRequiredFieldsLevel1 then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.subject", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.subjectReagent", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.objectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @@ -338,9 +338,9 @@ public void createConstructGenomicEntityAssociationWithInvalidFields() { invalidNote.setFreeText("Invalid"); ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubject(nonPersistedConstruct); + association.setSubjectReagent(nonPersistedConstruct); association.setRelation(noteType); - association.setObject(nonPersistedGene); + association.setObjectBiologicalEntity(nonPersistedGene); association.setEvidence(List.of(nonPersistedReference)); association.setRelatedNotes(List.of(invalidNote)); @@ -352,9 +352,9 @@ public void createConstructGenomicEntityAssociationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subject", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.subjectReagent", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.objectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relatedNotes", is(String.join(" | ", List.of( "noteType - " + ValidationConstants.INVALID_MESSAGE, @@ -379,9 +379,9 @@ public void editConstructGenomicEntityAssociationWithInvalidFields() { invalidNote.setFreeText("Invalid"); ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getId()); - association.setSubject(nonPersistedConstruct); + association.setSubjectReagent(nonPersistedConstruct); association.setRelation(noteType); - association.setObject(nonPersistedGene); + association.setObjectBiologicalEntity(nonPersistedGene); association.setEvidence(List.of(nonPersistedReference)); association.setRelatedNotes(List.of(invalidNote)); @@ -393,9 +393,9 @@ public void editConstructGenomicEntityAssociationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subject", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.subjectReagent", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.objectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relatedNotes", is(String.join(" | ", List.of( "noteType - " + ValidationConstants.INVALID_MESSAGE, @@ -407,9 +407,9 @@ public void editConstructGenomicEntityAssociationWithInvalidFields() { public void createConstructGenomicEntityAssociationWithObsoleteFields() { ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubject(obsoleteConstruct); + association.setSubjectReagent(obsoleteConstruct); association.setRelation(obsoleteRelation); - association.setObject(obsoleteGene); + association.setObjectBiologicalEntity(obsoleteGene); association.setEvidence(List.of(obsoleteReference)); Note note = new Note(); @@ -427,9 +427,9 @@ public void createConstructGenomicEntityAssociationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subject", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.subjectReagent", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.objectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relatedNotes", is(String.join(" | ", List.of( "noteType - " + ValidationConstants.OBSOLETE_MESSAGE, @@ -441,9 +441,9 @@ public void createConstructGenomicEntityAssociationWithObsoleteFields() { public void editConstructGenomicEntityAssociationWithObsoleteFields() { ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getId()); - association.setSubject(obsoleteConstruct); + association.setSubjectReagent(obsoleteConstruct); association.setRelation(obsoleteRelation); - association.setObject(obsoleteGene); + association.setObjectBiologicalEntity(obsoleteGene); association.setEvidence(List.of(obsoleteReference)); Note note = association.getRelatedNotes().get(0); @@ -460,9 +460,9 @@ public void editConstructGenomicEntityAssociationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subject", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.subjectReagent", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.object", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.objectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relatedNotes", is(String.join(" | ", List.of( "noteType - " + ValidationConstants.OBSOLETE_MESSAGE, From 38a91bb53cb85eb2469dc9ee21744c9de18733ad Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Thu, 15 Feb 2024 08:05:13 -0600 Subject: [PATCH 052/159] SCRUM-3661 Implemented persistence settings of new annotation form --- .../NewAnnotationForm.js | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js index 2493dd0c6..9d346e7b1 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js @@ -3,7 +3,7 @@ import { Dialog } from "primereact/dialog"; import { Button } from "primereact/button"; import { Dropdown } from "primereact/dropdown"; import { Toast } from "primereact/toast"; - import { MultiSelect } from 'primereact/multiselect'; +import { MultiSelect } from 'primereact/multiselect'; import { useMutation, useQueryClient } from "react-query"; import { FormErrorMessageComponent } from "../../components/Error/FormErrorMessageComponent"; import { classNames } from "primereact/utils"; @@ -32,7 +32,8 @@ import { WithAdditionalFieldData } from "../../components/FieldData/WithAddition import { GeneticModifiersAdditionalFieldData } from "../../components/FieldData/GeneticModifiersAdditionalFieldData"; import ErrorBoundary from "../../components/Error/ErrorBoundary"; import { ConfirmButton } from "../../components/ConfirmButton"; -import { getModFormFields } from "../../service/TableStateService"; +import { getDefaultTableState, getModFormFields } from "../../service/TableStateService"; +import { useGetUserSettings } from "../../service/useGetUserSettings"; export const NewAnnotationForm = ({ newAnnotationState, @@ -74,9 +75,16 @@ export const NewAnnotationForm = ({ const geneticModifierRelationTerms = useControlledVocabularyService('disease_genetic_modifier_relation'); const [uiErrorMessages, setUiErrorMessages] = useState({}); const areUiErrors = useRef(false); - const optionalFields = ["Asserted Genes", "Asserted Allele", "Negated", "With", "Related Notes", "Experimental Conditions", "Experiments", "Genetic Sex", + const newAnnotationFields = ["Asserted Genes", "Asserted Allele", "Negated", "With", "Related Notes", "Experimental Conditions", "Experiments", "Genetic Sex", "Disease Qualifiers", "SGD Strain Background", "Annotation Type", "Genetic Modifier Relation", "Genetic Modifiers","Internal"]; - const [selectedFields, setSelectedFields] = useState(optionalFields); + let defaultUserSettings = getDefaultTableState("DiseaseAnnotationsTableSettings"); + defaultUserSettings = {...defaultUserSettings, newAnnotationFields: newAnnotationFields}; + const { settings: settingsKey , mutate: setSettingsKey } = useGetUserSettings('DiseaseAnnotationsTableSettings', defaultUserSettings); + let selectedFields = []; + const setSelectedFields = (newValue)=>{ + selectedFields = newValue; + return selectedFields; + }; const mutation = useMutation(newAnnotation => { if (!diseaseAnnotationService) { diseaseAnnotationService = new DiseaseAnnotationService(); @@ -175,10 +183,6 @@ export const NewAnnotationForm = ({ handleSubmit(event, false); } - const handleShowAllFields = () => { - setSelectedFields(optionalFields); - } - const onSingleReferenceChange = (event) => { setUiErrorMessages({}); newAnnotationDispatch({ @@ -403,9 +407,21 @@ export const NewAnnotationForm = ({ autocompleteSearch(searchService, endpoint, filterName, filter, setFiltered); } + const updateFormFields = (updatedFields) => { + defaultUserSettings = JSON.parse(localStorage.getItem("DiseaseAnnotationsTableSettings")); + let updatedSettings = {...defaultUserSettings, newAnnotationFields: updatedFields}; + setSelectedFields(updatedFields); + setSettingsKey(updatedSettings); + + }; + + const handleShowAllFields = () => { + updateFormFields(newAnnotationFields); + } + const setToModDefault = () => { const modFormFields = getModFormFields("DiseaseAnnotations"); - setSelectedFields(modFormFields); + updateFormFields(modFormFields); } const dialogHeader = ( @@ -417,11 +433,11 @@ export const NewAnnotationForm = ({ setSelectedFields(e.value)} + onChange={(e) => updateFormFields(e.value)} className='w-20rem text-center' maxSelectedLabels={4} /> From 253f4c605bd47978d883e8f5bbf2a16470aba9b6 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Fri, 16 Feb 2024 14:17:11 -0500 Subject: [PATCH 053/159] Fix for failing ontologies --- .../AgmDiseaseAnnotationExecutor.java | 2 +- .../jobs/executors/AgmExecutor.java | 2 +- .../AlleleDiseaseAnnotationExecutor.java | 2 +- .../jobs/executors/AlleleExecutor.java | 2 +- .../jobs/executors/ConstructExecutor.java | 4 +- .../GeneDiseaseAnnotationExecutor.java | 2 +- .../jobs/executors/GeneExecutor.java | 2 +- .../jobs/executors/LoadFileExecutor.java | 2 +- .../jobs/executors/OntologyExecutor.java | 22 ++++----- .../jobs/executors/OrthologyExecutor.java | 2 +- .../jobs/executors/VariantExecutor.java | 2 +- .../jobs/processors/BulkLoadProcessor.java | 37 +++------------ .../jobs/processors/StartLoadProcessor.java | 47 +++++++++++++++++++ .../curation_api/model/entities/Synonym.java | 2 +- .../v0.29.0.5__synonym_name_length.sql | 1 + 15 files changed, 75 insertions(+), 56 deletions(-) create mode 100644 src/main/java/org/alliancegenome/curation_api/jobs/processors/StartLoadProcessor.java create mode 100644 src/main/resources/db/migration/v0.29.0.5__synonym_name_length.sql diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java index aaf7bcdbe..8d3dddd57 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java @@ -79,7 +79,7 @@ public APIResponse runLoad(String dataProviderName, List annotations, List idsAdded) { + private void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataProvider, List annotations, List idsAdded) { ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); ph.addDisplayHandler(loadProcessDisplayService); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmExecutor.java index 9eb6f1ff8..1a5db6533 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmExecutor.java @@ -79,7 +79,7 @@ public APIResponse runLoad(String dataProviderName, List agms, BackendBulkDataProvider dataProvider, List curiesAdded) { + private void runLoad(BulkLoadFileHistory history, List agms, BackendBulkDataProvider dataProvider, List curiesAdded) { ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); ph.addDisplayHandler(loadProcessDisplayService); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java index d98fc6f4e..d6fbbb6dc 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java @@ -79,7 +79,7 @@ public APIResponse runLoad(String dataProviderName, List annotations, List idsAdded) { + private void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataProvider, List annotations, List idsAdded) { ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); ph.addDisplayHandler(loadProcessDisplayService); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleExecutor.java index d52e900ae..cb7551c16 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleExecutor.java @@ -77,7 +77,7 @@ public APIResponse runLoad(String dataProviderName, List alleles) { return new LoadHistoryResponce(history); } - public void runLoad(BulkLoadFileHistory history, List alleles, BackendBulkDataProvider dataProvider, List curiesAdded) { + private void runLoad(BulkLoadFileHistory history, List alleles, BackendBulkDataProvider dataProvider, List curiesAdded) { ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); ph.addDisplayHandler(loadProcessDisplayService); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/ConstructExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/ConstructExecutor.java index d4002e097..db2a0fa2a 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/ConstructExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/ConstructExecutor.java @@ -82,7 +82,7 @@ public APIResponse runLoad(String dataProviderName, List construct return new LoadHistoryResponce(history); } - public void runLoad(BulkLoadFileHistory history, List constructs, BackendBulkDataProvider dataProvider, List idsAdded) { + private void runLoad(BulkLoadFileHistory history, List constructs, BackendBulkDataProvider dataProvider, List idsAdded) { ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); ph.addDisplayHandler(loadProcessDisplayService); @@ -108,7 +108,7 @@ public void runLoad(BulkLoadFileHistory history, List constructs, } - public void runCleanup(ConstructService service, BulkLoadFileHistory history, String dataProviderName, List constructIdsBefore, List constructIdsAfter, String md5sum) { + private void runCleanup(ConstructService service, BulkLoadFileHistory history, String dataProviderName, List constructIdsBefore, List constructIdsAfter, String md5sum) { Log.debug("runLoad: After: " + dataProviderName + " " + constructIdsAfter.size()); List distinctAfter = constructIdsAfter.stream().distinct().collect(Collectors.toList()); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java index ebeec05b5..887a30014 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java @@ -79,7 +79,7 @@ public APIResponse runLoad(String dataProviderName, List annotations, List idsAdded) { + private void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataProvider, List annotations, List idsAdded) { ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); ph.addDisplayHandler(loadProcessDisplayService); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExecutor.java index 3ea141307..a467f0006 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExecutor.java @@ -81,7 +81,7 @@ public APIResponse runLoad(String dataProviderName, List genes) { return new LoadHistoryResponce(history); } - public void runLoad(BulkLoadFileHistory history, List genes, BackendBulkDataProvider dataProvider, List curiesAdded) { + private void runLoad(BulkLoadFileHistory history, List genes, BackendBulkDataProvider dataProvider, List curiesAdded) { ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); ph.addDisplayHandler(loadProcessDisplayService); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java index 9e46329ea..7d7970ba1 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java @@ -164,7 +164,7 @@ protected boolean validSchemaVersion(String submittedSchemaVersion, Class dto // The following methods are for bulk validation - public void runCleanup(DiseaseAnnotationService service, BulkLoadFileHistory history, String dataProviderName, List annotationIdsBefore, List annotationIdsAfter, String md5sum) { + protected void runCleanup(DiseaseAnnotationService service, BulkLoadFileHistory history, String dataProviderName, List annotationIdsBefore, List annotationIdsAfter, String md5sum) { Log.debug("runLoad: After: " + dataProviderName + " " + annotationIdsAfter.size()); List distinctAfter = annotationIdsAfter.stream().distinct().collect(Collectors.toList()); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java index 17406be5d..66e70b584 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java @@ -114,25 +114,21 @@ public void runLoad(BulkLoadFile bulkLoadFile) throws Exception { bulkLoadFile.setRecordCount(0); GenericOntologyLoadConfig config = new GenericOntologyLoadConfig(); - BaseOntologyTermService service = null; OntologyBulkLoadType ontologyType = bulkLoadFile.getBulkLoad().getOntologyType(); switch (ontologyType) { case ZECO -> { config.setLoadOnlyIRIPrefix("ZECO"); - service = zecoTermService; processTerms(bulkLoadFile, zecoTermService, config); } case EMAPA -> { config.getAltNameSpaces().add("anatomical_structure"); - service = emapaTermService; processTerms(bulkLoadFile, emapaTermService, config); } case GO -> { config.getAltNameSpaces().add("biological_process"); config.getAltNameSpaces().add("molecular_function"); config.getAltNameSpaces().add("cellular_component"); - service = goTermService; processTerms(bulkLoadFile, goTermService, config); } case SO -> processTerms(bulkLoadFile, soTermService, config); @@ -246,7 +242,7 @@ private void processTerms(BulkLoadFile bulkLoadFile, BaseOntologyTermService ser private void processTerms(BulkLoadFile bulkLoadFile, OntologyBulkLoadType ontologyType, BaseOntologyTermService service, GenericOntologyLoadConfig config) throws Exception { - GenericOntologyLoadHelper loader = new GenericOntologyLoadHelper(ontologyType.getClazz(), config); + GenericOntologyLoadHelper loader = new GenericOntologyLoadHelper<>(ontologyType.getClazz(), config); Map termMap = loader.load(new GZIPInputStream(new FileInputStream(bulkLoadFile.getLocalFilePath()))); @@ -263,13 +259,13 @@ private void processTerms(BulkLoadFile bulkLoadFile, OntologyBulkLoadType ontolo } ph.finishProcess(); - ProcessDisplayHelper ph1 = new ProcessDisplayHelper(10000); - ph.addDisplayHandler(loadProcessDisplayService); - ph1.startProcess(bulkLoadFile.getBulkLoad().getName() + ": " + ontologyType.getClazz().getSimpleName() + " Closure", termMap.size()); - for (Entry entry : termMap.entrySet()) { - service.processUpdateRelationships(entry.getValue()); - ph1.progressProcess(); - } - ph1.finishProcess(); +// ProcessDisplayHelper ph1 = new ProcessDisplayHelper(10000); +// ph.addDisplayHandler(loadProcessDisplayService); +// ph1.startProcess(bulkLoadFile.getBulkLoad().getName() + ": " + ontologyType.getClazz().getSimpleName() + " Closure", termMap.size()); +// for (Entry entry : termMap.entrySet()) { +// service.processUpdateRelationships(entry.getValue()); +// ph1.progressProcess(); +// } +// ph1.finishProcess(); } } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/OrthologyExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/OrthologyExecutor.java index d4f688f1e..eab1cd6a1 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/OrthologyExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/OrthologyExecutor.java @@ -102,7 +102,7 @@ private void runCleanup(BulkLoadFileHistory history, String dataProvider, List> orthoPairsAdded) { + private void runLoad(BulkLoadFileHistory history, String dataProvider, OrthologyIngestFmsDTO orthologyData, List> orthoPairsAdded) { ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); ph.addDisplayHandler(loadProcessDisplayService); ph.startProcess(dataProvider + " Orthology DTO Update", orthologyData.getData().size()); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/VariantExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/VariantExecutor.java index 7bdbb15c0..96e819f9c 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/VariantExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/VariantExecutor.java @@ -76,7 +76,7 @@ public APIResponse runLoad(String dataProviderName, List variants) { return new LoadHistoryResponce(history); } - public void runLoad(BulkLoadFileHistory history, List variants, BackendBulkDataProvider dataProvider, List curiesAdded) { + private void runLoad(BulkLoadFileHistory history, List variants, BackendBulkDataProvider dataProvider, List curiesAdded) { ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); ph.addDisplayHandler(loadProcessDisplayService); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/processors/BulkLoadProcessor.java b/src/main/java/org/alliancegenome/curation_api/jobs/processors/BulkLoadProcessor.java index 2771bcc81..94d01bb7e 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/processors/BulkLoadProcessor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/processors/BulkLoadProcessor.java @@ -12,7 +12,6 @@ import org.alliancegenome.curation_api.enums.BulkLoadCleanUp; import org.alliancegenome.curation_api.enums.JobStatus; import org.alliancegenome.curation_api.jobs.events.PendingBulkLoadFileJobEvent; -import org.alliancegenome.curation_api.jobs.events.StartedBulkLoadFileJobEvent; import org.alliancegenome.curation_api.jobs.executors.BulkLoadJobExecutor; import org.alliancegenome.curation_api.jobs.util.SlackNotifier; import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoad; @@ -25,7 +24,6 @@ import io.quarkus.logging.Log; import jakarta.enterprise.event.Event; -import jakarta.enterprise.event.Observes; import jakarta.inject.Inject; import lombok.extern.jbosslog.JBossLog; @@ -69,33 +67,6 @@ public class BulkLoadProcessor { protected FileTransferHelper fileHelper = new FileTransferHelper(); - public void bulkLoadFile(@Observes StartedBulkLoadFileJobEvent event) { - BulkLoadFile bulkLoadFile = bulkLoadFileDAO.find(event.getId()); - if (!bulkLoadFile.getBulkloadStatus().isStarted()) { - log.warn("bulkLoadFile: Job is not started returning: " + bulkLoadFile.getBulkloadStatus()); - // endLoad(bulkLoadFile, "Finished ended due to status: " + - // bulkLoadFile.getBulkloadStatus(), bulkLoadFile.getBulkloadStatus()); - return; - } else { - startLoadFile(bulkLoadFile); - } - - try { - if (bulkLoadFile.getLocalFilePath() == null || bulkLoadFile.getS3Path() == null) { - syncWithS3(bulkLoadFile); - } - bulkLoadJobExecutor.process(bulkLoadFile, bulkLoadFile.getBulkloadCleanUp() == BulkLoadCleanUp.YES); - JobStatus status = bulkLoadFile.getBulkloadStatus().equals(JobStatus.FAILED) ? JobStatus.FAILED : JobStatus.FINISHED; - endLoadFile(bulkLoadFile, bulkLoadFile.getErrorMessage(), status); - - } catch (Exception e) { - endLoadFile(bulkLoadFile, "Failed loading: " + bulkLoadFile.getBulkLoad().getName() + " please check the logs for more info. " + bulkLoadFile.getErrorMessage(), JobStatus.FAILED); - log.error("Load File: " + bulkLoadFile.getBulkLoad().getName() + " is failed"); - e.printStackTrace(); - } - - } - private String processFMS(String dataType, String dataSubType) { List files = fmsDataFileService.getDataFiles(dataType, dataSubType); @@ -224,7 +195,9 @@ protected void endLoad(BulkLoad load, String message, JobStatus status) { BulkLoad bulkLoad = bulkLoadDAO.find(load.getId()); bulkLoad.setErrorMessage(message); bulkLoad.setBulkloadStatus(status); - slackNotifier.slackalert(bulkLoad); + if(status != JobStatus.FINISHED) { + slackNotifier.slackalert(bulkLoad); + } bulkLoadDAO.merge(bulkLoad); log.info("Load: " + bulkLoad.getName() + " is finished"); } @@ -243,7 +216,9 @@ protected void endLoadFile(BulkLoadFile bulkLoadFile, String message, JobStatus bulkLoadFile.setErrorMessage(message); bulkLoadFile.setBulkloadStatus(status); bulkLoadFile.setDateLastLoaded(OffsetDateTime.now()); - slackNotifier.slackalert(bulkLoadFile); + if(status != JobStatus.FINISHED) { + slackNotifier.slackalert(bulkLoadFile); + } bulkLoadFileDAO.merge(bulkLoadFile); log.info("Load File: " + bulkLoadFile.getMd5Sum() + " is finished"); } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/processors/StartLoadProcessor.java b/src/main/java/org/alliancegenome/curation_api/jobs/processors/StartLoadProcessor.java new file mode 100644 index 000000000..2e0fb43b4 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/jobs/processors/StartLoadProcessor.java @@ -0,0 +1,47 @@ +package org.alliancegenome.curation_api.jobs.processors; + +import org.alliancegenome.curation_api.dao.loads.BulkLoadFileDAO; +import org.alliancegenome.curation_api.enums.BulkLoadCleanUp; +import org.alliancegenome.curation_api.enums.JobStatus; +import org.alliancegenome.curation_api.jobs.events.StartedBulkLoadFileJobEvent; +import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFile; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.event.Observes; +import jakarta.inject.Inject; +import lombok.extern.jbosslog.JBossLog; + +@JBossLog +@ApplicationScoped +public class StartLoadProcessor extends BulkLoadProcessor { + + @Inject + BulkLoadFileDAO bulkLoadFileDAO; + + public void bulkLoadFile(@Observes StartedBulkLoadFileJobEvent event) { // An @Observes method should not be in a super class as then it gets run for every child class + BulkLoadFile bulkLoadFile = bulkLoadFileDAO.find(event.getId()); + if (!bulkLoadFile.getBulkloadStatus().isStarted()) { + log.warn("bulkLoadFile: Job is not started returning: " + bulkLoadFile.getBulkloadStatus()); + // endLoad(bulkLoadFile, "Finished ended due to status: " + + // bulkLoadFile.getBulkloadStatus(), bulkLoadFile.getBulkloadStatus()); + return; + } else { + startLoadFile(bulkLoadFile); + } + + try { + if (bulkLoadFile.getLocalFilePath() == null || bulkLoadFile.getS3Path() == null) { + syncWithS3(bulkLoadFile); + } + bulkLoadJobExecutor.process(bulkLoadFile, bulkLoadFile.getBulkloadCleanUp() == BulkLoadCleanUp.YES); + JobStatus status = bulkLoadFile.getBulkloadStatus().equals(JobStatus.FAILED) ? JobStatus.FAILED : JobStatus.FINISHED; + endLoadFile(bulkLoadFile, bulkLoadFile.getErrorMessage(), status); + + } catch (Exception e) { + endLoadFile(bulkLoadFile, "Failed loading: " + bulkLoadFile.getBulkLoad().getName() + " please check the logs for more info. " + bulkLoadFile.getErrorMessage(), JobStatus.FAILED); + log.error("Load File: " + bulkLoadFile.getBulkLoad().getName() + " is failed"); + e.printStackTrace(); + } + + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java index 746703af6..467aa5eb0 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Synonym.java @@ -34,6 +34,6 @@ public class Synonym extends GeneratedAuditedObject { @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") @KeywordField(name = "name_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") @JsonView({ View.FieldsOnly.class }) - @Column(length = 2000) + @Column(columnDefinition = "TEXT") private String name; } diff --git a/src/main/resources/db/migration/v0.29.0.5__synonym_name_length.sql b/src/main/resources/db/migration/v0.29.0.5__synonym_name_length.sql new file mode 100644 index 000000000..721af4a79 --- /dev/null +++ b/src/main/resources/db/migration/v0.29.0.5__synonym_name_length.sql @@ -0,0 +1 @@ +ALTER TABLE synonym ALTER COLUMN name TYPE text; From 5d19636d7bb1cb548b019bafb5947ed79722335f Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Fri, 16 Feb 2024 14:19:29 -0500 Subject: [PATCH 054/159] Update v0.29.0.5__synonym_name_length.sql --- .../resources/db/migration/v0.29.0.5__synonym_name_length.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/db/migration/v0.29.0.5__synonym_name_length.sql b/src/main/resources/db/migration/v0.29.0.5__synonym_name_length.sql index 721af4a79..b0c440484 100644 --- a/src/main/resources/db/migration/v0.29.0.5__synonym_name_length.sql +++ b/src/main/resources/db/migration/v0.29.0.5__synonym_name_length.sql @@ -1 +1,2 @@ ALTER TABLE synonym ALTER COLUMN name TYPE text; +ALTER TABLE synonym_aud ALTER COLUMN name TYPE text; From 5c213a422217a64875b156fbb81cd357d7e28b25 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 19 Feb 2024 09:04:46 -0600 Subject: [PATCH 055/159] update release-notes --- RELEASE-NOTES.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index b825201ac..58fc08d10 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -2,6 +2,16 @@ https://agr-jira.atlassian.net/wiki/spaces/ATEAM/overview + +## v0.30.0 +* New features + * Enable "New Annotation" pop-up field-visibility custom settings for disease annotations (SCRUM-2680) + * Add and enable "Show All Fields" button for "New Annotation" pop-up for disease annotations (SCRUM-2756) +* Fixes and maintenance + * Address deletion of allele-gene associations on the Allele detail page Allele-Gene Associations table (SCRUM-3637) + * ZFIN Allele load mostly failing with apparent unrecognized PMID not present in most cases (SCRUM-3640) + * Duplicate disease annotations (same Unique ID) on production curation (SCRUM-3641) + ## v0.29.0 * New features * Allele detail page: Visually emphasize field names/sections and visually demphasize 'Add' buttons (SCRUM-3343) From a1e7c5da60cdc2844abc15491eabf7a7ec00084f Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Mon, 19 Feb 2024 10:56:54 -0600 Subject: [PATCH 056/159] SCRUM-3661 Persistent settings of disease annotation pop up form --- .../NewAnnotationForm.js | 22 +++++++++---------- .../cliapp/src/service/TableStateService.js | 8 +++++++ .../cliapp/src/service/useGetUserSettings.js | 4 ++-- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js index 9d346e7b1..150125b4d 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js @@ -32,7 +32,7 @@ import { WithAdditionalFieldData } from "../../components/FieldData/WithAddition import { GeneticModifiersAdditionalFieldData } from "../../components/FieldData/GeneticModifiersAdditionalFieldData"; import ErrorBoundary from "../../components/Error/ErrorBoundary"; import { ConfirmButton } from "../../components/ConfirmButton"; -import { getDefaultTableState, getModFormFields } from "../../service/TableStateService"; +import { getDefaultFormState, getModFormFields } from "../../service/TableStateService"; import { useGetUserSettings } from "../../service/useGetUserSettings"; export const NewAnnotationForm = ({ @@ -75,12 +75,11 @@ export const NewAnnotationForm = ({ const geneticModifierRelationTerms = useControlledVocabularyService('disease_genetic_modifier_relation'); const [uiErrorMessages, setUiErrorMessages] = useState({}); const areUiErrors = useRef(false); - const newAnnotationFields = ["Asserted Genes", "Asserted Allele", "Negated", "With", "Related Notes", "Experimental Conditions", "Experiments", "Genetic Sex", + const newAnnotationOptionalFields = ["Asserted Genes", "Asserted Allele", "Negated", "With", "Related Notes", "Experimental Conditions", "Experiments", "Genetic Sex", "Disease Qualifiers", "SGD Strain Background", "Annotation Type", "Genetic Modifier Relation", "Genetic Modifiers","Internal"]; - let defaultUserSettings = getDefaultTableState("DiseaseAnnotationsTableSettings"); - defaultUserSettings = {...defaultUserSettings, newAnnotationFields: newAnnotationFields}; - const { settings: settingsKey , mutate: setSettingsKey } = useGetUserSettings('DiseaseAnnotationsTableSettings', defaultUserSettings); - let selectedFields = []; + let defaultUserSettings = getDefaultFormState("DiseaseAnnotations", newAnnotationOptionalFields, undefined); + const { settings: settingsKey , mutate: setSettingsKey } = useGetUserSettings('DiseaseAnnotationsFormSettings', defaultUserSettings); + let selectedFields = settingsKey.selectedFormFields? settingsKey.selectedFormFields : []; const setSelectedFields = (newValue)=>{ selectedFields = newValue; return selectedFields; @@ -408,15 +407,14 @@ export const NewAnnotationForm = ({ } const updateFormFields = (updatedFields) => { - defaultUserSettings = JSON.parse(localStorage.getItem("DiseaseAnnotationsTableSettings")); - let updatedSettings = {...defaultUserSettings, newAnnotationFields: updatedFields}; setSelectedFields(updatedFields); + defaultUserSettings = JSON.parse(localStorage.getItem("DiseaseAnnotationsFormSettings")); + let updatedSettings = {...defaultUserSettings, selectedFormFields: updatedFields}; setSettingsKey(updatedSettings); - }; const handleShowAllFields = () => { - updateFormFields(newAnnotationFields); + updateFormFields(newAnnotationOptionalFields); } const setToModDefault = () => { @@ -433,8 +431,8 @@ export const NewAnnotationForm = ({ updateFormFields(e.value)} diff --git a/src/main/cliapp/src/service/TableStateService.js b/src/main/cliapp/src/service/TableStateService.js index ea757589c..93f6b3570 100644 --- a/src/main/cliapp/src/service/TableStateService.js +++ b/src/main/cliapp/src/service/TableStateService.js @@ -231,3 +231,11 @@ export function getDefaultTableState(table, defaultColumnNames, defaultVisibleCo tableSettingsKeyName: `${table}TableSettings` } } + +export function getDefaultFormState(form, defaultFieldNames, defaultVisibleFields){ + return { + selectedFormFields: defaultVisibleFields ? defaultVisibleFields : defaultFieldNames, + orderedFormFields: defaultFieldNames, + formSettingsKeyName: `${form}FormSettings` + } +} diff --git a/src/main/cliapp/src/service/useGetUserSettings.js b/src/main/cliapp/src/service/useGetUserSettings.js index 37178ebbe..04c41b53e 100644 --- a/src/main/cliapp/src/service/useGetUserSettings.js +++ b/src/main/cliapp/src/service/useGetUserSettings.js @@ -10,7 +10,7 @@ export const useGetUserSettings = (key, defaultValue) => { const [settings, setSettings] = useState(() => { const stickyValue = localStorage.getItem(key); const stickyObject = stickyValue !== null ? JSON.parse(stickyValue) : defaultValue; - if(key !== 'themeSettings') { + if(key !== 'themeSettings' && key !== 'DiseaseAnnotationsFormSettings') { stickyObject.filters = removeInvalidFilters(stickyObject.filters); stickyObject.multiSortMeta = removeInvalidSorts(stickyObject.multiSortMeta); if(!stickyObject.orderedColumnNames) stickyObject.orderedColumnNames = defaultValue.selectedColumnNames; @@ -29,7 +29,7 @@ export const useGetUserSettings = (key, defaultValue) => { userSettings = data.entity.settingsMap; } - if(key !== 'themeSettings'){ + if(key !== 'themeSettings' && key !== 'DiseaseAnnotationsFormSettings'){ userSettings.filters = removeInvalidFilters(userSettings.filters); userSettings.multiSortMeta = removeInvalidSorts(userSettings.multiSortMeta); if(!userSettings.orderedColumnNames) userSettings.orderedColumnNames = defaultValue.selectedColumnNames; From 2da72e312a1580575ef2f3eb72cdebeef82d03ae Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Mon, 19 Feb 2024 13:10:19 -0600 Subject: [PATCH 057/159] Added isTable parameter --- .../NewAnnotationForm.js | 40 ++++++++----------- .../src/containers/layout/SiteLayout.js | 2 +- .../profilePage/ProfileComponent.js | 2 +- .../cliapp/src/service/useGetUserSettings.js | 6 +-- 4 files changed, 22 insertions(+), 28 deletions(-) diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js index 150125b4d..c8d64631b 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js @@ -78,12 +78,8 @@ export const NewAnnotationForm = ({ const newAnnotationOptionalFields = ["Asserted Genes", "Asserted Allele", "Negated", "With", "Related Notes", "Experimental Conditions", "Experiments", "Genetic Sex", "Disease Qualifiers", "SGD Strain Background", "Annotation Type", "Genetic Modifier Relation", "Genetic Modifiers","Internal"]; let defaultUserSettings = getDefaultFormState("DiseaseAnnotations", newAnnotationOptionalFields, undefined); - const { settings: settingsKey , mutate: setSettingsKey } = useGetUserSettings('DiseaseAnnotationsFormSettings', defaultUserSettings); - let selectedFields = settingsKey.selectedFormFields? settingsKey.selectedFormFields : []; - const setSelectedFields = (newValue)=>{ - selectedFields = newValue; - return selectedFields; - }; + const { settings: settingsKey , mutate: setSettingsKey } = useGetUserSettings('DiseaseAnnotationsFormSettings', defaultUserSettings, false); + const { selectedFormFields } = settingsKey; const mutation = useMutation(newAnnotation => { if (!diseaseAnnotationService) { diseaseAnnotationService = new DiseaseAnnotationService(); @@ -407,8 +403,6 @@ export const NewAnnotationForm = ({ } const updateFormFields = (updatedFields) => { - setSelectedFields(updatedFields); - defaultUserSettings = JSON.parse(localStorage.getItem("DiseaseAnnotationsFormSettings")); let updatedSettings = {...defaultUserSettings, selectedFormFields: updatedFields}; setSettingsKey(updatedSettings); }; @@ -432,7 +426,7 @@ export const NewAnnotationForm = ({ updateFormFields(e.value)} @@ -489,7 +483,7 @@ export const NewAnnotationForm = ({
- {selectedFields.includes("Asserted Genes") && ( + {selectedFormFields?.includes("Asserted Genes") && ( <>
@@ -518,7 +512,7 @@ export const NewAnnotationForm = ({ )} - {selectedFields.includes("Asserted Allele") && ( + {selectedFormFields?.includes("Asserted Allele") && ( <>
@@ -567,7 +561,7 @@ export const NewAnnotationForm = ({
- {selectedFields.includes("Negated") && ( + {selectedFormFields?.includes("Negated") && ( <>
@@ -659,7 +653,7 @@ export const NewAnnotationForm = ({
- {selectedFields.includes("With") && ( + {selectedFormFields?.includes("With") && ( <>
@@ -687,7 +681,7 @@ export const NewAnnotationForm = ({ )} - {selectedFields.includes("Related Notes") && ( + {selectedFormFields?.includes("Related Notes") && ( <>
@@ -708,7 +702,7 @@ export const NewAnnotationForm = ({ )} - {selectedFields.includes("Experimental Conditions") && ( + {selectedFormFields?.includes("Experimental Conditions") && ( <>
@@ -729,7 +723,7 @@ export const NewAnnotationForm = ({ )} - {selectedFields.includes("Experiments") && ( + {selectedFormFields?.includes("Experiments") && ( <>
@@ -755,7 +749,7 @@ export const NewAnnotationForm = ({ )} - {selectedFields.includes("Genetic Sex") && ( + {selectedFormFields?.includes("Genetic Sex") && ( <>
@@ -778,7 +772,7 @@ export const NewAnnotationForm = ({ )} - {selectedFields.includes("Disease Qualifiers") && ( + {selectedFormFields?.includes("Disease Qualifiers") && ( <>
@@ -800,7 +794,7 @@ export const NewAnnotationForm = ({ )} - {selectedFields.includes("SGD Strain Background") && ( + {selectedFormFields?.includes("SGD Strain Background") && ( <>
@@ -829,7 +823,7 @@ export const NewAnnotationForm = ({ )} - {selectedFields.includes("Annotation Type") && ( + {selectedFormFields?.includes("Annotation Type") && ( <>
@@ -853,7 +847,7 @@ export const NewAnnotationForm = ({ )} - {selectedFields.includes("Genetic Modifier Relation") && ( + {selectedFormFields?.includes("Genetic Modifier Relation") && ( <>
@@ -878,7 +872,7 @@ export const NewAnnotationForm = ({ )} - {selectedFields.includes("Genetic Modifiers") && ( + {selectedFormFields?.includes("Genetic Modifiers") && ( <>
@@ -904,7 +898,7 @@ export const NewAnnotationForm = ({ )} - {selectedFields.includes("Internal") && ( + {selectedFormFields?.includes("Internal") && ( <>
diff --git a/src/main/cliapp/src/containers/layout/SiteLayout.js b/src/main/cliapp/src/containers/layout/SiteLayout.js index 8f3655023..6c41a769d 100644 --- a/src/main/cliapp/src/containers/layout/SiteLayout.js +++ b/src/main/cliapp/src/containers/layout/SiteLayout.js @@ -38,7 +38,7 @@ const initialThemeState = { export const SiteLayout = (props) => { - const { settings: themeState, mutate: setThemeState } = useGetUserSettings( "themeSettings", initialThemeState); + const { settings: themeState, mutate: setThemeState } = useGetUserSettings( "themeSettings", initialThemeState, false); const [staticMenuInactive, setStaticMenuInactive] = useState(false); const [overlayMenuActive, setOverlayMenuActive] = useState(false); const [mobileMenuActive, setMobileMenuActive] = useState(false); diff --git a/src/main/cliapp/src/containers/profilePage/ProfileComponent.js b/src/main/cliapp/src/containers/profilePage/ProfileComponent.js index b49fe3d16..d7a4d0011 100644 --- a/src/main/cliapp/src/containers/profilePage/ProfileComponent.js +++ b/src/main/cliapp/src/containers/profilePage/ProfileComponent.js @@ -24,7 +24,7 @@ const initialThemeState = { export const ProfileComponent = () => { - const { settings: themeState, mutate: setThemeState } = useGetUserSettings("themeSettings", initialThemeState); + const { settings: themeState, mutate: setThemeState } = useGetUserSettings("themeSettings", initialThemeState, false); const [localUserInfo, setLocalUserInfo] = useState({}); const [oktaToken] = useState(JSON.parse(localStorage.getItem('okta-token-storage'))); diff --git a/src/main/cliapp/src/service/useGetUserSettings.js b/src/main/cliapp/src/service/useGetUserSettings.js index 04c41b53e..88ac62b5e 100644 --- a/src/main/cliapp/src/service/useGetUserSettings.js +++ b/src/main/cliapp/src/service/useGetUserSettings.js @@ -4,13 +4,13 @@ import { PersonSettingsService } from "./PersonSettingsService"; import { removeInvalidFilters, removeInvalidSorts } from '../utils/utils'; -export const useGetUserSettings = (key, defaultValue) => { +export const useGetUserSettings = (key, defaultValue, isTable = true) => { const personSettingsService = new PersonSettingsService(); const [settings, setSettings] = useState(() => { const stickyValue = localStorage.getItem(key); const stickyObject = stickyValue !== null ? JSON.parse(stickyValue) : defaultValue; - if(key !== 'themeSettings' && key !== 'DiseaseAnnotationsFormSettings') { + if(isTable) { stickyObject.filters = removeInvalidFilters(stickyObject.filters); stickyObject.multiSortMeta = removeInvalidSorts(stickyObject.multiSortMeta); if(!stickyObject.orderedColumnNames) stickyObject.orderedColumnNames = defaultValue.selectedColumnNames; @@ -29,7 +29,7 @@ export const useGetUserSettings = (key, defaultValue) => { userSettings = data.entity.settingsMap; } - if(key !== 'themeSettings' && key !== 'DiseaseAnnotationsFormSettings'){ + if(isTable){ userSettings.filters = removeInvalidFilters(userSettings.filters); userSettings.multiSortMeta = removeInvalidSorts(userSettings.multiSortMeta); if(!userSettings.orderedColumnNames) userSettings.orderedColumnNames = defaultValue.selectedColumnNames; From 6949fe0a8276def5608dd3e3dbf56fd93a947dd3 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 20 Feb 2024 12:25:35 +0000 Subject: [PATCH 058/159] Re-re-factor association slots and UI/indexing fixes --- src/main/cliapp/src/constants/FilterFields.js | 36 +-- src/main/cliapp/src/constants/SortFields.js | 6 +- .../AlleleGeneAssociationsForm.js | 4 +- .../AlleleGeneAssociationsFormTable.js | 8 +- .../constructsPage/ConstructsTable.js | 12 +- .../constructsPage/GenomicComponentsDialog.js | 14 +- .../DiseaseAnnotationsTable.js | 74 +++--- .../NewAnnotationForm.js | 34 +-- .../mockData/mockData.js | 4 +- .../useNewAnnotationReducer.js | 8 +- .../src/service/DiseaseAnnotationService.js | 2 +- .../constants/LinkMLSchemaConstants.java | 2 +- .../model/entities/AGMDiseaseAnnotation.java | 26 +- .../model/entities/AffectedGenomicModel.java | 2 +- .../curation_api/model/entities/Allele.java | 10 +- .../entities/AlleleDiseaseAnnotation.java | 26 +- .../model/entities/Construct.java | 8 +- .../model/entities/DiseaseAnnotation.java | 6 +- .../curation_api/model/entities/Gene.java | 10 +- .../model/entities/GeneDiseaseAnnotation.java | 26 +- .../model/entities/GenomicEntity.java | 10 +- .../AlleleGeneAssociation.java | 10 +- .../ConstructGenomicEntityAssociation.java | 10 +- .../AlleleGeneAssociationService.java | 8 +- ...structGenomicEntityAssociationService.java | 8 +- .../DiseaseAnnotationUniqueIdHelper.java | 4 +- .../AGMDiseaseAnnotationValidator.java | 17 +- .../AlleleDiseaseAnnotationValidator.java | 17 +- .../services/validation/AlleleValidator.java | 4 +- .../validation/ConstructValidator.java | 2 +- .../DiseaseAnnotationValidator.java | 12 +- .../GeneDiseaseAnnotationValidator.java | 12 +- .../AlleleGeneAssociationValidator.java | 24 +- ...ructGenomicEntityAssociationValidator.java | 29 +-- .../dto/AGMDiseaseAnnotationDTOValidator.java | 2 +- .../AlleleDiseaseAnnotationDTOValidator.java | 2 +- .../dto/DiseaseAnnotationDTOValidator.java | 2 +- .../GeneDiseaseAnnotationDTOValidator.java | 2 +- .../AlleleGeneAssociationDTOValidator.java | 8 +- ...tGenomicEntityAssociationDTOValidator.java | 8 +- ...ql => v0.31.0.1__linkml_v2.1.0_update.sql} | 62 ++--- .../DiseaseAnnotationBulkUploadITCase.java | 24 +- ...AlleleGeneAssociationBulkUploadITCase.java | 14 +- ...omicEntityAssociationBulkUploadITCase.java | 14 +- .../crud/controllers/AlleleITCase.java | 6 +- .../crud/controllers/ConstructITCase.java | 6 +- .../controllers/DiseaseAnnotationITCase.java | 236 +++++++++--------- .../AlleleGeneAssociationITCase.java | 76 +++--- ...nstructGenomicEntityAssociationITCase.java | 76 +++--- 49 files changed, 513 insertions(+), 510 deletions(-) rename src/main/resources/db/migration/{v0.30.0.1__linkml_v2.1.0_update.sql => v0.31.0.1__linkml_v2.1.0_update.sql} (96%) diff --git a/src/main/cliapp/src/constants/FilterFields.js b/src/main/cliapp/src/constants/FilterFields.js index ae041d711..ccb21d977 100644 --- a/src/main/cliapp/src/constants/FilterFields.js +++ b/src/main/cliapp/src/constants/FilterFields.js @@ -146,7 +146,7 @@ export const FIELD_SETS = Object.freeze({ }, constructGenomicComponentsFieldSet: { filterName: "constructGenomicComponentsFilter", - fields: ["constructGenomicEntityAssociations.object.symbol", "constructGenomicEntityAssociations.object.name", "constructGenomicEntityAssociations.object.curie", "constructGenomicEntityAssociations.object.modEntityId", "constructGenomicEntityAssociations.object.modInternalId", "constructGenomicEntityAssociations.relation.name"], + fields: ["constructGenomicEntityAssociations.constructGenomicEntityAssociationObject.symbol", "constructGenomicEntityAssociations.constructGenomicEntityAssociationObject.name", "constructGenomicEntityAssociations.constructGenomicEntityAssociationObject.curie", "constructGenomicEntityAssociations.constructGenomicEntityAssociationObject.modEntityId", "constructGenomicEntityAssociations.constructGenomicEntityAssociationObject.modInternalId", "constructGenomicEntityAssociations.relation.name"], }, daConditionRelationsHandleFieldSet: { filterName: "daConditionRelationHandleFilter", @@ -192,9 +192,9 @@ export const FIELD_SETS = Object.freeze({ filterName: "definitionFilter", fields: ["definition"], }, - vocabularyDescriptionFieldSet: { - filterName: "vocabularyDescriptionFilter", - fields: ["vocabularyDescription"], + diseaseAnnotationSubjectFieldSet: { + filterName: "diseaseAnnotationSubjectFilter", + fields: ["diseaseAnnotationSubject.symbol", "diseaseAnnotationSubject.name", "diseaseAnnotationSubject.curie", "diseaseAnnotationSubject.modEntityId", "diseaseAnnotationSubject.modInternalId"], }, diseaseQualifiersFieldSet: { filterName: "diseaseQualifiersFilter", @@ -316,9 +316,9 @@ export const FIELD_SETS = Object.freeze({ filterName: "negatedFilter", fields: ["negated"], }, - objectTermFieldSet: { + diseaseAnnotationObjectFieldSet: { filterName: "objectFilter", - fields: ["object.curie", "object.name"], + fields: ["diseaseAnnotationObject.curie", "diseaseAnnotationObject.name"], }, obsoleteFieldSet: { filterName: "obsoleteFilter", @@ -408,10 +408,6 @@ export const FIELD_SETS = Object.freeze({ filterName: "speciesAssemblyFilter", fields: ["assembly_curie"] }, - subjectFieldSet: { - filterName: "subjectFilter", - fields: ["subject.symbol", "subject.name", "subject.curie", "subject.modEntityId", "subject.modInternalId"], - }, subtypeFieldSet: { filterName: "subtypeFilter", fields: ["subtype.name"], @@ -452,6 +448,10 @@ export const FIELD_SETS = Object.freeze({ filterName: "variantTypeFilter", fields: ["variantType.name", "variantType.curie"], }, + vocabularyDescriptionFieldSet: { + filterName: "vocabularyDescriptionFilter", + fields: ["vocabularyDescription"], + }, vocabularyFieldSet: { filterName: "vocabularyFilter", fields: ["vocabularyTermSetVocabulary.name"], @@ -537,7 +537,8 @@ export const FILTER_CONFIGS = Object.freeze({ modinternalidFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.modinternalidFieldSet] }, nameFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.nameFieldSet] }, namespaceFilterConfig: { filterComponentType: 'input', fieldSets: [FIELD_SETS.namespaceFieldSet] }, - objectTermFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.objectTermFieldSet] }, + diseaseAnnotationSubjectFieldConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.diseaseAnnotationSubjectFieldSet] }, + diseaseAnnotationObjectFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.diseaseAnnotationObjectFieldSet] }, ontologySynonymsFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.ontologySynonymsFieldSet] }, pageDescriptionFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.pageDescriptionFieldSet] }, prefixFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.prefixFieldSet]}, @@ -549,13 +550,12 @@ export const FILTER_CONFIGS = Object.freeze({ singleReferenceFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.singleReferenceFieldSet] }, smilesFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.smilesFieldSet] }, sourceGeneralConsequenceFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.sourceGeneralConsequenceFieldSet] }, - speciesTaxonCurieFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.speciesTaxonCurieFieldSet]}, - speciesFullNameFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.speciesFullNameFieldSet]}, - speciesDisplayNameFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.speciesDisplayNameFieldSet]}, - speciesCommonNameFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.speciesCommonNameFieldSet]}, - speciesAbbreviationFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.speciesAbbreviationFieldSet]}, - speciesAssemblyFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.speciesAssemblyFieldSet]}, - subjectFieldConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.subjectFieldSet] }, + speciesTaxonCurieFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.speciesTaxonCurieFieldSet]}, + speciesFullNameFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.speciesFullNameFieldSet]}, + speciesDisplayNameFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.speciesDisplayNameFieldSet]}, + speciesCommonNameFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.speciesCommonNameFieldSet]}, + speciesAbbreviationFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.speciesAbbreviationFieldSet]}, + speciesAssemblyFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.speciesAssemblyFieldSet]}, subtypeFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.subtypeFieldSet] }, synonymsFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.synonymsFieldSet] }, taxonFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.taxonFieldSet] }, diff --git a/src/main/cliapp/src/constants/SortFields.js b/src/main/cliapp/src/constants/SortFields.js index e46369d7b..fbece06ce 100644 --- a/src/main/cliapp/src/constants/SortFields.js +++ b/src/main/cliapp/src/constants/SortFields.js @@ -2,10 +2,10 @@ export const SORT_FIELDS = Object.freeze([ "uniqueId", "modEntityId", "modInternalId", - "subject.symbol", + "diseaseAnnotationSubject.symbol", "relation.name", "negated", - "objectTerm.name", + "diseaseAnnotationObject.name", "singleReference.primaryCrossReferenceCurie", "evidenceCodes.abbreviation", "with.geneSymbol.displayText", @@ -98,7 +98,7 @@ export const SORT_FIELDS = Object.freeze([ "secondaryIdentifiers", "taxonText", "constructComponents.componentSymbol", - "constructGenomicEntityAssociations.object.symbol", + "constructGenomicEntityAssociations.constructGenomicEntityAssociationObject.symbol", "variantStatus.name", "variantType.name", "sourceGeneralConsequence.name" diff --git a/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsForm.js b/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsForm.js index 88e96211a..e91e58a6b 100644 --- a/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsForm.js +++ b/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsForm.js @@ -14,7 +14,7 @@ export const AlleleGeneAssociationsForm = ({ labelColumnSize, state, dispatch }) e.preventDefault(); const updatedErrorMessages = global.structuredClone(state.entityStates[entityType].errorMessages); const newAlleleGeneAssociation = { - subject: state.allele, + alleleAssociationSubject: state.allele, }; addDataKey(newAlleleGeneAssociation); @@ -66,7 +66,7 @@ export const AlleleGeneAssociationsForm = ({ labelColumnSize, state, dispatch }) type: 'EDIT_FILTERABLE_ROW', entityType: entityType, dataKey: props.rowData?.dataKey, - field: "object", + field: "alleleGeneAssociationObject", value: event.target.value }); }; diff --git a/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js b/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js index 7b1d467c8..3730637ef 100644 --- a/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js +++ b/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js @@ -28,7 +28,7 @@ export const AlleleGeneAssociationsFormTable = ({ const [first, setFirst] = useState(0); const [filters, setFilters] = useState({ "relation.name": { value: null, matchMode: "in" }, - "object.modEntityId": { value: null, matchMode: "contains" }, + "objectBiologicalEntity.modEntityId": { value: null, matchMode: "contains" }, "relatedNote.freeText": { value: null, matchMode: "contains" }, "evidenceCode.curie": { value: null, matchMode: "contains" }, "evidenceCurieSearchFilter": { value: null, matchMode: "contains" }, @@ -96,13 +96,13 @@ export const AlleleGeneAssociationsFormTable = ({ dataKey={props?.rowData?.dataKey} />; }} - field="object.modEntityId" + field="objectBiologicalEntity.modEntityId" header="Gene" headerClassName='surface-0' filter sortable - filterField="object.modEntityId" - sortField="object.modEntityId" + filterField="objectBiologicalEntity.modEntityId" + sortField="objectBiologicalEntity.modEntityId" showFilterMenu={false} /> { const componentSet = new Set(); for(var i = 0; i < rowData.constructGenomicEntityAssociations.length; i++){ let symbolValue = ""; - if (rowData.constructGenomicEntityAssociations[i]?.object.geneSymbol || rowData.constructGenomicEntityAssociations[i]?.object.alleleSymbol) { - symbolValue = rowData.constructGenomicEntityAssociations[i].object.geneSymbol ? rowData.constructGenomicEntityAssociations[i].object.geneSymbol.displayText : rowData.constructGenomicEntityAssociations[i].object.alleleSymbol.displayText; - } else if (rowData.constructGenomicEntityAssociations[i]?.object.name) { - symbolValue = rowData.constructGenomicEntityAssociations[i].object.name; + if (rowData.constructGenomicEntityAssociations[i]?.constructGenomicEntityAssociationObject?.geneSymbol || rowData.constructGenomicEntityAssociations[i]?.constructGenomicEntityAssociationObject?.alleleSymbol) { + symbolValue = rowData.constructGenomicEntityAssociations[i].constructGenomicEntityAssociationObject.geneSymbol ? rowData.constructGenomicEntityAssociations[i].constructGenomicEntityAssociationObject.geneSymbol.displayText : rowData.constructGenomicEntityAssociations[i].constructGenomicEntityAssociationObject.alleleSymbol.displayText; + } else if (rowData.constructGenomicEntityAssociations[i]?.constructGenomicEntityAssociationObject?.name) { + symbolValue = rowData.constructGenomicEntityAssociations[i].constructGenomicEntityAssociationObject.name; } else { - symbolValue = rowData.constructGenomicEntityAssociations[i].object.curie; + symbolValue = rowData.constructGenomicEntityAssociations[i].constructGenomicEntityAssociationObject.curie; } let relationName = ""; if (rowData.constructGenomicEntityAssociations[i]?.relation?.name) { @@ -380,7 +380,7 @@ export const ConstructsTable = () => { filterConfig: FILTER_CONFIGS.constructComponentsFilterConfig, }, { - field: "constructGenomicEntityAssociations.object.symbol", + field: "constructGenomicEntityAssociations.constructGenomicEntityAssociationObject.symbol", header: "Component Associations", body: genomicComponentsTemplate, sortable: { isInEditMode }, diff --git a/src/main/cliapp/src/containers/constructsPage/GenomicComponentsDialog.js b/src/main/cliapp/src/containers/constructsPage/GenomicComponentsDialog.js index c17829e61..5704e62aa 100644 --- a/src/main/cliapp/src/containers/constructsPage/GenomicComponentsDialog.js +++ b/src/main/cliapp/src/containers/constructsPage/GenomicComponentsDialog.js @@ -91,13 +91,13 @@ export const GenomicComponentsDialog = ({ const componentTemplate = (rowData) => { let componentDisplayValue = ""; - if (rowData.object.geneSymbol || rowData.object.alleleSymbol) { - let symbolValue = rowData.object.geneSymbol ? rowData.object.geneSymbol.displayText : rowData.object.alleleSymbol.displayText; - componentDisplayValue = symbolValue + ' (' + getIdentifier(rowData.object) + ')'; - } else if (rowData.object.name) { - componentDisplayValue = rowData.object.name + ' (' + getIdentifier(rowData.object) + ')'; + if (rowData.constructGenomicEntityAssociationObject.geneSymbol || rowData.constructGenomicEntityAssociationObject.alleleSymbol) { + let symbolValue = rowData.constructGenomicEntityAssociationObject.geneSymbol ? rowData.constructGenomicEntityAssociationObject.geneSymbol.displayText : rowData.constructGenomicEntityAssociationObject.alleleSymbol.displayText; + componentDisplayValue = symbolValue + ' (' + getIdentifier(rowData.constructGenomicEntityAssociationObject) + ')'; + } else if (rowData.constructGenomicEntityAssociationObject.name) { + componentDisplayValue = rowData.constructGenomicEntityAssociationObject.name + ' (' + getIdentifier(rowData.constructGenomicEntityAssociationObject) + ')'; } else { - componentDisplayValue = getIdentifier(rowData.object); + componentDisplayValue = getIdentifier(rowData.constructGenomicEntityAssociationObject); } return ( <> @@ -132,7 +132,7 @@ export const GenomicComponentsDialog = ({ - + evidenceTemplate(rowData)}/> diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 8da27d2c2..96eaf9a77 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -75,8 +75,8 @@ export const DiseaseAnnotationsTable = () => { let diseaseAnnotationService = new DiseaseAnnotationService(); const sortMapping = { - 'objectTerm.name': ['objectTerm.curie', 'objectTerm.namespace'], - 'subject.symbol': ['subject.name', 'subject.modEntityId'], + 'diseaseAnnotationObject.name': ['diseaseAnnotationObject.curie', 'diseaseAnnotationObject.namespace'], + 'diseaseAnnotationSubject.symbol': ['diseaseAnnotationSubject.name', 'diseaseAnnotationSubject.modEntityId'], 'with.geneSymbol.displayText': ['with.geneFullName.displayText', 'with.modEntityId'], 'sgdStrainBackground.name': ['sgdStrainBackground.modEntityId'], 'diseaseGeneticModifier.symbol': ['diseaseGeneticModifier.name', 'diseaseGeneticModifier.modEntityId'] @@ -506,7 +506,7 @@ export const DiseaseAnnotationsTable = () => { const onConditionRelationHandleEditorValueChange = (props, event) => { let updatedAnnotations = [...props.props.value]; - if (typeof event.value === "objectTerm") { + if (typeof event.value === "diseaseAnnotationObject") { updatedAnnotations[props.rowIndex].conditionRelations[0] = event.value; } else { updatedAnnotations[props.rowIndex].conditionRelations[0].handle = event.value; @@ -514,11 +514,11 @@ export const DiseaseAnnotationsTable = () => { }; const diseaseBodyTemplate = (rowData) => { - if (rowData.objectTerm) { + if (rowData.diseaseAnnotationObject) { return ( <> - {rowData.objectTerm.name} ({rowData.objectTerm.curie}) - + {rowData.diseaseAnnotationObject.name} ({rowData.diseaseAnnotationObject.curie}) + ) } @@ -700,13 +700,13 @@ export const DiseaseAnnotationsTable = () => { }; const onSubjectValueChange = (event, setFieldValue, props) => { - defaultAutocompleteOnChange(props, event, "subject", setFieldValue, "modEntityId"); + defaultAutocompleteOnChange(props, event, "diseaseAnnotationSubject", setFieldValue, "modEntityId"); }; const subjectSearch = (event, setFiltered, setQuery, props) => { const autocompleteFields = getSubjectAutocompleteFields(props); const endpoint = getSubjectEndpoint(props); - const filterName = "subjectFilter"; + const filterName = "diseaseAnnotationSubjectFilter"; const filter = buildAutocompleteFilter(event, autocompleteFields); setQuery(event.query); autocompleteSearch(searchService, endpoint, filterName, filter, setFiltered); @@ -716,23 +716,23 @@ export const DiseaseAnnotationsTable = () => { return ( <> } onValueChangeHandler={onSubjectValueChange} /> ); @@ -883,7 +883,7 @@ export const DiseaseAnnotationsTable = () => { }; const onDiseaseValueChange = (event, setFieldValue, props) => { - defaultAutocompleteOnChange(props, event, "objectTerm", setFieldValue); + defaultAutocompleteOnChange(props, event, "diseaseAnnotationObject", setFieldValue); }; const diseaseSearch = (event, setFiltered, setQuery) => { @@ -907,14 +907,14 @@ export const DiseaseAnnotationsTable = () => { <> ); @@ -1047,83 +1047,83 @@ export const DiseaseAnnotationsTable = () => { }; const subjectBodyTemplate = (rowData) => { - if (rowData.subject) { - const identifier = getIdentifier(rowData.subject); - if (rowData.subject.geneSymbol) { + if (rowData.diseaseAnnotationSubject) { + const identifier = getIdentifier(rowData.diseaseAnnotationSubject); + if (rowData.diseaseAnnotationSubject.geneSymbol) { return ( <>
) - } else if (rowData.subject.alleleSymbol) { + } else if (rowData.diseaseAnnotationSubject.alleleSymbol) { return ( <>
) - } else if (rowData.subject.geneFullName) { + } else if (rowData.diseaseAnnotationSubject.geneFullName) { return ( <>
) - } else if (rowData.subject.alleleFullName) { + } else if (rowData.diseaseAnnotationSubject.alleleFullName) { return ( <>
) - } else if (rowData.subject.name) { + } else if (rowData.diseaseAnnotationSubject.name) { return ( <>
@@ -1300,11 +1300,11 @@ export const DiseaseAnnotationsTable = () => { filterConfig: FILTER_CONFIGS.modinternalidFilterConfig, }, { - field: "subject.symbol", + field: "diseaseAnnotationSubject.symbol", header: "Subject", body: subjectBodyTemplate, sortable: true, - filterConfig: FILTER_CONFIGS.subjectFieldConfig, + filterConfig: FILTER_CONFIGS.diseaseAnnotationSubjectFieldConfig, editor: (props) => subjectEditorTemplate(props), }, { @@ -1323,11 +1323,11 @@ export const DiseaseAnnotationsTable = () => { editor: (props) => negatedEditor(props) }, { - field: "objectTerm.name", + field: "diseaseAnnotationObject.name", header: "Disease", body: diseaseBodyTemplate, sortable: true, - filterConfig: FILTER_CONFIGS.objectTermFilterConfig, + filterConfig: FILTER_CONFIGS.diseaseAnnotationObjectFilterConfig, editor: (props) => diseaseEditorTemplate(props), }, { diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js index 7c7ac518b..72849a8d9 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js @@ -263,7 +263,7 @@ export const NewAnnotationForm = ({ "alleleSecondaryIds.secondaryId", ]; const endpoint = "biologicalentity"; - const filterName = "subjectFilter"; + const filterName = "diseaseAnnotationSubjectFilter"; const filter = buildAutocompleteFilter(event, autocompleteFields); setQuery(event.query); autocompleteSearch(searchService, endpoint, filterName, filter, setFiltered); @@ -324,7 +324,7 @@ export const NewAnnotationForm = ({ const isExperimentEnabled = () => { return ( //only enabled if a reference is selected from suggestions and condition relation table isn't visible - typeof newAnnotation.singleReference === "object" + typeof newAnnotation.singleReference === "diseaseAnnotationObject" && newAnnotation.singleReference.curie !== "" && !showConditionRelations ) @@ -455,26 +455,26 @@ export const NewAnnotationForm = ({
- +
} - classNames={classNames({'p-invalid': submitted && errorMessages.subject})} + classNames={classNames({'p-invalid': submitted && errorMessages.diseaseAnnotationSubject})} />
- - - + + +
@@ -584,22 +584,22 @@ export const NewAnnotationForm = ({
- +
- - + +
diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js index 47ecdba39..13981e57d 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js @@ -67,7 +67,7 @@ export const data = { "dbDateUpdated": "2023-03-16T15:24:38.954678Z", "id": 18394375, "uniqueId": "MGI:5560505|DOID:0050545|AGRKB:101000000827851", - "objectTerm": { + "diseaseAnnotationObject": { "internal": false, "obsolete": false, "dbDateUpdated": "2023-04-02T22:02:52.730635Z", @@ -176,7 +176,7 @@ export const data = { } } }, - "subject": { + "diseaseAnnotationSubject": { "type": "AffectedGenomicModel", "internal": false, "obsolete": false, diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/useNewAnnotationReducer.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/useNewAnnotationReducer.js index b4314705a..42f7855bb 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/useNewAnnotationReducer.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/useNewAnnotationReducer.js @@ -2,7 +2,7 @@ import { useImmerReducer } from "use-immer"; import 'core-js/features/structured-clone'; const DEFAULT_ANNOTATION = { - subject: { + diseaseAnnotationSubject: { modEntityId: "", }, assertedGenes : [], @@ -11,7 +11,7 @@ const DEFAULT_ANNOTATION = { name: "", }, negated: false, - objectTerm: { + diseaseAnnotationObject: { curie: "", }, singleReference: { @@ -47,12 +47,12 @@ const initialNewAnnotationState = { const buildAnnotation = (rowData) => { return { - subject: global.structuredClone(rowData.subject) || DEFAULT_ANNOTATION.subject, + diseaseAnnotationSubject: global.structuredClone(rowData.diseaseAnnotationSubject) || DEFAULT_ANNOTATION.diseaseAnnotationSubject, assertedGenes : global.structuredClone(rowData.assertedGenes) || DEFAULT_ANNOTATION.assertedGenes, assertedAllele : global.structuredClone(rowData.assertedAllele) || DEFAULT_ANNOTATION.assertedAllele, relation: global.structuredClone(rowData.relation) || DEFAULT_ANNOTATION.relation, negated: rowData.negated || DEFAULT_ANNOTATION.negated, - objectTerm: global.structuredClone(rowData.objectTerm) || DEFAULT_ANNOTATION.objectTerm, + diseaseAnnotationObject: global.structuredClone(rowData.diseaseAnnotationObject) || DEFAULT_ANNOTATION.diseaseAnnotationObject, singleReference: global.structuredClone(rowData.singleReference) || DEFAULT_ANNOTATION.singleReference, evidenceCodes: global.structuredClone(rowData.evidenceCodes) || DEFAULT_ANNOTATION.subject, with: global.structuredClone(rowData.with) || DEFAULT_ANNOTATION.with, diff --git a/src/main/cliapp/src/service/DiseaseAnnotationService.js b/src/main/cliapp/src/service/DiseaseAnnotationService.js index ec84a60e9..b5f436b27 100644 --- a/src/main/cliapp/src/service/DiseaseAnnotationService.js +++ b/src/main/cliapp/src/service/DiseaseAnnotationService.js @@ -16,7 +16,7 @@ export class DiseaseAnnotationService extends BaseAuthService { createDiseaseAnnotation(annotation) { let newAnnotation = { ...annotation }; - const { type } = (annotation.subject) ? newAnnotation.subject : ''; + const { type } = (annotation.diseaseAnnotationSubject) ? newAnnotation.diseaseAnnotationSubject : ''; newAnnotation["type"] = subectAnnotationLookup[type]; let endpoint; diff --git a/src/main/java/org/alliancegenome/curation_api/constants/LinkMLSchemaConstants.java b/src/main/java/org/alliancegenome/curation_api/constants/LinkMLSchemaConstants.java index 3468390a0..60a458b93 100644 --- a/src/main/java/org/alliancegenome/curation_api/constants/LinkMLSchemaConstants.java +++ b/src/main/java/org/alliancegenome/curation_api/constants/LinkMLSchemaConstants.java @@ -2,7 +2,7 @@ public final class LinkMLSchemaConstants { - public static final String LATEST_RELEASE = "2.0.0"; + public static final String LATEST_RELEASE = "2.2.0"; public static final String MIN_ONTOLOGY_RELEASE = "1.2.4"; public static final String MAX_ONTOLOGY_RELEASE = LATEST_RELEASE; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java index 9d9580b01..f9ad8c657 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMDiseaseAnnotation.java @@ -36,12 +36,12 @@ @Schema(name = "AGM_Disease_Annotation", description = "Annotation class representing a agm disease annotation") @JsonTypeName("AGMDiseaseAnnotation") @OnDelete(action = OnDeleteAction.CASCADE) -@AGRCurationSchemaVersion(min = "2.0.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotation.class }) +@AGRCurationSchemaVersion(min = "2.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotation.class }) @Table(indexes = { @Index(name = "AGMDiseaseAnnotation_inferredGene_index", columnList = "inferredGene_id"), @Index(name = "AGMDiseaseAnnotation_inferredAllele_index", columnList = "inferredAllele_id"), @Index(name = "AGMDiseaseAnnotation_assertedAllele_index", columnList = "assertedAllele_id"), - @Index(name = "AGMDiseaseAnnotation_SubjectBiologicalEntity_index", columnList = "subjectbiologicalentity_id") + @Index(name = "AGMDiseaseAnnotation_DiseaseAnnotationSubject_index", columnList = "diseaseAnnotationSubject_id") }) public class AGMDiseaseAnnotation extends DiseaseAnnotation { @@ -51,7 +51,7 @@ public class AGMDiseaseAnnotation extends DiseaseAnnotation { @Fetch(FetchMode.SELECT) @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) - private AffectedGenomicModel subjectBiologicalEntity; + private AffectedGenomicModel diseaseAnnotationSubject; @IndexedEmbedded(includePaths = { "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", @@ -112,39 +112,39 @@ public class AGMDiseaseAnnotation extends DiseaseAnnotation { @Override @JsonIgnore public String getSubjectCurie() { - if (subjectBiologicalEntity == null) + if (diseaseAnnotationSubject == null) return null; - return subjectBiologicalEntity.getCurie(); + return diseaseAnnotationSubject.getCurie(); } @Transient @Override @JsonIgnore public String getSubjectTaxonCurie() { - if (subjectBiologicalEntity == null) + if (diseaseAnnotationSubject == null) return null; - if (subjectBiologicalEntity.getTaxon() == null) + if (diseaseAnnotationSubject.getTaxon() == null) return null; - return subjectBiologicalEntity.getTaxon().getCurie(); + return diseaseAnnotationSubject.getTaxon().getCurie(); } @Transient @Override @JsonIgnore public String getSubjectIdentifier() { - if (subjectBiologicalEntity == null) + if (diseaseAnnotationSubject == null) return null; - return subjectBiologicalEntity.getIdentifier(); + return diseaseAnnotationSubject.getIdentifier(); } @Transient @Override @JsonIgnore public String getSubjectSpeciesName() { - if (subjectBiologicalEntity == null) + if (diseaseAnnotationSubject == null) return null; - if (subjectBiologicalEntity.getTaxon() == null) + if (diseaseAnnotationSubject.getTaxon() == null) return null; - return subjectBiologicalEntity.getTaxon().getGenusSpecies(); + return diseaseAnnotationSubject.getTaxon().getGenusSpecies(); } } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java index e724af809..bf2b61b71 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AffectedGenomicModel.java @@ -35,7 +35,7 @@ public class AffectedGenomicModel extends GenomicEntity { @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) private String name; - @OneToMany(mappedBy = "subjectBiologicalEntity", cascade = CascadeType.ALL, orphanRemoval = true) + @OneToMany(mappedBy = "diseaseAnnotationSubject", cascade = CascadeType.ALL, orphanRemoval = true) private List agmDiseaseAnnotations; @IndexedEmbedded(includePaths = {"name", "name_keyword"}) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java index 3a87afd84..289c5c4a2 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Allele.java @@ -79,7 +79,7 @@ public class Allele extends GenomicEntity { @JsonView({ View.FieldsOnly.class }) private Boolean isExtinct; - @OneToMany(mappedBy = "subjectBiologicalEntity", cascade = CascadeType.ALL) + @OneToMany(mappedBy = "diseaseAnnotationSubject", cascade = CascadeType.ALL) private List alleleDiseaseAnnotations; @IndexedEmbedded(includePaths = { "mutationTypes.curie", "mutationTypes.name", "evidence.curie", "mutationTypes.curie_keyword", "mutationTypes.name_keyword", "evidence.curie_keyword"}) @@ -142,10 +142,10 @@ public class Allele extends GenomicEntity { @JsonView({ View.FieldsAndLists.class, View.AlleleView.class }) private List alleleNomenclatureEvents; - @IndexedEmbedded(includePaths = {"objectBiologicalEntity.curie", "objectBiologicalEntity.geneSymbol.displayText", "objectBiologicalEntity.geneSymbol.formatText", "objectBiologicalEntity.geneFullName.displayText", "objectBiologicalEntity.geneFullName.formatText", - "objectBiologicalEntity.curie_keyword", "objectBiologicalEntity.geneSymbol.displayText_keyword", "objectBiologicalEntity.geneSymbol.formatText_keyword", "objectBiologicalEntity.geneFullName.displayText_keyword", "objectBiologicalEntity.geneFullName.formatText_keyword", - "objectBiologicalEntity.modEntityId", "objectBiologicalEntity.modInternalId", "objectBiologicalEntity.modEntityId_keyword", "objectBiologicalEntity.modInternalId_keyword" }) - @OneToMany(mappedBy = "subjectBiologicalEntity", cascade = CascadeType.ALL, orphanRemoval = true) + @IndexedEmbedded(includePaths = {"alleleGeneAssociationObject.curie", "alleleGeneAssociationObject.geneSymbol.displayText", "alleleGeneAssociationObject.geneSymbol.formatText", "alleleGeneAssociationObject.geneFullName.displayText", "alleleGeneAssociationObject.geneFullName.formatText", + "alleleGeneAssociationObject.curie_keyword", "alleleGeneAssociationObject.geneSymbol.displayText_keyword", "alleleGeneAssociationObject.geneSymbol.formatText_keyword", "alleleGeneAssociationObject.geneFullName.displayText_keyword", "alleleGeneAssociationObject.geneFullName.formatText_keyword", + "alleleGeneAssociationObject.modEntityId", "alleleGeneAssociationObject.modInternalId", "alleleGeneAssociationObject.modEntityId_keyword", "alleleGeneAssociationObject.modInternalId_keyword" }) + @OneToMany(mappedBy = "alleleAssociationSubject", cascade = CascadeType.ALL, orphanRemoval = true) @JsonView({ View.FieldsAndLists.class, View.AlleleDetailView.class }) private List alleleGeneAssociations; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java index fc7777f45..249b4aecb 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AlleleDiseaseAnnotation.java @@ -36,10 +36,10 @@ @Schema(name = "Allele_Disease_Annotation", description = "Annotation class representing a allele disease annotation") @JsonTypeName("AlleleDiseaseAnnotation") @OnDelete(action = OnDeleteAction.CASCADE) -@AGRCurationSchemaVersion(min = "1.3.2", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotation.class }) +@AGRCurationSchemaVersion(min = "2.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotation.class }) @Table(indexes = { @Index(name = "AlleleDiseaseAnnotation_inferredGene_index", columnList = "inferredGene_id"), - @Index(name = "AlleleDiseaseAnnotation_SubjectBiologicalEntity_index", columnList = "subjectbiologicalentity_id") + @Index(name = "AlleleDiseaseAnnotation_DiseaseAnnotationSubject_index", columnList = "diseaseAnnotationSubject_id") }) public class AlleleDiseaseAnnotation extends DiseaseAnnotation { @@ -55,7 +55,7 @@ public class AlleleDiseaseAnnotation extends DiseaseAnnotation { @Fetch(FetchMode.SELECT) @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) - private Allele subjectBiologicalEntity; + private Allele diseaseAnnotationSubject; @IndexedEmbedded(includePaths = { "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", @@ -93,39 +93,39 @@ public class AlleleDiseaseAnnotation extends DiseaseAnnotation { @Override @JsonIgnore public String getSubjectCurie() { - if (subjectBiologicalEntity == null) + if (diseaseAnnotationSubject == null) return null; - return subjectBiologicalEntity.getCurie(); + return diseaseAnnotationSubject.getCurie(); } @Transient @Override @JsonIgnore public String getSubjectTaxonCurie() { - if (subjectBiologicalEntity == null) + if (diseaseAnnotationSubject == null) return null; - if (subjectBiologicalEntity.getTaxon() == null) + if (diseaseAnnotationSubject.getTaxon() == null) return null; - return subjectBiologicalEntity.getTaxon().getCurie(); + return diseaseAnnotationSubject.getTaxon().getCurie(); } @Transient @Override @JsonIgnore public String getSubjectIdentifier() { - if (subjectBiologicalEntity == null) + if (diseaseAnnotationSubject == null) return null; - return subjectBiologicalEntity.getIdentifier(); + return diseaseAnnotationSubject.getIdentifier(); } @Transient @Override @JsonIgnore public String getSubjectSpeciesName() { - if (subjectBiologicalEntity == null) + if (diseaseAnnotationSubject == null) return null; - if (subjectBiologicalEntity.getTaxon() == null) + if (diseaseAnnotationSubject.getTaxon() == null) return null; - return subjectBiologicalEntity.getTaxon().getGenusSpecies(); + return diseaseAnnotationSubject.getTaxon().getGenusSpecies(); } } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java index 0e5c5b416..a087080bf 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Construct.java @@ -36,7 +36,7 @@ @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @Schema(name = "construct", description = "POJO that represents a construct") @ToString(exclude = {"constructGenomicEntityAssociations", "constructComponents", "constructSymbol", "constructFullName", "constructSynonyms"}, callSuper = true) -@AGRCurationSchemaVersion(min = "1.10.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Reagent.class }) +@AGRCurationSchemaVersion(min = "2.1.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Reagent.class }) public class Construct extends Reagent { @@ -74,9 +74,9 @@ public class Construct extends Reagent { @JsonView({ View.FieldsAndLists.class, View.ConstructView.class }) private List constructComponents; - @IndexedEmbedded(includePaths = {"objectBiologicalEntity.curie", "objectBiologicalEntity.name", "objectBiologicalEntity.symbol", "relation.name", - "objectBiologicalEntity.curie_keyword", "objectBiologicalEntity.name_keyword", "objectBiologicalEntity.symbol_keyword", "relation.name_keyword"}) - @OneToMany(mappedBy = "subjectReagent", cascade = CascadeType.ALL, orphanRemoval = true) + @IndexedEmbedded(includePaths = {"constructGenomicEntityAssociationObject.curie", "constructGenomicEntityAssociationObject.modEntityId", "constructGenomicEntityAssociationObject.modInternalId", "constructGenomicEntityAssociationObject.name", "constructGenomicEntityAssociationObject.symbol", "relation.name", + "constructGenomicEntityAssociationObject.curie_keyword", "constructGenomicEntityAssociationObject.modEntityId_keyword", "constructGenomicEntityAssociationObject.modInternalId_keyword", "constructGenomicEntityAssociationObject.name_keyword", "constructGenomicEntityAssociationObject.symbol_keyword", "relation.name_keyword"}) + @OneToMany(mappedBy = "constructAssociationSubject", cascade = CascadeType.ALL, orphanRemoval = true) @JsonView({ View.FieldsAndLists.class, View.ConstructView.class }) private List constructGenomicEntityAssociations; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java index a5fd8e684..d013e4050 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java @@ -44,11 +44,11 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { ConditionRelation.class, Note.class, SingleReferenceAssociation.class }) +@AGRCurationSchemaVersion(min = "2.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { ConditionRelation.class, Note.class, SingleReferenceAssociation.class }) @Schema(name = "Disease_Annotation", description = "Annotation class representing a disease annotation") @Table(indexes = { - @Index(name = "DiseaseAnnotation_objectontologyterm_index", columnList = "objectontologyterm_id"), + @Index(name = "DiseaseAnnotation_diseaseAnnotationObject_index", columnList = "diseaseannotationobject_id"), @Index(name = "DiseaseAnnotation_relation_index", columnList = "relation_id"), @Index(name = "DiseaseAnnotation_annotationType_index", columnList = "annotationType_id"), @Index(name = "DiseaseAnnotation_geneticSex_index", columnList = "geneticSex_id"), @@ -64,7 +64,7 @@ public abstract class DiseaseAnnotation extends Annotation { @ManyToOne @Fetch(FetchMode.SELECT) @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) - private DOTerm objectOntologyTerm; + private DOTerm diseaseAnnotationObject; @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer", valueBridge = @ValueBridgeRef(type = BooleanValueBridge.class)) @KeywordField(name = "negated_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, valueBridge = @ValueBridgeRef(type = BooleanValueBridge.class)) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java index 3864532e6..b83a84da1 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Gene.java @@ -44,7 +44,7 @@ public class Gene extends GenomicEntity { @JsonView({ View.FieldsOnly.class }) private SOTerm geneType; - @OneToMany(mappedBy = "subjectBiologicalEntity", cascade = CascadeType.ALL, orphanRemoval = true) + @OneToMany(mappedBy = "diseaseAnnotationSubject", cascade = CascadeType.ALL, orphanRemoval = true) private List geneDiseaseAnnotations; @IndexedEmbedded(includePaths = { "displayText", "formatText", "nameType.name", "synonymScope.name", "evidence.curie", "displayText_keyword", "formatText_keyword", "nameType.name_keyword", "synonymScope.name_keyword", "evidence.curie_keyword"}) @@ -77,10 +77,10 @@ public class Gene extends GenomicEntity { @JsonView({ View.FieldsAndLists.class, View.GeneView.class }) private List geneSecondaryIds; - @IndexedEmbedded(includePaths = {"subjectBiologicalEntity.curie", "subjectBiologicalEntity.alleleSymbol.displayText", "subjectBiologicalEntity.alleleSymbol.formatText", "subjectBiologicalEntity.alleleFullName.displayText", "subjectBiologicalEntity.alleleFullName.formatText", - "subjectBiologicalEntity.curie_keyword", "subjectBiologicalEntity.alleleSymbol.displayText_keyword", "subjectBiologicalEntity.alleleSymbol.formatText_keyword", "subjectBiologicalEntity.alleleFullName.displayText_keyword", "subjectBiologicalEntity.alleleFullName.formatText_keyword", - "subjectBiologicalEntity.modEntityId", "subjectBiologicalEntity.modInternalId", "subjectBiologicalEntity.modEntityId_keyword", "subjectBiologicalEntity.modInternalId_keyword"}) - @OneToMany(mappedBy = "objectBiologicalEntity", cascade = CascadeType.ALL, orphanRemoval = true) + @IndexedEmbedded(includePaths = {"alleleAssociationSubject.curie", "alleleAssociationSubject.alleleSymbol.displayText", "alleleAssociationSubject.alleleSymbol.formatText", "alleleAssociationSubject.alleleFullName.displayText", "alleleAssociationSubject.alleleFullName.formatText", + "alleleAssociationSubject.curie_keyword", "alleleAssociationSubject.alleleSymbol.displayText_keyword", "alleleAssociationSubject.alleleSymbol.formatText_keyword", "alleleAssociationSubject.alleleFullName.displayText_keyword", "alleleAssociationSubject.alleleFullName.formatText_keyword", + "alleleAssociationSubject.modEntityId", "alleleAssociationSubject.modInternalId", "alleleAssociationSubject.modEntityId_keyword", "alleleAssociationSubject.modInternalId_keyword"}) + @OneToMany(mappedBy = "alleleGeneAssociationObject", cascade = CascadeType.ALL, orphanRemoval = true) @JsonView({ View.FieldsAndLists.class, View.GeneDetailView.class }) private List alleleGeneAssociations; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java index 21ead0348..49041fe37 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GeneDiseaseAnnotation.java @@ -30,9 +30,9 @@ @Schema(name = "Gene_Disease_Annotation", description = "Annotation class representing a gene disease annotation") @JsonTypeName("GeneDiseaseAnnotation") @OnDelete(action = OnDeleteAction.CASCADE) -@AGRCurationSchemaVersion(min = "1.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotation.class }) +@AGRCurationSchemaVersion(min = "2.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { DiseaseAnnotation.class }) @Table(indexes = { - @Index(name = "GeneDiseaseAnnotation_SubjectBiologicalEntity_index", columnList = "subjectbiologicalentity_id") + @Index(name = "GeneDiseaseAnnotation_DiseaseAnnotationSubject_index", columnList = "diseaseAnnotationSubject_id") }) public class GeneDiseaseAnnotation extends DiseaseAnnotation { @@ -48,7 +48,7 @@ public class GeneDiseaseAnnotation extends DiseaseAnnotation { @ManyToOne @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) - private Gene subjectBiologicalEntity; + private Gene diseaseAnnotationSubject; @IndexedEmbedded(includePaths = {"name", "name_keyword", "curie", "curie_keyword", "modEntityId", "modEntityId_keyword", "modInternalId", "modInternalId_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @@ -60,39 +60,39 @@ public class GeneDiseaseAnnotation extends DiseaseAnnotation { @Override @JsonIgnore public String getSubjectCurie() { - if (subjectBiologicalEntity == null) + if (diseaseAnnotationSubject == null) return null; - return subjectBiologicalEntity.getCurie(); + return diseaseAnnotationSubject.getCurie(); } @Transient @Override @JsonIgnore public String getSubjectTaxonCurie() { - if (subjectBiologicalEntity == null) + if (diseaseAnnotationSubject == null) return null; - if (subjectBiologicalEntity.getTaxon() == null) + if (diseaseAnnotationSubject.getTaxon() == null) return null; - return subjectBiologicalEntity.getTaxon().getCurie(); + return diseaseAnnotationSubject.getTaxon().getCurie(); } @Transient @Override @JsonIgnore public String getSubjectIdentifier() { - if (subjectBiologicalEntity == null) + if (diseaseAnnotationSubject == null) return null; - return subjectBiologicalEntity.getIdentifier(); + return diseaseAnnotationSubject.getIdentifier(); } @Transient @Override @JsonIgnore public String getSubjectSpeciesName() { - if (subjectBiologicalEntity == null) + if (diseaseAnnotationSubject == null) return null; - if (subjectBiologicalEntity.getTaxon() == null) + if (diseaseAnnotationSubject.getTaxon() == null) return null; - return subjectBiologicalEntity.getTaxon().getGenusSpecies(); + return diseaseAnnotationSubject.getTaxon().getGenusSpecies(); } } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java index 5baacdb92..6a8393655 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GenomicEntity.java @@ -40,11 +40,11 @@ public class GenomicEntity extends BiologicalEntity { private List crossReferences; - @IndexedEmbedded(includePaths = {"subjectReagent.curie", "subjectReagent.constructSymbol.displayText", "subjectReagent.constructSymbol.formatText", - "subjectReagent.constructFullName.displayText", "subjectReagent.constructFullName.formatText", "subjectReagent.modEntityId", - "subjectReagent.curie_keyword", "subjectReagent.constructSymbol.displayText_keyword", "subjectReagent.constructSymbol.formatText_keyword", - "subjectReagent.constructFullName.displayText_keyword", "subjectReagent.constructFullName.formatText_keyword", "subjectReagent.modEntityId_keyword",}) - @OneToMany(mappedBy = "objectBiologicalEntity", cascade = CascadeType.ALL, orphanRemoval = true) + @IndexedEmbedded(includePaths = {"constructAssociationSubject.curie", "constructAssociationSubject.constructSymbol.displayText", "constructAssociationSubject.constructSymbol.formatText", + "constructAssociationSubject.constructFullName.displayText", "constructAssociationSubject.constructFullName.formatText", "constructAssociationSubject.modEntityId", + "constructAssociationSubject.curie_keyword", "constructAssociationSubject.constructSymbol.displayText_keyword", "constructAssociationSubject.constructSymbol.formatText_keyword", + "constructAssociationSubject.constructFullName.displayText_keyword", "constructAssociationSubject.constructFullName.formatText_keyword", "constructAssociationSubject.modEntityId_keyword",}) + @OneToMany(mappedBy = "constructGenomicEntityAssociationObject", cascade = CascadeType.ALL, orphanRemoval = true) @JsonView({ View.FieldsAndLists.class, View.GeneDetailView.class }) private List constructGenomicEntityAssociations; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java index e452fcbe7..f0e2a3343 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/alleleAssociations/AlleleGeneAssociation.java @@ -27,11 +27,11 @@ @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) -@AGRCurationSchemaVersion(min = "1.9.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AlleleGenomicEntityAssociation.class }) +@AGRCurationSchemaVersion(min = "2.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { AlleleGenomicEntityAssociation.class }) @Schema(name = "AlleleGeneAssociation", description = "POJO representing an association between an allele and a gene") @Table(indexes = { - @Index(name = "allelegeneassociation_subjectbiologicalentity_index", columnList = "subjectbiologicalentity_id"), - @Index(name = "allelegeneassociation_objectbiologicalentity_index", columnList = "objectbiologicalentity_id") + @Index(name = "allelegeneassociation_alleleassociationsubject_index", columnList = "alleleassociationsubject_id"), + @Index(name = "allelegeneassociation_allelegeneassociationobject_index", columnList = "allelegeneassociationobject_id") }) public class AlleleGeneAssociation extends AlleleGenomicEntityAssociation { @@ -42,7 +42,7 @@ public class AlleleGeneAssociation extends AlleleGenomicEntityAssociation { @JsonView({ View.FieldsOnly.class }) @JsonIgnoreProperties("alleleGeneAssociations") @Fetch(FetchMode.JOIN) - private Allele subjectBiologicalEntity; + private Allele alleleAssociationSubject; @IndexedEmbedded(includePaths = {"curie", "geneSymbol.displayText", "geneSymbol.formatText", "geneFullName.displayText", "geneFullName.formatText", "curie_keyword", "geneSymbol.displayText_keyword", "geneSymbol.formatText_keyword", "geneFullName.displayText_keyword", "geneFullName.formatText_keyword", @@ -51,5 +51,5 @@ public class AlleleGeneAssociation extends AlleleGenomicEntityAssociation { @ManyToOne @JsonView({ View.FieldsOnly.class }) @JsonIgnoreProperties({"alleleGeneAssociations", "constructGenomicEntityAssociations"}) - private Gene objectBiologicalEntity; + private Gene alleleGeneAssociationObject; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java index 737ea0e41..138cb6b2c 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/associations/constructAssociations/ConstructGenomicEntityAssociation.java @@ -36,11 +36,11 @@ @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @ToString(callSuper = true) -@AGRCurationSchemaVersion(min = "1.11.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { EvidenceAssociation.class }) +@AGRCurationSchemaVersion(min = "2.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { EvidenceAssociation.class }) @Schema(name = "ConstructGenomicEntityAssociation", description = "POJO representing an association between a construct and a genomic entity") @Table(indexes = { - @Index(name = "constructgenomicentityassociation_subjectreagent_index", columnList = "subjectreagent_id"), - @Index(name = "constructgenomicentityassociation_objectbiologicalentity_index", columnList = "objectbiologicalentity_id"), + @Index(name = "constructgenomicentityassociation_subject_index", columnList = "constructassociationsubject_id"), + @Index(name = "constructgenomicentityassociation_object_index", columnList = "constructgenomicentityassociationobject_id"), @Index(name = "constructgenomicentityassociation_relation_index", columnList = "relation_id") }) public class ConstructGenomicEntityAssociation extends EvidenceAssociation { @@ -53,7 +53,7 @@ public class ConstructGenomicEntityAssociation extends EvidenceAssociation { @JsonView({ View.FieldsOnly.class }) @JsonIgnoreProperties("constructGenomicEntityAssociations") @Fetch(FetchMode.JOIN) - private Construct subjectReagent; + private Construct constructAssociationSubject; @IndexedEmbedded(includePaths = {"name", "name_keyword"}) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @@ -66,7 +66,7 @@ public class ConstructGenomicEntityAssociation extends EvidenceAssociation { @OneToOne @JsonView({ View.FieldsOnly.class }) @JsonIgnoreProperties({"alleleGeneAssociations", "constructGenomicEntityAssociations"}) - private GenomicEntity objectBiologicalEntity; + private GenomicEntity constructGenomicEntityAssociationObject; @IndexedEmbedded(includePaths = {"freeText", "noteType.name", "references.curie", "references.primaryCrossReferenceCurie", "freeText_keyword", "noteType.name_keyword", "references.curie_keyword", diff --git a/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java b/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java index be227349f..abbadf283 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java @@ -145,9 +145,9 @@ public ObjectResponse getAssociation(Long alleleId, Strin AlleleGeneAssociation association = null; Map params = new HashMap<>(); - params.put("subjectBiologicalEntity.id", alleleId); + params.put("alleleAssociationSubject.id", alleleId); params.put("relation.name", relationName); - params.put("objectBiologicalEntity.id", geneId); + params.put("alleleGeneAssociationObject.id", geneId); SearchResponse resp = alleleGeneAssociationDAO.findByParams(params); if (resp != null && resp.getSingleResult() != null) @@ -160,7 +160,7 @@ public ObjectResponse getAssociation(Long alleleId, Strin } private void addAssociationToAllele(AlleleGeneAssociation association) { - Allele allele = association.getSubjectBiologicalEntity(); + Allele allele = association.getAlleleAssociationSubject(); List currentAssociations = allele.getAlleleGeneAssociations(); if (currentAssociations == null) currentAssociations = new ArrayList<>(); @@ -172,7 +172,7 @@ private void addAssociationToAllele(AlleleGeneAssociation association) { } private void addAssociationToGene(AlleleGeneAssociation association) { - Gene gene = association.getObjectBiologicalEntity(); + Gene gene = association.getAlleleGeneAssociationObject(); List currentAssociations = gene.getAlleleGeneAssociations(); if (currentAssociations == null) currentAssociations = new ArrayList<>(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java b/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java index db9ba6d37..99e375377 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java @@ -130,9 +130,9 @@ public ObjectResponse getAssociation(Long con ConstructGenomicEntityAssociation association = null; Map params = new HashMap<>(); - params.put("subjectReagent.id", constructId); + params.put("constructAssociationSubject.id", constructId); params.put("relation.name", relationName); - params.put("objectBiologicalEntity.id", genomicEntityId); + params.put("constructGenomicEntityAssociationObject.id", genomicEntityId); SearchResponse resp = constructGenomicEntityAssociationDAO.findByParams(params); if (resp != null && resp.getSingleResult() != null) @@ -145,7 +145,7 @@ public ObjectResponse getAssociation(Long con } private void addAssociationToConstruct(ConstructGenomicEntityAssociation association) { - Construct construct = association.getSubjectReagent(); + Construct construct = association.getConstructAssociationSubject(); List currentAssociations = construct.getConstructGenomicEntityAssociations(); if (currentAssociations == null) currentAssociations = new ArrayList<>(); @@ -157,7 +157,7 @@ private void addAssociationToConstruct(ConstructGenomicEntityAssociation associa } private void addAssociationToGenomicEntity(ConstructGenomicEntityAssociation association) { - GenomicEntity genomicEntity = association.getObjectBiologicalEntity(); + GenomicEntity genomicEntity = association.getConstructGenomicEntityAssociationObject(); List currentAssociations = genomicEntity.getConstructGenomicEntityAssociations(); if (currentAssociations == null) currentAssociations = new ArrayList<>(); diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java index bb120f6c3..e28f84d7b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java @@ -82,8 +82,8 @@ public static String getDiseaseAnnotationUniqueId(DiseaseAnnotation annotation) uniqueId.add(annotation.getRelation().getName()); if (annotation.getNegated() != null) uniqueId.add(annotation.getNegated().toString()); - if (annotation.getObjectOntologyTerm() != null) - uniqueId.add(annotation.getObjectOntologyTerm().getCurie()); + if (annotation.getDiseaseAnnotationObject() != null) + uniqueId.add(annotation.getDiseaseAnnotationObject().getCurie()); if (annotation.getSingleReference()!= null) uniqueId.add(annotation.getSingleReference().getCurie()); if (CollectionUtils.isNotEmpty(annotation.getEvidenceCodes())) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java index 5a17ead07..b0e262ae4 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AGMDiseaseAnnotationValidator.java @@ -72,7 +72,7 @@ public AGMDiseaseAnnotation validateAnnotationCreate(AGMDiseaseAnnotation uiEnti public AGMDiseaseAnnotation validateAnnotation(AGMDiseaseAnnotation uiEntity, AGMDiseaseAnnotation dbEntity) { AffectedGenomicModel subject = validateSubject(uiEntity, dbEntity); - dbEntity.setSubjectBiologicalEntity(subject); + dbEntity.setDiseaseAnnotationSubject(subject); Gene inferredGene = validateInferredGene(uiEntity, dbEntity); dbEntity.setInferredGene(inferredGene); @@ -100,21 +100,22 @@ public AGMDiseaseAnnotation validateAnnotation(AGMDiseaseAnnotation uiEntity, AG } private AffectedGenomicModel validateSubject(AGMDiseaseAnnotation uiEntity, AGMDiseaseAnnotation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getSubjectBiologicalEntity())) { - addMessageResponse("subjectBiologicalEntity", ValidationConstants.REQUIRED_MESSAGE); + String field = "diseaseAnnotationSubject"; + if (ObjectUtils.isEmpty(uiEntity.getDiseaseAnnotationSubject())) { + addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } AffectedGenomicModel subjectEntity = null; - if (uiEntity.getSubjectBiologicalEntity().getId() != null) - subjectEntity = affectedGenomicModelDAO.find(uiEntity.getSubjectBiologicalEntity().getId()); + if (uiEntity.getDiseaseAnnotationSubject().getId() != null) + subjectEntity = affectedGenomicModelDAO.find(uiEntity.getDiseaseAnnotationSubject().getId()); if (subjectEntity == null) { - addMessageResponse("subjectBiologicalEntity", ValidationConstants.INVALID_MESSAGE); + addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubjectBiologicalEntity() == null || !subjectEntity.getId().equals(dbEntity.getSubjectBiologicalEntity().getId()))) { - addMessageResponse("subjectBiologicalEntity", ValidationConstants.OBSOLETE_MESSAGE); + if (subjectEntity.getObsolete() && (dbEntity.getDiseaseAnnotationSubject() == null || !subjectEntity.getId().equals(dbEntity.getDiseaseAnnotationSubject().getId()))) { + addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java index 9194bde87..6b32794b0 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleDiseaseAnnotationValidator.java @@ -67,7 +67,7 @@ public AlleleDiseaseAnnotation validateAnnotationCreate(AlleleDiseaseAnnotation public AlleleDiseaseAnnotation validateAnnotation(AlleleDiseaseAnnotation uiEntity, AlleleDiseaseAnnotation dbEntity) { Allele subject = validateSubject(uiEntity, dbEntity); - dbEntity.setSubjectBiologicalEntity(subject); + dbEntity.setDiseaseAnnotationSubject(subject); Gene inferredGene = validateInferredGene(uiEntity, dbEntity); dbEntity.setInferredGene(inferredGene); @@ -89,21 +89,22 @@ public AlleleDiseaseAnnotation validateAnnotation(AlleleDiseaseAnnotation uiEnti } private Allele validateSubject(AlleleDiseaseAnnotation uiEntity, AlleleDiseaseAnnotation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getSubjectBiologicalEntity())) { - addMessageResponse("subjectBiologicalEntity", ValidationConstants.REQUIRED_MESSAGE); + String field = "diseaseAnnotationSubject"; + if (ObjectUtils.isEmpty(uiEntity.getDiseaseAnnotationSubject())) { + addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } Allele subjectEntity = null; - if (uiEntity.getSubjectBiologicalEntity().getId() != null) - subjectEntity = alleleDAO.find(uiEntity.getSubjectBiologicalEntity().getId()); + if (uiEntity.getDiseaseAnnotationSubject().getId() != null) + subjectEntity = alleleDAO.find(uiEntity.getDiseaseAnnotationSubject().getId()); if (subjectEntity == null) { - addMessageResponse("subjectBiologicalEntity", ValidationConstants.INVALID_MESSAGE); + addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubjectBiologicalEntity() == null || !subjectEntity.getId().equals(dbEntity.getSubjectBiologicalEntity().getId()))) { - addMessageResponse("subjectBiologicalEntity", ValidationConstants.OBSOLETE_MESSAGE); + if (subjectEntity.getObsolete() && (dbEntity.getDiseaseAnnotationSubject() == null || !subjectEntity.getId().equals(dbEntity.getDiseaseAnnotationSubject().getId()))) { + addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } return subjectEntity; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java index 2d804a3f2..8c124e4be 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java @@ -614,7 +614,7 @@ private List validateAlleleGeneAssociations(Allele uiEnti response.addErrorMessages(field, ix, gaResponse.getErrorMessages()); } else { ga = gaResponse.getEntity(); - ga.setSubjectBiologicalEntity(dbEntity); + ga.setAlleleAssociationSubject(dbEntity); validatedGeneAssociations.add(ga); } } @@ -627,7 +627,7 @@ private List validateAlleleGeneAssociations(Allele uiEnti idsToDelete.removeAll(uiIDs); for(AlleleGeneAssociation ga: dbAssociations){ if(idsToDelete.contains(ga.getId())){ - Gene gene = ga.getObjectBiologicalEntity(); + Gene gene = ga.getAlleleGeneAssociationObject(); List geneAssociations = gene.getAlleleGeneAssociations(); geneAssociations.removeIf(geneAGA -> { return idsToDelete.contains(geneAGA.getId()); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ConstructValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ConstructValidator.java index 5c760dfb5..86005fe26 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ConstructValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ConstructValidator.java @@ -293,7 +293,7 @@ private List validateConstructGenomicEntityAs response.addErrorMessages(field, ix, geaResponse.getErrorMessages()); } else { gea = geaResponse.getEntity(); - gea.setSubjectReagent(dbEntity); + gea.setConstructAssociationSubject(dbEntity); validatedAssociations.add(gea); } } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java index 2318a42db..dce899783 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java @@ -49,19 +49,19 @@ public class DiseaseAnnotationValidator extends AnnotationValidator { DataProviderValidator dataProviderValidator; public DOTerm validateObjectOntologyTerm(DiseaseAnnotation uiEntity, DiseaseAnnotation dbEntity) { - String field = "objectOntologyTerm"; - if (ObjectUtils.isEmpty(uiEntity.getObjectOntologyTerm())) { + String field = "diseaseAnnotationObject"; + if (ObjectUtils.isEmpty(uiEntity.getDiseaseAnnotationObject())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } DOTerm diseaseTerm = null; - if (uiEntity.getObjectOntologyTerm().getId() != null) - diseaseTerm = doTermDAO.find(uiEntity.getObjectOntologyTerm().getId()); + if (uiEntity.getDiseaseAnnotationObject().getId() != null) + diseaseTerm = doTermDAO.find(uiEntity.getDiseaseAnnotationObject().getId()); if (diseaseTerm == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; - } else if (diseaseTerm.getObsolete() && (dbEntity.getObjectOntologyTerm() == null || !diseaseTerm.getId().equals(dbEntity.getObjectOntologyTerm().getId()))) { + } else if (diseaseTerm.getObsolete() && (dbEntity.getDiseaseAnnotationObject() == null || !diseaseTerm.getId().equals(dbEntity.getDiseaseAnnotationObject().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -300,7 +300,7 @@ public String validateUniqueId(DiseaseAnnotation uiEntity, DiseaseAnnotation dbE public DiseaseAnnotation validateCommonDiseaseAnnotationFields(DiseaseAnnotation uiEntity, DiseaseAnnotation dbEntity) { DOTerm term = validateObjectOntologyTerm(uiEntity, dbEntity); - dbEntity.setObjectOntologyTerm(term); + dbEntity.setDiseaseAnnotationObject(term); List terms = validateEvidenceCodes(uiEntity, dbEntity); dbEntity.setEvidenceCodes(terms); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java index a299cc3f0..4c7e35ef3 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/GeneDiseaseAnnotationValidator.java @@ -63,7 +63,7 @@ public GeneDiseaseAnnotation validateAnnotationCreate(GeneDiseaseAnnotation uiEn public GeneDiseaseAnnotation validateAnnotation(GeneDiseaseAnnotation uiEntity, GeneDiseaseAnnotation dbEntity) { Gene subject = validateSubject(uiEntity, dbEntity); - dbEntity.setSubjectBiologicalEntity(subject); + dbEntity.setDiseaseAnnotationSubject(subject); VocabularyTerm relation = validateDiseaseRelation(uiEntity, dbEntity); dbEntity.setRelation(relation); @@ -82,21 +82,21 @@ public GeneDiseaseAnnotation validateAnnotation(GeneDiseaseAnnotation uiEntity, } private Gene validateSubject(GeneDiseaseAnnotation uiEntity, GeneDiseaseAnnotation dbEntity) { - String field = "subjectBiologicalEntity"; - if (ObjectUtils.isEmpty(uiEntity.getSubjectBiologicalEntity())) { + String field = "diseaseAnnotationSubject"; + if (ObjectUtils.isEmpty(uiEntity.getDiseaseAnnotationSubject())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } Gene subjectEntity = null; - if (uiEntity.getSubjectBiologicalEntity().getId() != null) - subjectEntity = geneDAO.find(uiEntity.getSubjectBiologicalEntity().getId()); + if (uiEntity.getDiseaseAnnotationSubject().getId() != null) + subjectEntity = geneDAO.find(uiEntity.getDiseaseAnnotationSubject().getId()); if (subjectEntity == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubjectBiologicalEntity() == null || !subjectEntity.getId().equals(dbEntity.getSubjectBiologicalEntity().getId()))) { + if (subjectEntity.getObsolete() && (dbEntity.getDiseaseAnnotationSubject() == null || !subjectEntity.getId().equals(dbEntity.getDiseaseAnnotationSubject().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java index aee796f92..1cc810ea0 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java @@ -56,11 +56,11 @@ public AlleleGeneAssociation validateAlleleGeneAssociation(AlleleGeneAssociation if (validateAllele) { Allele subject = validateSubject(uiEntity, dbEntity); - dbEntity.setSubjectBiologicalEntity(subject); + dbEntity.setAlleleAssociationSubject(subject); } Gene object = validateObject(uiEntity, dbEntity); - dbEntity.setObjectBiologicalEntity(object); + dbEntity.setAlleleGeneAssociationObject(object); VocabularyTerm relation = validateRelation(uiEntity, dbEntity); dbEntity.setRelation(relation); @@ -78,21 +78,21 @@ public AlleleGeneAssociation validateAlleleGeneAssociation(AlleleGeneAssociation } private Allele validateSubject(AlleleGeneAssociation uiEntity, AlleleGeneAssociation dbEntity) { - String field = "subjectBiologicalEntity"; - if (ObjectUtils.isEmpty(uiEntity.getSubjectBiologicalEntity())) { + String field = "alleleAssociationSubject"; + if (ObjectUtils.isEmpty(uiEntity.getAlleleAssociationSubject())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } Allele subjectEntity = null; - if (uiEntity.getSubjectBiologicalEntity().getId() != null) - subjectEntity = alleleDAO.find(uiEntity.getSubjectBiologicalEntity().getId()); + if (uiEntity.getAlleleAssociationSubject().getId() != null) + subjectEntity = alleleDAO.find(uiEntity.getAlleleAssociationSubject().getId()); if (subjectEntity == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubjectBiologicalEntity() == null || !subjectEntity.getId().equals(dbEntity.getSubjectBiologicalEntity().getId()))) { + if (subjectEntity.getObsolete() && (dbEntity.getAlleleAssociationSubject() == null || !subjectEntity.getId().equals(dbEntity.getAlleleAssociationSubject().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -102,21 +102,21 @@ private Allele validateSubject(AlleleGeneAssociation uiEntity, AlleleGeneAssocia } private Gene validateObject(AlleleGeneAssociation uiEntity, AlleleGeneAssociation dbEntity) { - String field = "objectBiologicalEntity"; - if (ObjectUtils.isEmpty(uiEntity.getObjectBiologicalEntity())) { + String field = "alleleGeneAssociationObject"; + if (ObjectUtils.isEmpty(uiEntity.getAlleleGeneAssociationObject())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } Gene objectEntity = null; - if (uiEntity.getObjectBiologicalEntity().getId() != null) - objectEntity = geneDAO.find(uiEntity.getObjectBiologicalEntity().getId()); + if (uiEntity.getAlleleGeneAssociationObject().getId() != null) + objectEntity = geneDAO.find(uiEntity.getAlleleGeneAssociationObject().getId()); if (objectEntity == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (objectEntity.getObsolete() && (dbEntity.getObjectBiologicalEntity() == null || !objectEntity.getId().equals(dbEntity.getObjectBiologicalEntity().getId()))) { + if (objectEntity.getObsolete() && (dbEntity.getAlleleGeneAssociationObject() == null || !objectEntity.getId().equals(dbEntity.getAlleleGeneAssociationObject().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java index b873950aa..4f64ceef2 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/constructAssociations/ConstructGenomicEntityAssociationValidator.java @@ -72,11 +72,11 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati if (validateConstruct) { Construct subject = validateSubjectReagent(uiEntity, dbEntity); - dbEntity.setSubjectReagent(subject); + dbEntity.setConstructAssociationSubject(subject); } GenomicEntity object = validateObject(uiEntity, dbEntity); - dbEntity.setObjectBiologicalEntity(object); + dbEntity.setConstructGenomicEntityAssociationObject(object); VocabularyTerm relation = validateRelation(uiEntity, dbEntity); dbEntity.setRelation(relation); @@ -103,21 +103,21 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati } private Construct validateSubjectReagent(ConstructGenomicEntityAssociation uiEntity, ConstructGenomicEntityAssociation dbEntity) { - String field = "subjectReagent"; - if (ObjectUtils.isEmpty(uiEntity.getSubjectReagent())) { + String field = "constructAssociationSubject"; + if (ObjectUtils.isEmpty(uiEntity.getConstructAssociationSubject())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } Construct subjectEntity = null; - if (uiEntity.getSubjectReagent().getId() != null) - subjectEntity = constructDAO.find(uiEntity.getSubjectReagent().getId()); + if (uiEntity.getConstructAssociationSubject().getId() != null) + subjectEntity = constructDAO.find(uiEntity.getConstructAssociationSubject().getId()); if (subjectEntity == null) { addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (subjectEntity.getObsolete() && (dbEntity.getSubjectReagent() == null || !subjectEntity.getId().equals(dbEntity.getSubjectReagent().getId()))) { + if (subjectEntity.getObsolete() && (dbEntity.getConstructAssociationSubject() == null || !subjectEntity.getId().equals(dbEntity.getConstructAssociationSubject().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } @@ -127,21 +127,22 @@ private Construct validateSubjectReagent(ConstructGenomicEntityAssociation uiEnt } private GenomicEntity validateObject(ConstructGenomicEntityAssociation uiEntity, ConstructGenomicEntityAssociation dbEntity) { - if (ObjectUtils.isEmpty(uiEntity.getObjectBiologicalEntity())) { - addMessageResponse("objectBiologicalEntity", ValidationConstants.REQUIRED_MESSAGE); + String field = "constructGenomicEntityAssociationObject"; + if (ObjectUtils.isEmpty(uiEntity.getConstructGenomicEntityAssociationObject())) { + addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } GenomicEntity objectEntity = null; - if (uiEntity.getObjectBiologicalEntity().getId() != null) - objectEntity = genomicEntityDAO.find(uiEntity.getObjectBiologicalEntity().getId()); + if (uiEntity.getConstructGenomicEntityAssociationObject().getId() != null) + objectEntity = genomicEntityDAO.find(uiEntity.getConstructGenomicEntityAssociationObject().getId()); if (objectEntity == null) { - addMessageResponse("objectBiologicalEntity", ValidationConstants.INVALID_MESSAGE); + addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } - if (objectEntity.getObsolete() && (dbEntity.getObjectBiologicalEntity() == null || !objectEntity.getId().equals(dbEntity.getObjectBiologicalEntity().getId()))) { - addMessageResponse("objectBiologicalEntity", ValidationConstants.OBSOLETE_MESSAGE); + if (objectEntity.getObsolete() && (dbEntity.getConstructGenomicEntityAssociationObject() == null || !objectEntity.getId().equals(dbEntity.getConstructGenomicEntityAssociationObject().getId()))) { + addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); return null; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java index e5f432797..c6d453d4e 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java @@ -83,7 +83,7 @@ public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotation SearchResponse annotationList = agmDiseaseAnnotationDAO.findByField(identifyingField, annotationId); annotation = DiseaseAnnotationRetrievalHelper.getCurrentDiseaseAnnotation(annotation, annotationList); annotation.setUniqueId(uniqueId); - annotation.setSubjectBiologicalEntity(agm); + annotation.setDiseaseAnnotationSubject(agm); if (dataProvider != null && (dataProvider.name().equals("RGD") || dataProvider.name().equals("HUMAN")) && !agm.getTaxon().getCurie().equals(dataProvider.canonicalTaxonCurie) || !dataProvider.sourceOrganization.equals(agm.getDataProvider().getSourceOrganization().getAbbreviation())) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java index 1e4b7eca1..689bf40bf 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java @@ -78,7 +78,7 @@ public AlleleDiseaseAnnotation validateAlleleDiseaseAnnotationDTO(AlleleDiseaseA SearchResponse annotationList = alleleDiseaseAnnotationDAO.findByField(identifyingField, annotationId); annotation = DiseaseAnnotationRetrievalHelper.getCurrentDiseaseAnnotation(annotation, annotationList); annotation.setUniqueId(uniqueId); - annotation.setSubjectBiologicalEntity(allele); + annotation.setDiseaseAnnotationSubject(allele); if (dataProvider != null && (dataProvider.name().equals("RGD") || dataProvider.name().equals("HUMAN")) && !allele.getTaxon().getCurie().equals(dataProvider.canonicalTaxonCurie) || !dataProvider.sourceOrganization.equals(allele.getDataProvider().getSourceOrganization().getAbbreviation())) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java index d33d4ff42..7369dce66 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/DiseaseAnnotationDTOValidator.java @@ -58,7 +58,7 @@ public ObjectRespo DOTerm disease = doTermService.findByCurieOrSecondaryId(dto.getDoTermCurie()); if (disease == null) daResponse.addErrorMessage("do_term_curie", ValidationConstants.INVALID_MESSAGE + " (" + dto.getDoTermCurie() + ")"); - annotation.setObjectOntologyTerm(disease); + annotation.setDiseaseAnnotationObject(disease); } if (CollectionUtils.isEmpty(dto.getEvidenceCodeCuries())) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java index 348165e8e..fdb96f234 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java @@ -76,7 +76,7 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat SearchResponse annotationList = geneDiseaseAnnotationDAO.findByField(identifyingField, annotationId); annotation = DiseaseAnnotationRetrievalHelper.getCurrentDiseaseAnnotation(annotation, annotationList); annotation.setUniqueId(uniqueId); - annotation.setSubjectBiologicalEntity(gene); + annotation.setDiseaseAnnotationSubject(gene); if (dataProvider != null && (dataProvider.name().equals("RGD") || dataProvider.name().equals("HUMAN")) && !gene.getTaxon().getCurie().equals(dataProvider.canonicalTaxonCurie) || !dataProvider.sourceOrganization.equals(gene.getDataProvider().getSourceOrganization().getAbbreviation())) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java index 7b83cbb1a..172bc2595 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/alleleAssociations/AlleleGeneAssociationDTOValidator.java @@ -65,9 +65,9 @@ public AlleleGeneAssociation validateAlleleGeneAssociationDTO(AlleleGeneAssociat AlleleGeneAssociation association = null; if (subject != null && object != null && StringUtils.isNotBlank(dto.getRelationName())) { HashMap params = new HashMap<>(); - params.put("subjectBiologicalEntity.id", subject.getId()); + params.put("alleleAssociationSubject.id", subject.getId()); params.put("relation.name", dto.getRelationName()); - params.put("objectBiologicalEntity.id", object.getId()); + params.put("alleleGeneAssociationObject.id", object.getId()); SearchResponse searchResponse = alleleGeneAssociationDAO.findByParams(params); if (searchResponse != null && searchResponse.getResults().size() == 1) { @@ -77,8 +77,8 @@ public AlleleGeneAssociation validateAlleleGeneAssociationDTO(AlleleGeneAssociat if (association == null) association = new AlleleGeneAssociation(); - association.setSubjectBiologicalEntity(subject); - association.setObjectBiologicalEntity(object); + association.setAlleleAssociationSubject(subject); + association.setAlleleGeneAssociationObject(object); ObjectResponse ageaResponse = validateAlleleGenomicEntityAssociationDTO(association, dto); agaResponse.addErrorMessages(ageaResponse.getErrorMessages()); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java index 66ad108cc..448998434 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/associations/constructAssociations/ConstructGenomicEntityAssociationDTOValidator.java @@ -75,9 +75,9 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati ConstructGenomicEntityAssociation association = null; if (construct != null && StringUtils.isNotBlank(dto.getGenomicEntityRelationName()) && genomicEntity != null) { HashMap params = new HashMap<>(); - params.put("subjectReagent.id", construct.getId()); + params.put("constructAssociationSubject.id", construct.getId()); params.put("relation.name", dto.getGenomicEntityRelationName()); - params.put("objectBiologicalEntity.id", genomicEntity.getId()); + params.put("constructGenomicEntityAssociationObject.id", genomicEntity.getId()); SearchResponse searchResponse = constructGenomicEntityAssociationDAO.findByParams(params); if (searchResponse != null && searchResponse.getResults().size() == 1) { @@ -87,8 +87,8 @@ public ConstructGenomicEntityAssociation validateConstructGenomicEntityAssociati if (association == null) association = new ConstructGenomicEntityAssociation(); - association.setSubjectReagent(construct); - association.setObjectBiologicalEntity(genomicEntity); + association.setConstructAssociationSubject(construct); + association.setConstructGenomicEntityAssociationObject(genomicEntity); ObjectResponse eviResponse = validateEvidenceAssociationDTO(association, dto); assocResponse.addErrorMessages(eviResponse.getErrorMessages()); diff --git a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.1.0_update.sql b/src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql similarity index 96% rename from src/main/resources/db/migration/v0.30.0.1__linkml_v2.1.0_update.sql rename to src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql index e5bc32e34..936bb70d5 100644 --- a/src/main/resources/db/migration/v0.30.0.1__linkml_v2.1.0_update.sql +++ b/src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql @@ -2,7 +2,7 @@ ALTER TABLE constructgenomicentityassociation RENAME objectgenomicentity_curie TO object_curie; -ALTER TABLE constructgenomicentityassociation RENAME subjectconstruct_id TO subjectreagent_id; +ALTER TABLE constructgenomicentityassociation RENAME subjectconstruct_id TO constructassociationsubject_id; ALTER TABLE allelegeneassociation RENAME objectgene_curie TO object_curie; @@ -284,8 +284,8 @@ ALTER INDEX constructcomponentsa_note_relatednotes_id_index RENAME TO constructc ALTER INDEX constructfullname_singleconstruct_id_index RENAME TO constructfullname_singleconstruct_index; ALTER TABLE constructgenomicentityassociation DROP CONSTRAINT constructgenomicentityassociation_object_curie_fk; ALTER TABLE constructgenomicentityassociation RENAME CONSTRAINT fkgrhw9gxslaub14x4b0mc7v9mk TO constructgenomicentityassociation_id_fk; -ALTER TABLE constructgenomicentityassociation RENAME CONSTRAINT constructgenomicentityassociation_subject_id_fk TO constructgenomicentityassociation_subjectreagent_id_fk; -ALTER INDEX constructgenomicentityassociation_subject_index RENAME TO constructgenomicentityassociation_subjectreagent_index; +ALTER TABLE constructgenomicentityassociation RENAME CONSTRAINT constructgenomicentityassociation_subject_id_fk TO constructgenomicentityassociation_cgeassociationsubject_id_fk; +ALTER INDEX constructgenomicentityassociation_subject_index RENAME TO constructgenomicentityassociation_subject_index; DROP INDEX constructgenomicentityassociation_object_index; ALTER INDEX cgeassociation_note_cgeassociation_id_index RENAME TO cgeassociation_note_cgeassociation_index; ALTER INDEX cgeassociation_note_relatednotes_id_index RENAME TO cgeassociation_note_relatednotes_index; @@ -506,7 +506,7 @@ ALTER TABLE affectedgenomicmodel ADD COLUMN id bigint; ALTER TABLE agmdiseaseannotation ADD COLUMN inferredallele_id bigint; ALTER TABLE agmdiseaseannotation ADD COLUMN inferredgene_id bigint; ALTER TABLE agmdiseaseannotation ADD COLUMN assertedallele_id bigint; -ALTER TABLE agmdiseaseannotation ADD COLUMN subjectbiologicalentity_id bigint; +ALTER TABLE agmdiseaseannotation ADD COLUMN diseaseannotationsubject_id bigint; ALTER TABLE agmdiseaseannotation_gene ADD COLUMN assertedgenes_id bigint; ALTER TABLE allele ADD COLUMN id bigint; ALTER TABLE allele_note ADD COLUMN allele_id bigint; @@ -514,13 +514,13 @@ ALTER TABLE allele_reference ADD COLUMN allele_id bigint; ALTER TABLE allele_reference ADD COLUMN references_id bigint; ALTER TABLE alleledatabasestatusslotannotation ADD COLUMN singleallele_id bigint; ALTER TABLE allelediseaseannotation ADD COLUMN inferredgene_id bigint; -ALTER TABLE allelediseaseannotation ADD COLUMN subjectbiologicalentity_id bigint; +ALTER TABLE allelediseaseannotation ADD COLUMN diseaseannotationsubject_id bigint; ALTER TABLE allelediseaseannotation_gene ADD COLUMN assertedgenes_id bigint; ALTER TABLE allelefullnameslotannotation ADD COLUMN singleallele_id bigint; ALTER TABLE allelefunctionalimpactslotannotation ADD COLUMN singleallele_id bigint; ALTER TABLE allelefunctionalimpactslotannotation ADD COLUMN phenotypeterm_id bigint; -ALTER TABLE allelegeneassociation ADD COLUMN subjectbiologicalentity_id bigint; -ALTER TABLE allelegeneassociation ADD COLUMN objectbiologicalentity_id bigint; +ALTER TABLE allelegeneassociation ADD COLUMN alleleassociationsubject_id bigint; +ALTER TABLE allelegeneassociation ADD COLUMN allelegeneassociationobject_id bigint; ALTER TABLE allelegenomicentityassociation ADD COLUMN evidencecode_id bigint; ALTER TABLE allelegermlinetransmissionstatusslotannotation ADD COLUMN singleallele_id bigint; ALTER TABLE alleleinheritancemodeslotannotation ADD COLUMN singleallele_id bigint; @@ -546,9 +546,9 @@ ALTER TABLE cmoterm ADD COLUMN id bigint; ALTER TABLE conditionrelation ADD COLUMN singlereference_id bigint; ALTER TABLE construct_reference ADD COLUMN references_id bigint; ALTER TABLE constructcomponentslotannotation ADD COLUMN taxon_id bigint; -ALTER TABLE constructgenomicentityassociation ADD COLUMN objectbiologicalentity_id bigint; +ALTER TABLE constructgenomicentityassociation ADD COLUMN constructgenomicentityassociationobject_id bigint; ALTER TABLE daoterm ADD COLUMN id bigint; -ALTER TABLE diseaseannotation ADD COLUMN objectontologyterm_id bigint; +ALTER TABLE diseaseannotation ADD COLUMN diseaseannotationobject_id bigint; ALTER TABLE diseaseannotation_biologicalentity ADD COLUMN diseasegeneticmodifiers_id bigint; ALTER TABLE diseaseannotation_ecoterm ADD COLUMN evidencecodes_id bigint; ALTER TABLE diseaseannotation_gene ADD COLUMN with_id bigint; @@ -568,7 +568,7 @@ ALTER TABLE fbdvterm ADD COLUMN id bigint; ALTER TABLE gene ADD COLUMN id bigint; ALTER TABLE gene ADD COLUMN genetype_id bigint; ALTER TABLE genediseaseannotation ADD COLUMN sgdstrainbackground_id bigint; -ALTER TABLE genediseaseannotation ADD COLUMN subjectbiologicalentity_id bigint; +ALTER TABLE genediseaseannotation ADD COLUMN diseaseannotationsubject_id bigint; ALTER TABLE genefullnameslotannotation ADD COLUMN singlegene_id bigint; ALTER TABLE genesecondaryidslotannotation ADD COLUMN singlegene_id bigint; ALTER TABLE genesymbolslotannotation ADD COLUMN singlegene_id bigint; @@ -658,7 +658,7 @@ UPDATE affectedgenomicmodel t SET id = b.id FROM biologicalentity b WHERE t.curi UPDATE agmdiseaseannotation t SET inferredallele_id = b.id FROM biologicalentity b WHERE t.inferredallele_curie = b.modentityid; UPDATE agmdiseaseannotation t SET assertedallele_id = b.id FROM biologicalentity b WHERE t.assertedallele_curie = b.modentityid; UPDATE agmdiseaseannotation t SET inferredgene_id = b.id FROM biologicalentity b WHERE t.inferredgene_curie = b.modentityid; -UPDATE agmdiseaseannotation t SET subjectbiologicalentity_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid; +UPDATE agmdiseaseannotation t SET diseaseannotationsubject_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid; UPDATE agmdiseaseannotation_gene t SET assertedgenes_id = b.id FROM biologicalentity b WHERE t.assertedgenes_curie = b.modentityid; UPDATE allele t SET id = b.id FROM biologicalentity b WHERE t.curie = b.modentityid; UPDATE allele_note t SET allele_id = b.id FROM biologicalentity b WHERE t.allele_curie = b.modentityid; @@ -666,13 +666,13 @@ UPDATE allele_reference t SET allele_id = b.id FROM biologicalentity b WHERE t.a UPDATE allele_reference t SET references_id = i.id FROM informationcontententity i WHERE t.references_curie = i.curie; UPDATE alleledatabasestatusslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; UPDATE allelediseaseannotation t SET inferredgene_id = b.id FROM biologicalentity b WHERE t.inferredgene_curie = b.modentityid; -UPDATE allelediseaseannotation t SET subjectbiologicalentity_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid; +UPDATE allelediseaseannotation t SET diseaseannotationsubject_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid; UPDATE allelediseaseannotation_gene t SET assertedgenes_id = b.id FROM biologicalentity b WHERE t.assertedgenes_curie = b.modentityid; UPDATE allelefullnameslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; UPDATE allelefunctionalimpactslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; UPDATE allelefunctionalimpactslotannotation t SET phenotypeterm_id = o.id FROM ontologyterm o WHERE t.phenotypeterm_curie = o.curie; -UPDATE allelegeneassociation t SET subjectbiologicalentity_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid; -UPDATE allelegeneassociation t SET objectbiologicalentity_id = b.id FROM biologicalentity b WHERE t.object_curie = b.modentityid; +UPDATE allelegeneassociation t SET alleleassociationsubject_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid; +UPDATE allelegeneassociation t SET allelegeneassociationobject_id = b.id FROM biologicalentity b WHERE t.object_curie = b.modentityid; UPDATE allelegenomicentityassociation t SET evidencecode_id = o.id FROM ontologyterm o WHERE t.evidencecode_curie = o.curie; UPDATE allelegermlinetransmissionstatusslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; UPDATE alleleinheritancemodeslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid; @@ -696,9 +696,9 @@ UPDATE cmoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE conditionrelation t SET singlereference_id = i.id FROM informationcontententity i WHERE t.singlereference_curie = i.curie; UPDATE construct_reference t SET references_id = i.id FROM informationcontententity i WHERE t.references_curie = i.curie; UPDATE constructcomponentslotannotation t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie; -UPDATE constructgenomicentityassociation t SET objectbiologicalentity_id = b.id FROM biologicalentity b WHERE t.object_curie = b.modentityid; +UPDATE constructgenomicentityassociation t SET constructgenomicentityassociationobject_id = b.id FROM biologicalentity b WHERE t.object_curie = b.modentityid; UPDATE daoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; -UPDATE diseaseannotation t SET objectontologyterm_id = o.id FROM ontologyterm o WHERE t.object_curie = o.curie; +UPDATE diseaseannotation t SET diseaseannotationobject_id = o.id FROM ontologyterm o WHERE t.object_curie = o.curie; UPDATE diseaseannotation_biologicalentity t SET diseasegeneticmodifiers_id = b.id FROM biologicalentity b WHERE t.diseasegeneticmodifiers_curie = b.modentityid; UPDATE diseaseannotation_ecoterm t SET evidencecodes_id = o.id FROM ontologyterm o WHERE t.evidencecodes_curie = o.curie; UPDATE diseaseannotation_gene t SET with_id = b.id FROM biologicalentity b WHERE t.with_curie = b.modentityid; @@ -718,7 +718,7 @@ UPDATE fbdvterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie; UPDATE gene t SET id = b.id FROM biologicalentity b WHERE t.curie = b.modentityid; UPDATE gene t SET genetype_id = o.id FROM ontologyterm o WHERE t.genetype_curie = o.curie; UPDATE genediseaseannotation t SET sgdstrainbackground_id = b.id FROM biologicalentity b WHERE t.sgdstrainbackground_curie = b.modentityid; -UPDATE genediseaseannotation t SET subjectbiologicalentity_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid; +UPDATE genediseaseannotation t SET diseaseannotationsubject_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid; UPDATE genefullnameslotannotation t SET singlegene_id = b.id FROM biologicalentity b WHERE t.singlegene_curie = b.modentityid; UPDATE genesecondaryidslotannotation t SET singlegene_id = b.id FROM biologicalentity b WHERE t.singlegene_curie = b.modentityid; UPDATE genesymbolslotannotation t SET singlegene_id = b.id FROM biologicalentity b WHERE t.singlegene_curie = b.modentityid; @@ -979,12 +979,12 @@ ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_pkey PRIMARY KEY (id); ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_pkey PRIMARY KEY (id); ALTER TABLE affectedgenomicmodel ADD CONSTRAINT affectedgenomicmodel_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); -ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_subjectbiologicalentity_id_fk FOREIGN KEY (subjectbiologicalentity_id) REFERENCES affectedgenomicmodel (id); +ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_diseaseannotationsubject_id_fk FOREIGN KEY (diseaseannotationsubject_id) REFERENCES affectedgenomicmodel (id); ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_assertedallele_id_fk FOREIGN KEY (assertedallele_id) REFERENCES allele (id); ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredallele_id_fk FOREIGN KEY (inferredallele_id) REFERENCES allele (id); ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id); ALTER TABLE agmdiseaseannotation_gene ADD CONSTRAINT agmdiseaseannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); -CREATE INDEX agmdiseaseannotation_subjectbiologicalentity_index ON agmdiseaseannotation USING btree (subjectbiologicalentity_id); +CREATE INDEX agmdiseaseannotation_diseaseannotationsubject_index ON agmdiseaseannotation USING btree (diseaseannotationsubject_id); CREATE INDEX agmdiseaseannotation_assertedallele_index ON agmdiseaseannotation USING btree (assertedallele_id); CREATE INDEX agmdiseaseannotation_inferredallele_index ON agmdiseaseannotation USING btree (inferredallele_id); CREATE INDEX agmdiseaseannotation_inferredgene_index ON agmdiseaseannotation USING btree (inferredgene_id); @@ -998,10 +998,10 @@ CREATE INDEX allele_reference_references_index ON allele_reference USING btree ( CREATE INDEX allele_reference_allele_references_index ON allele_reference USING btree (allele_id, references_id); ALTER TABLE alleledatabasestatusslotannotation ADD CONSTRAINT alleledatabasestatus_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); CREATE INDEX alleledatabasestatus_singleallele_index ON alleledatabasestatusslotannotation USING btree (singleallele_id); -ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannoation_subjectbiologicalentity_id_fk FOREIGN KEY (subjectbiologicalentity_id) REFERENCES allele (id); +ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannoation_diseaseannotationsubject_id_fk FOREIGN KEY (diseaseannotationsubject_id) REFERENCES allele (id); ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id); CREATE INDEX allelediseaseannotation_inferredgene_index ON allelediseaseannotation USING btree (inferredgene_id); -CREATE INDEX allelediseaseannotation_subjectbiologicalentity_index ON allelediseaseannotation USING btree (subjectbiologicalentity_id); +CREATE INDEX allelediseaseannotation_diseaseannotationsubject_index ON allelediseaseannotation USING btree (diseaseannotationsubject_id); ALTER TABLE allelediseaseannotation_gene ADD CONSTRAINT allelediseaseannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); CREATE INDEX allelediseaseannotationgene_assertedgenes_index ON allelediseaseannotation_gene USING btree (assertedgenes_id); CREATE INDEX allelefullname_singleallele_index ON allelefullnameslotannotation USING btree (singleallele_id); @@ -1009,10 +1009,10 @@ ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctional ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctionalimpactslotannotation_phenotypeterm_id_fk FOREIGN KEY (phenotypeterm_id) REFERENCES phenotypeterm (id); CREATE INDEX allelefunctionalimpact_singleallele_index ON allelefunctionalimpactslotannotation USING btree (singleallele_id); CREATE INDEX allelefunctionalimpact_phenotypeterm_index ON allelefunctionalimpactslotannotation USING btree (phenotypeterm_id); -ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_objectbiologicalentity_id_fk FOREIGN KEY (objectbiologicalentity_id) REFERENCES gene (id); -ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_subjectbiologicalentity_id_fk FOREIGN KEY (subjectbiologicalentity_id) REFERENCES allele (id); -CREATE INDEX allelegeneassociation_objectbiologicalentity_index ON allelegeneassociation USING btree (objectbiologicalentity_id); -CREATE INDEX allelegeneassociation_subjectbiologicalentity_index ON allelegeneassociation USING btree (subjectbiologicalentity_id); +ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_allelegeneassociationobject_id_fk FOREIGN KEY (allelegeneassociationobject_id) REFERENCES gene (id); +ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_alleleassociationsubject_id_fk FOREIGN KEY (alleleassociationsubject_id) REFERENCES allele (id); +CREATE INDEX allelegeneassociation_allelegeneassociationobject_index ON allelegeneassociation USING btree (allelegeneassociationobject_id); +CREATE INDEX allelegeneassociation_alleleassociationsubject_index ON allelegeneassociation USING btree (alleleassociationsubject_id); ALTER TABLE allelegenomicentityassociation ADD CONSTRAINT allelegenomicentityassociation_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES ecoterm (id); ALTER TABLE allelegermlinetransmissionstatusslotannotation ADD CONSTRAINT allelegermlinetransmissionstatus_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id); CREATE INDEX allelegermlinetransmissionstatus_singleallele_index ON allelegermlinetransmissionstatusslotannotation USING btree (singleallele_id); @@ -1047,11 +1047,11 @@ ALTER TABLE construct_reference ADD CONSTRAINT construct_reference_references_id CREATE INDEX construct_reference_references_index ON construct_reference USING btree (references_id); ALTER TABLE constructcomponentslotannotation ADD CONSTRAINT constructcomponentslotannotation_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); CREATE INDEX constructcomponentslotannotation_taxon_index ON constructcomponentslotannotation USING btree (taxon_id); -ALTER TABLE constructgenomicentityassociation ADD CONSTRAINT constructgenomicentityassociation_objectbiologicalentity_id_fk FOREIGN KEY (objectbiologicalentity_id) REFERENCES genomicentity (id); -CREATE INDEX constructgenomicentityassociation_objectbiologicalentity_index ON constructgenomicentityassociation USING btree (objectbiologicalentity_id); +ALTER TABLE constructgenomicentityassociation ADD CONSTRAINT constructgenomicentityassociation_cgeassociationobject_id_fk FOREIGN KEY (constructgenomicentityassociationobject_id) REFERENCES genomicentity (id); +CREATE INDEX constructgenomicentityassociation_object_index ON constructgenomicentityassociation USING btree (constructgenomicentityassociationobject_id); ALTER TABLE daoterm ADD CONSTRAINT daoterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id); -ALTER TABLE diseaseannotation ADD CONSTRAINT diseaseannotation_objectontologyterm_id_fk FOREIGN KEY (objectontologyterm_id) REFERENCES doterm (id); -CREATE INDEX diseaseannotation_objectontologyterm_index ON diseaseannotation USING btree (objectontologyterm_id); +ALTER TABLE diseaseannotation ADD CONSTRAINT diseaseannotation_diseaseannotationobject_id_fk FOREIGN KEY (diseaseannotationobject_id) REFERENCES doterm (id); +CREATE INDEX diseaseannotation_diseaseannotationobject_index ON diseaseannotation USING btree (diseaseannotationobject_id); ALTER TABLE diseaseannotation_biologicalentity ADD CONSTRAINT diseaseannotation_biologicalentity_dgm_id_fk FOREIGN KEY (diseasegeneticmodifiers_id) REFERENCES biologicalentity (id); CREATE INDEX diseaseannotation_biologicalentity_dgms_index ON diseaseannotation_biologicalentity USING btree (diseasegeneticmodifiers_id); ALTER TABLE diseaseannotation_ecoterm ADD CONSTRAINT diseaseannotation_ecoterm_evidencecodes_id_fk FOREIGN KEY (evidencecodes_id) REFERENCES ecoterm (id); @@ -1075,9 +1075,9 @@ ALTER TABLE fbdvterm ADD CONSTRAINT fbdvterm_id_fk FOREIGN KEY (id) REFERENCES s ALTER TABLE gene ADD CONSTRAINT gene_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id); ALTER TABLE gene ADD CONSTRAINT gene_genetype_id_fk FOREIGN KEY (genetype_id) REFERENCES soterm (id); CREATE INDEX gene_genetype_index ON gene USING btree (genetype_id); -ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_subjectbiologicalentity_id_fk FOREIGN KEY (subjectbiologicalentity_id) REFERENCES gene (id); +ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_diseaseannotationsubject_id_fk FOREIGN KEY (diseaseannotationsubject_id) REFERENCES gene (id); ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_sgdstrainbackground_id_fk FOREIGN KEY (sgdstrainbackground_id) REFERENCES affectedgenomicmodel (id); -CREATE INDEX genediseaseannotation_subjectbiologicalentity_index ON genediseaseannotation USING btree (subjectbiologicalentity_id); +CREATE INDEX genediseaseannotation_diseaseannotationsubject_index ON genediseaseannotation USING btree (diseaseannotationsubject_id); ALTER TABLE genefullnameslotannotation ADD CONSTRAINT genefullnameslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); CREATE INDEX genefullname_singlegene_index ON genefullnameslotannotation USING btree (singlegene_id); ALTER TABLE genesecondaryidslotannotation ADD CONSTRAINT genesecondaryidslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id); diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java index 2b7b56dd7..d9e9d6351 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/DiseaseAnnotationBulkUploadITCase.java @@ -203,8 +203,8 @@ public void geneDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-10T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-09T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:Gene0001|is_implicated_in|true|DATEST:Disease0001|AGRKB:000000002|DATEST:Evidence0001|HGNC:0001|exacerbated_by|DATEST:ExpCondTerm0001|DATEST:ExpCondTerm0002|DATEST:AnatomyTerm0001|DATEST:ChemicalTerm0001|DATEST:GOTerm0001|NCBITaxon:6239|Some amount|Free text|susceptibility|ameliorated_by|DATEST:Gene0002")). - body("entity.subjectBiologicalEntity.modEntityId", is(gene)). - body("entity.objectOntologyTerm.curie", is(doTerm)). + body("entity.diseaseAnnotationSubject.modEntityId", is(gene)). + body("entity.diseaseAnnotationObject.curie", is(doTerm)). body("entity.relation.name", is(alleleAndGeneRelation)). body("entity.geneticSex.name", is(geneticSex)). body("entity.conditionRelations", hasSize(1)). @@ -283,8 +283,8 @@ public void alleleDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-10T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-09T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:Allele0001|is_implicated_in|true|DATEST:Disease0001|AGRKB:000000002|DATEST:Evidence0001|HGNC:0001|exacerbated_by|DATEST:ExpCondTerm0001|DATEST:ExpCondTerm0002|DATEST:AnatomyTerm0001|DATEST:ChemicalTerm0001|DATEST:GOTerm0001|NCBITaxon:6239|Some amount|Free text|susceptibility|ameliorated_by|DATEST:Gene0002")). - body("entity.subjectBiologicalEntity.modEntityId", is(allele)). - body("entity.objectOntologyTerm.curie", is(doTerm)). + body("entity.diseaseAnnotationSubject.modEntityId", is(allele)). + body("entity.diseaseAnnotationObject.curie", is(doTerm)). body("entity.relation.name", is(alleleAndGeneRelation)). body("entity.geneticSex.name", is(geneticSex)). body("entity.conditionRelations", hasSize(1)). @@ -364,8 +364,8 @@ public void agmDiseaseAnnotationBulkUploadCheckFields() throws Exception { body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-10T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-09T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:AGM0001|is_model_of|true|DATEST:Disease0001|AGRKB:000000002|DATEST:Evidence0001|HGNC:0001|exacerbated_by|DATEST:ExpCondTerm0001|DATEST:ExpCondTerm0002|DATEST:AnatomyTerm0001|DATEST:ChemicalTerm0001|DATEST:GOTerm0001|NCBITaxon:6239|Some amount|Free text|susceptibility|ameliorated_by|DATEST:Gene0002")). - body("entity.subjectBiologicalEntity.modEntityId", is(agm)). - body("entity.objectOntologyTerm.curie", is(doTerm)). + body("entity.diseaseAnnotationSubject.modEntityId", is(agm)). + body("entity.diseaseAnnotationObject.curie", is(doTerm)). body("entity.relation.name", is(agmRelation)). body("entity.geneticSex.name", is(geneticSex)). body("entity.conditionRelations", hasSize(1)). @@ -447,8 +447,8 @@ public void geneDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exception body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-20T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-19T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:Gene0002|is_marker_for|false|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). - body("entity.subjectBiologicalEntity.modEntityId", is(gene2)). - body("entity.objectOntologyTerm.curie", is(doTerm2)). + body("entity.diseaseAnnotationSubject.modEntityId", is(gene2)). + body("entity.diseaseAnnotationObject.curie", is(doTerm2)). body("entity.relation.name", is(geneRelation)). body("entity.geneticSex.name", is(geneticSex2)). body("entity.conditionRelations", hasSize(1)). @@ -527,8 +527,8 @@ public void alleleDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exceptio body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-20T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-19T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:Allele0002|is_implicated_in|false|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). - body("entity.subjectBiologicalEntity.modEntityId", is(allele2)). - body("entity.objectOntologyTerm.curie", is(doTerm2)). + body("entity.diseaseAnnotationSubject.modEntityId", is(allele2)). + body("entity.diseaseAnnotationObject.curie", is(doTerm2)). body("entity.relation.name", is(alleleAndGeneRelation)). body("entity.geneticSex.name", is(geneticSex2)). body("entity.conditionRelations", hasSize(1)). @@ -608,8 +608,8 @@ public void agmDiseaseAnnotationBulkUploadUpdateCheckFields() throws Exception { body("entity.dateUpdated", is(OffsetDateTime.parse("2022-03-20T22:10:12Z").toString())). body("entity.dateCreated", is(OffsetDateTime.parse("2022-03-19T22:10:12Z").toString())). body("entity.uniqueId", is("DATEST:AGM0002|is_exacerbated_model_of|false|DATEST:Disease0002|AGRKB:000000021|DATEST:Evidence0002|HGNC:0002|induced_by|DATEST:ExpCondTerm0003|DATEST:ExpCondTerm0001|DATEST:AnatomyTerm0002|DATEST:ChemicalTerm0002|DATEST:GOTerm0002|NCBITaxon:9606|Some amount 2|Free text 2|severity|exacerbated_by|DATEST:Gene0001")). - body("entity.subjectBiologicalEntity.modEntityId", is(agm2)). - body("entity.objectOntologyTerm.curie", is(doTerm2)). + body("entity.diseaseAnnotationSubject.modEntityId", is(agm2)). + body("entity.diseaseAnnotationObject.curie", is(doTerm2)). body("entity.relation.name", is(agmRelation2)). body("entity.geneticSex.name", is(geneticSex2)). body("entity.conditionRelations", hasSize(1)). diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java index 6fd7bf54a..ec8ef173f 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/AlleleGeneAssociationBulkUploadITCase.java @@ -82,8 +82,8 @@ public void alleleGeneAssociationBulkUploadCheckFields() throws Exception { then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.objectBiologicalEntity.modEntityId", is(geneCurie)). - body("entity.subjectBiologicalEntity.modEntityId", is(alleleCurie)). + body("entity.alleleGeneAssociationObject.modEntityId", is(geneCurie)). + body("entity.alleleAssociationSubject.modEntityId", is(alleleCurie)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference)). body("entity.evidenceCode.curie", is(evidenceCodeCurie)). @@ -110,8 +110,8 @@ public void alleleGeneAssociationBulkUploadCheckFields() throws Exception { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relationName)). - body("entity.alleleGeneAssociations[0].objectBiologicalEntity.modEntityId", is(geneCurie)). - body("entity.alleleGeneAssociations[0].subjectBiologicalEntity", not(hasKey("alleleGeneAssociations"))); + body("entity.alleleGeneAssociations[0].alleleGeneAssociationObject.modEntityId", is(geneCurie)). + body("entity.alleleGeneAssociations[0].alleleAssociationSubject", not(hasKey("alleleGeneAssociations"))); RestAssured.given(). when(). @@ -120,8 +120,8 @@ public void alleleGeneAssociationBulkUploadCheckFields() throws Exception { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relationName)). - body("entity.alleleGeneAssociations[0].objectBiologicalEntity.modEntityId", is(geneCurie)). - body("entity.alleleGeneAssociations[0].objectBiologicalEntity", not(hasKey("alleleGeneAssociations"))); + body("entity.alleleGeneAssociations[0].alleleGeneAssociationObject.modEntityId", is(geneCurie)). + body("entity.alleleGeneAssociations[0].alleleGeneAssociationObject", not(hasKey("alleleGeneAssociations"))); } @Test @@ -137,7 +137,7 @@ public void alleleGeneAssociationBulkUploadUpdateCheckFields() throws Exception then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.objectBiologicalEntity.modEntityId", is(geneCurie)). + body("entity.alleleGeneAssociationObject.modEntityId", is(geneCurie)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2)). body("entity.evidenceCode.curie", is(evidenceCodeCurie2)). diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java index 3b12f7b1e..9ccf1bf0b 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/associations/ConstructGenomicEntityAssociationBulkUploadITCase.java @@ -76,8 +76,8 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.objectBiologicalEntity.modEntityId", is(geneModEntityId)). - body("entity.subjectReagent.modEntityId", is(constructModEntityId)). + body("entity.constructGenomicEntityAssociationObject.modEntityId", is(geneModEntityId)). + body("entity.constructAssociationSubject.modEntityId", is(constructModEntityId)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference)). body("entity.internal", is(true)). @@ -104,8 +104,8 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce body("entity.modEntityId", is(constructModEntityId)). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relationName)). - body("entity.constructGenomicEntityAssociations[0].objectBiologicalEntity.modEntityId", is(geneModEntityId)). - body("entity.constructGenomicEntityAssociations[0].subjectReagent", not(hasKey("constructGenomicEntityAssociations"))); + body("entity.constructGenomicEntityAssociations[0].constructGenomicEntityAssociationObject.modEntityId", is(geneModEntityId)). + body("entity.constructGenomicEntityAssociations[0].constructAssociationSubject", not(hasKey("constructGenomicEntityAssociations"))); RestAssured.given(). when(). @@ -114,8 +114,8 @@ public void constructGenomicEntityAssociationBulkUploadCheckFields() throws Exce statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relationName)). - body("entity.constructGenomicEntityAssociations[0].objectBiologicalEntity.modEntityId", is(geneModEntityId)). - body("entity.constructGenomicEntityAssociations[0].objectBiologicalEntity", not(hasKey("constructGenomicEntityAssociations"))); + body("entity.constructGenomicEntityAssociations[0].constructGenomicEntityAssociationObject.modEntityId", is(geneModEntityId)). + body("entity.constructGenomicEntityAssociations[0].constructGenomicEntityAssociationObject", not(hasKey("constructGenomicEntityAssociations"))); } @Test @@ -129,7 +129,7 @@ public void constructGenomicEntityAssociationBulkUploadUpdateCheckFields() throw then(). statusCode(200). body("entity.relation.name", is(relationName)). - body("entity.objectBiologicalEntity.modEntityId", is(geneModEntityId)). + body("entity.constructGenomicEntityAssociationObject.modEntityId", is(geneModEntityId)). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2)). body("entity.internal", is(false)). diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java index e27569f17..afaaae8e3 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java @@ -1453,7 +1453,7 @@ public void updateAlleleDetailWithNewAssociations() { Allele allele = getAllele(ALLELE); AlleleGeneAssociation geneAssociation = new AlleleGeneAssociation(); - geneAssociation.setObjectBiologicalEntity(gene); + geneAssociation.setAlleleGeneAssociationObject(gene); geneAssociation.setRelation(geneAssociationRelation); Reference reference = createReference("AGRKB:AssocTest1", false); geneAssociation.setEvidence(List.of(reference)); @@ -1473,7 +1473,7 @@ public void updateAlleleDetailWithNewAssociations() { then(). statusCode(200). body("entity", hasKey("alleleGeneAssociations")). - body("entity.alleleGeneAssociations[0].objectBiologicalEntity.modEntityId", is(gene.getModEntityId())); + body("entity.alleleGeneAssociations[0].alleleGeneAssociationObject.modEntityId", is(gene.getModEntityId())); } @Test @@ -1505,7 +1505,7 @@ public void updateAlleleDetailWithInvalidAssociations() { Allele allele = getAllele(ALLELE); AlleleGeneAssociation geneAssociation = new AlleleGeneAssociation(); - geneAssociation.setObjectBiologicalEntity(gene); + geneAssociation.setAlleleGeneAssociationObject(gene); geneAssociation.setRelation(dominantInheritanceMode); allele.setAlleleGeneAssociations(List.of(geneAssociation)); diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java index ac02f2a1e..6c6babb9d 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ConstructITCase.java @@ -934,7 +934,7 @@ public void updateConstructWithNewAssociations() { Construct construct = getConstruct(CONSTRUCT); ConstructGenomicEntityAssociation geAssociation = new ConstructGenomicEntityAssociation(); - geAssociation.setObjectBiologicalEntity(gene); + geAssociation.setConstructGenomicEntityAssociationObject(gene); geAssociation.setRelation(geAssociationRelation); construct.setConstructGenomicEntityAssociations(List.of(geAssociation)); @@ -952,7 +952,7 @@ public void updateConstructWithNewAssociations() { then(). statusCode(200). body("entity", hasKey("constructGenomicEntityAssociations")). - body("entity.constructGenomicEntityAssociations[0].objectBiologicalEntity.modEntityId", is(gene.getModEntityId())); + body("entity.constructGenomicEntityAssociations[0].constructGenomicEntityAssociationObject.modEntityId", is(gene.getModEntityId())); } @Test @@ -984,7 +984,7 @@ public void updateConstructWithInvalidAssociations() { Construct construct = getConstruct(CONSTRUCT); ConstructGenomicEntityAssociation geneAssociation = new ConstructGenomicEntityAssociation(); - geneAssociation.setObjectBiologicalEntity(gene); + geneAssociation.setConstructGenomicEntityAssociationObject(gene); geneAssociation.setRelation(systematicNameType); construct.setConstructGenomicEntityAssociations(List.of(geneAssociation)); diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java index 55a1ce6ca..6ac967656 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/DiseaseAnnotationITCase.java @@ -223,10 +223,10 @@ public void createGeneDiseaseAnnotation() { diseaseAnnotation.setModEntityId(GENE_DISEASE_ANNOTATION); diseaseAnnotation.setDateCreated(datetime); diseaseAnnotation.setNegated(false); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider2); - diseaseAnnotation.setSubjectBiologicalEntity(gene); + diseaseAnnotation.setDiseaseAnnotationSubject(gene); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); diseaseAnnotation.setConditionRelations(List.of(conditionRelation)); @@ -253,8 +253,8 @@ public void createGeneDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("GENE:da0001|is_implicated_in|false|DOID:da0001|AGRKB:100000005|ECO:da00001|HGNC:1|has_condition|ZECO:da001|severity|ameliorated_by|SGD:da0002")). body("entity.modEntityId", is(GENE_DISEASE_ANNOTATION)). - body("entity.subjectBiologicalEntity.modEntityId", is(gene.getModEntityId())). - body("entity.objectOntologyTerm.curie", is(doTerm.getCurie())). + body("entity.diseaseAnnotationSubject.modEntityId", is(gene.getModEntityId())). + body("entity.diseaseAnnotationObject.curie", is(doTerm.getCurie())). body("entity.relation.name", is(alleleAndGeneRelation.getName())). body("entity.negated", is(false)). body("entity.internal", is(false)). @@ -293,10 +293,10 @@ public void createAlleleDiseaseAnnotation() { diseaseAnnotation.setModEntityId(ALLELE_DISEASE_ANNOTATION); diseaseAnnotation.setDateCreated(datetime); diseaseAnnotation.setNegated(false); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider2); - diseaseAnnotation.setSubjectBiologicalEntity(allele); + diseaseAnnotation.setDiseaseAnnotationSubject(allele); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); diseaseAnnotation.setConditionRelations(List.of(conditionRelation)); @@ -324,8 +324,8 @@ public void createAlleleDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("ALLELE:da0001|is_implicated_in|false|DOID:da0001|AGRKB:100000005|ECO:da00001|HGNC:1|has_condition|ZECO:da001|severity|ameliorated_by|SGD:da0002")). body("entity.modEntityId", is(ALLELE_DISEASE_ANNOTATION)). - body("entity.subjectBiologicalEntity.modEntityId", is(allele.getModEntityId())). - body("entity.objectOntologyTerm.curie", is(doTerm.getCurie())). + body("entity.diseaseAnnotationSubject.modEntityId", is(allele.getModEntityId())). + body("entity.diseaseAnnotationObject.curie", is(doTerm.getCurie())). body("entity.relation.name", is(alleleAndGeneRelation.getName())). body("entity.negated", is(false)). body("entity.internal", is(false)). @@ -366,10 +366,10 @@ public void createAgmDiseaseAnnotation() { diseaseAnnotation.setModEntityId(AGM_DISEASE_ANNOTATION); diseaseAnnotation.setDateCreated(datetime); diseaseAnnotation.setNegated(false); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider2); - diseaseAnnotation.setSubjectBiologicalEntity(agm); + diseaseAnnotation.setDiseaseAnnotationSubject(agm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); diseaseAnnotation.setConditionRelations(List.of(conditionRelation)); @@ -399,8 +399,8 @@ public void createAgmDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("SGD:da0001|is_model_of|false|DOID:da0001|AGRKB:100000005|ECO:da00001|HGNC:1|has_condition|ZECO:da001|severity|ameliorated_by|SGD:da0002")). body("entity.modEntityId", is(AGM_DISEASE_ANNOTATION)). - body("entity.subjectBiologicalEntity.modEntityId", is(agm.getModEntityId())). - body("entity.objectOntologyTerm.curie", is(doTerm.getCurie())). + body("entity.diseaseAnnotationSubject.modEntityId", is(agm.getModEntityId())). + body("entity.diseaseAnnotationObject.curie", is(doTerm.getCurie())). body("entity.relation.name", is(agmRelation.getName())). body("entity.negated", is(false)). body("entity.internal", is(false)). @@ -445,10 +445,10 @@ public void editGeneDiseaseAnnotation() { diseaseAnnotation.setInternal(true); diseaseAnnotation.setCreatedBy(person); diseaseAnnotation.setNegated(true); - diseaseAnnotation.setObjectOntologyTerm(doTerm2); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm2); diseaseAnnotation.setDataProvider(dataProvider2); diseaseAnnotation.setSecondaryDataProvider(dataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(gene2); + diseaseAnnotation.setDiseaseAnnotationSubject(gene2); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm2)); diseaseAnnotation.setSingleReference(reference2); diseaseAnnotation.setSgdStrainBackground(agm2); @@ -487,8 +487,8 @@ public void editGeneDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("GENE:da0002|is_marker_for|true|DOID:da0002|AGRKB:100000006|ECO:da00002|HGNC:2|induced_by|ZECO:da002|onset|exacerbated_by|SGD:da0001")). body("entity.modEntityId", is(GENE_DISEASE_ANNOTATION)). - body("entity.subjectBiologicalEntity.modEntityId", is(gene2.getModEntityId())). - body("entity.objectOntologyTerm.curie", is(doTerm2.getCurie())). + body("entity.diseaseAnnotationSubject.modEntityId", is(gene2.getModEntityId())). + body("entity.diseaseAnnotationObject.curie", is(doTerm2.getCurie())). body("entity.relation.name", is(geneRelation.getName())). body("entity.negated", is(true)). body("entity.internal", is(true)). @@ -528,10 +528,10 @@ public void editAlleleDiseaseAnnotation() { diseaseAnnotation.setInternal(true); diseaseAnnotation.setCreatedBy(person); diseaseAnnotation.setNegated(true); - diseaseAnnotation.setObjectOntologyTerm(doTerm2); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm2); diseaseAnnotation.setDataProvider(dataProvider2); diseaseAnnotation.setSecondaryDataProvider(dataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(allele2); + diseaseAnnotation.setDiseaseAnnotationSubject(allele2); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm2)); diseaseAnnotation.setSingleReference(reference2); diseaseAnnotation.setWith(List.of(withGene2)); @@ -571,8 +571,8 @@ public void editAlleleDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("ALLELE:da0002|is_implicated_in|true|DOID:da0002|AGRKB:100000006|ECO:da00002|HGNC:2|induced_by|ZECO:da002|onset|exacerbated_by|SGD:da0001")). body("entity.modEntityId", is(ALLELE_DISEASE_ANNOTATION)). - body("entity.subjectBiologicalEntity.modEntityId", is(allele2.getModEntityId())). - body("entity.objectOntologyTerm.curie", is(doTerm2.getCurie())). + body("entity.diseaseAnnotationSubject.modEntityId", is(allele2.getModEntityId())). + body("entity.diseaseAnnotationObject.curie", is(doTerm2.getCurie())). body("entity.relation.name", is(alleleAndGeneRelation.getName())). body("entity.negated", is(true)). body("entity.internal", is(true)). @@ -615,10 +615,10 @@ public void editAgmDiseaseAnnotation() { diseaseAnnotation.setInternal(true); diseaseAnnotation.setCreatedBy(person); diseaseAnnotation.setNegated(true); - diseaseAnnotation.setObjectOntologyTerm(doTerm2); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm2); diseaseAnnotation.setDataProvider(dataProvider2); diseaseAnnotation.setSecondaryDataProvider(dataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(agm2); + diseaseAnnotation.setDiseaseAnnotationSubject(agm2); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm2)); diseaseAnnotation.setSingleReference(reference2); diseaseAnnotation.setWith(List.of(withGene2)); @@ -660,8 +660,8 @@ public void editAgmDiseaseAnnotation() { statusCode(200). body("entity.uniqueId", is("SGD:da0002|is_exacerbated_model_of|true|DOID:da0002|AGRKB:100000006|ECO:da00002|HGNC:2|induced_by|ZECO:da002|onset|exacerbated_by|SGD:da0001")). body("entity.modEntityId", is(AGM_DISEASE_ANNOTATION)). - body("entity.subjectBiologicalEntity.modEntityId", is(agm2.getModEntityId())). - body("entity.objectOntologyTerm.curie", is(doTerm2.getCurie())). + body("entity.diseaseAnnotationSubject.modEntityId", is(agm2.getModEntityId())). + body("entity.diseaseAnnotationObject.curie", is(doTerm2.getCurie())). body("entity.relation.name", is(agmRelation2.getName())). body("entity.negated", is(true)). body("entity.internal", is(true)). @@ -709,8 +709,8 @@ public void createGeneDiseaseAnnotationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.evidenceCodes", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.singleReference", is(ValidationConstants.REQUIRED_MESSAGE)); @@ -729,8 +729,8 @@ public void createAlleleDiseaseAnnotationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.evidenceCodes", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.singleReference", is(ValidationConstants.REQUIRED_MESSAGE)); @@ -749,8 +749,8 @@ public void createAgmDiseaseAnnotationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.evidenceCodes", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.singleReference", is(ValidationConstants.REQUIRED_MESSAGE)); @@ -760,8 +760,8 @@ public void createAgmDiseaseAnnotationWithMissingRequiredFieldsLevel1() { @Order(10) public void editGeneDiseaseAnnotationWithMissingRequiredFieldsLevel1() { GeneDiseaseAnnotation diseaseAnnotation = getGeneDiseaseAnnotation(GENE_DISEASE_ANNOTATION); - diseaseAnnotation.setSubjectBiologicalEntity(null); - diseaseAnnotation.setObjectOntologyTerm(null); + diseaseAnnotation.setDiseaseAnnotationSubject(null); + diseaseAnnotation.setDiseaseAnnotationObject(null); diseaseAnnotation.setRelation(null); diseaseAnnotation.setEvidenceCodes(null); diseaseAnnotation.setSingleReference(null); @@ -775,8 +775,8 @@ public void editGeneDiseaseAnnotationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(6))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.evidenceCodes", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.singleReference", is(ValidationConstants.REQUIRED_MESSAGE)). @@ -787,8 +787,8 @@ public void editGeneDiseaseAnnotationWithMissingRequiredFieldsLevel1() { @Order(11) public void editAlleleDiseaseAnnotationWithMissingRequiredFieldsLevel1() { AlleleDiseaseAnnotation diseaseAnnotation = getAlleleDiseaseAnnotation(ALLELE_DISEASE_ANNOTATION); - diseaseAnnotation.setSubjectBiologicalEntity(null); - diseaseAnnotation.setObjectOntologyTerm(null); + diseaseAnnotation.setDiseaseAnnotationSubject(null); + diseaseAnnotation.setDiseaseAnnotationObject(null); diseaseAnnotation.setRelation(null); diseaseAnnotation.setEvidenceCodes(null); diseaseAnnotation.setSingleReference(null); @@ -802,8 +802,8 @@ public void editAlleleDiseaseAnnotationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(6))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.evidenceCodes", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.singleReference", is(ValidationConstants.REQUIRED_MESSAGE)). @@ -814,8 +814,8 @@ public void editAlleleDiseaseAnnotationWithMissingRequiredFieldsLevel1() { @Order(12) public void editAgmDiseaseAnnotationWithMissingRequiredFieldsLevel1() { AGMDiseaseAnnotation diseaseAnnotation = getAgmDiseaseAnnotation(AGM_DISEASE_ANNOTATION); - diseaseAnnotation.setSubjectBiologicalEntity(null); - diseaseAnnotation.setObjectOntologyTerm(null); + diseaseAnnotation.setDiseaseAnnotationSubject(null); + diseaseAnnotation.setDiseaseAnnotationObject(null); diseaseAnnotation.setRelation(null); diseaseAnnotation.setEvidenceCodes(null); diseaseAnnotation.setSingleReference(null); @@ -829,8 +829,8 @@ public void editAgmDiseaseAnnotationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(6))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.evidenceCodes", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.singleReference", is(ValidationConstants.REQUIRED_MESSAGE)). @@ -844,8 +844,8 @@ public void createGeneDiseaseAnnotationWithMissingRequiredFieldsLevel2() { diseaseAnnotation.setModEntityId("GeneDisease:0013"); diseaseAnnotation.setRelation(geneRelation); diseaseAnnotation.setSingleReference(reference); - diseaseAnnotation.setSubjectBiologicalEntity(gene); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationSubject(gene); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); DataProvider newDataProvider = new DataProvider(); @@ -881,8 +881,8 @@ public void createAlleleDiseaseAnnotationWithMissingRequiredFieldsLevel2() { diseaseAnnotation.setModEntityId("AlleleDisease:0014"); diseaseAnnotation.setRelation(alleleAndGeneRelation); diseaseAnnotation.setSingleReference(reference); - diseaseAnnotation.setSubjectBiologicalEntity(allele); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationSubject(allele); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); DataProvider newDataProvider = new DataProvider(); @@ -918,8 +918,8 @@ public void createAgmDiseaseAnnotationWithMissingRequiredFieldsLevel2() { diseaseAnnotation.setModEntityId("AGMDisease:0016"); diseaseAnnotation.setRelation(agmRelation); diseaseAnnotation.setSingleReference(reference); - diseaseAnnotation.setSubjectBiologicalEntity(agm); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationSubject(agm); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); DataProvider newDataProvider = new DataProvider(); @@ -1075,8 +1075,8 @@ public void createGeneDiseaseAnnotationWithEmptyRequiredFieldsLevel2() { diseaseAnnotation.setModEntityId("GeneDisease:0019"); diseaseAnnotation.setRelation(geneRelation); diseaseAnnotation.setSingleReference(reference); - diseaseAnnotation.setSubjectBiologicalEntity(gene); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationSubject(gene); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setDataProvider(dataProvider); @@ -1103,8 +1103,8 @@ public void createAlleleDiseaseAnnotationWithEmptyRequiredFieldsLevel2() { diseaseAnnotation.setModEntityId("AlleleDisease:0020"); diseaseAnnotation.setRelation(alleleAndGeneRelation); diseaseAnnotation.setSingleReference(reference); - diseaseAnnotation.setSubjectBiologicalEntity(allele); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationSubject(allele); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setDataProvider(dataProvider); @@ -1131,8 +1131,8 @@ public void createAgmDiseaseAnnotationWithEmptyRequiredFieldsLevel2() { diseaseAnnotation.setModEntityId("AgmDisease:0021"); diseaseAnnotation.setRelation(agmRelation); diseaseAnnotation.setSingleReference(reference); - diseaseAnnotation.setSubjectBiologicalEntity(agm); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationSubject(agm); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setDataProvider(dataProvider); @@ -1217,12 +1217,12 @@ public void editAgmDiseaseAnnotationWithEmptyRequiredFieldsLevel2() { public void createGeneDiseaseAnnotationWithInvalidFields() { GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); diseaseAnnotation.setRelation(agmRelation); - diseaseAnnotation.setObjectOntologyTerm(nonPersistedDoTerm); + diseaseAnnotation.setDiseaseAnnotationObject(nonPersistedDoTerm); DataProvider invalidDataProvider = new DataProvider(); invalidDataProvider.setSourceOrganization(nonPersistedOrganization); diseaseAnnotation.setDataProvider(invalidDataProvider); diseaseAnnotation.setSecondaryDataProvider(invalidDataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(nonPersistedGene); + diseaseAnnotation.setDiseaseAnnotationSubject(nonPersistedGene); diseaseAnnotation.setEvidenceCodes(List.of(nonPersistedEcoTerm)); diseaseAnnotation.setSingleReference(nonPersistedReference); diseaseAnnotation.setSgdStrainBackground(nonSgdAgm); @@ -1253,8 +1253,8 @@ public void createGeneDiseaseAnnotationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(16))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.dataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). body("errorMessages.secondaryDataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). @@ -1281,12 +1281,12 @@ public void createGeneDiseaseAnnotationWithInvalidFields() { public void createAlleleDiseaseAnnotationWithInvalidFields() { AlleleDiseaseAnnotation diseaseAnnotation = new AlleleDiseaseAnnotation(); diseaseAnnotation.setRelation(agmRelation); - diseaseAnnotation.setObjectOntologyTerm(nonPersistedDoTerm); + diseaseAnnotation.setDiseaseAnnotationObject(nonPersistedDoTerm); DataProvider invalidDataProvider = new DataProvider(); invalidDataProvider.setSourceOrganization(nonPersistedOrganization); diseaseAnnotation.setDataProvider(invalidDataProvider); diseaseAnnotation.setSecondaryDataProvider(invalidDataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(nonPersistedAllele); + diseaseAnnotation.setDiseaseAnnotationSubject(nonPersistedAllele); diseaseAnnotation.setEvidenceCodes(List.of(nonPersistedEcoTerm)); diseaseAnnotation.setSingleReference(nonPersistedReference); diseaseAnnotation.setWith(List.of(gene)); @@ -1318,8 +1318,8 @@ public void createAlleleDiseaseAnnotationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(17))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.dataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). body("errorMessages.secondaryDataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). @@ -1347,12 +1347,12 @@ public void createAlleleDiseaseAnnotationWithInvalidFields() { public void createAgmDiseaseAnnotationWithInvalidFields() { AGMDiseaseAnnotation diseaseAnnotation = new AGMDiseaseAnnotation(); diseaseAnnotation.setRelation(geneRelation); - diseaseAnnotation.setObjectOntologyTerm(nonPersistedDoTerm); + diseaseAnnotation.setDiseaseAnnotationObject(nonPersistedDoTerm); DataProvider invalidDataProvider = new DataProvider(); invalidDataProvider.setSourceOrganization(nonPersistedOrganization); diseaseAnnotation.setDataProvider(invalidDataProvider); diseaseAnnotation.setSecondaryDataProvider(invalidDataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(nonPersistedAgm); + diseaseAnnotation.setDiseaseAnnotationSubject(nonPersistedAgm); diseaseAnnotation.setEvidenceCodes(List.of(nonPersistedEcoTerm)); diseaseAnnotation.setSingleReference(nonPersistedReference); diseaseAnnotation.setWith(List.of(gene)); @@ -1386,8 +1386,8 @@ public void createAgmDiseaseAnnotationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(19))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.dataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). body("errorMessages.secondaryDataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). @@ -1417,12 +1417,12 @@ public void createAgmDiseaseAnnotationWithInvalidFields() { public void editGeneDiseaseAnnotationWithInvalidFields() { GeneDiseaseAnnotation diseaseAnnotation = getGeneDiseaseAnnotation(GENE_DISEASE_ANNOTATION); diseaseAnnotation.setRelation(agmRelation); - diseaseAnnotation.setObjectOntologyTerm(nonPersistedDoTerm); + diseaseAnnotation.setDiseaseAnnotationObject(nonPersistedDoTerm); DataProvider invalidDataProvider = new DataProvider(); invalidDataProvider.setSourceOrganization(nonPersistedOrganization); diseaseAnnotation.setDataProvider(invalidDataProvider); diseaseAnnotation.setSecondaryDataProvider(invalidDataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(nonPersistedGene); + diseaseAnnotation.setDiseaseAnnotationSubject(nonPersistedGene); diseaseAnnotation.setEvidenceCodes(List.of(nonPersistedEcoTerm)); diseaseAnnotation.setSingleReference(nonPersistedReference); diseaseAnnotation.setSgdStrainBackground(nonSgdAgm); @@ -1452,8 +1452,8 @@ public void editGeneDiseaseAnnotationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(16))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.dataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). body("errorMessages.secondaryDataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). @@ -1480,12 +1480,12 @@ public void editGeneDiseaseAnnotationWithInvalidFields() { public void editAlleleDiseaseAnnotationWithInvalidFields() { AlleleDiseaseAnnotation diseaseAnnotation = getAlleleDiseaseAnnotation(ALLELE_DISEASE_ANNOTATION); diseaseAnnotation.setRelation(agmRelation); - diseaseAnnotation.setObjectOntologyTerm(nonPersistedDoTerm); + diseaseAnnotation.setDiseaseAnnotationObject(nonPersistedDoTerm); DataProvider invalidDataProvider = new DataProvider(); invalidDataProvider.setSourceOrganization(nonPersistedOrganization); diseaseAnnotation.setDataProvider(invalidDataProvider); diseaseAnnotation.setSecondaryDataProvider(invalidDataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(nonPersistedAllele); + diseaseAnnotation.setDiseaseAnnotationSubject(nonPersistedAllele); diseaseAnnotation.setEvidenceCodes(List.of(nonPersistedEcoTerm)); diseaseAnnotation.setSingleReference(nonPersistedReference); diseaseAnnotation.setWith(List.of(gene)); @@ -1516,8 +1516,8 @@ public void editAlleleDiseaseAnnotationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(17))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.dataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). body("errorMessages.secondaryDataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). @@ -1545,12 +1545,12 @@ public void editAlleleDiseaseAnnotationWithInvalidFields() { public void editAgmDiseaseAnnotationWithInvalidFields() { AGMDiseaseAnnotation diseaseAnnotation = getAgmDiseaseAnnotation(AGM_DISEASE_ANNOTATION); diseaseAnnotation.setRelation(geneRelation); - diseaseAnnotation.setObjectOntologyTerm(nonPersistedDoTerm); + diseaseAnnotation.setDiseaseAnnotationObject(nonPersistedDoTerm); DataProvider invalidDataProvider = new DataProvider(); invalidDataProvider.setSourceOrganization(nonPersistedOrganization); diseaseAnnotation.setDataProvider(invalidDataProvider); diseaseAnnotation.setSecondaryDataProvider(invalidDataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(nonPersistedAgm); + diseaseAnnotation.setDiseaseAnnotationSubject(nonPersistedAgm); diseaseAnnotation.setEvidenceCodes(List.of(nonPersistedEcoTerm)); diseaseAnnotation.setSingleReference(nonPersistedReference); diseaseAnnotation.setWith(List.of(gene)); @@ -1583,8 +1583,8 @@ public void editAgmDiseaseAnnotationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(19))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.dataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). body("errorMessages.secondaryDataProvider", is("sourceOrganization - " + ValidationConstants.INVALID_MESSAGE)). @@ -1615,10 +1615,10 @@ public void createGeneDiseaseAnnotationWithObsoleteFields() { dataProvider.setObsolete(true); GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); diseaseAnnotation.setRelation(obsoleteGeneRelation); - diseaseAnnotation.setObjectOntologyTerm(obsoleteDoTerm); + diseaseAnnotation.setDiseaseAnnotationObject(obsoleteDoTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(obsoleteGene); + diseaseAnnotation.setDiseaseAnnotationSubject(obsoleteGene); diseaseAnnotation.setEvidenceCodes(List.of(obsoleteEcoTerm)); diseaseAnnotation.setSingleReference(obsoleteReference); diseaseAnnotation.setSgdStrainBackground(obsoleteAgm); @@ -1649,8 +1649,8 @@ public void createGeneDiseaseAnnotationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(16))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.dataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.secondaryDataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). @@ -1676,10 +1676,10 @@ public void createGeneDiseaseAnnotationWithObsoleteFields() { public void createAlleleDiseaseAnnotationWithObsoleteFields() { AlleleDiseaseAnnotation diseaseAnnotation = new AlleleDiseaseAnnotation(); diseaseAnnotation.setRelation(obsoleteAlleleRelation); - diseaseAnnotation.setObjectOntologyTerm(obsoleteDoTerm); + diseaseAnnotation.setDiseaseAnnotationObject(obsoleteDoTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(obsoleteAllele); + diseaseAnnotation.setDiseaseAnnotationSubject(obsoleteAllele); diseaseAnnotation.setEvidenceCodes(List.of(obsoleteEcoTerm)); diseaseAnnotation.setSingleReference(obsoleteReference); diseaseAnnotation.setWith(List.of(obsoleteGene)); @@ -1711,8 +1711,8 @@ public void createAlleleDiseaseAnnotationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(17))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.dataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.secondaryDataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). @@ -1739,10 +1739,10 @@ public void createAlleleDiseaseAnnotationWithObsoleteFields() { public void createAgmDiseaseAnnotationWithObsoleteFields() { AGMDiseaseAnnotation diseaseAnnotation = new AGMDiseaseAnnotation(); diseaseAnnotation.setRelation(obsoleteAgmRelation); - diseaseAnnotation.setObjectOntologyTerm(obsoleteDoTerm); + diseaseAnnotation.setDiseaseAnnotationObject(obsoleteDoTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(obsoleteAgm); + diseaseAnnotation.setDiseaseAnnotationSubject(obsoleteAgm); diseaseAnnotation.setEvidenceCodes(List.of(obsoleteEcoTerm)); diseaseAnnotation.setSingleReference(obsoleteReference); diseaseAnnotation.setWith(List.of(obsoleteGene)); @@ -1776,8 +1776,8 @@ public void createAgmDiseaseAnnotationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(19))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.dataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.secondaryDataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). @@ -1808,10 +1808,10 @@ public void editGeneDiseaseAnnotationWithObsoleteFields() { GeneDiseaseAnnotation diseaseAnnotation = getGeneDiseaseAnnotation(GENE_DISEASE_ANNOTATION); diseaseAnnotation.setRelation(obsoleteGeneRelation); - diseaseAnnotation.setObjectOntologyTerm(obsoleteDoTerm); + diseaseAnnotation.setDiseaseAnnotationObject(obsoleteDoTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider2); - diseaseAnnotation.setSubjectBiologicalEntity(obsoleteGene); + diseaseAnnotation.setDiseaseAnnotationSubject(obsoleteGene); diseaseAnnotation.setEvidenceCodes(List.of(obsoleteEcoTerm)); diseaseAnnotation.setSingleReference(obsoleteReference); diseaseAnnotation.setSgdStrainBackground(obsoleteAgm); @@ -1840,8 +1840,8 @@ public void editGeneDiseaseAnnotationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(16))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.dataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.secondaryDataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). @@ -1867,10 +1867,10 @@ public void editGeneDiseaseAnnotationWithObsoleteFields() { public void editAlleleDiseaseAnnotationWithObsoleteFields() { AlleleDiseaseAnnotation diseaseAnnotation = getAlleleDiseaseAnnotation(ALLELE_DISEASE_ANNOTATION); diseaseAnnotation.setRelation(obsoleteAlleleRelation); - diseaseAnnotation.setObjectOntologyTerm(obsoleteDoTerm); + diseaseAnnotation.setDiseaseAnnotationObject(obsoleteDoTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider2); - diseaseAnnotation.setSubjectBiologicalEntity(obsoleteAllele); + diseaseAnnotation.setDiseaseAnnotationSubject(obsoleteAllele); diseaseAnnotation.setEvidenceCodes(List.of(obsoleteEcoTerm)); diseaseAnnotation.setSingleReference(obsoleteReference); diseaseAnnotation.setWith(List.of(obsoleteGene)); @@ -1900,8 +1900,8 @@ public void editAlleleDiseaseAnnotationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(17))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.dataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.secondaryDataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). @@ -1928,10 +1928,10 @@ public void editAlleleDiseaseAnnotationWithObsoleteFields() { public void editAgmDiseaseAnnotationWithObsoleteFields() { AGMDiseaseAnnotation diseaseAnnotation = getAgmDiseaseAnnotation(AGM_DISEASE_ANNOTATION); diseaseAnnotation.setRelation(obsoleteAgmRelation); - diseaseAnnotation.setObjectOntologyTerm(obsoleteDoTerm); + diseaseAnnotation.setDiseaseAnnotationObject(obsoleteDoTerm); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setSecondaryDataProvider(dataProvider2); - diseaseAnnotation.setSubjectBiologicalEntity(obsoleteAgm); + diseaseAnnotation.setDiseaseAnnotationSubject(obsoleteAgm); diseaseAnnotation.setEvidenceCodes(List.of(obsoleteEcoTerm)); diseaseAnnotation.setSingleReference(obsoleteReference); diseaseAnnotation.setWith(List.of(obsoleteGene)); @@ -1963,8 +1963,8 @@ public void editAgmDiseaseAnnotationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(19))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.objectOntologyTerm", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.diseaseAnnotationSubject", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.diseaseAnnotationObject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.dataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.secondaryDataProvider", is(ValidationConstants.OBSOLETE_MESSAGE)). @@ -1995,8 +1995,8 @@ public void editAgmDiseaseAnnotationWithObsoleteFields() { @Order(37) public void createDiseaseAnnotationWithUnsupportedFields() { GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); - diseaseAnnotation.setSubjectBiologicalEntity(gene); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationSubject(gene); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setRelation(geneRelation); diseaseAnnotation.setEvidenceCodes(List.of(unsupportedEcoTerm)); diseaseAnnotation.setSingleReference(reference); @@ -2034,8 +2034,8 @@ public void editDiseaseAnnotationWithUnsupportedFields() { @Order(39) public void createDiseaseAnnotationWithMissingDependentFields() { GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); - diseaseAnnotation.setSubjectBiologicalEntity(gene); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationSubject(gene); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setRelation(geneRelation); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); @@ -2103,8 +2103,8 @@ public void editDiseaseAnnotationWithMissingDependentFields() { @Order(41) public void createDiseaseAnnotationConditionRelationWithHandleWithoutReference() { GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); - diseaseAnnotation.setSubjectBiologicalEntity(gene); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationSubject(gene); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setRelation(geneRelation); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); @@ -2151,8 +2151,8 @@ public void editDiseaseAnnotationConditionRelationWithHandleWithoutReference() { @Order(43) public void createDiseaseAnnotationWithConditionRelationReferenceMismatch() { GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); - diseaseAnnotation.setSubjectBiologicalEntity(gene); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationSubject(gene); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setRelation(geneRelation); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); @@ -2352,9 +2352,9 @@ public void editAgmDiseaseAnnotationWithNullNonRequiredFieldsLevel() { public void createGeneDiseaseAnnotationWithOnlyRequiredFields() { GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); diseaseAnnotation.setRelation(alleleAndGeneRelation); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setDataProvider(dataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(gene); + diseaseAnnotation.setDiseaseAnnotationSubject(gene); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); @@ -2372,9 +2372,9 @@ public void createGeneDiseaseAnnotationWithOnlyRequiredFields() { public void createAlleleDiseaseAnnotationWithOnlyRequiredFields() { AlleleDiseaseAnnotation diseaseAnnotation = new AlleleDiseaseAnnotation(); diseaseAnnotation.setRelation(alleleAndGeneRelation); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setDataProvider(dataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(allele); + diseaseAnnotation.setDiseaseAnnotationSubject(allele); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); @@ -2392,9 +2392,9 @@ public void createAlleleDiseaseAnnotationWithOnlyRequiredFields() { public void createAgmDiseaseAnnotationWithOnlyRequiredFields() { AGMDiseaseAnnotation diseaseAnnotation = new AGMDiseaseAnnotation(); diseaseAnnotation.setRelation(agmRelation); - diseaseAnnotation.setObjectOntologyTerm(doTerm); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm); diseaseAnnotation.setDataProvider(dataProvider); - diseaseAnnotation.setSubjectBiologicalEntity(agm); + diseaseAnnotation.setDiseaseAnnotationSubject(agm); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference); @@ -2412,8 +2412,8 @@ public void createAgmDiseaseAnnotationWithOnlyRequiredFields() { public void createDiseaseAnnotationWithDuplicateNote() { GeneDiseaseAnnotation diseaseAnnotation = new GeneDiseaseAnnotation(); diseaseAnnotation.setRelation(geneRelation); - diseaseAnnotation.setObjectOntologyTerm(doTerm2); - diseaseAnnotation.setSubjectBiologicalEntity(gene); + diseaseAnnotation.setDiseaseAnnotationObject(doTerm2); + diseaseAnnotation.setDiseaseAnnotationSubject(gene); diseaseAnnotation.setDataProvider(dataProvider); diseaseAnnotation.setEvidenceCodes(List.of(ecoTerm)); diseaseAnnotation.setSingleReference(reference2); diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java index f00a81e04..68d2363ef 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/AlleleGeneAssociationITCase.java @@ -95,8 +95,8 @@ public void createValidAlleleGeneAssociation() { loadRequiredEntities(); AlleleGeneAssociation association = new AlleleGeneAssociation(); - association.setSubjectBiologicalEntity(allele); - association.setObjectBiologicalEntity(gene); + association.setAlleleAssociationSubject(allele); + association.setAlleleGeneAssociationObject(gene); association.setRelation(relation); association.setEvidenceCode(ecoTerm); association.setInternal(true); @@ -118,8 +118,8 @@ public void createValidAlleleGeneAssociation() { then(). statusCode(200). body("entity.relation.name", is(relation.getName())). - body("entity.objectBiologicalEntity.modEntityId", is(gene.getModEntityId())). - body("entity.subjectBiologicalEntity.modEntityId", is(allele.getModEntityId())). + body("entity.alleleGeneAssociationObject.modEntityId", is(gene.getModEntityId())). + body("entity.alleleAssociationSubject.modEntityId", is(allele.getModEntityId())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference.getCurie())). body("entity.evidenceCode.curie", is(ecoTerm.getCurie())). @@ -142,8 +142,8 @@ public void createValidAlleleGeneAssociation() { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relation.getName())). - body("entity.alleleGeneAssociations[0].objectBiologicalEntity.modEntityId", is(gene.getModEntityId())). - body("entity.alleleGeneAssociations[0].subjectBiologicalEntity", not(hasKey("alleleGeneAssociations"))); + body("entity.alleleGeneAssociations[0].alleleGeneAssociationObject.modEntityId", is(gene.getModEntityId())). + body("entity.alleleGeneAssociations[0].alleleAssociationSubject", not(hasKey("alleleGeneAssociations"))); RestAssured.given(). when(). @@ -152,17 +152,17 @@ public void createValidAlleleGeneAssociation() { statusCode(200). body("entity.alleleGeneAssociations", hasSize(1)). body("entity.alleleGeneAssociations[0].relation.name", is(relation.getName())). - body("entity.alleleGeneAssociations[0].objectBiologicalEntity.modEntityId", is(gene.getModEntityId())). - body("entity.alleleGeneAssociations[0].objectBiologicalEntity", not(hasKey("alleleGeneAssociations"))); + body("entity.alleleGeneAssociations[0].alleleGeneAssociationObject.modEntityId", is(gene.getModEntityId())). + body("entity.alleleGeneAssociations[0].alleleGeneAssociationObject", not(hasKey("alleleGeneAssociations"))); } @Test @Order(2) public void editAlleleGeneAssociation() { AlleleGeneAssociation association = getAlleleGeneAssociation(allele.getId(), relation.getName(), gene.getId()); - association.setSubjectBiologicalEntity(allele2); + association.setAlleleAssociationSubject(allele2); association.setRelation(relation2); - association.setObjectBiologicalEntity(gene2); + association.setAlleleGeneAssociationObject(gene2); association.setEvidenceCode(ecoTerm2); association.setInternal(false); association.setObsolete(false); @@ -183,8 +183,8 @@ public void editAlleleGeneAssociation() { then(). statusCode(200). body("entity.relation.name", is(relation2.getName())). - body("entity.objectBiologicalEntity.modEntityId", is(gene2.getModEntityId())). - body("entity.subjectBiologicalEntity.modEntityId", is(allele2.getModEntityId())). + body("entity.alleleGeneAssociationObject.modEntityId", is(gene2.getModEntityId())). + body("entity.alleleAssociationSubject.modEntityId", is(allele2.getModEntityId())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2.getCurie())). body("entity.evidenceCode.curie", is(ecoTerm2.getCurie())). @@ -214,18 +214,18 @@ public void createAlleleGeneAssociationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.alleleAssociationSubject", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.objectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.alleleGeneAssociationObject", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @Order(4) public void createAlleleGeneAssociationWithMissingRequiredFieldsLevel2() { AlleleGeneAssociation association = new AlleleGeneAssociation(); - association.setSubjectBiologicalEntity(allele2); + association.setAlleleAssociationSubject(allele2); association.setRelation(relation); - association.setObjectBiologicalEntity(gene); + association.setAlleleGeneAssociationObject(gene); Note emptyNote = new Note(); association.setRelatedNote(emptyNote); @@ -247,9 +247,9 @@ public void createAlleleGeneAssociationWithMissingRequiredFieldsLevel2() { @Order(5) public void createAlleleGeneAssociationWithEmptyRequiredFieldsLevel2() { AlleleGeneAssociation association = new AlleleGeneAssociation(); - association.setSubjectBiologicalEntity(allele2); + association.setAlleleAssociationSubject(allele2); association.setRelation(relation); - association.setObjectBiologicalEntity(gene); + association.setAlleleGeneAssociationObject(gene); Note invalidNote = new Note(); invalidNote.setNoteType(noteType); @@ -270,9 +270,9 @@ public void createAlleleGeneAssociationWithEmptyRequiredFieldsLevel2() { @Order(6) public void editAlleleGeneAssociationWithMissingRequiredFieldsLevel1() { AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getId(), relation2.getName(), gene2.getId()); - association.setSubjectBiologicalEntity(null); + association.setAlleleAssociationSubject(null); association.setRelation(null); - association.setObjectBiologicalEntity(null); + association.setAlleleGeneAssociationObject(null); RestAssured.given(). contentType("application/json"). @@ -282,9 +282,9 @@ public void editAlleleGeneAssociationWithMissingRequiredFieldsLevel1() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.alleleAssociationSubject", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.objectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.alleleGeneAssociationObject", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @@ -348,9 +348,9 @@ public void createAlleleGeneAssociationWithInvalidFields() { invalidNote.setFreeText("Invalid"); AlleleGeneAssociation association = new AlleleGeneAssociation(); - association.setSubjectBiologicalEntity(nonPersistedAllele); + association.setAlleleAssociationSubject(nonPersistedAllele); association.setRelation(noteType); - association.setObjectBiologicalEntity(nonPersistedGene); + association.setAlleleGeneAssociationObject(nonPersistedGene); association.setEvidence(List.of(nonPersistedReference)); association.setRelatedNote(invalidNote); association.setEvidenceCode(nonPersistedEcoTerm); @@ -363,9 +363,9 @@ public void createAlleleGeneAssociationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(6))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.alleleAssociationSubject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.objectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.alleleGeneAssociationObject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidenceCode", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relatedNote", is(String.join(" | ", List.of( @@ -391,9 +391,9 @@ public void editAlleleGeneAssociationWithInvalidFields() { invalidNote.setFreeText("Invalid"); AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getId(), relation2.getName(), gene2.getId()); - association.setSubjectBiologicalEntity(nonPersistedAllele); + association.setAlleleAssociationSubject(nonPersistedAllele); association.setRelation(noteType); - association.setObjectBiologicalEntity(nonPersistedGene); + association.setAlleleGeneAssociationObject(nonPersistedGene); association.setEvidence(List.of(nonPersistedReference)); association.setRelatedNote(invalidNote); association.setEvidenceCode(nonPersistedEcoTerm); @@ -406,9 +406,9 @@ public void editAlleleGeneAssociationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(6))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.alleleAssociationSubject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.objectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.alleleGeneAssociationObject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidenceCode", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relatedNote", is(String.join(" | ", List.of( @@ -421,9 +421,9 @@ public void editAlleleGeneAssociationWithInvalidFields() { public void createAlleleGeneAssociationWithObsoleteFields() { AlleleGeneAssociation association = new AlleleGeneAssociation(); - association.setSubjectBiologicalEntity(obsoleteAllele); + association.setAlleleAssociationSubject(obsoleteAllele); association.setRelation(obsoleteRelation); - association.setObjectBiologicalEntity(obsoleteGene); + association.setAlleleGeneAssociationObject(obsoleteGene); association.setEvidenceCode(obsoleteEcoTerm); association.setEvidence(List.of(obsoleteReference)); @@ -442,9 +442,9 @@ public void createAlleleGeneAssociationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(6))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.alleleAssociationSubject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.objectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.alleleGeneAssociationObject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidenceCode", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relatedNote", is(String.join(" | ", List.of( @@ -457,9 +457,9 @@ public void createAlleleGeneAssociationWithObsoleteFields() { public void editAlleleGeneAssociationWithObsoleteFields() { AlleleGeneAssociation association = getAlleleGeneAssociation(allele2.getId(), relation2.getName(), gene2.getId()); - association.setSubjectBiologicalEntity(obsoleteAllele); + association.setAlleleAssociationSubject(obsoleteAllele); association.setRelation(obsoleteRelation); - association.setObjectBiologicalEntity(obsoleteGene); + association.setAlleleGeneAssociationObject(obsoleteGene); association.setEvidenceCode(obsoleteEcoTerm); association.setEvidence(List.of(obsoleteReference)); @@ -477,9 +477,9 @@ public void editAlleleGeneAssociationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(6))). - body("errorMessages.subjectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.alleleAssociationSubject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.objectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.alleleGeneAssociationObject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidenceCode", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relatedNote", is(String.join(" | ", List.of( diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java index 529ef338e..9c99e6669 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/associations/ConstructGenomicEntityAssociationITCase.java @@ -89,8 +89,8 @@ public void createValidConstructGenomicEntityAssociation() { loadRequiredEntities(); ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubjectReagent(construct); - association.setObjectBiologicalEntity(gene); + association.setConstructAssociationSubject(construct); + association.setConstructGenomicEntityAssociationObject(gene); association.setRelation(relation); association.setInternal(true); association.setObsolete(true); @@ -111,8 +111,8 @@ public void createValidConstructGenomicEntityAssociation() { then(). statusCode(200). body("entity.relation.name", is(relation.getName())). - body("entity.objectBiologicalEntity.modEntityId", is(gene.getModEntityId())). - body("entity.subjectReagent.modEntityId", is(construct.getModEntityId())). + body("entity.constructGenomicEntityAssociationObject.modEntityId", is(gene.getModEntityId())). + body("entity.constructAssociationSubject.modEntityId", is(construct.getModEntityId())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference.getCurie())). body("entity.internal", is(true)). @@ -134,8 +134,8 @@ public void createValidConstructGenomicEntityAssociation() { statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relation.getName())). - body("entity.constructGenomicEntityAssociations[0].objectBiologicalEntity.modEntityId", is(gene.getModEntityId())). - body("entity.constructGenomicEntityAssociations[0].subjectReagent", not(hasKey("constructGeneAssociations"))); + body("entity.constructGenomicEntityAssociations[0].constructGenomicEntityAssociationObject.modEntityId", is(gene.getModEntityId())). + body("entity.constructGenomicEntityAssociations[0].constructAssociationSubject", not(hasKey("constructGeneAssociations"))); RestAssured.given(). when(). @@ -144,17 +144,17 @@ public void createValidConstructGenomicEntityAssociation() { statusCode(200). body("entity.constructGenomicEntityAssociations", hasSize(1)). body("entity.constructGenomicEntityAssociations[0].relation.name", is(relation.getName())). - body("entity.constructGenomicEntityAssociations[0].objectBiologicalEntity.modEntityId", is(gene.getModEntityId())). - body("entity.constructGenomicEntityAssociations[0].subjectReagent", not(hasKey("constructGeneAssociations"))); + body("entity.constructGenomicEntityAssociations[0].constructGenomicEntityAssociationObject.modEntityId", is(gene.getModEntityId())). + body("entity.constructGenomicEntityAssociations[0].constructAssociationSubject", not(hasKey("constructGeneAssociations"))); } @Test @Order(2) public void editConstructGenomicEntityAssociation() { ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct.getId(), relation.getName(), gene.getId()); - association.setSubjectReagent(construct2); + association.setConstructAssociationSubject(construct2); association.setRelation(relation2); - association.setObjectBiologicalEntity(gene2); + association.setConstructGenomicEntityAssociationObject(gene2); association.setInternal(false); association.setObsolete(false); association.setEvidence(List.of(reference2)); @@ -174,8 +174,8 @@ public void editConstructGenomicEntityAssociation() { then(). statusCode(200). body("entity.relation.name", is(relation2.getName())). - body("entity.objectBiologicalEntity.curie", is(gene2.getCurie())). - body("entity.subjectReagent.modEntityId", is(construct2.getModEntityId())). + body("entity.constructGenomicEntityAssociationObject.curie", is(gene2.getCurie())). + body("entity.constructAssociationSubject.modEntityId", is(construct2.getModEntityId())). body("entity.evidence", hasSize(1)). body("entity.evidence[0].curie", is(reference2.getCurie())). body("entity.internal", is(false)). @@ -204,18 +204,18 @@ public void createConstructGenomicEntityAssociationWithMissingRequiredFieldsLeve then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.subjectReagent", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.constructAssociationSubject", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.objectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.constructGenomicEntityAssociationObject", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @Order(4) public void createConstructGenomicEntityAssociationWithMissingRequiredFieldsLevel2() { ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubjectReagent(construct2); + association.setConstructAssociationSubject(construct2); association.setRelation(relation); - association.setObjectBiologicalEntity(gene); + association.setConstructGenomicEntityAssociationObject(gene); Note emptyNote = new Note(); association.setRelatedNotes(List.of(emptyNote)); @@ -237,9 +237,9 @@ public void createConstructGenomicEntityAssociationWithMissingRequiredFieldsLeve @Order(5) public void createConstructGenomicEntityAssociationWithEmptyRequiredFieldsLevel2() { ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubjectReagent(construct2); + association.setConstructAssociationSubject(construct2); association.setRelation(relation); - association.setObjectBiologicalEntity(gene); + association.setConstructGenomicEntityAssociationObject(gene); Note invalidNote = new Note(); invalidNote.setNoteType(noteType); @@ -260,9 +260,9 @@ public void createConstructGenomicEntityAssociationWithEmptyRequiredFieldsLevel2 @Order(6) public void editConstructGenomicEntityAssociationWithMissingRequiredFieldsLevel1() { ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getId()); - association.setSubjectReagent(null); + association.setConstructAssociationSubject(null); association.setRelation(null); - association.setObjectBiologicalEntity(null); + association.setConstructGenomicEntityAssociationObject(null); RestAssured.given(). contentType("application/json"). @@ -272,9 +272,9 @@ public void editConstructGenomicEntityAssociationWithMissingRequiredFieldsLevel1 then(). statusCode(400). body("errorMessages", is(aMapWithSize(3))). - body("errorMessages.subjectReagent", is(ValidationConstants.REQUIRED_MESSAGE)). + body("errorMessages.constructAssociationSubject", is(ValidationConstants.REQUIRED_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.REQUIRED_MESSAGE)). - body("errorMessages.objectBiologicalEntity", is(ValidationConstants.REQUIRED_MESSAGE)); + body("errorMessages.constructGenomicEntityAssociationObject", is(ValidationConstants.REQUIRED_MESSAGE)); } @Test @@ -338,9 +338,9 @@ public void createConstructGenomicEntityAssociationWithInvalidFields() { invalidNote.setFreeText("Invalid"); ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubjectReagent(nonPersistedConstruct); + association.setConstructAssociationSubject(nonPersistedConstruct); association.setRelation(noteType); - association.setObjectBiologicalEntity(nonPersistedGene); + association.setConstructGenomicEntityAssociationObject(nonPersistedGene); association.setEvidence(List.of(nonPersistedReference)); association.setRelatedNotes(List.of(invalidNote)); @@ -352,9 +352,9 @@ public void createConstructGenomicEntityAssociationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subjectReagent", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.constructAssociationSubject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.objectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.constructGenomicEntityAssociationObject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relatedNotes", is(String.join(" | ", List.of( "noteType - " + ValidationConstants.INVALID_MESSAGE, @@ -379,9 +379,9 @@ public void editConstructGenomicEntityAssociationWithInvalidFields() { invalidNote.setFreeText("Invalid"); ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getId()); - association.setSubjectReagent(nonPersistedConstruct); + association.setConstructAssociationSubject(nonPersistedConstruct); association.setRelation(noteType); - association.setObjectBiologicalEntity(nonPersistedGene); + association.setConstructGenomicEntityAssociationObject(nonPersistedGene); association.setEvidence(List.of(nonPersistedReference)); association.setRelatedNotes(List.of(invalidNote)); @@ -393,9 +393,9 @@ public void editConstructGenomicEntityAssociationWithInvalidFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subjectReagent", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.constructAssociationSubject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.INVALID_MESSAGE)). - body("errorMessages.objectBiologicalEntity", is(ValidationConstants.INVALID_MESSAGE)). + body("errorMessages.constructGenomicEntityAssociationObject", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.INVALID_MESSAGE)). body("errorMessages.relatedNotes", is(String.join(" | ", List.of( "noteType - " + ValidationConstants.INVALID_MESSAGE, @@ -407,9 +407,9 @@ public void editConstructGenomicEntityAssociationWithInvalidFields() { public void createConstructGenomicEntityAssociationWithObsoleteFields() { ConstructGenomicEntityAssociation association = new ConstructGenomicEntityAssociation(); - association.setSubjectReagent(obsoleteConstruct); + association.setConstructAssociationSubject(obsoleteConstruct); association.setRelation(obsoleteRelation); - association.setObjectBiologicalEntity(obsoleteGene); + association.setConstructGenomicEntityAssociationObject(obsoleteGene); association.setEvidence(List.of(obsoleteReference)); Note note = new Note(); @@ -427,9 +427,9 @@ public void createConstructGenomicEntityAssociationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subjectReagent", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.constructAssociationSubject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.objectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.constructGenomicEntityAssociationObject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relatedNotes", is(String.join(" | ", List.of( "noteType - " + ValidationConstants.OBSOLETE_MESSAGE, @@ -441,9 +441,9 @@ public void createConstructGenomicEntityAssociationWithObsoleteFields() { public void editConstructGenomicEntityAssociationWithObsoleteFields() { ConstructGenomicEntityAssociation association = getConstructGenomicEntityAssociation(construct2.getId(), relation2.getName(), gene2.getId()); - association.setSubjectReagent(obsoleteConstruct); + association.setConstructAssociationSubject(obsoleteConstruct); association.setRelation(obsoleteRelation); - association.setObjectBiologicalEntity(obsoleteGene); + association.setConstructGenomicEntityAssociationObject(obsoleteGene); association.setEvidence(List.of(obsoleteReference)); Note note = association.getRelatedNotes().get(0); @@ -460,9 +460,9 @@ public void editConstructGenomicEntityAssociationWithObsoleteFields() { then(). statusCode(400). body("errorMessages", is(aMapWithSize(5))). - body("errorMessages.subjectReagent", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.constructAssociationSubject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relation", is(ValidationConstants.OBSOLETE_MESSAGE)). - body("errorMessages.objectBiologicalEntity", is(ValidationConstants.OBSOLETE_MESSAGE)). + body("errorMessages.constructGenomicEntityAssociationObject", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.evidence", is(ValidationConstants.OBSOLETE_MESSAGE)). body("errorMessages.relatedNotes", is(String.join(" | ", List.of( "noteType - " + ValidationConstants.OBSOLETE_MESSAGE, From ec709b8ecbf715cf3dfd42e93ac6acbd41051081 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 20 Feb 2024 12:35:11 +0000 Subject: [PATCH 059/159] Remove redundant migration command --- .../resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql b/src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql index 936bb70d5..5726245ec 100644 --- a/src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql +++ b/src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql @@ -285,7 +285,6 @@ ALTER INDEX constructfullname_singleconstruct_id_index RENAME TO constructfullna ALTER TABLE constructgenomicentityassociation DROP CONSTRAINT constructgenomicentityassociation_object_curie_fk; ALTER TABLE constructgenomicentityassociation RENAME CONSTRAINT fkgrhw9gxslaub14x4b0mc7v9mk TO constructgenomicentityassociation_id_fk; ALTER TABLE constructgenomicentityassociation RENAME CONSTRAINT constructgenomicentityassociation_subject_id_fk TO constructgenomicentityassociation_cgeassociationsubject_id_fk; -ALTER INDEX constructgenomicentityassociation_subject_index RENAME TO constructgenomicentityassociation_subject_index; DROP INDEX constructgenomicentityassociation_object_index; ALTER INDEX cgeassociation_note_cgeassociation_id_index RENAME TO cgeassociation_note_cgeassociation_index; ALTER INDEX cgeassociation_note_relatednotes_id_index RENAME TO cgeassociation_note_relatednotes_index; From d152b4a38eae5b32ea136897d2c6d4583ff249cc Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 20 Feb 2024 12:49:15 +0000 Subject: [PATCH 060/159] Update UI test mock data --- .../cliapp/src/containers/constructsPage/mockData/mockData.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/cliapp/src/containers/constructsPage/mockData/mockData.js b/src/main/cliapp/src/containers/constructsPage/mockData/mockData.js index d95d67087..58773db58 100644 --- a/src/main/cliapp/src/containers/constructsPage/mockData/mockData.js +++ b/src/main/cliapp/src/containers/constructsPage/mockData/mockData.js @@ -297,7 +297,7 @@ export const data = { "internal": false, "obsolete": false, "id": 135641224, - "subjectReagent": { + "constructAssociationSubject": { "createdBy": { "internal": false, "obsolete": false, @@ -657,7 +657,7 @@ export const data = { "name": "expresses (RO:0002292)", "definition": "Indicates that the construct expresses the indicated GenomicEntity" }, - "object": { + "constructGenomicEntityAssociationObject": { "type": "Gene", "createdBy": { "internal": false, From 2e5bce4ab800de1f8850063e2f848a48769e801d Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 20 Feb 2024 13:00:18 +0000 Subject: [PATCH 061/159] UI utils fix --- .../cliapp/src/utils/__tests__/utils.test.js | 30 +++++++++---------- src/main/cliapp/src/utils/utils.js | 6 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/cliapp/src/utils/__tests__/utils.test.js b/src/main/cliapp/src/utils/__tests__/utils.test.js index b8f1cd5f0..de9569232 100644 --- a/src/main/cliapp/src/utils/__tests__/utils.test.js +++ b/src/main/cliapp/src/utils/__tests__/utils.test.js @@ -7,11 +7,11 @@ describe('removeInvalidFilters', () => { it('All Valid fields', () => { const localStorageFilters = { "objectFilter": { - "object.name": { + "diseaseAnnotationObject.name": { "queryString": "j", "tokenOperator": "AND" }, - "object.curie": { + "diseaseAnnotationObject.curie": { "queryString": "j", "tokenOperator": "AND" } @@ -36,11 +36,11 @@ describe('removeInvalidFilters', () => { it('One invalid field', () => { const localStorageFilters = { "objectFilter": { - "object.invalidName": { + "diseaseAnnotationObject.invalidName": { "queryString": "j", "tokenOperator": "AND" }, - "object.curie": { + "diseaseAnnotationObject.curie": { "queryString": "j", "tokenOperator": "AND" } @@ -63,7 +63,7 @@ describe('removeInvalidFilters', () => { expect(newFilters).toEqual({ "objectFilter": { - "object.curie": { + "diseaseAnnotationObject.curie": { "queryString": "j", "tokenOperator": "AND" } @@ -86,11 +86,11 @@ describe('removeInvalidFilters', () => { it('All invalid fields', () => { const localStorageFilters = { "objectFilter": { - "object.invalidName": { + "diseaseAnnotationObject.invalidName": { "queryString": "j", " tokenOperator": "AND" }, - "object.invalidCurie": { + "diseaseAnnotationObject.invalidCurie": { "queryString": "j", "tokenOperator": "AND" } @@ -122,11 +122,11 @@ describe('removeInvalidSorts', () => { "order": 1 }, { - "field": "object.name", + "field": "diseaseAnnotationObject.name", "order": 1 }, { - "field": "subject.symbol", + "field": "diseaseAnnotationSubject.symbol", "order": 1 } ]; @@ -141,11 +141,11 @@ describe('removeInvalidSorts', () => { "order": 1 }, { - "field": "object.name", + "field": "diseaseAnnotationObject.name", "order": 1 }, { - "field": "subject.symbol", + "field": "diseaseAnnotationSubject.symbol", "order": 1 } ]; @@ -153,11 +153,11 @@ describe('removeInvalidSorts', () => { const newSorts = removeInvalidSorts(localMultiSortMeta); expect(newSorts).toEqual([ { - "field": "object.name", + "field": "diseaseAnnotationObject.name", "order": 1 }, { - "field": "subject.symbol", + "field": "diseaseAnnotationSubject.symbol", "order": 1 } ]); @@ -170,11 +170,11 @@ describe('removeInvalidSorts', () => { "order": 1 }, { - "field": "object.invalidName", + "field": "diseaseAnnotationObject.invalidName", "order": 1 }, { - "field": "subject.invalidSymbol", + "field": "diseaseAnnotationSubject.invalidSymbol", "order": 1 } ]; diff --git a/src/main/cliapp/src/utils/utils.js b/src/main/cliapp/src/utils/utils.js index 999a07aef..2b677e670 100644 --- a/src/main/cliapp/src/utils/utils.js +++ b/src/main/cliapp/src/utils/utils.js @@ -342,7 +342,7 @@ export function getUniqueItemsByProperty(items, propName) { } export function validateBioEntityFields(updatedRow, setUiErrorMessages, event, setIsInEditMode, closeRowRef, areUiErrors) { - const bioEntityFieldNames = ["subject", "sgdStrainBackground", "assertedAllele"]; + const bioEntityFieldNames = ["diseaseAnnotationSubject", "sgdStrainBackground", "assertedAllele"]; bioEntityFieldNames.forEach((field) => { if(updatedRow[field] && Object.keys(updatedRow[field]).length === 1){ @@ -371,10 +371,10 @@ export function validateBioEntityFields(updatedRow, setUiErrorMessages, event, s } export function validateFormBioEntityFields(newAnnotationForm, uiErrorMessages, setUiErrorMessages, areUiErrors) { - const bioEntityFieldNames = ["subject", "sgdStrainBackground", "assertedAllele"]; + const bioEntityFieldNames = ["diseaseAnnotationSubject", "sgdStrainBackground", "assertedAllele"]; bioEntityFieldNames.forEach((field) => { - if(newAnnotationForm[field] && !Object.keys(newAnnotationForm['subject']).includes("curie") && !Object.keys(newAnnotationForm['subject']).includes("modEntityId") && !Object.keys(newAnnotationForm['subject']).includes("modInternalId")){ + if(newAnnotationForm[field] && !Object.keys(newAnnotationForm['diseaseAnnotationSubject']).includes("curie") && !Object.keys(newAnnotationForm['diseaseAnnotationSubject']).includes("modEntityId") && !Object.keys(newAnnotationForm['diseaseAnnotationSubject']).includes("modInternalId")){ const _uiErrorMessages = {}; _uiErrorMessages[field] = "Must select from autosuggest"; setUiErrorMessages({..._uiErrorMessages}); From 0c3d3df04c3bbdbbb595a54258e9318412e3cd9b Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 20 Feb 2024 13:25:57 +0000 Subject: [PATCH 062/159] Only get previous IDs if doing cleanup --- .../jobs/executors/AgmDiseaseAnnotationExecutor.java | 6 ++++-- .../curation_api/jobs/executors/AgmExecutor.java | 9 ++++++--- .../jobs/executors/AlleleDiseaseAnnotationExecutor.java | 8 +++++--- .../curation_api/jobs/executors/AlleleExecutor.java | 7 +++++-- .../curation_api/jobs/executors/ConstructExecutor.java | 7 +++++-- .../jobs/executors/GeneDiseaseAnnotationExecutor.java | 8 +++++--- .../curation_api/jobs/executors/GeneExecutor.java | 9 ++++++--- .../curation_api/jobs/executors/VariantExecutor.java | 7 +++++-- .../AlleleGeneAssociationExecutor.java | 7 +++++-- .../ConstructGenomicEntityAssociationExecutor.java | 7 +++++-- 10 files changed, 51 insertions(+), 24 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java index 8d3dddd57..cd847e7eb 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java @@ -49,8 +49,10 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { List annotationIdsLoaded = new ArrayList<>(); List annotationIdsBefore = new ArrayList<>(); - annotationIdsBefore.addAll(agmDiseaseAnnotationService.getAnnotationIdsByDataProvider(dataProvider)); - annotationIdsBefore.removeIf(Objects::isNull); + if (cleanUp) { + annotationIdsBefore.addAll(agmDiseaseAnnotationService.getAnnotationIdsByDataProvider(dataProvider)); + annotationIdsBefore.removeIf(Objects::isNull); + } bulkLoadFile.setRecordCount(annotations.size() + bulkLoadFile.getRecordCount()); bulkLoadFileDAO.merge(bulkLoadFile); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmExecutor.java index 1038d2052..cb7fa0b6d 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmExecutor.java @@ -49,9 +49,12 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { BackendBulkDataProvider dataProvider = manual.getDataProvider(); List agmIdsLoaded = new ArrayList<>(); - List agmIdsBefore = affectedGenomicModelService.getIdsByDataProvider(dataProvider.name()); - Log.debug("runLoad: Before: total " + agmIdsBefore.size()); - + List agmIdsBefore = new ArrayList<>(); + if (cleanUp) { + agmIdsBefore.addAll(affectedGenomicModelService.getIdsByDataProvider(dataProvider.name())); + Log.debug("runLoad: Before: total " + agmIdsBefore.size()); + } + bulkLoadFile.setRecordCount(agms.size() + bulkLoadFile.getRecordCount()); bulkLoadFileDAO.merge(bulkLoadFile); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java index d6fbbb6dc..f33f21d45 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java @@ -49,9 +49,11 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { List annotationIdsLoaded = new ArrayList<>(); List annotationIdsBefore = new ArrayList<>(); - annotationIdsBefore.addAll(alleleDiseaseAnnotationService.getAnnotationIdsByDataProvider(dataProvider)); - annotationIdsBefore.removeIf(Objects::isNull); - + if (cleanUp) { + annotationIdsBefore.addAll(alleleDiseaseAnnotationService.getAnnotationIdsByDataProvider(dataProvider)); + annotationIdsBefore.removeIf(Objects::isNull); + } + bulkLoadFile.setRecordCount(annotations.size() + bulkLoadFile.getRecordCount()); bulkLoadFileDAO.merge(bulkLoadFile); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleExecutor.java index 3f56ea270..9cda18960 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleExecutor.java @@ -44,8 +44,11 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { BackendBulkDataProvider dataProvider = manual.getDataProvider(); List alleleIdsLoaded = new ArrayList<>(); - List alleleIdsBefore = alleleService.getIdsByDataProvider(dataProvider.name()); - Log.debug("runLoad: Before: total " + alleleIdsBefore.size()); + List alleleIdsBefore = new ArrayList<>(); + if (cleanUp) { + alleleIdsBefore.addAll(alleleService.getIdsByDataProvider(dataProvider.name())); + Log.debug("runLoad: Before: total " + alleleIdsBefore.size()); + } bulkLoadFile.setRecordCount(alleles.size() + bulkLoadFile.getRecordCount()); bulkLoadFileDAO.merge(bulkLoadFile); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/ConstructExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/ConstructExecutor.java index db2a0fa2a..9be544120 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/ConstructExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/ConstructExecutor.java @@ -51,8 +51,11 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { BackendBulkDataProvider dataProvider = manual.getDataProvider(); List constructIdsLoaded = new ArrayList<>(); - List constructIdsBefore = constructService.getConstructIdsByDataProvider(dataProvider); - Log.debug("runLoad: Before: total " + constructIdsBefore.size()); + List constructIdsBefore = new ArrayList<>(); + if (cleanUp) { + constructIdsBefore.addAll(constructService.getConstructIdsByDataProvider(dataProvider)); + Log.debug("runLoad: Before: total " + constructIdsBefore.size()); + } bulkLoadFile.setRecordCount(constructs.size() + bulkLoadFile.getRecordCount()); bulkLoadFileDAO.merge(bulkLoadFile); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java index ba6292520..c868410de 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java @@ -49,9 +49,11 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { List annotationIdsLoaded = new ArrayList<>(); List annotationIdsBefore = new ArrayList<>(); - annotationIdsBefore.addAll(geneDiseaseAnnotationService.getAnnotationIdsByDataProvider(dataProvider)); - annotationIdsBefore.removeIf(Objects::isNull); - + if (cleanUp) { + annotationIdsBefore.addAll(geneDiseaseAnnotationService.getAnnotationIdsByDataProvider(dataProvider)); + annotationIdsBefore.removeIf(Objects::isNull); + } + bulkLoadFile.setRecordCount(annotations.size() + bulkLoadFile.getRecordCount()); bulkLoadFileDAO.merge(bulkLoadFile); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExecutor.java index b962db874..5e37fd39a 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExecutor.java @@ -49,9 +49,12 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { if (genes == null) genes = new ArrayList<>(); List geneIdsLoaded = new ArrayList<>(); - List geneIdsBefore = geneService.getIdsByDataProvider(dataProvider); - log.debug("runLoad: Before: total " + geneIdsBefore.size()); - + List geneIdsBefore = new ArrayList<>(); + if (cleanUp) { + geneIdsBefore.addAll(geneService.getIdsByDataProvider(dataProvider)); + log.debug("runLoad: Before: total " + geneIdsBefore.size()); + } + bulkLoadFile.setRecordCount(genes.size() + bulkLoadFile.getRecordCount()); bulkLoadFileDAO.merge(bulkLoadFile); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/VariantExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/VariantExecutor.java index 6d581d426..04dabfcc9 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/VariantExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/VariantExecutor.java @@ -44,8 +44,11 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { BackendBulkDataProvider dataProvider = manual.getDataProvider(); List variantIdsLoaded = new ArrayList<>(); - List variantIdsBefore = variantService.getIdsByDataProvider(dataProvider.name()); - Log.debug("runLoad: Before: total " + variantIdsBefore.size()); + List variantIdsBefore = new ArrayList<>(); + if (cleanUp) { + variantIdsBefore.addAll(variantService.getIdsByDataProvider(dataProvider.name())); + Log.debug("runLoad: Before: total " + variantIdsBefore.size()); + } bulkLoadFile.setRecordCount(variants.size() + bulkLoadFile.getRecordCount()); bulkLoadFileDAO.merge(bulkLoadFile); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/alleleAssociations/AlleleGeneAssociationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/alleleAssociations/AlleleGeneAssociationExecutor.java index 3014a6a83..3b4cb7295 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/alleleAssociations/AlleleGeneAssociationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/alleleAssociations/AlleleGeneAssociationExecutor.java @@ -44,8 +44,11 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { List associationIdsLoaded = new ArrayList<>(); - List associationIdsBefore = alleleGeneAssociationService.getAssociationsByDataProvider(dataProvider); - associationIdsBefore.removeIf(Objects::isNull); + List associationIdsBefore = new ArrayList<>(); + if (cleanUp) { + associationIdsBefore.addAll(alleleGeneAssociationService.getAssociationsByDataProvider(dataProvider)); + associationIdsBefore.removeIf(Objects::isNull); + } bulkLoadFile.setRecordCount(associations.size() + bulkLoadFile.getRecordCount()); bulkLoadFileDAO.merge(bulkLoadFile); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/constructAssociations/ConstructGenomicEntityAssociationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/constructAssociations/ConstructGenomicEntityAssociationExecutor.java index 9a4957dba..4258442e3 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/constructAssociations/ConstructGenomicEntityAssociationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/associations/constructAssociations/ConstructGenomicEntityAssociationExecutor.java @@ -47,8 +47,11 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { List associationIdsLoaded = new ArrayList<>(); - List associationIdsBefore = constructGenomicEntityAssociationService.getAssociationsByDataProvider(dataProvider); - associationIdsBefore.removeIf(Objects::isNull); + List associationIdsBefore = new ArrayList<>(); + if (cleanUp) { + associationIdsBefore.addAll(constructGenomicEntityAssociationService.getAssociationsByDataProvider(dataProvider)); + associationIdsBefore.removeIf(Objects::isNull); + } bulkLoadFile.setRecordCount(associations.size() + bulkLoadFile.getRecordCount()); bulkLoadFileDAO.merge(bulkLoadFile); From 75e7a9a1fac9b5d56f3ae2c0ec0142fc461b8a1f Mon Sep 17 00:00:00 2001 From: Andres Becerra Date: Tue, 20 Feb 2024 13:29:50 +0000 Subject: [PATCH 063/159] SCRUM-3718: upgrade github actions to nodejs 20 --- .github/workflows/alpha-build-and-deploy.yml | 8 ++++---- .../workflows/github-actions-PR-validation.yml | 2 +- .../github-release-build-and-deploy.yml | 16 ++++++++-------- .github/workflows/release-PR-merge-actions.yml | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/alpha-build-and-deploy.yml b/.github/workflows/alpha-build-and-deploy.yml index 169ec4c6f..2977858d5 100644 --- a/.github/workflows/alpha-build-and-deploy.yml +++ b/.github/workflows/alpha-build-and-deploy.yml @@ -22,14 +22,14 @@ jobs: # This step will configure environment variables to be used by all steps # involving AWS interaction further down - name: AWS credentials configuration - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{secrets.GH_ACTIONS_AWS_ROLE}} role-session-name: gh-actions-${{github.run_id}}.${{github.run_number}}.${{github.run_attempt}}-build-image aws-region: us-east-1 - name: Amazon ECR login id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 + uses: aws-actions/amazon-ecr-login@v2 - name: Build, tag, and push image to Amazon ECR env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} @@ -46,7 +46,7 @@ jobs: - name: Check out repository code uses: actions/checkout@v3 - name: Set up Maven Central Repository - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' @@ -109,7 +109,7 @@ jobs: - name: Generate deployment package run: zip -r ${{ env.tagname }}.zip docker-compose.yml .ebextensions/ - name: AWS credentials configuration - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{secrets.GH_ACTIONS_AWS_ROLE}} role-session-name: gh-actions-${{github.run_id}}.${{github.run_number}}.${{github.run_attempt}}-eb-deploy diff --git a/.github/workflows/github-actions-PR-validation.yml b/.github/workflows/github-actions-PR-validation.yml index 9fe101197..39c3ad9b0 100644 --- a/.github/workflows/github-actions-PR-validation.yml +++ b/.github/workflows/github-actions-PR-validation.yml @@ -32,7 +32,7 @@ jobs: git fetch -q origin ${{ github.base_ref }} ${{ github.head_ref }} git diff --name-only origin/${{ github.base_ref }} origin/${{ github.head_ref }} - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' diff --git a/.github/workflows/github-release-build-and-deploy.yml b/.github/workflows/github-release-build-and-deploy.yml index e876186d3..7931f0d8a 100644 --- a/.github/workflows/github-release-build-and-deploy.yml +++ b/.github/workflows/github-release-build-and-deploy.yml @@ -11,14 +11,14 @@ jobs: - name: Check out repository code uses: actions/checkout@v3 - name: AWS credentials configuration - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{secrets.GH_ACTIONS_AWS_ROLE}} role-session-name: gh-actions-${{github.run_id}}.${{github.run_number}}.${{github.run_attempt}}-build-image aws-region: us-east-1 - name: Amazon ECR login id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 + uses: aws-actions/amazon-ecr-login@v2 - name: Build, tag, and push image to Amazon ECR env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} @@ -36,7 +36,7 @@ jobs: - name: Check out repository code uses: actions/checkout@v3 - name: Set up Maven Central Repository - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' @@ -69,7 +69,7 @@ jobs: - name: Generate deployment package run: zip -r ${{ github.event.release.tag_name }}.zip docker-compose.yml .ebextensions/ - name: Store deployment package in cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ github.event.release.tag_name }}.zip key: ${{github.workflow}}.${{github.run_id}}.${{github.run_number}}.${{github.run_attempt}}-eb-deployment-zip @@ -81,12 +81,12 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Fetch deployment package from cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ github.event.release.tag_name }}.zip key: ${{github.workflow}}.${{github.run_id}}.${{github.run_number}}.${{github.run_attempt}}-eb-deployment-zip - name: AWS credentials configuration - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{secrets.GH_ACTIONS_AWS_ROLE}} role-session-name: gh-actions-${{github.run_id}}.${{github.run_number}}.${{github.run_attempt}}-eb-deploy-production @@ -117,12 +117,12 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Fetch deployment package from cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ github.event.release.tag_name }}.zip key: ${{github.workflow}}.${{github.run_id}}.${{github.run_number}}.${{github.run_attempt}}-eb-deployment-zip - name: AWS credentials configuration - uses: aws-actions/configure-aws-credentials@v2 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{secrets.GH_ACTIONS_AWS_ROLE}} role-session-name: gh-actions-${{github.run_id}}.${{github.run_number}}.${{github.run_attempt}}-eb-deploy-beta diff --git a/.github/workflows/release-PR-merge-actions.yml b/.github/workflows/release-PR-merge-actions.yml index 1450b1c11..c2884c8fa 100644 --- a/.github/workflows/release-PR-merge-actions.yml +++ b/.github/workflows/release-PR-merge-actions.yml @@ -15,7 +15,7 @@ jobs: latestrelease: ${{ steps.releaseflags.outputs.latestrelease }} steps: - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Generate release tag name (as step output) id: tagname shell: bash @@ -51,7 +51,7 @@ jobs: tagmessage: '' steps: - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Generate and store release message shell: bash run: | @@ -86,7 +86,7 @@ jobs: mergeback-basebranchname: "alpha" steps: - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.GH_PAT }} From d71698d9b02026d787184ff7f9d2152ed4f3580b Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 20 Feb 2024 16:07:33 +0000 Subject: [PATCH 064/159] Remove unused DAO classes --- .../curation_api/dao/base/CurieObjectDAO.java | 12 ------------ .../curation_api/dao/base/SubmittedObjectDAO.java | 12 ------------ 2 files changed, 24 deletions(-) delete mode 100644 src/main/java/org/alliancegenome/curation_api/dao/base/CurieObjectDAO.java delete mode 100644 src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java diff --git a/src/main/java/org/alliancegenome/curation_api/dao/base/CurieObjectDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/base/CurieObjectDAO.java deleted file mode 100644 index bb0e1e5ee..000000000 --- a/src/main/java/org/alliancegenome/curation_api/dao/base/CurieObjectDAO.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.alliancegenome.curation_api.dao.base; - -import org.alliancegenome.curation_api.model.entities.base.CurieObject; - -public class CurieObjectDAO extends BaseSQLDAO { - - - protected CurieObjectDAO(Class myClass) { - super(myClass); - } - -} diff --git a/src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java deleted file mode 100644 index fe50be496..000000000 --- a/src/main/java/org/alliancegenome/curation_api/dao/base/SubmittedObjectDAO.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.alliancegenome.curation_api.dao.base; - -import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; - -public class SubmittedObjectDAO extends BaseSQLDAO { - - - protected SubmittedObjectDAO(Class myClass) { - super(myClass); - } - -} From fb483b4d9564b4bcd3f0ae1a6e42f47e2d49bb6e Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 20 Feb 2024 16:11:32 +0000 Subject: [PATCH 065/159] Fix copy-paste error --- .../diseaseAnnotationsPage/DiseaseAnnotationsTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 96eaf9a77..3a6f050b0 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -506,7 +506,7 @@ export const DiseaseAnnotationsTable = () => { const onConditionRelationHandleEditorValueChange = (props, event) => { let updatedAnnotations = [...props.props.value]; - if (typeof event.value === "diseaseAnnotationObject") { + if (typeof event.value === "object") { updatedAnnotations[props.rowIndex].conditionRelations[0] = event.value; } else { updatedAnnotations[props.rowIndex].conditionRelations[0].handle = event.value; From 8048317987bbba7e397622b6868070fa7b8a6f40 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 20 Feb 2024 16:13:25 +0000 Subject: [PATCH 066/159] Fix other copy-paste error --- .../src/containers/diseaseAnnotationsPage/NewAnnotationForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js index 72849a8d9..6b84df829 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js @@ -324,7 +324,7 @@ export const NewAnnotationForm = ({ const isExperimentEnabled = () => { return ( //only enabled if a reference is selected from suggestions and condition relation table isn't visible - typeof newAnnotation.singleReference === "diseaseAnnotationObject" + typeof newAnnotation.singleReference === "object" && newAnnotation.singleReference.curie !== "" && !showConditionRelations ) From da37450d1ec5b93c3e9e1674b4bb31a5c4614e3c Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 20 Feb 2024 18:14:11 +0000 Subject: [PATCH 067/159] Remove unnecessary injections --- .../alleleAssociations/AlleleGeneAssociationService.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java b/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java index abbadf283..36d0033f1 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java @@ -23,8 +23,6 @@ import org.alliancegenome.curation_api.model.ingest.dto.associations.alleleAssociations.AlleleGeneAssociationDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; -import org.alliancegenome.curation_api.services.AlleleService; -import org.alliancegenome.curation_api.services.GeneService; import org.alliancegenome.curation_api.services.PersonService; import org.alliancegenome.curation_api.services.base.BaseAssociationDTOCrudService; import org.alliancegenome.curation_api.services.validation.associations.alleleAssociations.AlleleGeneAssociationValidator; @@ -49,14 +47,10 @@ public class AlleleGeneAssociationService extends BaseAssociationDTOCrudService< @Inject AlleleDAO alleleDAO; @Inject - AlleleService alleleService; - @Inject NoteDAO noteDAO; @Inject GeneDAO geneDAO; @Inject - GeneService geneService; - @Inject PersonService personService; @Inject PersonDAO personDAO; From cc0623393aac0f002620b80267cbd26ea42dd71c Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 20 Feb 2024 18:53:05 +0000 Subject: [PATCH 068/159] Replace JPQL queries --- .../dao/AffectedGenomicModelDAO.java | 25 +++--- .../curation_api/dao/AlleleDAO.java | 39 +++++---- .../curation_api/dao/GeneDAO.java | 81 ++++++++++--------- .../curation_api/dao/VariantDAO.java | 15 ++-- 4 files changed, 86 insertions(+), 74 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/dao/AffectedGenomicModelDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/AffectedGenomicModelDAO.java index 86aaa016d..5186bce5c 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/AffectedGenomicModelDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/AffectedGenomicModelDAO.java @@ -1,34 +1,33 @@ package org.alliancegenome.curation_api.dao; -import java.math.BigInteger; -import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.alliancegenome.curation_api.dao.base.BaseSQLDAO; import org.alliancegenome.curation_api.model.entities.AffectedGenomicModel; import jakarta.enterprise.context.ApplicationScoped; -import jakarta.persistence.Query; +import jakarta.inject.Inject; @ApplicationScoped public class AffectedGenomicModelDAO extends BaseSQLDAO { + @Inject DiseaseAnnotationDAO diseaseAnnotationDAO; + @Inject AGMDiseaseAnnotationDAO agmDiseaseAnnotationDAO; + protected AffectedGenomicModelDAO() { super(AffectedGenomicModel.class); } public List findReferencingDiseaseAnnotations(Long agmId) { - List results = new ArrayList<>(); - - Query jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AGMDiseaseAnnotation ada WHERE ada.subjectBiologicalEntity.id = :agmId"); - jpqlQuery.setParameter("agmId", agmId); - for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) - results.add(nativeResult.longValue()); + Map params = new HashMap<>(); + params.put("diseaseAnnotationSubject.id", agmId); + List results = agmDiseaseAnnotationDAO.findFilteredIds(params); - jpqlQuery = entityManager.createNativeQuery("SELECT diseaseannotation_id FROM diseaseannotation_biologicalentity db WHERE diseasegeneticmodifiers_id = :agmId"); - jpqlQuery.setParameter("agmId", agmId); - for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) - results.add(nativeResult.longValue()); + Map dgmParams = new HashMap<>(); + dgmParams.put("diseaseGeneticModifiers.id", agmId); + results.addAll(diseaseAnnotationDAO.findFilteredIds(dgmParams)); return results; } diff --git a/src/main/java/org/alliancegenome/curation_api/dao/AlleleDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/AlleleDAO.java index 9a82f61a8..9a34b4995 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/AlleleDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/AlleleDAO.java @@ -1,38 +1,43 @@ package org.alliancegenome.curation_api.dao; -import java.math.BigInteger; -import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.alliancegenome.curation_api.dao.base.BaseSQLDAO; import org.alliancegenome.curation_api.model.entities.Allele; import jakarta.enterprise.context.ApplicationScoped; -import jakarta.persistence.Query; +import jakarta.inject.Inject; @ApplicationScoped public class AlleleDAO extends BaseSQLDAO { + @Inject DiseaseAnnotationDAO diseaseAnnotationDAO; + @Inject AlleleDiseaseAnnotationDAO alleleDiseaseAnnotationDAO; + @Inject AGMDiseaseAnnotationDAO agmDiseaseAnnotationDAO; + protected AlleleDAO() { super(Allele.class); } public List findReferencingDiseaseAnnotationIds(Long alleleId) { - List results = new ArrayList<>(); - Query jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AlleleDiseaseAnnotation ada WHERE ada.subjectBiologicalEntity.id = :alleleId"); - jpqlQuery.setParameter("alleleId", alleleId); - for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) - results.add(nativeResult.longValue()); - - jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AGMDiseaseAnnotation ada WHERE ada.inferredAllele.id = :alleleId OR ada.assertedAllele.id = :alleleId"); - jpqlQuery.setParameter("alleleId", alleleId); - for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) - results.add(nativeResult.longValue()); - jpqlQuery = entityManager.createNativeQuery("SELECT diseaseannotation_id FROM diseaseannotation_biologicalentity db WHERE diseasegeneticmodifiers_id = :alleleId"); - jpqlQuery.setParameter("alleleId", alleleId); - for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) - results.add(nativeResult.longValue()); + Map params = new HashMap<>(); + params.put("diseaseAnnotationSubject.id", alleleId); + List results = alleleDiseaseAnnotationDAO.findFilteredIds(params); + + Map aaParams = new HashMap<>(); + aaParams.put("assertedAllele.id", alleleId); + results.addAll(agmDiseaseAnnotationDAO.findFilteredIds(aaParams)); + + Map iaParams = new HashMap<>(); + iaParams.put("inferredAllele.id", alleleId); + results.addAll(agmDiseaseAnnotationDAO.findFilteredIds(iaParams)); + + Map dgmParams = new HashMap<>(); + dgmParams.put("diseaseGeneticModifiers.id", alleleId); + results.addAll(diseaseAnnotationDAO.findFilteredIds(dgmParams)); return results; } diff --git a/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java index b3268b9cb..f155f6f36 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java @@ -1,61 +1,70 @@ package org.alliancegenome.curation_api.dao; -import java.math.BigInteger; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.alliancegenome.curation_api.dao.base.BaseSQLDAO; +import org.alliancegenome.curation_api.dao.orthology.GeneToGeneOrthologyDAO; import org.alliancegenome.curation_api.model.entities.Gene; import jakarta.enterprise.context.ApplicationScoped; -import jakarta.persistence.Query; +import jakarta.inject.Inject; @ApplicationScoped public class GeneDAO extends BaseSQLDAO { + + @Inject DiseaseAnnotationDAO diseaseAnnotationDAO; + @Inject AlleleDiseaseAnnotationDAO alleleDiseaseAnnotationDAO; + @Inject AGMDiseaseAnnotationDAO agmDiseaseAnnotationDAO; + @Inject GeneDiseaseAnnotationDAO geneDiseaseAnnotationDAO; + @Inject GeneToGeneOrthologyDAO geneToGeneOrthologyDAO; protected GeneDAO() { super(Gene.class); } public List findReferencingDiseaseAnnotations(Long geneId) { - Query jpqlQuery = entityManager.createQuery("SELECT gda.id FROM GeneDiseaseAnnotation gda WHERE gda.subjectBiologicalEntity.id = :geneId"); - jpqlQuery.setParameter("geneId", geneId); - List results = (List) jpqlQuery.getResultList(); - - jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AGMDiseaseAnnotation ada WHERE ada.inferredGene.id = :geneId"); - jpqlQuery.setParameter("geneId", geneId); - results.addAll((List) jpqlQuery.getResultList()); - - jpqlQuery = entityManager.createQuery("SELECT ada.id FROM AlleleDiseaseAnnotation ada WHERE ada.inferredGene.id = :geneId"); - jpqlQuery.setParameter("geneId", geneId); - results.addAll((List) jpqlQuery.getResultList()); - - jpqlQuery = entityManager.createNativeQuery("SELECT diseaseannotation_id FROM diseaseannotation_gene gda WHERE with_id = :geneId"); - jpqlQuery.setParameter("geneId", geneId); - for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) - results.add(nativeResult.longValue()); - - jpqlQuery = entityManager.createNativeQuery("SELECT agmdiseaseannotation_id FROM agmdiseaseannotation_gene gda WHERE assertedgenes_id = :geneId"); - jpqlQuery.setParameter("geneId", geneId); - for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) - results.add(nativeResult.longValue()); - - jpqlQuery = entityManager.createNativeQuery("SELECT allelediseaseannotation_id FROM allelediseaseannotation_gene gda WHERE assertedgenes_id = :geneId"); - jpqlQuery.setParameter("geneId", geneId); - for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) - results.add(nativeResult.longValue()); + Map params = new HashMap<>(); + params.put("diseaseAnnotationSubject.id", geneId); + List results = geneDiseaseAnnotationDAO.findFilteredIds(params); + + Map dgmParams = new HashMap<>(); + dgmParams.put("diseaseGeneticModifiers.id", geneId); + results.addAll(diseaseAnnotationDAO.findFilteredIds(dgmParams)); + + Map agmAgParams = new HashMap<>(); + agmAgParams.put("assertedGenes.id", geneId); + results.addAll(agmDiseaseAnnotationDAO.findFilteredIds(agmAgParams)); - jpqlQuery = entityManager.createNativeQuery("SELECT diseaseannotation_id FROM diseaseannotation_biologicalentity db WHERE diseasegeneticmodifiers_id = :geneId"); - jpqlQuery.setParameter("geneId", geneId); - for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) - results.add(nativeResult.longValue()); + Map agmIgParams = new HashMap<>(); + agmIgParams.put("inferredGene.id", geneId); + results.addAll(agmDiseaseAnnotationDAO.findFilteredIds(agmIgParams)); + + Map alleleAgParams = new HashMap<>(); + alleleAgParams.put("assertedGenes.id", geneId); + results.addAll(alleleDiseaseAnnotationDAO.findFilteredIds(alleleAgParams)); + + Map alleleIgParams = new HashMap<>(); + alleleIgParams.put("inferredGene.id", geneId); + results.addAll(alleleDiseaseAnnotationDAO.findFilteredIds(alleleIgParams)); + + Map withParams = new HashMap<>(); + withParams.put("with.id", geneId); + results.addAll(diseaseAnnotationDAO.findFilteredIds(withParams)); return results; } public List findReferencingOrthologyPairs(Long geneId) { - Query jpqlQuery = entityManager.createQuery("SELECT o.id FROM GeneToGeneOrthology o WHERE o.subjectGene.id = :geneId OR o.objectGene.id = :geneId"); - jpqlQuery.setParameter("geneId", geneId); - return (List) jpqlQuery.getResultList(); + Map subjectParams = new HashMap<>(); + subjectParams.put("subjectGene.id", geneId); + List results = geneDiseaseAnnotationDAO.findFilteredIds(subjectParams); + + Map objectParams = new HashMap<>(); + objectParams.put("objectGene.id", geneId); + results.addAll(diseaseAnnotationDAO.findFilteredIds(objectParams)); + + return results; } - } diff --git a/src/main/java/org/alliancegenome/curation_api/dao/VariantDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/VariantDAO.java index 361ad1131..d86aa2e07 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/VariantDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/VariantDAO.java @@ -1,28 +1,27 @@ package org.alliancegenome.curation_api.dao; -import java.math.BigInteger; -import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import org.alliancegenome.curation_api.dao.base.BaseSQLDAO; import org.alliancegenome.curation_api.model.entities.Variant; import jakarta.enterprise.context.ApplicationScoped; -import jakarta.persistence.Query; +import jakarta.inject.Inject; @ApplicationScoped public class VariantDAO extends BaseSQLDAO { + @Inject DiseaseAnnotationDAO diseaseAnnotationDAO; protected VariantDAO() { super(Variant.class); } public List findReferencingDiseaseAnnotationIds(Long variantId) { - List results = new ArrayList<>(); - Query jpqlQuery = entityManager.createNativeQuery("SELECT diseaseannotation_id FROM diseaseannotation_biologicalentity db WHERE diseasegeneticmodifiers_id = :variantId"); - jpqlQuery.setParameter("variantId", variantId); - for(BigInteger nativeResult : (List) jpqlQuery.getResultList()) - results.add(nativeResult.longValue()); + Map dgmParams = new HashMap<>(); + dgmParams.put("diseaseGeneticModifiers.id", variantId); + Listresults = diseaseAnnotationDAO.findFilteredIds(dgmParams); return results; } From 81f97638342b4c723bab991ee8e6057471726021 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 20 Feb 2024 18:59:32 +0000 Subject: [PATCH 069/159] Update migration --- .../resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql b/src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql index 5726245ec..e0b6ecf37 100644 --- a/src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql +++ b/src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql @@ -17,8 +17,6 @@ ALTER TABLE agmdiseaseannotation DROP COLUMN IF EXISTS predicate; ALTER TABLE allelediseaseannotation DROP COLUMN IF EXISTS predicate; ALTER TABLE genediseaseannotation DROP COLUMN IF EXISTS predicate; -ALTER TABLE synonym ALTER COLUMN name SET DATA TYPE text; - -- Drop audit tables SET session_replication_role = 'replica'; From fffe0c570c2f44e9a6faa3e053ed099e3f4c15df Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 20 Feb 2024 21:44:04 +0000 Subject: [PATCH 070/159] Update EntityFieldConstants --- .../curation_api/constants/EntityFieldConstants.java | 9 +++++---- .../curation_api/services/DiseaseAnnotationService.java | 4 ++-- .../alleleAssociations/AlleleGeneAssociationService.java | 2 +- .../ConstructGenomicEntityAssociationService.java | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/constants/EntityFieldConstants.java b/src/main/java/org/alliancegenome/curation_api/constants/EntityFieldConstants.java index 0e25ec907..402678c24 100644 --- a/src/main/java/org/alliancegenome/curation_api/constants/EntityFieldConstants.java +++ b/src/main/java/org/alliancegenome/curation_api/constants/EntityFieldConstants.java @@ -2,11 +2,12 @@ public final class EntityFieldConstants { + public static final String TAXON = "taxon.curie"; public static final String DATA_PROVIDER = "dataProvider.sourceOrganization.abbreviation"; public static final String SECONDARY_DATA_PROVIDER = "secondaryDataProvider.sourceOrganization.abbreviation"; - public static final String SUBJECT_BIOLOGICAL_ENTITY_DATA_PROVIDER = "subjectBiologicalEntity." + DATA_PROVIDER; - public static final String SUBJECT_REAGENT_DATA_PROVIDER = "subjectReagent." + DATA_PROVIDER; - public static final String SUBJECT_BIOLOGICAL_ENTITY_TAXON = "subjectBiologicalEntity.taxon.curie"; - public static final String TAXON = "taxon.curie"; + public static final String DA_SUBJECT = "diseaseAnnotationSubject"; + public static final String DA_SUBJECT_TAXON = DA_SUBJECT+ "." + TAXON; + public static final String ALLELE_ASSOCIATION_SUBJECT_DATA_PROVIDER = "alleleAssociationSubject." + DATA_PROVIDER; + public static final String CONSTRUCT_ASSOCIATION_SUBJECT_DATA_PROVIDER = "constructAssociationSubject." + DATA_PROVIDER; } \ No newline at end of file diff --git a/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java index a9aa8378f..98db96677 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java @@ -141,7 +141,7 @@ protected > List getAnnotationIdsByDataProvider(D params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider.sourceOrganization); if(StringUtils.equals(dataProvider.sourceOrganization, "RGD")) - params.put(EntityFieldConstants.SUBJECT_BIOLOGICAL_ENTITY_TAXON, dataProvider.canonicalTaxonCurie); + params.put(EntityFieldConstants.DA_SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); List annotationIds = dao.findFilteredIds(params); annotationIds.removeIf(Objects::isNull); @@ -149,7 +149,7 @@ protected > List getAnnotationIdsByDataProvider(D if (StringUtils.equals(dataProvider.toString(), "HUMAN")) { Map newParams = new HashMap<>(); newParams.put(EntityFieldConstants.SECONDARY_DATA_PROVIDER, dataProvider.sourceOrganization); - newParams.put(EntityFieldConstants.SUBJECT_BIOLOGICAL_ENTITY_TAXON, dataProvider.canonicalTaxonCurie); + newParams.put(EntityFieldConstants.DA_SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); List additionalIds = dao.findFilteredIds(newParams); annotationIds.addAll(additionalIds); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java b/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java index 36d0033f1..6e837d0f3 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/associations/alleleAssociations/AlleleGeneAssociationService.java @@ -90,7 +90,7 @@ public AlleleGeneAssociation upsert(AlleleGeneAssociationDTO dto, BackendBulkDat public List getAssociationsByDataProvider(BackendBulkDataProvider dataProvider) { Map params = new HashMap<>(); - params.put(EntityFieldConstants.SUBJECT_BIOLOGICAL_ENTITY_DATA_PROVIDER, dataProvider.sourceOrganization); + params.put(EntityFieldConstants.ALLELE_ASSOCIATION_SUBJECT_DATA_PROVIDER, dataProvider.sourceOrganization); List associationIds = alleleGeneAssociationDAO.findFilteredIds(params); associationIds.removeIf(Objects::isNull); diff --git a/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java b/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java index 99e375377..65187c78f 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/associations/constructAssociations/ConstructGenomicEntityAssociationService.java @@ -87,7 +87,7 @@ public ConstructGenomicEntityAssociation upsert(ConstructGenomicEntityAssociatio public List getAssociationsByDataProvider(BackendBulkDataProvider dataProvider) { Map params = new HashMap<>(); - params.put(EntityFieldConstants.SUBJECT_REAGENT_DATA_PROVIDER, dataProvider.sourceOrganization); + params.put(EntityFieldConstants.CONSTRUCT_ASSOCIATION_SUBJECT_DATA_PROVIDER, dataProvider.sourceOrganization); List associationIds = constructGenomicEntityAssociationDAO.findFilteredIds(params); associationIds.removeIf(Objects::isNull); From f3984559675c6c82993d7c92e7d9641f326a76d1 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Wed, 21 Feb 2024 10:02:30 +0000 Subject: [PATCH 071/159] Fix DAO --- .../java/org/alliancegenome/curation_api/dao/GeneDAO.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java index f155f6f36..62d8df5c9 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/GeneDAO.java @@ -59,11 +59,11 @@ public List findReferencingDiseaseAnnotations(Long geneId) { public List findReferencingOrthologyPairs(Long geneId) { Map subjectParams = new HashMap<>(); subjectParams.put("subjectGene.id", geneId); - List results = geneDiseaseAnnotationDAO.findFilteredIds(subjectParams); + List results = geneToGeneOrthologyDAO.findFilteredIds(subjectParams); Map objectParams = new HashMap<>(); objectParams.put("objectGene.id", geneId); - results.addAll(diseaseAnnotationDAO.findFilteredIds(objectParams)); + results.addAll(geneToGeneOrthologyDAO.findFilteredIds(objectParams)); return results; } From facffad99cd952a91280c623c77acefed8274e07 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Wed, 21 Feb 2024 11:19:09 +0000 Subject: [PATCH 072/159] Remove set_session_replicate_role statements --- .../resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql b/src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql index e0b6ecf37..ab8ad2036 100644 --- a/src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql +++ b/src/main/resources/db/migration/v0.31.0.1__linkml_v2.1.0_update.sql @@ -18,7 +18,6 @@ ALTER TABLE allelediseaseannotation DROP COLUMN IF EXISTS predicate; ALTER TABLE genediseaseannotation DROP COLUMN IF EXISTS predicate; -- Drop audit tables -SET session_replication_role = 'replica'; DROP TABLE affectedgenomicmodel_aud; DROP TABLE agmdiseaseannotation_aud; @@ -908,8 +907,6 @@ ALTER TABLE zecoterm DROP COLUMN curie; ALTER TABLE zfaterm DROP COLUMN curie; ALTER TABLE zfsterm DROP COLUMN curie; -SET session_replication_role = 'origin'; - -- Add constraints and indexes CREATE INDEX experimentalcondition_createdby_index ON experimentalcondition USING btree (createdby_id); From 83b390d96a5591699424c2f1f637b62a3b2170ac Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Wed, 21 Feb 2024 21:18:24 +0000 Subject: [PATCH 073/159] DTO classes and start of executor --- .../enums/BackendBulkLoadType.java | 1 + .../jobs/executors/BulkLoadJobExecutor.java | 3 + .../PhenotypeAnnotationExecutor.java | 71 +++++++++++++++++++ .../dto/fms/ConditionRelationFmsDTO.java | 18 +++++ .../model/ingest/dto/fms/EvidenceFmsDTO.java | 1 + .../dto/fms/ExperimentalConditionFmsDTO.java | 29 ++++++++ .../model/ingest/dto/fms/PhenotypeFmsDTO.java | 31 ++++++++ .../ingest/dto/fms/PhenotypeIngestFmsDTO.java | 16 +++++ .../fms/PhenotypeTermIdentifierFmsDTO.java | 16 +++++ .../ingest/dto/fms/PublicationFmsDTO.java | 1 + .../ingest/dto/fms/PublicationRefFmsDTO.java | 15 ++++ 11 files changed, 202 insertions(+) create mode 100644 src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java create mode 100644 src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/ConditionRelationFmsDTO.java create mode 100644 src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/ExperimentalConditionFmsDTO.java create mode 100644 src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PhenotypeFmsDTO.java create mode 100644 src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PhenotypeIngestFmsDTO.java create mode 100644 src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PhenotypeTermIdentifierFmsDTO.java create mode 100644 src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PublicationRefFmsDTO.java diff --git a/src/main/java/org/alliancegenome/curation_api/enums/BackendBulkLoadType.java b/src/main/java/org/alliancegenome/curation_api/enums/BackendBulkLoadType.java index b40b4c98c..72030a2be 100644 --- a/src/main/java/org/alliancegenome/curation_api/enums/BackendBulkLoadType.java +++ b/src/main/java/org/alliancegenome/curation_api/enums/BackendBulkLoadType.java @@ -10,6 +10,7 @@ public enum BackendBulkLoadType { ALLELE_DISEASE_ANNOTATION("json"), GENE_DISEASE_ANNOTATION("json"), ONTOLOGY("owl"), + PHENOTYPE_ANNOTATION("json"), MOLECULE("json"), FULL_INGEST("json"), RESOURCE_DESCRIPTOR("yaml"), diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/BulkLoadJobExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/BulkLoadJobExecutor.java index 91a61ef51..a3f82f25b 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/BulkLoadJobExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/BulkLoadJobExecutor.java @@ -45,6 +45,7 @@ public class BulkLoadJobExecutor { @Inject VariantExecutor variantExecutor; @Inject AlleleGeneAssociationExecutor alleleGeneAssociationExecutor; @Inject ConstructGenomicEntityAssociationExecutor constructGenomicEntityAssociationExecutor; + @Inject PhenotypeAnnotationExecutor phenotypeAnnotationExecutor; public void process(BulkLoadFile bulkLoadFile, Boolean cleanUp) throws Exception { @@ -90,6 +91,8 @@ public void process(BulkLoadFile bulkLoadFile, Boolean cleanUp) throws Exception } else if (bulkLoadFile.getBulkLoad().getBackendBulkLoadType() == BackendBulkLoadType.MOLECULE) { moleculeExecutor.runLoad(bulkLoadFile); + } else if (bulkLoadFile.getBulkLoad().getBackendBulkLoadType() == BackendBulkLoadType.PHENOTYPE_ANNOTATION) { + phenotypeAnnotationExecutor.runLoad(bulkLoadFile); } else if (bulkLoadFile.getBulkLoad().getBackendBulkLoadType() == BackendBulkLoadType.ORTHOLOGY) { orthologyExecutor.runLoad(bulkLoadFile); } else if (bulkLoadFile.getBulkLoad().getBackendBulkLoadType() == BackendBulkLoadType.ONTOLOGY) { diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java new file mode 100644 index 000000000..8bc570af4 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java @@ -0,0 +1,71 @@ +package org.alliancegenome.curation_api.jobs.executors; + +import java.io.FileInputStream; +import java.util.zip.GZIPInputStream; + +import org.alliancegenome.curation_api.exceptions.ObjectUpdateException; +import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; +import org.alliancegenome.curation_api.model.entities.Molecule; +import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFile; +import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFileHistory; +import org.alliancegenome.curation_api.model.ingest.dto.fms.MoleculeFmsDTO; +import org.alliancegenome.curation_api.model.ingest.dto.fms.MoleculeIngestFmsDTO; +import org.alliancegenome.curation_api.services.MoleculeService; +import org.alliancegenome.curation_api.util.ProcessDisplayHelper; +import org.apache.commons.lang3.StringUtils; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; + +@ApplicationScoped +public class PhenotypeAnnotationExecutor extends LoadFileExecutor { + + @Inject + PhenotypeAnnotationService phenotypeAnnotationService; + + public void runLoad(BulkLoadFile bulkLoadFile) { + try { + MoleculeIngestFmsDTO moleculeData = mapper.readValue(new GZIPInputStream(new FileInputStream(bulkLoadFile.getLocalFilePath())), MoleculeIngestFmsDTO.class); + bulkLoadFile.setRecordCount(moleculeData.getData().size()); + if (bulkLoadFile.getLinkMLSchemaVersion() == null) { + AGRCurationSchemaVersion version = Molecule.class.getAnnotation(AGRCurationSchemaVersion.class); + bulkLoadFile.setLinkMLSchemaVersion(version.max()); + } + if (moleculeData.getMetaData() != null && StringUtils.isNotBlank(moleculeData.getMetaData().getRelease())) + bulkLoadFile.setAllianceMemberReleaseVersion(moleculeData.getMetaData().getRelease()); + bulkLoadFileDAO.merge(bulkLoadFile); + + BulkLoadFileHistory history = new BulkLoadFileHistory(moleculeData.getData().size()); + + runLoad(history, moleculeData); + + history.finishLoad(); + + trackHistory(history, bulkLoadFile); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + // Gets called from the API directly + public void runLoad(BulkLoadFileHistory history, MoleculeIngestFmsDTO moleculeData) { + ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); + ph.addDisplayHandler(loadProcessDisplayService); + ph.startProcess("Molecule DTO Update", moleculeData.getData().size()); + + for (MoleculeFmsDTO molecule : moleculeData.getData()) { + try { + moleculeService.processUpdate(molecule); + history.incrementCompleted(); + } catch (ObjectUpdateException e) { + history.incrementFailed(); + addException(history, e.getData()); + } + ph.progressProcess(); + } + ph.finishProcess(); + + } + +} diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/ConditionRelationFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/ConditionRelationFmsDTO.java new file mode 100644 index 000000000..624bdde84 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/ConditionRelationFmsDTO.java @@ -0,0 +1,18 @@ +package org.alliancegenome.curation_api.model.ingest.dto.fms; + +import java.util.List; + +import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +public class ConditionRelationFmsDTO extends BaseDTO { + + private String conditionRelationType; + + private List conditions; + +} diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/EvidenceFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/EvidenceFmsDTO.java index 1e6789405..a932a86c7 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/EvidenceFmsDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/EvidenceFmsDTO.java @@ -12,6 +12,7 @@ public class EvidenceFmsDTO extends BaseDTO { private PublicationFmsDTO publication; + private List evidenceCodes; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/ExperimentalConditionFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/ExperimentalConditionFmsDTO.java new file mode 100644 index 000000000..bd96e313c --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/ExperimentalConditionFmsDTO.java @@ -0,0 +1,29 @@ +package org.alliancegenome.curation_api.model.ingest.dto.fms; + +import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +public class ExperimentalConditionFmsDTO extends BaseDTO { + + private String conditionClassId; + + private String conditionStatement; + + private String conditionQuantity; + + private String anatomicalOntologyId; + + private String geneOntologyId; + + @JsonProperty("NCBITaxonID") + private String ncbiTaxonId; + + private String chemicalOntologyId; + +} diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PhenotypeFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PhenotypeFmsDTO.java new file mode 100644 index 000000000..804e5a6a7 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PhenotypeFmsDTO.java @@ -0,0 +1,31 @@ +package org.alliancegenome.curation_api.model.ingest.dto.fms; + +import java.util.List; + +import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +public class PhenotypeFmsDTO extends BaseDTO { + + private String objectId; + + @JsonProperty("primaryGeneticEntityIDs") + private List primaryGeneticEntityIds; + + private List phenotypeTermIdentifiers; + + private String phenotypeStatement; + + private PublicationRefFmsDTO evidence; + + private String dateAssigned; + + private List conditionRelations; + +} diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PhenotypeIngestFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PhenotypeIngestFmsDTO.java new file mode 100644 index 000000000..c96bcd346 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PhenotypeIngestFmsDTO.java @@ -0,0 +1,16 @@ +package org.alliancegenome.curation_api.model.ingest.dto.fms; + +import java.util.List; + +import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +public class PhenotypeIngestFmsDTO extends BaseDTO { + + private MetaDataFmsDTO metaData; + private List data; +} diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PhenotypeTermIdentifierFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PhenotypeTermIdentifierFmsDTO.java new file mode 100644 index 000000000..1abe2ea1a --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PhenotypeTermIdentifierFmsDTO.java @@ -0,0 +1,16 @@ +package org.alliancegenome.curation_api.model.ingest.dto.fms; + +import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +public class PhenotypeTermIdentifierFmsDTO extends BaseDTO { + + private String termId; + + private Integer termOrder; + +} diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PublicationFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PublicationFmsDTO.java index 295145904..0e9d3c861 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PublicationFmsDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PublicationFmsDTO.java @@ -10,6 +10,7 @@ public class PublicationFmsDTO extends BaseDTO { private String publicationId; + private CrossReferenceFmsDTO crossReference; } diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PublicationRefFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PublicationRefFmsDTO.java new file mode 100644 index 000000000..c2eeedf45 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/PublicationRefFmsDTO.java @@ -0,0 +1,15 @@ +package org.alliancegenome.curation_api.model.ingest.dto.fms; + +import org.alliancegenome.curation_api.model.ingest.dto.base.BaseDTO; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Data +@EqualsAndHashCode(callSuper = true) +public class PublicationRefFmsDTO extends BaseDTO { + + private String publicationId; + + private CrossReferenceFmsDTO crossReference; +} From 315653253ac484f9f807d7716f30c53875a6d513 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Wed, 21 Feb 2024 16:24:04 -0500 Subject: [PATCH 074/159] Updated refresh interval to only be set while indexing --- .../curation_api/dao/base/BaseSQLDAO.java | 10 ++++++---- src/main/resources/hibernate/dev-index-settings.json | 1 - .../resources/hibernate/production-index-settings.json | 1 - src/main/resources/hibernate/test-index-settings.json | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java index fe8f5bf8d..8d8e19004 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java @@ -273,7 +273,7 @@ public void documentsBuilt(long increment) { public void indexingCompleted() { ph.finishProcess(); - setRefreshInterval(); + setRefreshInterval("1s"); } }); @@ -281,6 +281,7 @@ public void indexingCompleted() { if (limitIndexedObjectsTo > 0) { indexer.limitIndexedObjectsTo(limitIndexedObjectsTo); } + setRefreshInterval("-1"); indexer.start(); } @@ -311,7 +312,7 @@ public void documentsBuilt(long increment) { @Override public void indexingCompleted() { ph.finishProcess(); - setRefreshInterval(); + setRefreshInterval("1s"); } }); @@ -320,15 +321,16 @@ public void indexingCompleted() { if (limitIndexedObjectsTo > 0) { indexer.limitIndexedObjectsTo(limitIndexedObjectsTo); } + setRefreshInterval("-1"); indexer.start(); } - public void setRefreshInterval() { + public void setRefreshInterval(String value) { RestHighLevelClient client = EsClientFactory.createClient(esHosts, esProtocol); Log.info("Creating Settings Search Client: " + esProtocol + "://" + esHosts); Map settings = new HashMap<>(); - settings.put("refresh_interval", "1s"); + settings.put("refresh_interval", value); Log.info("Setting Refresh Interval: " + settings); UpdateSettingsRequest request = new UpdateSettingsRequest(); request.indices("_all"); diff --git a/src/main/resources/hibernate/dev-index-settings.json b/src/main/resources/hibernate/dev-index-settings.json index 99229f7d6..35f49b81c 100644 --- a/src/main/resources/hibernate/dev-index-settings.json +++ b/src/main/resources/hibernate/dev-index-settings.json @@ -2,7 +2,6 @@ "number_of_shards": "1", "number_of_replicas": "0", "max_ngram_diff": "32", - "refresh_interval" : "-1", "max_result_window": 5000000, "mapping.total_fields.limit": 2000, "translog.sync_interval": "600s", diff --git a/src/main/resources/hibernate/production-index-settings.json b/src/main/resources/hibernate/production-index-settings.json index 1e30d7f6d..12c898234 100644 --- a/src/main/resources/hibernate/production-index-settings.json +++ b/src/main/resources/hibernate/production-index-settings.json @@ -2,7 +2,6 @@ "number_of_shards": "8", "number_of_replicas": "0", "max_ngram_diff": "32", - "refresh_interval" : "-1", "max_result_window": 5000000, "translog.sync_interval": "600s", "translog.flush_threshold_size": "4096mb", diff --git a/src/main/resources/hibernate/test-index-settings.json b/src/main/resources/hibernate/test-index-settings.json index 99229f7d6..35f49b81c 100644 --- a/src/main/resources/hibernate/test-index-settings.json +++ b/src/main/resources/hibernate/test-index-settings.json @@ -2,7 +2,6 @@ "number_of_shards": "1", "number_of_replicas": "0", "max_ngram_diff": "32", - "refresh_interval" : "-1", "max_result_window": 5000000, "mapping.total_fields.limit": 2000, "translog.sync_interval": "600s", From cef990017f088a8fe355d4a08b420de46681d7a5 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Wed, 21 Feb 2024 16:26:02 -0500 Subject: [PATCH 075/159] Forgot this fix --- .../curation_api/controllers/SystemController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/SystemController.java b/src/main/java/org/alliancegenome/curation_api/controllers/SystemController.java index 76dbd51c2..538b5d849 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/SystemController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/SystemController.java @@ -42,7 +42,7 @@ public void updateDiseaseAnnotationUniqueIds() { @Override public void updateRefreshIntervalOnAllIndexes() { - systemSQLDAO.setRefreshInterval(); + systemSQLDAO.setRefreshInterval("1s"); } @Override From 18c605b03f0816678cc40cbe5877d321ee895eec Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Wed, 21 Feb 2024 22:07:02 +0000 Subject: [PATCH 076/159] UI fixes --- src/main/cliapp/src/components/Editors/GeneEditor.js | 8 ++++---- .../src/containers/allelesPage/AlleleDetailPage.js | 2 +- .../AlleleGeneAssociationsFormTable.js | 9 +++++---- src/main/cliapp/src/containers/allelesPage/utils.js | 2 +- .../cliapp/src/containers/variantsPage/VariantsTable.js | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/cliapp/src/components/Editors/GeneEditor.js b/src/main/cliapp/src/components/Editors/GeneEditor.js index 457ae1d81..1b0b9ae5b 100644 --- a/src/main/cliapp/src/components/Editors/GeneEditor.js +++ b/src/main/cliapp/src/components/Editors/GeneEditor.js @@ -20,14 +20,14 @@ const geneSearch = (event, setFiltered, setInputValue) => { autocompleteSearch(searchService, endpoint, filterName, filter, setFiltered); }; -export const GeneEditor = ({ props, errorMessages, onChange, dataKey }) => { +export const GeneEditor = ({ props, errorMessages, onChange, dataKey, fieldName }) => { return ( <> } @@ -35,7 +35,7 @@ export const GeneEditor = ({ props, errorMessages, onChange, dataKey }) => { /> ); diff --git a/src/main/cliapp/src/containers/allelesPage/AlleleDetailPage.js b/src/main/cliapp/src/containers/allelesPage/AlleleDetailPage.js index f33e003c7..9a74405d2 100644 --- a/src/main/cliapp/src/containers/allelesPage/AlleleDetailPage.js +++ b/src/main/cliapp/src/containers/allelesPage/AlleleDetailPage.js @@ -74,7 +74,7 @@ export default function AlleleDetailPage() { alleleState.entityStates.alleleGeneAssociations.errorMessages, alleleDispatch, "alleleGeneAssociations", - "object", + "alleleGeneAssociationObject", ); diff --git a/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js b/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js index 3730637ef..71c4e8d04 100644 --- a/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js +++ b/src/main/cliapp/src/containers/allelesPage/alleleGeneAssociations/AlleleGeneAssociationsFormTable.js @@ -28,7 +28,7 @@ export const AlleleGeneAssociationsFormTable = ({ const [first, setFirst] = useState(0); const [filters, setFilters] = useState({ "relation.name": { value: null, matchMode: "in" }, - "objectBiologicalEntity.modEntityId": { value: null, matchMode: "contains" }, + "alleleGeneAssociationObject.modEntityId": { value: null, matchMode: "contains" }, "relatedNote.freeText": { value: null, matchMode: "contains" }, "evidenceCode.curie": { value: null, matchMode: "contains" }, "evidenceCurieSearchFilter": { value: null, matchMode: "contains" }, @@ -90,19 +90,20 @@ export const AlleleGeneAssociationsFormTable = ({ { return ; }} - field="objectBiologicalEntity.modEntityId" + field="alleleGeneAssociationObject" header="Gene" headerClassName='surface-0' filter sortable - filterField="objectBiologicalEntity.modEntityId" - sortField="objectBiologicalEntity.modEntityId" + filterField="alleleGeneAssociationObject.modEntityId" + sortField="alleleGeneAssociationObject.modEntityId" showFilterMenu={false} /> { Date: Thu, 22 Feb 2024 09:31:30 -0500 Subject: [PATCH 077/159] Remove refresh interval altogether --- .../controllers/SystemController.java | 5 ---- .../curation_api/dao/base/BaseSQLDAO.java | 28 ------------------- .../interfaces/SystemControllerInterface.java | 6 +--- 3 files changed, 1 insertion(+), 38 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/SystemController.java b/src/main/java/org/alliancegenome/curation_api/controllers/SystemController.java index 538b5d849..7c91df7a3 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/SystemController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/SystemController.java @@ -40,11 +40,6 @@ public void updateDiseaseAnnotationUniqueIds() { diseaseAnnotationService.updateUniqueIds(); } - @Override - public void updateRefreshIntervalOnAllIndexes() { - systemSQLDAO.setRefreshInterval("1s"); - } - @Override public void deleteUnusedConditionsAndExperiments() { List inUseCrIds = diseaseAnnotationService.getAllReferencedConditionRelationIds(); diff --git a/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java index 8d8e19004..0c3d69e0f 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java @@ -2,7 +2,6 @@ import static org.reflections.scanners.Scanners.TypesAnnotated; -import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -16,13 +15,8 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.processing.IndexProcessDisplayService; -import org.alliancegenome.curation_api.util.EsClientFactory; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; import org.eclipse.microprofile.config.inject.ConfigProperty; -import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest; -import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.client.RequestOptions; -import org.elasticsearch.client.RestHighLevelClient; import org.hibernate.exception.ConstraintViolationException; import org.hibernate.query.sqm.internal.QuerySqmImpl; import org.hibernate.query.sqm.tree.domain.SqmPluralValuedSimplePath; @@ -273,7 +267,6 @@ public void documentsBuilt(long increment) { public void indexingCompleted() { ph.finishProcess(); - setRefreshInterval("1s"); } }); @@ -281,7 +274,6 @@ public void indexingCompleted() { if (limitIndexedObjectsTo > 0) { indexer.limitIndexedObjectsTo(limitIndexedObjectsTo); } - setRefreshInterval("-1"); indexer.start(); } @@ -312,7 +304,6 @@ public void documentsBuilt(long increment) { @Override public void indexingCompleted() { ph.finishProcess(); - setRefreshInterval("1s"); } }); @@ -321,28 +312,9 @@ public void indexingCompleted() { if (limitIndexedObjectsTo > 0) { indexer.limitIndexedObjectsTo(limitIndexedObjectsTo); } - setRefreshInterval("-1"); indexer.start(); } - public void setRefreshInterval(String value) { - RestHighLevelClient client = EsClientFactory.createClient(esHosts, esProtocol); - Log.info("Creating Settings Search Client: " + esProtocol + "://" + esHosts); - - Map settings = new HashMap<>(); - settings.put("refresh_interval", value); - Log.info("Setting Refresh Interval: " + settings); - UpdateSettingsRequest request = new UpdateSettingsRequest(); - request.indices("_all"); - request.settings(settings); - try { - AcknowledgedResponse resp = client.indices().putSettings(request, RequestOptions.DEFAULT); - Log.info("Settings Change Complete: " + resp.isAcknowledged()); - } catch (IOException e) { - e.printStackTrace(); - } - } - public SearchResponse searchAll(Pagination pagination) { return searchByParams(pagination, null); } diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/SystemControllerInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/SystemControllerInterface.java index 537d86709..b4e95781e 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/SystemControllerInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/SystemControllerInterface.java @@ -37,11 +37,7 @@ public void reindexEverything( @GET @Path("/updatedauniqueids") public void updateDiseaseAnnotationUniqueIds(); - - @GET - @Path("/updaterefreshindex") - public void updateRefreshIntervalOnAllIndexes(); - + @DELETE @Path("/deletedUnusedConditionsAndExperiments") public void deleteUnusedConditionsAndExperiments(); From 82f9e855165aa237b289c616f3d68e049b1991ba Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 22 Feb 2024 16:17:26 +0000 Subject: [PATCH 078/159] Use curies to validate OntologyTerm entries coming from UI --- .../validation/BiologicalEntityValidator.java | 22 +-- .../DiseaseAnnotationValidator.java | 22 +-- .../ExperimentalConditionValidator.java | 131 +++++++++--------- .../services/validation/GeneValidator.java | 22 +-- .../services/validation/VariantValidator.java | 39 +++--- ...nctionalImpactSlotAnnotationValidator.java | 22 +-- ...nheritanceModeSlotAnnotationValidator.java | 22 +-- 7 files changed, 149 insertions(+), 131 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/BiologicalEntityValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/BiologicalEntityValidator.java index fff926af5..5fb44be44 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/BiologicalEntityValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/BiologicalEntityValidator.java @@ -5,6 +5,7 @@ import org.alliancegenome.curation_api.model.entities.ontology.NCBITaxonTerm; import org.alliancegenome.curation_api.services.ontology.NcbiTaxonTermService; import org.alliancegenome.curation_api.services.validation.base.SubmittedObjectValidator; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import jakarta.inject.Inject; @@ -26,20 +27,23 @@ public E validateBiologicalEntityFields(E uiEntity, E dbEntity) { public NCBITaxonTerm validateTaxon(E uiEntity, E dbEntity) { String field = "taxon"; - if (uiEntity.getTaxon() == null || StringUtils.isBlank(uiEntity.getTaxon().getCurie())) { + if (ObjectUtils.isEmpty(uiEntity.getTaxon())) { addMessageResponse(field, ValidationConstants.REQUIRED_MESSAGE); return null; } - NCBITaxonTerm taxon = ncbiTaxonTermService.get(uiEntity.getTaxon().getCurie()).getEntity(); - if (taxon == null) { - addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); - return null; - } + NCBITaxonTerm taxon = null; + if (StringUtils.isNotBlank(uiEntity.getTaxon().getCurie())) { + taxon = ncbiTaxonTermService.findByCurie(uiEntity.getTaxon().getCurie()); + if (taxon == null) { + addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); + return null; + } - if (taxon.getObsolete() && (dbEntity.getTaxon() == null || !taxon.getCurie().equals(dbEntity.getTaxon().getCurie()))) { - addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); - return null; + if (taxon.getObsolete() && (dbEntity.getTaxon() == null || !taxon.getCurie().equals(dbEntity.getTaxon().getCurie()))) { + addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); + return null; + } } return taxon; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java index dce899783..82217026e 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java @@ -10,7 +10,6 @@ import org.alliancegenome.curation_api.dao.BiologicalEntityDAO; import org.alliancegenome.curation_api.dao.DiseaseAnnotationDAO; import org.alliancegenome.curation_api.dao.GeneDAO; -import org.alliancegenome.curation_api.dao.ontology.DoTermDAO; import org.alliancegenome.curation_api.dao.ontology.EcoTermDAO; import org.alliancegenome.curation_api.model.entities.BiologicalEntity; import org.alliancegenome.curation_api.model.entities.DataProvider; @@ -24,8 +23,10 @@ import org.alliancegenome.curation_api.services.DataProviderService; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.ontology.DoTermService; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; import jakarta.inject.Inject; @@ -34,7 +35,7 @@ public class DiseaseAnnotationValidator extends AnnotationValidator { @Inject EcoTermDAO ecoTermDAO; @Inject - DoTermDAO doTermDAO; + DoTermService doTermService; @Inject GeneDAO geneDAO; @Inject @@ -56,14 +57,15 @@ public DOTerm validateObjectOntologyTerm(DiseaseAnnotation uiEntity, DiseaseAnno } DOTerm diseaseTerm = null; - if (uiEntity.getDiseaseAnnotationObject().getId() != null) - diseaseTerm = doTermDAO.find(uiEntity.getDiseaseAnnotationObject().getId()); - if (diseaseTerm == null) { - addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); - return null; - } else if (diseaseTerm.getObsolete() && (dbEntity.getDiseaseAnnotationObject() == null || !diseaseTerm.getId().equals(dbEntity.getDiseaseAnnotationObject().getId()))) { - addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); - return null; + if (StringUtils.isNotBlank(uiEntity.getDiseaseAnnotationObject().getCurie())) { + diseaseTerm = doTermService.findByCurie(uiEntity.getDiseaseAnnotationObject().getCurie()); + if (diseaseTerm == null) { + addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); + return null; + } else if (diseaseTerm.getObsolete() && (dbEntity.getDiseaseAnnotationObject() == null || !diseaseTerm.getId().equals(dbEntity.getDiseaseAnnotationObject().getId()))) { + addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); + return null; + } } return diseaseTerm; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java index 8b3b6f8b0..3ed10cfca 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java @@ -3,12 +3,6 @@ import org.alliancegenome.curation_api.constants.OntologyConstants; import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.dao.ExperimentalConditionDAO; -import org.alliancegenome.curation_api.dao.ontology.AnatomicalTermDAO; -import org.alliancegenome.curation_api.dao.ontology.ChemicalTermDAO; -import org.alliancegenome.curation_api.dao.ontology.ExperimentalConditionOntologyTermDAO; -import org.alliancegenome.curation_api.dao.ontology.GoTermDAO; -import org.alliancegenome.curation_api.dao.ontology.NcbiTaxonTermDAO; -import org.alliancegenome.curation_api.dao.ontology.ZecoTermDAO; import org.alliancegenome.curation_api.exceptions.ApiErrorException; import org.alliancegenome.curation_api.model.entities.ExperimentalCondition; import org.alliancegenome.curation_api.model.entities.ontology.AnatomicalTerm; @@ -21,9 +15,15 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.ExperimentalConditionSummary; +import org.alliancegenome.curation_api.services.ontology.AnatomicalTermService; +import org.alliancegenome.curation_api.services.ontology.ChemicalTermService; +import org.alliancegenome.curation_api.services.ontology.ExperimentalConditionOntologyTermService; +import org.alliancegenome.curation_api.services.ontology.GoTermService; import org.alliancegenome.curation_api.services.ontology.NcbiTaxonTermService; +import org.alliancegenome.curation_api.services.ontology.ZecoTermService; import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -34,17 +34,15 @@ public class ExperimentalConditionValidator extends AuditedObjectValidator { @Inject GeneDAO geneDAO; @Inject - SoTermDAO soTermDAO; + SoTermService soTermService; @Inject GeneSymbolSlotAnnotationValidator geneSymbolValidator; @Inject @@ -139,14 +140,15 @@ private SOTerm validateGeneType(Gene uiEntity, Gene dbEntity) { return null; SOTerm soTerm = null; - if (uiEntity.getGeneType().getId() != null) - soTerm = soTermDAO.find(uiEntity.getGeneType().getId()); - if (soTerm == null) { - addMessageResponse("geneType", ValidationConstants.INVALID_MESSAGE); - return null; - } else if (soTerm.getObsolete() && (dbEntity.getGeneType() == null || !soTerm.getId().equals(dbEntity.getGeneType().getId()))) { - addMessageResponse("geneType", ValidationConstants.OBSOLETE_MESSAGE); - return null; + if (StringUtils.isNotBlank(uiEntity.getGeneType().getCurie())) { + soTerm = soTermService.findByCurie(uiEntity.getGeneType().getCurie()); + if (soTerm == null) { + addMessageResponse("geneType", ValidationConstants.INVALID_MESSAGE); + return null; + } else if (soTerm.getObsolete() && (dbEntity.getGeneType() == null || !soTerm.getId().equals(dbEntity.getGeneType().getId()))) { + addMessageResponse("geneType", ValidationConstants.OBSOLETE_MESSAGE); + return null; + } } return soTerm; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/VariantValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/VariantValidator.java index 8cc46272f..1b6c26932 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/VariantValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/VariantValidator.java @@ -11,7 +11,6 @@ import org.alliancegenome.curation_api.constants.VocabularyConstants; import org.alliancegenome.curation_api.dao.CrossReferenceDAO; import org.alliancegenome.curation_api.dao.VariantDAO; -import org.alliancegenome.curation_api.dao.ontology.SoTermDAO; import org.alliancegenome.curation_api.exceptions.ApiErrorException; import org.alliancegenome.curation_api.model.entities.Note; import org.alliancegenome.curation_api.model.entities.Variant; @@ -20,8 +19,10 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.helpers.notes.NoteIdentityHelper; +import org.alliancegenome.curation_api.services.ontology.SoTermService; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -38,7 +39,7 @@ public class VariantValidator extends GenomicEntityValidator { @Inject CrossReferenceDAO crossReferenceDAO; @Inject - SoTermDAO soTermDAO; + SoTermService soTermService; private String errorMessage; @@ -113,14 +114,15 @@ public SOTerm validateVariantType(Variant uiEntity, Variant dbEntity) { return null; } SOTerm variantType = null; - if (uiEntity.getVariantType().getId() != null) - variantType = soTermDAO.find(uiEntity.getVariantType().getId()); - if (variantType == null) { - addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); - return null; - } else if (variantType.getObsolete() && (dbEntity.getVariantType() == null || !variantType.getId().equals(dbEntity.getVariantType().getId()))) { - addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); - return null; + if (StringUtils.isNotBlank(uiEntity.getVariantType().getCurie())) { + variantType = soTermService.findByCurie(uiEntity.getVariantType().getCurie()); + if (variantType == null) { + addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); + return null; + } else if (variantType.getObsolete() && (dbEntity.getVariantType() == null || !variantType.getId().equals(dbEntity.getVariantType().getId()))) { + addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); + return null; + } } return variantType; } @@ -150,14 +152,15 @@ public SOTerm validateSourceGeneralConsequence(Variant uiEntity, Variant dbEntit return null; SOTerm sourceGeneralConsequence = null; - if (uiEntity.getSourceGeneralConsequence().getId() != null) - sourceGeneralConsequence = soTermDAO.find(uiEntity.getSourceGeneralConsequence().getId()); - if (sourceGeneralConsequence == null) { - addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); - return null; - } else if (sourceGeneralConsequence.getObsolete() && (dbEntity.getSourceGeneralConsequence() == null || !sourceGeneralConsequence.getId().equals(dbEntity.getSourceGeneralConsequence().getId()))) { - addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); - return null; + if (StringUtils.isNotBlank(uiEntity.getSourceGeneralConsequence().getCurie())) { + sourceGeneralConsequence = soTermService.findByCurie(uiEntity.getSourceGeneralConsequence().getCurie()); + if (sourceGeneralConsequence == null) { + addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); + return null; + } else if (sourceGeneralConsequence.getObsolete() && (dbEntity.getSourceGeneralConsequence() == null || !sourceGeneralConsequence.getId().equals(dbEntity.getSourceGeneralConsequence().getId()))) { + addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); + return null; + } } return sourceGeneralConsequence; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationValidator.java index 870712926..6241a01e4 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleFunctionalImpactSlotAnnotationValidator.java @@ -5,7 +5,6 @@ import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.constants.VocabularyConstants; -import org.alliancegenome.curation_api.dao.ontology.PhenotypeTermDAO; import org.alliancegenome.curation_api.dao.slotAnnotations.alleleSlotAnnotations.AlleleFunctionalImpactSlotAnnotationDAO; import org.alliancegenome.curation_api.exceptions.ApiErrorException; import org.alliancegenome.curation_api.model.entities.Allele; @@ -14,9 +13,11 @@ import org.alliancegenome.curation_api.model.entities.slotAnnotations.alleleSlotAnnotations.AlleleFunctionalImpactSlotAnnotation; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.VocabularyTermService; +import org.alliancegenome.curation_api.services.ontology.PhenotypeTermService; import org.alliancegenome.curation_api.services.validation.slotAnnotations.SlotAnnotationValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -27,7 +28,7 @@ public class AlleleFunctionalImpactSlotAnnotationValidator extends SlotAnnotatio @Inject AlleleFunctionalImpactSlotAnnotationDAO alleleFunctionalImpactDAO; @Inject - PhenotypeTermDAO phenotypeTermDAO; + PhenotypeTermService phenotypeTermService; @Inject VocabularyTermService vocabularyTermService; @@ -115,14 +116,15 @@ public PhenotypeTerm validatePhenotypeTerm(AlleleFunctionalImpactSlotAnnotation return null; PhenotypeTerm phenotypeTerm = null; - if (uiEntity.getPhenotypeTerm().getId() != null) - phenotypeTerm = phenotypeTermDAO.find(uiEntity.getPhenotypeTerm().getId()); - if (phenotypeTerm == null) { - addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); - return null; - } else if (phenotypeTerm.getObsolete() && (dbEntity.getPhenotypeTerm() == null || !phenotypeTerm.getId().equals(dbEntity.getPhenotypeTerm().getId()))) { - addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); - return null; + if (StringUtils.isNotBlank(uiEntity.getPhenotypeTerm().getCurie())) { + phenotypeTerm = phenotypeTermService.findByCurie(uiEntity.getPhenotypeTerm().getCurie()); + if (phenotypeTerm == null) { + addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); + return null; + } else if (phenotypeTerm.getObsolete() && (dbEntity.getPhenotypeTerm() == null || !phenotypeTerm.getId().equals(dbEntity.getPhenotypeTerm().getId()))) { + addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); + return null; + } } return phenotypeTerm; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationValidator.java index 08fee1c78..654ade21b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/slotAnnotations/alleleSlotAnnotations/AlleleInheritanceModeSlotAnnotationValidator.java @@ -2,7 +2,6 @@ import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.constants.VocabularyConstants; -import org.alliancegenome.curation_api.dao.ontology.PhenotypeTermDAO; import org.alliancegenome.curation_api.dao.slotAnnotations.alleleSlotAnnotations.AlleleInheritanceModeSlotAnnotationDAO; import org.alliancegenome.curation_api.exceptions.ApiErrorException; import org.alliancegenome.curation_api.model.entities.Allele; @@ -11,8 +10,10 @@ import org.alliancegenome.curation_api.model.entities.slotAnnotations.alleleSlotAnnotations.AlleleInheritanceModeSlotAnnotation; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.VocabularyTermService; +import org.alliancegenome.curation_api.services.ontology.PhenotypeTermService; import org.alliancegenome.curation_api.services.validation.slotAnnotations.SlotAnnotationValidator; import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -23,7 +24,7 @@ public class AlleleInheritanceModeSlotAnnotationValidator extends SlotAnnotation @Inject AlleleInheritanceModeSlotAnnotationDAO alleleInheritanceModeDAO; @Inject - PhenotypeTermDAO phenotypeTermDAO; + PhenotypeTermService phenotypeTermService; @Inject VocabularyTermService vocabularyTermService; @@ -108,14 +109,15 @@ public PhenotypeTerm validatePhenotypeTerm(AlleleInheritanceModeSlotAnnotation u return null; PhenotypeTerm phenotypeTerm = null; - if (uiEntity.getPhenotypeTerm().getId() != null) - phenotypeTerm = phenotypeTermDAO.find(uiEntity.getPhenotypeTerm().getId()); - if (phenotypeTerm == null) { - addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); - return null; - } else if (phenotypeTerm.getObsolete() && (dbEntity.getPhenotypeTerm() == null || !phenotypeTerm.getId().equals(dbEntity.getPhenotypeTerm().getId()))) { - addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); - return null; + if (StringUtils.isNotBlank(uiEntity.getPhenotypeTerm().getCurie())) { + phenotypeTerm = phenotypeTermService.findByCurie(uiEntity.getPhenotypeTerm().getCurie()); + if (phenotypeTerm == null) { + addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); + return null; + } else if (phenotypeTerm.getObsolete() && (dbEntity.getPhenotypeTerm() == null || !phenotypeTerm.getId().equals(dbEntity.getPhenotypeTerm().getId()))) { + addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); + return null; + } } return phenotypeTerm; } From ffd609c7e84a3ba8fcff1ecd7e6445f66166b287 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 15 Jan 2024 13:27:34 -0600 Subject: [PATCH 079/159] refactor WithTemplate --- .../src/components/Templates/WithTemplate.js | 22 +++++++++++++++++++ .../DiseaseAnnotationsTable.js | 21 ++---------------- 2 files changed, 24 insertions(+), 19 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/WithTemplate.js diff --git a/src/main/cliapp/src/components/Templates/WithTemplate.js b/src/main/cliapp/src/components/Templates/WithTemplate.js new file mode 100644 index 000000000..05d07eb18 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/WithTemplate.js @@ -0,0 +1,22 @@ +import { EllipsisTableCell } from "../EllipsisTableCell"; +import { ListTableCell } from "../ListTableCell"; + +export const WithTemplate = ({ rowData }) => { + if (rowData?.with) { + const sortedWithGenes = rowData.with.sort((a, b) => (a.geneSymbol.displayText > b.geneSymbol.displayText) ? 1 : (a.curie === b.curie) ? 1 : -1); + const listTemplate = (item) => { + return ( + + {item.geneSymbol.displayText + ' (' + item.curie + ')'} + + ); + }; + return ( +
+ +
+ ); + } else { + return null; + } +}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 3a6f050b0..b1305fd5e 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -14,6 +14,7 @@ import { SearchService } from '../../service/SearchService'; import { DiseaseAnnotationService } from '../../service/DiseaseAnnotationService'; import { RelatedNotesDialog } from '../../components/RelatedNotesDialog'; import { ConditionRelationsDialog } from './ConditionRelationsDialog'; +import { WithTemplate } from '../../components/Templates/WithTemplate'; import { ControlledVocabularyDropdown } from '../../components/ControlledVocabularySelector'; import { ConditionRelationHandleDropdown } from '../../components/ConditionRelationHandleSelector'; @@ -165,24 +166,6 @@ export const DiseaseAnnotationsTable = () => { })); }; - const withTemplate = (rowData) => { - if (rowData && rowData.with) { - const sortedWithGenes = rowData.with.sort((a, b) => (a.geneSymbol.displayText > b.geneSymbol.displayText) ? 1 : (getIdentifier(a) === getIdentifier(b)) ? 1 : -1); - const listTemplate = (item) => { - return ( - - {item.geneSymbol.displayText + ' (' + getIdentifier(item) + ')'} - - ); - }; - return( -
- -
- ); - } - }; - const assertedGenesBodyTemplate = (rowData) => { if (rowData && rowData.assertedGenes && rowData.assertedGenes.length > 0) { const sortedAssertedGenes = rowData.assertedGenes.sort((a, b) => (a.geneSymbol?.displayText > b.geneSymbol?.displayText) ? 1 : (getIdentifier(a) === getIdentifier(b)) ? 1 : -1); @@ -1350,7 +1333,7 @@ export const DiseaseAnnotationsTable = () => { { field: "with.geneSymbol.displayText", header: "With", - body: withTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.withFilterConfig, editor: (props) => withEditorTemplate(props) From d48fd606840a88e01771ef756f0e890c4d8618cd Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 15 Jan 2024 13:49:20 -0600 Subject: [PATCH 080/159] refactor AssertedGenesBodyTemplate --- .../Templates/AssertedGenesBodyTemplate.js | 29 +++++++++++++++++++ .../DiseaseAnnotationsTable.js | 27 ++--------------- 2 files changed, 31 insertions(+), 25 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/AssertedGenesBodyTemplate.js diff --git a/src/main/cliapp/src/components/Templates/AssertedGenesBodyTemplate.js b/src/main/cliapp/src/components/Templates/AssertedGenesBodyTemplate.js new file mode 100644 index 000000000..8eeaac6bb --- /dev/null +++ b/src/main/cliapp/src/components/Templates/AssertedGenesBodyTemplate.js @@ -0,0 +1,29 @@ +import { EllipsisTableCell } from "../EllipsisTableCell"; +import { ListTableCell } from "../ListTableCell"; +import { Tooltip } from "primereact/tooltip"; + +export const AssertedGenesBodyTemplate = ({ rowData }) => { + if (rowData?.assertedGenes?.length > 0) { + const sortedAssertedGenes = rowData.assertedGenes.sort((a, b) => (a.geneSymbol?.displayText > b.geneSymbol?.displayText) ? 1 : (a.curie === b.curie) ? 1 : -1); + const listTemplate = (item) => { + return ( + + {`${item.geneSymbol?.displayText} (${item.curie})`} + + ); + }; + + return ( + <> +
+ +
+ + + + + ); + } else { + return null; + } +}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index b1305fd5e..db05da681 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -15,6 +15,7 @@ import { DiseaseAnnotationService } from '../../service/DiseaseAnnotationService import { RelatedNotesDialog } from '../../components/RelatedNotesDialog'; import { ConditionRelationsDialog } from './ConditionRelationsDialog'; import { WithTemplate } from '../../components/Templates/WithTemplate'; +import { AssertedGenesBodyTemplate } from '../../components/Templates/AssertedGenesBodyTemplate' import { ControlledVocabularyDropdown } from '../../components/ControlledVocabularySelector'; import { ConditionRelationHandleDropdown } from '../../components/ConditionRelationHandleSelector'; @@ -166,30 +167,6 @@ export const DiseaseAnnotationsTable = () => { })); }; - const assertedGenesBodyTemplate = (rowData) => { - if (rowData && rowData.assertedGenes && rowData.assertedGenes.length > 0) { - const sortedAssertedGenes = rowData.assertedGenes.sort((a, b) => (a.geneSymbol?.displayText > b.geneSymbol?.displayText) ? 1 : (getIdentifier(a) === getIdentifier(b)) ? 1 : -1); - const listTemplate = (item) => { - return ( - - {item.geneSymbol?.displayText + ' (' + getIdentifier(item) + ')'} - - ); - }; - const identifier = getIdentifier(rowData.assertedGenes[0]); - return ( - <> -
- -
- - - - - ); - } - }; - const evidenceTemplate = (rowData) => { if (rowData?.evidenceCodes && rowData.evidenceCodes.length > 0) { const sortedEvidenceCodes = rowData.evidenceCodes.sort((a, b) => (a.abbreviation > b.abbreviation) ? 1 : (a.curie === b.curie) ? 1 : -1); @@ -1417,7 +1394,7 @@ export const DiseaseAnnotationsTable = () => { { field: "assertedGenes.geneSymbol.displayText", header: "Asserted Genes", - body: assertedGenesBodyTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.assertedGenesFilterConfig, editor: (props) => assertedGenesEditorTemplate(props), From ff2114f9594842fa7480d01221eb5234c3c6f1b2 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 15 Jan 2024 14:01:47 -0600 Subject: [PATCH 081/159] refactor EvidenceTemplate --- .../components/Templates/EvidenceTemplate.js | 28 ++++++++++++++ .../DiseaseAnnotationsTable.js | 37 +++++++------------ 2 files changed, 41 insertions(+), 24 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/EvidenceTemplate.js diff --git a/src/main/cliapp/src/components/Templates/EvidenceTemplate.js b/src/main/cliapp/src/components/Templates/EvidenceTemplate.js new file mode 100644 index 000000000..a98432514 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/EvidenceTemplate.js @@ -0,0 +1,28 @@ +import { EllipsisTableCell } from "../EllipsisTableCell"; +import { ListTableCell } from "../ListTableCell"; +import { Tooltip } from "primereact/tooltip"; + +export const EvidenceTemplate = ({ rowData }) => { + if (rowData?.evidenceCodes && rowData.evidenceCodes.length > 0) { + const sortedEvidenceCodes = rowData.evidenceCodes.sort((a, b) => (a.abbreviation > b.abbreviation) ? 1 : (a.curie === b.curie) ? 1 : -1); + const listTemplate = (item) => { + return ( + + {item.abbreviation + ' - ' + item.name + ' (' + item.curie + ')'} + + ); + }; + return ( + <> +
+ +
+ + + + + ); + } else { + return null; + } +}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index db05da681..794c42a22 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -15,7 +15,8 @@ import { DiseaseAnnotationService } from '../../service/DiseaseAnnotationService import { RelatedNotesDialog } from '../../components/RelatedNotesDialog'; import { ConditionRelationsDialog } from './ConditionRelationsDialog'; import { WithTemplate } from '../../components/Templates/WithTemplate'; -import { AssertedGenesBodyTemplate } from '../../components/Templates/AssertedGenesBodyTemplate' +import { AssertedGenesBodyTemplate } from '../../components/Templates/AssertedGenesBodyTemplate'; +import { EvidenceTemplate } from '../../components/Templates/EvidenceTemplate'; import { ControlledVocabularyDropdown } from '../../components/ControlledVocabularySelector'; import { ConditionRelationHandleDropdown } from '../../components/ConditionRelationHandleSelector'; @@ -167,29 +168,8 @@ export const DiseaseAnnotationsTable = () => { })); }; - const evidenceTemplate = (rowData) => { - if (rowData?.evidenceCodes && rowData.evidenceCodes.length > 0) { - const sortedEvidenceCodes = rowData.evidenceCodes.sort((a, b) => (a.abbreviation > b.abbreviation) ? 1 : (a.curie === b.curie) ? 1 : -1); - const listTemplate = (item) => { - return ( - - {item.abbreviation + ' - ' + item.name + ' (' + item.curie + ')'} - - ); - }; - return ( - <> -
- -
- - - - - ); - } - }; +//MOVE const singleReferenceBodyTemplate = (rowData) => { if (rowData && rowData.singleReference) { let refString = getRefString(rowData.singleReference); @@ -212,6 +192,7 @@ export const DiseaseAnnotationsTable = () => { } }; + //MOVE const inferredGeneBodyTemplate = (rowData) => { if (rowData && rowData.inferredGene) { const identifier = getIdentifier(rowData.inferredGene); @@ -233,6 +214,7 @@ export const DiseaseAnnotationsTable = () => { } }; +//MOVE const inferredAlleleBodyTemplate = (rowData) => { if (rowData && rowData.inferredAllele) { const identifier = getIdentifier(rowData.inferredAllele); @@ -272,6 +254,7 @@ export const DiseaseAnnotationsTable = () => { } }; + //MOVE const assertedAlleleBodyTemplate = (rowData) => { if (rowData && rowData.assertedAllele) { const identifier = getIdentifier(rowData.assertedAllele); @@ -311,6 +294,7 @@ export const DiseaseAnnotationsTable = () => { } }; + //MOVE const diseaseQualifiersBodyTemplate = (rowData) => { if (rowData && rowData.diseaseQualifiers) { const sortedDiseaseQualifiers = rowData.diseaseQualifiers.sort((a, b) => (a.name > b.name) ? 1 : -1); @@ -323,6 +307,7 @@ export const DiseaseAnnotationsTable = () => { } }; + //MOVE const negatedTemplate = (rowData) => { if (rowData && rowData.negated !== null && rowData.negated !== undefined) { return {JSON.stringify(rowData.negated)}; @@ -1178,6 +1163,7 @@ export const DiseaseAnnotationsTable = () => { ); }; + //MOVE const uniqueIdBodyTemplate = (rowData) => { return ( //the 'a' at the start is a hack since css selectors can't start with a number @@ -1204,6 +1190,7 @@ export const DiseaseAnnotationsTable = () => { ); }; + //MOVE const modEntityIdBodyTemplate = (rowData) => { return ( //the 'a' at the start is a hack since css selectors can't start with a number @@ -1216,6 +1203,7 @@ export const DiseaseAnnotationsTable = () => { ) }; + //MOVE const modInternalIdBodyTemplate = (rowData) => { return ( //the 'a' at the start is a hack since css selectors can't start with a number @@ -1302,7 +1290,7 @@ export const DiseaseAnnotationsTable = () => { { field: "evidenceCodes.abbreviation", header: "Evidence Code", - body: evidenceTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.evidenceCodesFilterConfig, editor: (props) => evidenceEditorTemplate(props) @@ -1543,3 +1531,4 @@ export const DiseaseAnnotationsTable = () => { ); }; + From 7b87b0085229cf055e58e428fcff4260b806d97b Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 15 Jan 2024 14:15:35 -0600 Subject: [PATCH 082/159] refactor SingleReferenceBodyTemplate --- .../Templates/SingleReferenceBodyTemplate.js | 26 ++++++++++++++++++ .../DiseaseAnnotationsTable.js | 27 ++----------------- 2 files changed, 28 insertions(+), 25 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/SingleReferenceBodyTemplate.js diff --git a/src/main/cliapp/src/components/Templates/SingleReferenceBodyTemplate.js b/src/main/cliapp/src/components/Templates/SingleReferenceBodyTemplate.js new file mode 100644 index 000000000..b59ff772f --- /dev/null +++ b/src/main/cliapp/src/components/Templates/SingleReferenceBodyTemplate.js @@ -0,0 +1,26 @@ +import { getRefString } from "../../utils/utils"; +import { Tooltip } from "primereact/tooltip"; + +export const SingleReferenceBodyTemplate = ({ rowData }) => { + if (rowData?.singleReference) { + let refString = getRefString(rowData.singleReference); + return ( + <> +
+ +
+ + + ); + + } else { + return null; + } +}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 794c42a22..5b391d840 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -17,6 +17,7 @@ import { ConditionRelationsDialog } from './ConditionRelationsDialog'; import { WithTemplate } from '../../components/Templates/WithTemplate'; import { AssertedGenesBodyTemplate } from '../../components/Templates/AssertedGenesBodyTemplate'; import { EvidenceTemplate } from '../../components/Templates/EvidenceTemplate'; +import { SingleReferenceBodyTemplate } from '../../components/Templates/SingleReferenceBodyTemplate'; import { ControlledVocabularyDropdown } from '../../components/ControlledVocabularySelector'; import { ConditionRelationHandleDropdown } from '../../components/ConditionRelationHandleSelector'; @@ -168,30 +169,6 @@ export const DiseaseAnnotationsTable = () => { })); }; - -//MOVE - const singleReferenceBodyTemplate = (rowData) => { - if (rowData && rowData.singleReference) { - let refString = getRefString(rowData.singleReference); - return ( - <> -
- -
- - - ); - - } - }; - //MOVE const inferredGeneBodyTemplate = (rowData) => { if (rowData && rowData.inferredGene) { @@ -1281,7 +1258,7 @@ export const DiseaseAnnotationsTable = () => { { field: "singleReference.primaryCrossReferenceCurie", header: "Reference", - body: singleReferenceBodyTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.singleReferenceFilterConfig, editor: (props) => referenceEditorTemplate(props), From 757fd4cdd172921960ca432238cb2e608308e76f Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 16 Jan 2024 09:06:47 -0600 Subject: [PATCH 083/159] refactor InferredGeneBodyTemplate --- .../Templates/InferredGeneBodyTemplate.js | 22 ++++++++++++++++ .../DiseaseAnnotationsTable.js | 26 ++----------------- 2 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/InferredGeneBodyTemplate.js diff --git a/src/main/cliapp/src/components/Templates/InferredGeneBodyTemplate.js b/src/main/cliapp/src/components/Templates/InferredGeneBodyTemplate.js new file mode 100644 index 000000000..bc67c2e48 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/InferredGeneBodyTemplate.js @@ -0,0 +1,22 @@ +import { Tooltip } from "primereact/tooltip"; +export const InferredGeneBodyTemplate = ({ rowData }) => { + if (rowData?.inferredGene) { + return ( + <> +
+ +
+ + + ); + } else { + return null; + } +}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 5b391d840..1dbb9aafa 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -18,6 +18,7 @@ import { WithTemplate } from '../../components/Templates/WithTemplate'; import { AssertedGenesBodyTemplate } from '../../components/Templates/AssertedGenesBodyTemplate'; import { EvidenceTemplate } from '../../components/Templates/EvidenceTemplate'; import { SingleReferenceBodyTemplate } from '../../components/Templates/SingleReferenceBodyTemplate'; +import { InferredGeneBodyTemplate } from '../../components/Templates/InferredGeneBodyTemplate'; import { ControlledVocabularyDropdown } from '../../components/ControlledVocabularySelector'; import { ConditionRelationHandleDropdown } from '../../components/ConditionRelationHandleSelector'; @@ -169,29 +170,6 @@ export const DiseaseAnnotationsTable = () => { })); }; - //MOVE - const inferredGeneBodyTemplate = (rowData) => { - if (rowData && rowData.inferredGene) { - const identifier = getIdentifier(rowData.inferredGene); - return ( - <> -
- -
- - - ) - } - }; - -//MOVE const inferredAlleleBodyTemplate = (rowData) => { if (rowData && rowData.inferredAllele) { const identifier = getIdentifier(rowData.inferredAllele); @@ -1352,7 +1330,7 @@ export const DiseaseAnnotationsTable = () => { { field: "inferredGene.geneSymbol.displayText", header: "Inferred Gene", - body: inferredGeneBodyTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.inferredGeneFilterConfig, }, From 631db48d3f5a2eaea994be938fa206b56674f7fc Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 16 Jan 2024 09:26:02 -0600 Subject: [PATCH 084/159] refactor InferredAlleleBodyTemplate --- .../Templates/InferredAlleleBodyTemplate.js | 41 +++++++++++++++++++ .../DiseaseAnnotationsTable.js | 41 +------------------ 2 files changed, 43 insertions(+), 39 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/InferredAlleleBodyTemplate.js diff --git a/src/main/cliapp/src/components/Templates/InferredAlleleBodyTemplate.js b/src/main/cliapp/src/components/Templates/InferredAlleleBodyTemplate.js new file mode 100644 index 000000000..74f38bd10 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/InferredAlleleBodyTemplate.js @@ -0,0 +1,41 @@ +import { Tooltip } from "primereact/tooltip"; + +export const InferredAlleleBodyTemplate = ({ rowData }) => { + if (rowData?.inferredAllele) { + if (rowData.inferredAllele.alleleSymbol?.displayText) { + return ( + <> +
+ +
+ + + ); + } else { + return ( + <> +
+ +
+ + + ); + } + } else { + return null; + } +}; diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 1dbb9aafa..b257b8e20 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -19,6 +19,7 @@ import { AssertedGenesBodyTemplate } from '../../components/Templates/AssertedGe import { EvidenceTemplate } from '../../components/Templates/EvidenceTemplate'; import { SingleReferenceBodyTemplate } from '../../components/Templates/SingleReferenceBodyTemplate'; import { InferredGeneBodyTemplate } from '../../components/Templates/InferredGeneBodyTemplate'; +import { InferredAlleleBodyTemplate } from '../../components/Templates/InferredAlleleBodyTemplate'; import { ControlledVocabularyDropdown } from '../../components/ControlledVocabularySelector'; import { ConditionRelationHandleDropdown } from '../../components/ConditionRelationHandleSelector'; @@ -170,44 +171,6 @@ export const DiseaseAnnotationsTable = () => { })); }; - const inferredAlleleBodyTemplate = (rowData) => { - if (rowData && rowData.inferredAllele) { - const identifier = getIdentifier(rowData.inferredAllele); - if (rowData.inferredAllele.alleleSymbol?.displayText) { - return ( - <> -
- -
- - - ) - } else { - return ( - <> -
- -
- - - ) - } - } - }; //MOVE const assertedAlleleBodyTemplate = (rowData) => { @@ -1345,7 +1308,7 @@ export const DiseaseAnnotationsTable = () => { { field: "inferredAllele.alleleSymbol.displayText", header: "Inferred Allele", - body: inferredAlleleBodyTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.inferredAlleleFilterConfig, }, From 271503fec2a12afbc02410e5d2ba63e89ea79b83 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 17 Jan 2024 10:09:25 -0600 Subject: [PATCH 085/159] refactor AssertedAlleleBodyTemplate --- .../Templates/AssertedAlleleBodyTemplate.js | 41 ++++++++++++++++++ .../DiseaseAnnotationsTable.js | 42 +------------------ 2 files changed, 43 insertions(+), 40 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/AssertedAlleleBodyTemplate.js diff --git a/src/main/cliapp/src/components/Templates/AssertedAlleleBodyTemplate.js b/src/main/cliapp/src/components/Templates/AssertedAlleleBodyTemplate.js new file mode 100644 index 000000000..e8b918968 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/AssertedAlleleBodyTemplate.js @@ -0,0 +1,41 @@ +import { Tooltip } from "primereact/tooltip"; + +export const AssertedAlleleBodyTemplate = ({ rowData }) => { + if (rowData?.assertedAllele) { + if (rowData.assertedAllele?.alleleSymbol) { + return ( + <> +
+ +
+ + + ); + } else { + return ( + <> +
+ +
+ + + ); + } + } else { + return null; + } +}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index b257b8e20..520b83474 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -20,6 +20,7 @@ import { EvidenceTemplate } from '../../components/Templates/EvidenceTemplate'; import { SingleReferenceBodyTemplate } from '../../components/Templates/SingleReferenceBodyTemplate'; import { InferredGeneBodyTemplate } from '../../components/Templates/InferredGeneBodyTemplate'; import { InferredAlleleBodyTemplate } from '../../components/Templates/InferredAlleleBodyTemplate'; +import { AssertedAlleleBodyTemplate } from '../../components/Templates/AssertedAlleleBodyTemplate'; import { ControlledVocabularyDropdown } from '../../components/ControlledVocabularySelector'; import { ConditionRelationHandleDropdown } from '../../components/ConditionRelationHandleSelector'; @@ -172,45 +173,6 @@ export const DiseaseAnnotationsTable = () => { }; - //MOVE - const assertedAlleleBodyTemplate = (rowData) => { - if (rowData && rowData.assertedAllele) { - const identifier = getIdentifier(rowData.assertedAllele); - if (rowData.assertedAllele.alleleSymbol) { - return ( - <> -
- -
- - - ) - } else { - return ( - <> -
- -
- - - ) - } - } - }; //MOVE const diseaseQualifiersBodyTemplate = (rowData) => { @@ -1315,7 +1277,7 @@ export const DiseaseAnnotationsTable = () => { { field: "assertedAllele.alleleSymbol.displayText", header: "Asserted Allele", - body: assertedAlleleBodyTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.assertedAlleleFilterConfig, editor: (props) => assertedAlleleEditorTemplate(props), From 555677fd38859abcb23e30527a61c468674f7872 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 17 Jan 2024 10:15:14 -0600 Subject: [PATCH 086/159] refactor DiseaseQualifiersBodyTemplate --- .../DiseaseQualifiersBodyTemplate.js | 13 +++++++++++++ .../DiseaseAnnotationsTable.js | 19 +++---------------- 2 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/DiseaseQualifiersBodyTemplate.js diff --git a/src/main/cliapp/src/components/Templates/DiseaseQualifiersBodyTemplate.js b/src/main/cliapp/src/components/Templates/DiseaseQualifiersBodyTemplate.js new file mode 100644 index 000000000..19a02d99c --- /dev/null +++ b/src/main/cliapp/src/components/Templates/DiseaseQualifiersBodyTemplate.js @@ -0,0 +1,13 @@ +import { ListTableCell } from "../ListTableCell"; + +export const DiseaseQualifiersBodyTemplate = ({ rowData }) => { + if (rowData?.diseaseQualifiers) { + const sortedDiseaseQualifiers = rowData.diseaseQualifiers.sort((a, b) => (a.name > b.name) ? 1 : -1); + const listTemplate = (item) => item.name; + return ( +
+ +
+ ); + } +}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 520b83474..034dee762 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -21,6 +21,8 @@ import { SingleReferenceBodyTemplate } from '../../components/Templates/SingleRe import { InferredGeneBodyTemplate } from '../../components/Templates/InferredGeneBodyTemplate'; import { InferredAlleleBodyTemplate } from '../../components/Templates/InferredAlleleBodyTemplate'; import { AssertedAlleleBodyTemplate } from '../../components/Templates/AssertedAlleleBodyTemplate'; +import { DiseaseQualifiersBodyTemplate } from '../../components/Templates/DiseaseQualifiersBodyTemplate'; + import { ControlledVocabularyDropdown } from '../../components/ControlledVocabularySelector'; import { ConditionRelationHandleDropdown } from '../../components/ConditionRelationHandleSelector'; @@ -172,21 +174,6 @@ export const DiseaseAnnotationsTable = () => { })); }; - - - //MOVE - const diseaseQualifiersBodyTemplate = (rowData) => { - if (rowData && rowData.diseaseQualifiers) { - const sortedDiseaseQualifiers = rowData.diseaseQualifiers.sort((a, b) => (a.name > b.name) ? 1 : -1); - const listTemplate = (item) => item.name; - return( -
- -
- ) - } - }; - //MOVE const negatedTemplate = (rowData) => { if (rowData && rowData.negated !== null && rowData.negated !== undefined) { @@ -1217,7 +1204,7 @@ export const DiseaseAnnotationsTable = () => { { field: "diseaseQualifiers.name", header: "Disease Qualifiers", - body: diseaseQualifiersBodyTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.diseaseQualifiersFilterConfig, editor: (props) => diseaseQualifiersEditor(props) From d7112bed84c116512e33d9e91261db7febe77bee Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 17 Jan 2024 10:22:37 -0600 Subject: [PATCH 087/159] refactor NegatedTemplate --- .../src/components/Templates/NegatedTemplate.js | 9 +++++++++ .../diseaseAnnotationsPage/DiseaseAnnotationsTable.js | 11 +++-------- 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/NegatedTemplate.js diff --git a/src/main/cliapp/src/components/Templates/NegatedTemplate.js b/src/main/cliapp/src/components/Templates/NegatedTemplate.js new file mode 100644 index 000000000..ea5d2681f --- /dev/null +++ b/src/main/cliapp/src/components/Templates/NegatedTemplate.js @@ -0,0 +1,9 @@ +import { EllipsisTableCell } from "../EllipsisTableCell"; + +export const NegatedTemplate = ({ rowData }) => { + if (rowData?.negated !== null || rowData?.negated !== undefined) { + return {JSON.stringify(rowData.negated)}; + } else { + return null; + } +}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 034dee762..d23ccb1b8 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -22,6 +22,8 @@ import { InferredGeneBodyTemplate } from '../../components/Templates/InferredGen import { InferredAlleleBodyTemplate } from '../../components/Templates/InferredAlleleBodyTemplate'; import { AssertedAlleleBodyTemplate } from '../../components/Templates/AssertedAlleleBodyTemplate'; import { DiseaseQualifiersBodyTemplate } from '../../components/Templates/DiseaseQualifiersBodyTemplate'; +import { NegatedTemplate } from '../../components/Templates/NegatedTemplate'; + import { ControlledVocabularyDropdown } from '../../components/ControlledVocabularySelector'; @@ -174,13 +176,6 @@ export const DiseaseAnnotationsTable = () => { })); }; - //MOVE - const negatedTemplate = (rowData) => { - if (rowData && rowData.negated !== null && rowData.negated !== undefined) { - return {JSON.stringify(rowData.negated)}; - } - }; - const relatedNotesTemplate = (rowData) => { if (rowData?.relatedNotes) { return ( @@ -1132,7 +1127,7 @@ export const DiseaseAnnotationsTable = () => { { field: "negated", header: "Negated", - body: negatedTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.negatedFilterConfig, editor: (props) => negatedEditor(props) From 468aeb0df297575b3dbeefdfc18dc04e2b9f25f7 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 17 Jan 2024 10:30:43 -0600 Subject: [PATCH 088/159] refactor UniqueIdBodyTemplate --- .../components/Templates/UniqueIdBodyTemplate.js | 14 ++++++++++++++ .../DiseaseAnnotationsTable.js | 16 +++------------- 2 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/UniqueIdBodyTemplate.js diff --git a/src/main/cliapp/src/components/Templates/UniqueIdBodyTemplate.js b/src/main/cliapp/src/components/Templates/UniqueIdBodyTemplate.js new file mode 100644 index 000000000..90ab185f5 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/UniqueIdBodyTemplate.js @@ -0,0 +1,14 @@ +import { EllipsisTableCell } from "../EllipsisTableCell"; +import { Tooltip } from "primereact/tooltip"; + +export const UniqueIdBodyTemplate = ({ rowData }) => { + return ( + //the 'c' at the start is a hack since css selectors can't start with a number + <> + + {rowData.uniqueId} + + + + ); +}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index d23ccb1b8..d51136d8d 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -23,6 +23,8 @@ import { InferredAlleleBodyTemplate } from '../../components/Templates/InferredA import { AssertedAlleleBodyTemplate } from '../../components/Templates/AssertedAlleleBodyTemplate'; import { DiseaseQualifiersBodyTemplate } from '../../components/Templates/DiseaseQualifiersBodyTemplate'; import { NegatedTemplate } from '../../components/Templates/NegatedTemplate'; +import { UniqueIdBodyTemplate } from '../../components/Templates/UniqueIdBodyTemplate'; + @@ -1025,18 +1027,6 @@ export const DiseaseAnnotationsTable = () => { ); }; - //MOVE - const uniqueIdBodyTemplate = (rowData) => { - return ( - //the 'a' at the start is a hack since css selectors can't start with a number - <> - - {rowData.uniqueId} - - - - ) - }; const uniqueIdEditorTemplate = (props) => { return ( @@ -1090,7 +1080,7 @@ export const DiseaseAnnotationsTable = () => { const columns = [{ field: "uniqueId", header: "Unique ID", - body: uniqueIdBodyTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.uniqueidFilterConfig, editor: (props) => uniqueIdEditorTemplate(props) From d12335fa5e497797627c12888b235ef0da2d1940 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 17 Jan 2024 11:24:01 -0600 Subject: [PATCH 089/159] combine id templates into IdBodyTemplate --- .../components/Templates/IdBodyTemplate.js | 15 +++++++ .../Templates/UniqueIdBodyTemplate.js | 14 ------- .../DiseaseAnnotationsTable.js | 39 +++++-------------- 3 files changed, 24 insertions(+), 44 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/IdBodyTemplate.js delete mode 100644 src/main/cliapp/src/components/Templates/UniqueIdBodyTemplate.js diff --git a/src/main/cliapp/src/components/Templates/IdBodyTemplate.js b/src/main/cliapp/src/components/Templates/IdBodyTemplate.js new file mode 100644 index 000000000..d6181b65b --- /dev/null +++ b/src/main/cliapp/src/components/Templates/IdBodyTemplate.js @@ -0,0 +1,15 @@ +import { EllipsisTableCell } from "../EllipsisTableCell"; +import { Tooltip } from "primereact/tooltip"; + +export const IdBodyTemplate = ({ id }) => { + //the 'a' at the start is a hack since css selectors can't start with a number + const targetClass = `a${global.crypto.randomUUID()}`; + return ( + <> + + {id} + + + + ); +}; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/UniqueIdBodyTemplate.js b/src/main/cliapp/src/components/Templates/UniqueIdBodyTemplate.js deleted file mode 100644 index 90ab185f5..000000000 --- a/src/main/cliapp/src/components/Templates/UniqueIdBodyTemplate.js +++ /dev/null @@ -1,14 +0,0 @@ -import { EllipsisTableCell } from "../EllipsisTableCell"; -import { Tooltip } from "primereact/tooltip"; - -export const UniqueIdBodyTemplate = ({ rowData }) => { - return ( - //the 'c' at the start is a hack since css selectors can't start with a number - <> - - {rowData.uniqueId} - - - - ); -}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index d51136d8d..df35fe6cf 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -23,7 +23,7 @@ import { InferredAlleleBodyTemplate } from '../../components/Templates/InferredA import { AssertedAlleleBodyTemplate } from '../../components/Templates/AssertedAlleleBodyTemplate'; import { DiseaseQualifiersBodyTemplate } from '../../components/Templates/DiseaseQualifiersBodyTemplate'; import { NegatedTemplate } from '../../components/Templates/NegatedTemplate'; -import { UniqueIdBodyTemplate } from '../../components/Templates/UniqueIdBodyTemplate'; +import { IdBodyTemplate } from '../../components/Templates/IdBodyTemplate'; @@ -39,6 +39,7 @@ import { Tooltip } from 'primereact/tooltip'; import { getRefString, autocompleteSearch, buildAutocompleteFilter, defaultAutocompleteOnChange, multipleAutocompleteOnChange, getIdentifier } from '../../utils/utils'; import { useNewAnnotationReducer } from "./useNewAnnotationReducer"; import { NewAnnotationForm } from "./NewAnnotationForm"; +//MOVE? import { internalTemplate, obsoleteTemplate } from '../../components/AuditedObjectComponent'; import { AutocompleteMultiEditor } from "../../components/Autocomplete/AutocompleteMultiEditor"; import { getDefaultTableState } from '../../service/TableStateService'; @@ -322,6 +323,7 @@ export const DiseaseAnnotationsTable = () => { } }; + //MOVE const diseaseBodyTemplate = (rowData) => { if (rowData.diseaseAnnotationObject) { return ( @@ -855,6 +857,7 @@ export const DiseaseAnnotationsTable = () => { ); }; + //MOVE const subjectBodyTemplate = (rowData) => { if (rowData.diseaseAnnotationSubject) { const identifier = getIdentifier(rowData.diseaseAnnotationSubject); @@ -944,6 +947,7 @@ export const DiseaseAnnotationsTable = () => { } }; + //MOVE const sgdStrainBackgroundBodyTemplate = (rowData) => { if (rowData.sgdStrainBackground) { const identifier = getIdentifier(rowData.sgdStrainBackground); @@ -959,6 +963,7 @@ export const DiseaseAnnotationsTable = () => { } }; + //MOVE const geneticModifiersBodyTemplate = (rowData) => { if (rowData?.diseaseGeneticModifiers && rowData.diseaseGeneticModifiers.length > 0) { const diseaseGeneticModifierStrings = []; @@ -1042,32 +1047,6 @@ export const DiseaseAnnotationsTable = () => { ); }; - //MOVE - const modEntityIdBodyTemplate = (rowData) => { - return ( - //the 'a' at the start is a hack since css selectors can't start with a number - <> - - {rowData.modEntityId} - - - - ) - }; - - //MOVE - const modInternalIdBodyTemplate = (rowData) => { - return ( - //the 'a' at the start is a hack since css selectors can't start with a number - <> - - {rowData.modInternalId} - - - - ) - }; - const sgdStrainBackgroundEditorSelector = (props) => { if (props.rowData.type === "GeneDiseaseAnnotation") { return sgdStrainBackgroundEditorTemplate(props); @@ -1080,7 +1059,7 @@ export const DiseaseAnnotationsTable = () => { const columns = [{ field: "uniqueId", header: "Unique ID", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.uniqueidFilterConfig, editor: (props) => uniqueIdEditorTemplate(props) @@ -1088,14 +1067,14 @@ export const DiseaseAnnotationsTable = () => { { field: "modEntityId", header: "MOD Annotation ID", - body: modEntityIdBodyTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.modentityidFilterConfig, }, { field: "modInternalId", header: "MOD Internal ID", - body: modInternalIdBodyTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.modinternalidFilterConfig, }, From 58ed41416882fa0b1abf95a230697dad4f7cfd4c Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 2 Feb 2024 12:28:37 -0600 Subject: [PATCH 090/159] refactor DiseaseTemplate --- .../Templates/DiseaseQualifiersBodyTemplate.js | 2 ++ .../src/components/Templates/DiseaseTemplate.js | 16 ++++++++++++++++ .../DiseaseAnnotationsTable.js | 14 ++------------ 3 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/DiseaseTemplate.js diff --git a/src/main/cliapp/src/components/Templates/DiseaseQualifiersBodyTemplate.js b/src/main/cliapp/src/components/Templates/DiseaseQualifiersBodyTemplate.js index 19a02d99c..356b03a4f 100644 --- a/src/main/cliapp/src/components/Templates/DiseaseQualifiersBodyTemplate.js +++ b/src/main/cliapp/src/components/Templates/DiseaseQualifiersBodyTemplate.js @@ -9,5 +9,7 @@ export const DiseaseQualifiersBodyTemplate = ({ rowData }) => {
); + } else { + return null; } }; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/DiseaseTemplate.js b/src/main/cliapp/src/components/Templates/DiseaseTemplate.js new file mode 100644 index 000000000..421136255 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/DiseaseTemplate.js @@ -0,0 +1,16 @@ +import { Tooltip } from "primereact/tooltip"; +import { EllipsisTableCell } from "../EllipsisTableCell"; + +export const DiseaseTemplate = ({ object }) => { + const targetClass = `a${global.crypto.randomUUID()}`; + if (object) { + return ( + <> + {object.name} ({object.curie}) + + + ); + } else { + return null; + } +}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index df35fe6cf..e78adf667 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -24,6 +24,7 @@ import { AssertedAlleleBodyTemplate } from '../../components/Templates/AssertedA import { DiseaseQualifiersBodyTemplate } from '../../components/Templates/DiseaseQualifiersBodyTemplate'; import { NegatedTemplate } from '../../components/Templates/NegatedTemplate'; import { IdBodyTemplate } from '../../components/Templates/IdBodyTemplate'; +import { DiseaseTemplate } from '../../components/Templates/DiseaseTemplate'; @@ -323,17 +324,6 @@ export const DiseaseAnnotationsTable = () => { } }; - //MOVE - const diseaseBodyTemplate = (rowData) => { - if (rowData.diseaseAnnotationObject) { - return ( - <> - {rowData.diseaseAnnotationObject.name} ({rowData.diseaseAnnotationObject.curie}) - - - ) - } - }; const onRelationEditorValueChange = (props, event) => { let updatedAnnotations = [...props.props.value]; @@ -1104,7 +1094,7 @@ export const DiseaseAnnotationsTable = () => { { field: "diseaseAnnotationObject.name", header: "Disease", - body: diseaseBodyTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.diseaseAnnotationObjectFilterConfig, editor: (props) => diseaseEditorTemplate(props), From 8906fdf4f17e56f434fa61dc5f7e62b2a115c954 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 5 Feb 2024 10:20:34 -0600 Subject: [PATCH 091/159] update SubjectTemplate --- .../Templates/subject/SubjectTemplate.js | 28 ++++ .../subject/__tests__/SubjectTemplate.test.js | 124 ++++++++++++++++++ .../DiseaseAnnotationsTable.js | 111 +--------------- src/main/cliapp/src/utils/utils.js | 11 +- 4 files changed, 165 insertions(+), 109 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/subject/SubjectTemplate.js create mode 100644 src/main/cliapp/src/components/Templates/subject/__tests__/SubjectTemplate.test.js diff --git a/src/main/cliapp/src/components/Templates/subject/SubjectTemplate.js b/src/main/cliapp/src/components/Templates/subject/SubjectTemplate.js new file mode 100644 index 000000000..658a1fad0 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/subject/SubjectTemplate.js @@ -0,0 +1,28 @@ +import { Tooltip } from "primereact/tooltip"; +import { getSubjectText } from "../../../utils/utils"; + +export const SubjectTemplate = ({ subject }) => { + if (!subject) return null; + + const targetClass = `a${global.crypto.randomUUID()}`; + const subjectText = getSubjectText(subject); + + if(!subjectText) return
{subject.curie}
; + + return ( + <> +
+ +
+ + + ); +}; + diff --git a/src/main/cliapp/src/components/Templates/subject/__tests__/SubjectTemplate.test.js b/src/main/cliapp/src/components/Templates/subject/__tests__/SubjectTemplate.test.js new file mode 100644 index 000000000..a220a9cfd --- /dev/null +++ b/src/main/cliapp/src/components/Templates/subject/__tests__/SubjectTemplate.test.js @@ -0,0 +1,124 @@ +import { fireEvent, render } from '@testing-library/react'; +import { SubjectTemplate } from '../SubjectTemplate'; +import '../../../../tools/jest/setupTests'; + +describe('SubjectTemplate', () => { + + it('should render subject text and curie when subject has geneSymbol', () => { + const subject = { + geneSymbol: { + displayText: 'Gene Symbol' + }, + curie: 'CURIE' + }; + + const result = render(); + + const content = result.getByText('Gene Symbol (CURIE)'); + expect(content).toBeInTheDocument(); + }); + + it('should render subject text and curie when subject has alleleSymbol', () => { + const subject = { + alleleSymbol: { + displayText: 'Allele Symbol' + }, + curie: 'CURIE' + }; + + const result = render(); + + const content = result.getByText('Allele Symbol (CURIE)'); + expect(content).toBeInTheDocument(); + }); + + it('should render subject text and curie when subject has geneFullName', () => { + const subject = { + geneFullName: { + displayText: 'Gene Full Name' + }, + curie: 'CURIE' + }; + + const result = render(); + + const content = result.getByText('Gene Full Name (CURIE)'); + expect(content).toBeInTheDocument(); + }); + + it('should render subject text and curie when subject has alleleFullName', () => { + const subject = { + alleleFullName: { + displayText: 'Allele Full Name' + }, + curie: 'CURIE' + }; + + const result = render(); + + const content = result.getByText('Allele Full Name (CURIE)'); + expect(content).toBeInTheDocument(); + }); + it('should render subject name and curie when subject has name', () => { + const subject = { + name: 'Subject Name', + curie: 'CURIE' + }; + + const result = render(); + + const content = result.getByText('Subject Name (CURIE)'); + expect(content).toBeInTheDocument(); + }); + + it('should render subject curie in a div when subject has no displayable text', () => { + const subject = { + curie: 'CURIE' + }; + + const result = render(); + + const divContent = result.getByText('CURIE'); + expect(divContent).toBeInTheDocument(); + }); + + it('should render null when subject is null', () => { + const subject = null; + + const { container } = render(); + + expect(container.firstChild).toBeNull(); + }); + + it('should render subject text and curie in a tooltip when subject has geneSymbol', async () => { + const subject = { + geneSymbol: { + displayText: 'Gene Symbol' + }, + curie: 'CURIE' + }; + + const result = render(); + + let divContentArray = result.getAllByText('Gene Symbol (CURIE)'); + expect(divContentArray).toHaveLength(1); + + fireEvent.mouseEnter(divContentArray[0]); + //using find... here because it's async and the tooltip is dynamically added + expect(await result.findAllByText('Gene Symbol (CURIE)')).toHaveLength(2); + }); + + it('should render tags in the HTML', async () => { + const subject = { + geneSymbol: { + displayText: 'Gene Symbol' + }, + curie: 'CURIE' + }; + + const { container } = render(); + + let superScript = container.querySelector('sup'); + expect(superScript).toBeInTheDocument(); + }); +}); diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index e78adf667..f25339e48 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -25,6 +25,7 @@ import { DiseaseQualifiersBodyTemplate } from '../../components/Templates/Diseas import { NegatedTemplate } from '../../components/Templates/NegatedTemplate'; import { IdBodyTemplate } from '../../components/Templates/IdBodyTemplate'; import { DiseaseTemplate } from '../../components/Templates/DiseaseTemplate'; +import { SubjectTemplate } from '../../components/Templates/subject/SubjectTemplate'; @@ -847,112 +848,6 @@ export const DiseaseAnnotationsTable = () => { ); }; - //MOVE - const subjectBodyTemplate = (rowData) => { - if (rowData.diseaseAnnotationSubject) { - const identifier = getIdentifier(rowData.diseaseAnnotationSubject); - if (rowData.diseaseAnnotationSubject.geneSymbol) { - return ( - <> -
- -
- - - ) - } else if (rowData.diseaseAnnotationSubject.alleleSymbol) { - return ( - <> -
- -
- - - ) - } else if (rowData.diseaseAnnotationSubject.geneFullName) { - return ( - <> -
- -
- - - ) - } else if (rowData.diseaseAnnotationSubject.alleleFullName) { - return ( - <> -
- -
- - - ) - } else if (rowData.diseaseAnnotationSubject.name) { - return ( - <> -
- -
- - - ) - } else { - return
{identifier}
; - } - } - }; - - //MOVE - const sgdStrainBackgroundBodyTemplate = (rowData) => { - if (rowData.sgdStrainBackground) { - const identifier = getIdentifier(rowData.sgdStrainBackground); - if (rowData.sgdStrainBackground.name) { - return
; - } else { - return
{identifier}
; - } - } - }; - //MOVE const geneticModifiersBodyTemplate = (rowData) => { if (rowData?.diseaseGeneticModifiers && rowData.diseaseGeneticModifiers.length > 0) { @@ -1071,7 +966,7 @@ export const DiseaseAnnotationsTable = () => { { field: "diseaseAnnotationSubject.symbol", header: "Subject", - body: subjectBodyTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.diseaseAnnotationSubjectFieldConfig, editor: (props) => subjectEditorTemplate(props), @@ -1166,7 +1061,7 @@ export const DiseaseAnnotationsTable = () => { { field: "sgdStrainBackground.name", header: "SGD Strain Background", - body: sgdStrainBackgroundBodyTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.sgdStrainBackgroundFilterConfig, editor: (props) => sgdStrainBackgroundEditorSelector(props) diff --git a/src/main/cliapp/src/utils/utils.js b/src/main/cliapp/src/utils/utils.js index 2b677e670..c8fec9c96 100644 --- a/src/main/cliapp/src/utils/utils.js +++ b/src/main/cliapp/src/utils/utils.js @@ -479,4 +479,13 @@ export const processOptionalField = (eventValue) => { if(!eventValue || eventValue === "") return null; if (!eventValue.curie) return {curie: eventValue}; return eventValue; -} \ No newline at end of file +} + +export const getSubjectText = (subject) => { + if (subject.geneSymbol) return subject.geneSymbol.displayText; + if (subject.alleleSymbol) return subject.alleleSymbol.displayText; + if (subject.geneFullName) return subject.geneFullName.displayText; + if (subject.alleleFullName) return subject.alleleFullName.displayText; + if (subject.name) return subject.name; + return null; +}; \ No newline at end of file From 992abdc4207fff199056c95519eccc685238ccd8 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 9 Feb 2024 12:07:44 -0600 Subject: [PATCH 092/159] moved BooleanTemplate and added to DiseaseAnnotationsTable --- .../src/components/{ => Templates}/BooleanTemplate.js | 3 ++- .../diseaseAnnotationsPage/DiseaseAnnotationsTable.js | 7 +++---- .../src/containers/ontologies/GeneralOntologyComponent.js | 2 +- .../src/containers/vocabularyPage/VocabulariesTable.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename src/main/cliapp/src/components/{ => Templates}/BooleanTemplate.js (56%) diff --git a/src/main/cliapp/src/components/BooleanTemplate.js b/src/main/cliapp/src/components/Templates/BooleanTemplate.js similarity index 56% rename from src/main/cliapp/src/components/BooleanTemplate.js rename to src/main/cliapp/src/components/Templates/BooleanTemplate.js index 8685460d6..d717f797a 100644 --- a/src/main/cliapp/src/components/BooleanTemplate.js +++ b/src/main/cliapp/src/components/Templates/BooleanTemplate.js @@ -1,6 +1,7 @@ import React from 'react' -import { EllipsisTableCell } from './EllipsisTableCell'; +import { EllipsisTableCell } from '../EllipsisTableCell'; export const BooleanTemplate = ({ value }) => { + if (value === null || value === undefined) return null; return {JSON.stringify(value)}; } diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index f25339e48..c65167de5 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -41,11 +41,10 @@ import { Tooltip } from 'primereact/tooltip'; import { getRefString, autocompleteSearch, buildAutocompleteFilter, defaultAutocompleteOnChange, multipleAutocompleteOnChange, getIdentifier } from '../../utils/utils'; import { useNewAnnotationReducer } from "./useNewAnnotationReducer"; import { NewAnnotationForm } from "./NewAnnotationForm"; -//MOVE? -import { internalTemplate, obsoleteTemplate } from '../../components/AuditedObjectComponent'; import { AutocompleteMultiEditor } from "../../components/Autocomplete/AutocompleteMultiEditor"; import { getDefaultTableState } from '../../service/TableStateService'; import { FILTER_CONFIGS } from '../../constants/FilterFields'; +import { BooleanTemplate } from '../../components/Templates/BooleanTemplate'; export const DiseaseAnnotationsTable = () => { @@ -1157,7 +1156,7 @@ export const DiseaseAnnotationsTable = () => { { field: "internal", header: "Internal", - body: internalTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.internalFilterConfig, editor: (props) => internalEditor(props) @@ -1165,7 +1164,7 @@ export const DiseaseAnnotationsTable = () => { { field: "obsolete", header: "Obsolete", - body: obsoleteTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.obsoleteFilterConfig, editor: (props) => obsoleteEditor(props) diff --git a/src/main/cliapp/src/containers/ontologies/GeneralOntologyComponent.js b/src/main/cliapp/src/containers/ontologies/GeneralOntologyComponent.js index 140235a1c..926ff1581 100644 --- a/src/main/cliapp/src/containers/ontologies/GeneralOntologyComponent.js +++ b/src/main/cliapp/src/containers/ontologies/GeneralOntologyComponent.js @@ -3,7 +3,7 @@ import { Toast } from 'primereact/toast'; import { NameTemplate } from './NameTemplate'; import { TabView, TabPanel } from 'primereact/tabview'; import { DefinitionTemplate } from './DefinitionTemplate'; -import { BooleanTemplate } from '../../components/BooleanTemplate'; +import { BooleanTemplate } from '../../components/Templates/BooleanTemplate'; import { GenericDataTable } from '../../components/GenericDataTable/GenericDataTable'; import { GenericDataTree } from '../../components/GenericDataTree'; import { getDefaultTableState } from '../../service/TableStateService'; diff --git a/src/main/cliapp/src/containers/vocabularyPage/VocabulariesTable.js b/src/main/cliapp/src/containers/vocabularyPage/VocabulariesTable.js index 2b5b8a795..5138f8304 100644 --- a/src/main/cliapp/src/containers/vocabularyPage/VocabulariesTable.js +++ b/src/main/cliapp/src/containers/vocabularyPage/VocabulariesTable.js @@ -1,7 +1,7 @@ import React, { useRef, useState } from 'react' import { useMutation } from 'react-query'; import { Toast } from 'primereact/toast'; -import { BooleanTemplate } from '../../components/BooleanTemplate'; +import { BooleanTemplate } from '../../components/Templates/BooleanTemplate'; import { VocabularyService } from "../../service/VocabularyService"; import { useControlledVocabularyService } from "../../service/useControlledVocabularyService"; import { GenericDataTable } from '../../components/GenericDataTable/GenericDataTable'; From 1a15263db6e5a0b155a9856a94d2a806e435bf28 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 9 Feb 2024 12:13:34 -0600 Subject: [PATCH 093/159] refactor GeneticModifiersTemplate --- .../subject/GeneticModifiersTemplate.js | 35 ++++++++++++++++ .../DiseaseAnnotationsTable.js | 40 +------------------ 2 files changed, 37 insertions(+), 38 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/subject/GeneticModifiersTemplate.js diff --git a/src/main/cliapp/src/components/Templates/subject/GeneticModifiersTemplate.js b/src/main/cliapp/src/components/Templates/subject/GeneticModifiersTemplate.js new file mode 100644 index 000000000..b7396a41f --- /dev/null +++ b/src/main/cliapp/src/components/Templates/subject/GeneticModifiersTemplate.js @@ -0,0 +1,35 @@ +import { EllipsisTableCell } from "../../EllipsisTableCell"; +import { ListTableCell } from "../../ListTableCell"; +import { getSubjectText } from "../../../utils/utils"; +import { Tooltip } from "primereact/tooltip"; + +export const GeneticModifiersTemplate = ({ diseaseGeneticModifiers }) => { + if (!diseaseGeneticModifiers || diseaseGeneticModifiers.length !== 0) return null; + const targetClass = `a${global.crypto.randomUUID()}`; + const diseaseGeneticModifierStrings = diseaseGeneticModifiers.map((dgm) => { + const text = getSubjectText(dgm); + if(!text) return dgm.curie; + return `${text} (${dgm.curie})`; + }); + + const sortedDiseaseGeneticModifierStrings = diseaseGeneticModifierStrings.sort(); + + const listTemplate = (dgmString) => { + return ( + +
+ + ); + }; + + return ( + <> +
+ +
+ + + + + ); +}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index c65167de5..d8d8659db 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -8,7 +8,6 @@ import { EvidenceAutocompleteTemplate } from '../../components/Autocomplete/Evid import { LiteratureAutocompleteTemplate } from '../../components/Autocomplete/LiteratureAutocompleteTemplate'; import { EditMessageTooltip } from '../../components/EditMessageTooltip'; import { EllipsisTableCell } from '../../components/EllipsisTableCell'; -import { ListTableCell } from '../../components/ListTableCell'; import { GenericDataTable } from '../../components/GenericDataTable/GenericDataTable'; import { SearchService } from '../../service/SearchService'; import { DiseaseAnnotationService } from '../../service/DiseaseAnnotationService'; @@ -44,6 +43,7 @@ import { NewAnnotationForm } from "./NewAnnotationForm"; import { AutocompleteMultiEditor } from "../../components/Autocomplete/AutocompleteMultiEditor"; import { getDefaultTableState } from '../../service/TableStateService'; import { FILTER_CONFIGS } from '../../constants/FilterFields'; +import { GeneticModifiersTemplate } from '../../components/Templates/subject/GeneticModifiersTemplate'; import { BooleanTemplate } from '../../components/Templates/BooleanTemplate'; export const DiseaseAnnotationsTable = () => { @@ -847,42 +847,6 @@ export const DiseaseAnnotationsTable = () => { ); }; - //MOVE - const geneticModifiersBodyTemplate = (rowData) => { - if (rowData?.diseaseGeneticModifiers && rowData.diseaseGeneticModifiers.length > 0) { - const diseaseGeneticModifierStrings = []; - rowData.diseaseGeneticModifiers.forEach((dgm) => { - const identifier = getIdentifier(dgm); - if (dgm.geneSymbol || dgm.alleleSymbol) { - let symbolValue = dgm.geneSymbol ? dgm.geneSymbol.displayText : dgm.alleleSymbol.displayText; - diseaseGeneticModifierStrings.push(symbolValue + ' (' + identifier + ')'); - } else if (dgm.name) { - diseaseGeneticModifierStrings.push(dgm.name + ' (' + identifier + ')'); - } else { - diseaseGeneticModifierStrings.push(identifier); - } - }); - const sortedDiseaseGeneticModifierStrings = diseaseGeneticModifierStrings.sort(); - const listTemplate = (dgmString) => { - return ( - -
- - ) - }; - return ( - <> -
- -
- - - - - ); - } - }; - const onReferenceValueChange = (event, setFieldValue, props) => { defaultAutocompleteOnChange(props, event, "singleReference", setFieldValue); }; @@ -1082,7 +1046,7 @@ export const DiseaseAnnotationsTable = () => { { field: "diseaseGeneticModifiers.symbol", header: "Genetic Modifiers", - body: geneticModifiersBodyTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.geneticModifiersFilterConfig, editor: (props) => geneticModifiersEditorTemplate(props), From da0fffe0738df0fe5f6e0a057c93b85644f0416b Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 13 Feb 2024 12:24:59 -0600 Subject: [PATCH 094/159] add GenomicEntityTemplate and GenomicEntityListTemplate --- .../Templates/AssertedAlleleBodyTemplate.js | 41 ---- .../Templates/AssertedGenesBodyTemplate.js | 29 --- .../Templates/InferredAlleleBodyTemplate.js | 41 ---- .../Templates/InferredGeneBodyTemplate.js | 22 --- .../src/components/Templates/WithTemplate.js | 22 --- .../GenomicEntityListTemplate.js | 34 ++++ .../GenomicEntityTemplate.js} | 14 +- .../GenomicEntityListTemplate.test.js | 180 ++++++++++++++++++ .../__tests__/GenomicEntityTemplate.test.js | 124 ++++++++++++ .../subject/GeneticModifiersTemplate.js | 35 ---- .../subject/__tests__/SubjectTemplate.test.js | 124 ------------ .../DiseaseAnnotationsTable.js | 25 +-- .../__tests__/DiseaseAnnotationsTable.test.js | 8 +- .../mockData/mockData.js | 2 +- src/main/cliapp/src/tools/jest/setupTests.js | 16 +- src/main/cliapp/src/utils/utils.js | 12 +- 16 files changed, 375 insertions(+), 354 deletions(-) delete mode 100644 src/main/cliapp/src/components/Templates/AssertedAlleleBodyTemplate.js delete mode 100644 src/main/cliapp/src/components/Templates/AssertedGenesBodyTemplate.js delete mode 100644 src/main/cliapp/src/components/Templates/InferredAlleleBodyTemplate.js delete mode 100644 src/main/cliapp/src/components/Templates/InferredGeneBodyTemplate.js delete mode 100644 src/main/cliapp/src/components/Templates/WithTemplate.js create mode 100644 src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityListTemplate.js rename src/main/cliapp/src/components/Templates/{subject/SubjectTemplate.js => genomicEntity/GenomicEntityTemplate.js} (54%) create mode 100644 src/main/cliapp/src/components/Templates/genomicEntity/__tests__/GenomicEntityListTemplate.test.js create mode 100644 src/main/cliapp/src/components/Templates/genomicEntity/__tests__/GenomicEntityTemplate.test.js delete mode 100644 src/main/cliapp/src/components/Templates/subject/GeneticModifiersTemplate.js delete mode 100644 src/main/cliapp/src/components/Templates/subject/__tests__/SubjectTemplate.test.js diff --git a/src/main/cliapp/src/components/Templates/AssertedAlleleBodyTemplate.js b/src/main/cliapp/src/components/Templates/AssertedAlleleBodyTemplate.js deleted file mode 100644 index e8b918968..000000000 --- a/src/main/cliapp/src/components/Templates/AssertedAlleleBodyTemplate.js +++ /dev/null @@ -1,41 +0,0 @@ -import { Tooltip } from "primereact/tooltip"; - -export const AssertedAlleleBodyTemplate = ({ rowData }) => { - if (rowData?.assertedAllele) { - if (rowData.assertedAllele?.alleleSymbol) { - return ( - <> -
- -
- - - ); - } else { - return ( - <> -
- -
- - - ); - } - } else { - return null; - } -}; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/AssertedGenesBodyTemplate.js b/src/main/cliapp/src/components/Templates/AssertedGenesBodyTemplate.js deleted file mode 100644 index 8eeaac6bb..000000000 --- a/src/main/cliapp/src/components/Templates/AssertedGenesBodyTemplate.js +++ /dev/null @@ -1,29 +0,0 @@ -import { EllipsisTableCell } from "../EllipsisTableCell"; -import { ListTableCell } from "../ListTableCell"; -import { Tooltip } from "primereact/tooltip"; - -export const AssertedGenesBodyTemplate = ({ rowData }) => { - if (rowData?.assertedGenes?.length > 0) { - const sortedAssertedGenes = rowData.assertedGenes.sort((a, b) => (a.geneSymbol?.displayText > b.geneSymbol?.displayText) ? 1 : (a.curie === b.curie) ? 1 : -1); - const listTemplate = (item) => { - return ( - - {`${item.geneSymbol?.displayText} (${item.curie})`} - - ); - }; - - return ( - <> -
- -
- - - - - ); - } else { - return null; - } -}; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/InferredAlleleBodyTemplate.js b/src/main/cliapp/src/components/Templates/InferredAlleleBodyTemplate.js deleted file mode 100644 index 74f38bd10..000000000 --- a/src/main/cliapp/src/components/Templates/InferredAlleleBodyTemplate.js +++ /dev/null @@ -1,41 +0,0 @@ -import { Tooltip } from "primereact/tooltip"; - -export const InferredAlleleBodyTemplate = ({ rowData }) => { - if (rowData?.inferredAllele) { - if (rowData.inferredAllele.alleleSymbol?.displayText) { - return ( - <> -
- -
- - - ); - } else { - return ( - <> -
- -
- - - ); - } - } else { - return null; - } -}; diff --git a/src/main/cliapp/src/components/Templates/InferredGeneBodyTemplate.js b/src/main/cliapp/src/components/Templates/InferredGeneBodyTemplate.js deleted file mode 100644 index bc67c2e48..000000000 --- a/src/main/cliapp/src/components/Templates/InferredGeneBodyTemplate.js +++ /dev/null @@ -1,22 +0,0 @@ -import { Tooltip } from "primereact/tooltip"; -export const InferredGeneBodyTemplate = ({ rowData }) => { - if (rowData?.inferredGene) { - return ( - <> -
- -
- - - ); - } else { - return null; - } -}; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/WithTemplate.js b/src/main/cliapp/src/components/Templates/WithTemplate.js deleted file mode 100644 index 05d07eb18..000000000 --- a/src/main/cliapp/src/components/Templates/WithTemplate.js +++ /dev/null @@ -1,22 +0,0 @@ -import { EllipsisTableCell } from "../EllipsisTableCell"; -import { ListTableCell } from "../ListTableCell"; - -export const WithTemplate = ({ rowData }) => { - if (rowData?.with) { - const sortedWithGenes = rowData.with.sort((a, b) => (a.geneSymbol.displayText > b.geneSymbol.displayText) ? 1 : (a.curie === b.curie) ? 1 : -1); - const listTemplate = (item) => { - return ( - - {item.geneSymbol.displayText + ' (' + item.curie + ')'} - - ); - }; - return ( -
- -
- ); - } else { - return null; - } -}; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityListTemplate.js b/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityListTemplate.js new file mode 100644 index 000000000..8f186a977 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityListTemplate.js @@ -0,0 +1,34 @@ +import { ListTableCell } from "../../ListTableCell"; +import { getGenomicEntityText } from "../../../utils/utils"; +import { Tooltip } from "primereact/tooltip"; + +export const GenomicEntityListTemplate = ({ genomicEntities }) => { + + if (!genomicEntities || genomicEntities.length === 0) return null; + + const targetClass = `a${global.crypto.randomUUID()}`; + + const genomicEntityStrings = genomicEntities.map((genomicEntity) => { + const text = getGenomicEntityText(genomicEntity); + if(!text) return genomicEntity.curie; + if(!genomicEntity.curie) return text; + return `${text} (${genomicEntity.curie})`; + }); + + const sortedGenomicEntityStrings = genomicEntityStrings.sort(); + + const listTemplate = (genomicEntityString) => { + return
; + }; + + return ( + <> +
+ +
+ + + + + ); +}; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/subject/SubjectTemplate.js b/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityTemplate.js similarity index 54% rename from src/main/cliapp/src/components/Templates/subject/SubjectTemplate.js rename to src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityTemplate.js index 658a1fad0..268008db5 100644 --- a/src/main/cliapp/src/components/Templates/subject/SubjectTemplate.js +++ b/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityTemplate.js @@ -1,24 +1,24 @@ import { Tooltip } from "primereact/tooltip"; -import { getSubjectText } from "../../../utils/utils"; +import { getGenomicEntityText } from "../../../utils/utils"; -export const SubjectTemplate = ({ subject }) => { - if (!subject) return null; +export const GenomicEntityTemplate = ({ genomicEntity }) => { + if (!genomicEntity) return null; const targetClass = `a${global.crypto.randomUUID()}`; - const subjectText = getSubjectText(subject); + const subjectText = getGenomicEntityText(genomicEntity); - if(!subjectText) return
{subject.curie}
; + if(!subjectText) return
{genomicEntity.curie}
; return ( <>
diff --git a/src/main/cliapp/src/components/Templates/genomicEntity/__tests__/GenomicEntityListTemplate.test.js b/src/main/cliapp/src/components/Templates/genomicEntity/__tests__/GenomicEntityListTemplate.test.js new file mode 100644 index 000000000..8300a2f6a --- /dev/null +++ b/src/main/cliapp/src/components/Templates/genomicEntity/__tests__/GenomicEntityListTemplate.test.js @@ -0,0 +1,180 @@ +import { within, render } from '@testing-library/react'; +import { GenomicEntityListTemplate } from '../GenomicEntityListTemplate'; +import '../../../../tools/jest/setupTests'; + +describe('GenomicEntityListTemplate', () => { + + it('should render a list of genomic entities with their corresponding curie', () => { + const genomicEntities = [ + { alleleFullName: { displayText: 'Allele Full Name 1' }, curie: 'CURIE1' }, + { alleleFullName: { displayText: 'Allele Full Name 2' }, curie: 'CURIE2' }, + { alleleFullName: { displayText: 'Allele Full Name 3' }, curie: 'CURIE3' }, + ]; + + const result = render(); + + const genomicEntity1 = result.getByText('Allele Full Name 1 (CURIE1)'); + const genomicEntity2 = result.getByText('Allele Full Name 2 (CURIE2)'); + const genomicEntity3 = result.getByText('Allele Full Name 3 (CURIE3)'); + + expect(genomicEntity1).toBeInTheDocument(); + expect(genomicEntity2).toBeInTheDocument(); + expect(genomicEntity3).toBeInTheDocument(); + }); + + it('should sort the genomic entities alphabetically by their display text', () => { + const genomicEntities = [ + { alleleSymbol: { displayText: 'Allele Symbol C' }, curie: 'CURIE1' }, + { alleleSymbol: { displayText: 'Allele Symbol A' }, curie: 'CURIE2' }, + { alleleSymbol: { displayText: 'Allele Symbol B' }, curie: 'CURIE3' }, + ]; + + const result = render(); + + const genomicEntityList = result.getByRole('list'); + const genomicEntityItems = within(genomicEntityList).getAllByRole('listitem'); + + expect(genomicEntityItems[0]).toHaveTextContent('Allele Symbol A (CURIE2)'); + expect(genomicEntityItems[1]).toHaveTextContent('Allele Symbol B (CURIE3)'); + expect(genomicEntityItems[2]).toHaveTextContent('Allele Symbol C (CURIE1)'); + }); + + it('should return null if genomic entities array is empty', () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); + + it('should return null if genomic entities array is undefined', () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); + + it('should return the genomic entity curie if no display text is available', () => { + const genomicEntities = [ + { curie: 'CURIE1' }, + { curie: 'CURIE2' }, + { curie: 'CURIE3' }, + ]; + + const result = render(); + + const genomicEntity1 = result.getByText('CURIE1'); + const genomicEntity2 = result.getByText('CURIE2'); + const genomicEntity3 = result.getByText('CURIE3'); + + expect(genomicEntity1).toBeInTheDocument(); + expect(genomicEntity2).toBeInTheDocument(); + expect(genomicEntity3).toBeInTheDocument(); + }); + + it('should handle genomic entities with missing or null properties', () => { + const genomicEntities = [ + { geneSymbol: null, curie: 'CURIE1' }, + { geneSymbol: { displayText: 'Gene Symbol 2' }, curie: 'CURIE2' }, + { geneSymbol: { displayText: 'Gene Symbol 3' }, curie: null }, + ]; + + const result = render(); + + const genomicEntity1 = result.getByText('CURIE1'); + const genomicEntity2 = result.getByText('Gene Symbol 2 (CURIE2)'); + const genomicEntity3 = result.getByText('Gene Symbol 3'); + + expect(genomicEntity1).toBeInTheDocument(); + expect(genomicEntity2).toBeInTheDocument(); + expect(genomicEntity3).toBeInTheDocument(); + }); + + // Handles genomic entities with missing or null properties. + it('should handle genomic entities with missing or null properties', () => { + const genomicEntities = [ + { alleleFullName: null, curie: 'CURIE1' }, + { alleleFullName: { displayText: 'Allele Full Name 2' }, curie: null }, + { alleleFullName: null, curie: null }, + ]; + + const result = render(); + + const genomicEntity1 = result.getByText('CURIE1'); + const genomicEntity2 = result.getByText('Allele Full Name 2'); + const genomicEntity3 = result.queryByText('Allele Full Name 3'); + + expect(genomicEntity1).toBeInTheDocument(); + expect(genomicEntity2).toBeInTheDocument(); + expect(genomicEntity3).toBeNull(); + }); + + it('should handle genomic entities with missing or null display text', () => { + const genomicEntities = [ + { alleleFullName: { displayText: null }, curie: 'CURIE1' }, + { alleleFullName: { displayText: null }, curie: 'CURIE2' }, + { alleleFullName: { displayText: null }, curie: 'CURIE3' }, + ]; + + const result = render(); + + const genomicEntity1 = result.getByText('CURIE1'); + const genomicEntity2 = result.getByText('CURIE2'); + const genomicEntity3 = result.getByText('CURIE3'); + + expect(genomicEntity1).toBeInTheDocument(); + expect(genomicEntity2).toBeInTheDocument(); + expect(genomicEntity3).toBeInTheDocument(); + }); + + it('should handle genomic entities with missing or null alleleFullName', () => { + const genomicEntities = [ + { alleleFullName: null, curie: 'CURIE1' }, + { alleleFullName: null, curie: 'CURIE2' }, + { alleleFullName: null, curie: 'CURIE3' }, + ]; + + const result = render(); + + const genomicEntity1 = result.getByText('CURIE1'); + const genomicEntity2 = result.getByText('CURIE2'); + const genomicEntity3 = result.getByText('CURIE3'); + + expect(genomicEntity1).toBeInTheDocument(); + expect(genomicEntity2).toBeInTheDocument(); + expect(genomicEntity3).toBeInTheDocument(); + }); + + it('should display symbol before full name', () => { + const genomicEntities = [ + { + geneSymbol: { + displayText: "Gene Symbol 1", + }, + geneFullName: { + displayText: "Gene Full Name 1", + }, + curie: 'CURIE1' + }, + { + geneSymbol: null, + geneFullName: { + displayText: "Gene Full Name 2", + }, + curie: 'CURIE2' + }, + { + geneSymbol: { + displayText: "Gene Symbol 3", + }, + geneFullName: null, + curie: 'CURIE3' + }, + ]; + + const result = render(); + + const genomicEntity1 = result.getByText('Gene Symbol 1 (CURIE1)'); + const genomicEntity2 = result.getByText('Gene Full Name 2 (CURIE2)'); + const genomicEntity3 = result.getByText('Gene Symbol 3 (CURIE3)'); + + expect(genomicEntity1).toBeInTheDocument(); + expect(genomicEntity2).toBeInTheDocument(); + expect(genomicEntity3).toBeInTheDocument(); + }); +}); diff --git a/src/main/cliapp/src/components/Templates/genomicEntity/__tests__/GenomicEntityTemplate.test.js b/src/main/cliapp/src/components/Templates/genomicEntity/__tests__/GenomicEntityTemplate.test.js new file mode 100644 index 000000000..d4c14604d --- /dev/null +++ b/src/main/cliapp/src/components/Templates/genomicEntity/__tests__/GenomicEntityTemplate.test.js @@ -0,0 +1,124 @@ +import { fireEvent, render } from '@testing-library/react'; +import { GenomicEntityTemplate } from '../GenomicEntityTemplate'; +import '../../../../tools/jest/setupTests'; + +describe('GenomicEntityTemplate', () => { + + it('should render genomicEntity text and curie when genomicEntity has geneSymbol', () => { + const genomicEntity = { + geneSymbol: { + displayText: 'Gene Symbol' + }, + curie: 'CURIE' + }; + + const result = render(); + + const content = result.getByText('Gene Symbol (CURIE)'); + expect(content).toBeInTheDocument(); + }); + + it('should render genomicEntity text and curie when genomicEntity has alleleSymbol', () => { + const genomicEntity = { + alleleSymbol: { + displayText: 'Allele Symbol' + }, + curie: 'CURIE' + }; + + const result = render(); + + const content = result.getByText('Allele Symbol (CURIE)'); + expect(content).toBeInTheDocument(); + }); + + it('should render genomicEntity text and curie when genomicEntity has geneFullName', () => { + const genomicEntity = { + geneFullName: { + displayText: 'Gene Full Name' + }, + curie: 'CURIE' + }; + + const result = render(); + + const content = result.getByText('Gene Full Name (CURIE)'); + expect(content).toBeInTheDocument(); + }); + + it('should render genomicEntity text and curie when genomicEntity has alleleFullName', () => { + const genomicEntity = { + alleleFullName: { + displayText: 'Allele Full Name' + }, + curie: 'CURIE' + }; + + const result = render(); + + const content = result.getByText('Allele Full Name (CURIE)'); + expect(content).toBeInTheDocument(); + }); + it('should render genomicEntity name and curie when genomicEntity has name', () => { + const genomicEntity = { + name: 'genomicEntity Name', + curie: 'CURIE' + }; + + const result = render(); + + const content = result.getByText('genomicEntity Name (CURIE)'); + expect(content).toBeInTheDocument(); + }); + + it('should render genomicEntity curie in a div when genomicEntity has no displayable text', () => { + const genomicEntity = { + curie: 'CURIE' + }; + + const result = render(); + + const divContent = result.getByText('CURIE'); + expect(divContent).toBeInTheDocument(); + }); + + it('should render null when genomicEntity is null', () => { + const genomicEntity = null; + + const { container } = render(); + + expect(container.firstChild).toBeNull(); + }); + + it('should render genomicEntity text and curie in a tooltip when genomicEntity has geneSymbol', async () => { + const genomicEntity = { + geneSymbol: { + displayText: 'Gene Symbol' + }, + curie: 'CURIE' + }; + + const result = render(); + + let divContentArray = result.getAllByText('Gene Symbol (CURIE)'); + expect(divContentArray).toHaveLength(1); + + fireEvent.mouseEnter(divContentArray[0]); + //using find... here because it's async and the tooltip is dynamically added + expect(await result.findAllByText('Gene Symbol (CURIE)')).toHaveLength(2); + }); + + it('should render tags in the HTML', async () => { + const genomicEntity = { + geneSymbol: { + displayText: 'Gene Symbol' + }, + curie: 'CURIE' + }; + + const { container } = render(); + + let superScript = container.querySelector('sup'); + expect(superScript).toBeInTheDocument(); + }); +}); diff --git a/src/main/cliapp/src/components/Templates/subject/GeneticModifiersTemplate.js b/src/main/cliapp/src/components/Templates/subject/GeneticModifiersTemplate.js deleted file mode 100644 index b7396a41f..000000000 --- a/src/main/cliapp/src/components/Templates/subject/GeneticModifiersTemplate.js +++ /dev/null @@ -1,35 +0,0 @@ -import { EllipsisTableCell } from "../../EllipsisTableCell"; -import { ListTableCell } from "../../ListTableCell"; -import { getSubjectText } from "../../../utils/utils"; -import { Tooltip } from "primereact/tooltip"; - -export const GeneticModifiersTemplate = ({ diseaseGeneticModifiers }) => { - if (!diseaseGeneticModifiers || diseaseGeneticModifiers.length !== 0) return null; - const targetClass = `a${global.crypto.randomUUID()}`; - const diseaseGeneticModifierStrings = diseaseGeneticModifiers.map((dgm) => { - const text = getSubjectText(dgm); - if(!text) return dgm.curie; - return `${text} (${dgm.curie})`; - }); - - const sortedDiseaseGeneticModifierStrings = diseaseGeneticModifierStrings.sort(); - - const listTemplate = (dgmString) => { - return ( - -
- - ); - }; - - return ( - <> -
- -
- - - - - ); -}; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/subject/__tests__/SubjectTemplate.test.js b/src/main/cliapp/src/components/Templates/subject/__tests__/SubjectTemplate.test.js deleted file mode 100644 index a220a9cfd..000000000 --- a/src/main/cliapp/src/components/Templates/subject/__tests__/SubjectTemplate.test.js +++ /dev/null @@ -1,124 +0,0 @@ -import { fireEvent, render } from '@testing-library/react'; -import { SubjectTemplate } from '../SubjectTemplate'; -import '../../../../tools/jest/setupTests'; - -describe('SubjectTemplate', () => { - - it('should render subject text and curie when subject has geneSymbol', () => { - const subject = { - geneSymbol: { - displayText: 'Gene Symbol' - }, - curie: 'CURIE' - }; - - const result = render(); - - const content = result.getByText('Gene Symbol (CURIE)'); - expect(content).toBeInTheDocument(); - }); - - it('should render subject text and curie when subject has alleleSymbol', () => { - const subject = { - alleleSymbol: { - displayText: 'Allele Symbol' - }, - curie: 'CURIE' - }; - - const result = render(); - - const content = result.getByText('Allele Symbol (CURIE)'); - expect(content).toBeInTheDocument(); - }); - - it('should render subject text and curie when subject has geneFullName', () => { - const subject = { - geneFullName: { - displayText: 'Gene Full Name' - }, - curie: 'CURIE' - }; - - const result = render(); - - const content = result.getByText('Gene Full Name (CURIE)'); - expect(content).toBeInTheDocument(); - }); - - it('should render subject text and curie when subject has alleleFullName', () => { - const subject = { - alleleFullName: { - displayText: 'Allele Full Name' - }, - curie: 'CURIE' - }; - - const result = render(); - - const content = result.getByText('Allele Full Name (CURIE)'); - expect(content).toBeInTheDocument(); - }); - it('should render subject name and curie when subject has name', () => { - const subject = { - name: 'Subject Name', - curie: 'CURIE' - }; - - const result = render(); - - const content = result.getByText('Subject Name (CURIE)'); - expect(content).toBeInTheDocument(); - }); - - it('should render subject curie in a div when subject has no displayable text', () => { - const subject = { - curie: 'CURIE' - }; - - const result = render(); - - const divContent = result.getByText('CURIE'); - expect(divContent).toBeInTheDocument(); - }); - - it('should render null when subject is null', () => { - const subject = null; - - const { container } = render(); - - expect(container.firstChild).toBeNull(); - }); - - it('should render subject text and curie in a tooltip when subject has geneSymbol', async () => { - const subject = { - geneSymbol: { - displayText: 'Gene Symbol' - }, - curie: 'CURIE' - }; - - const result = render(); - - let divContentArray = result.getAllByText('Gene Symbol (CURIE)'); - expect(divContentArray).toHaveLength(1); - - fireEvent.mouseEnter(divContentArray[0]); - //using find... here because it's async and the tooltip is dynamically added - expect(await result.findAllByText('Gene Symbol (CURIE)')).toHaveLength(2); - }); - - it('should render tags in the HTML', async () => { - const subject = { - geneSymbol: { - displayText: 'Gene Symbol' - }, - curie: 'CURIE' - }; - - const { container } = render(); - - let superScript = container.querySelector('sup'); - expect(superScript).toBeInTheDocument(); - }); -}); diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index d8d8659db..7b962db45 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -13,18 +13,13 @@ import { SearchService } from '../../service/SearchService'; import { DiseaseAnnotationService } from '../../service/DiseaseAnnotationService'; import { RelatedNotesDialog } from '../../components/RelatedNotesDialog'; import { ConditionRelationsDialog } from './ConditionRelationsDialog'; -import { WithTemplate } from '../../components/Templates/WithTemplate'; -import { AssertedGenesBodyTemplate } from '../../components/Templates/AssertedGenesBodyTemplate'; import { EvidenceTemplate } from '../../components/Templates/EvidenceTemplate'; import { SingleReferenceBodyTemplate } from '../../components/Templates/SingleReferenceBodyTemplate'; -import { InferredGeneBodyTemplate } from '../../components/Templates/InferredGeneBodyTemplate'; -import { InferredAlleleBodyTemplate } from '../../components/Templates/InferredAlleleBodyTemplate'; -import { AssertedAlleleBodyTemplate } from '../../components/Templates/AssertedAlleleBodyTemplate'; import { DiseaseQualifiersBodyTemplate } from '../../components/Templates/DiseaseQualifiersBodyTemplate'; import { NegatedTemplate } from '../../components/Templates/NegatedTemplate'; import { IdBodyTemplate } from '../../components/Templates/IdBodyTemplate'; import { DiseaseTemplate } from '../../components/Templates/DiseaseTemplate'; -import { SubjectTemplate } from '../../components/Templates/subject/SubjectTemplate'; +import { GenomicEntityTemplate } from '../../components/Templates/genomicEntity/GenomicEntityTemplate'; @@ -43,7 +38,7 @@ import { NewAnnotationForm } from "./NewAnnotationForm"; import { AutocompleteMultiEditor } from "../../components/Autocomplete/AutocompleteMultiEditor"; import { getDefaultTableState } from '../../service/TableStateService'; import { FILTER_CONFIGS } from '../../constants/FilterFields'; -import { GeneticModifiersTemplate } from '../../components/Templates/subject/GeneticModifiersTemplate'; +import { GenomicEntityListTemplate } from '../../components/Templates/genomicEntity/GenomicEntityListTemplate'; import { BooleanTemplate } from '../../components/Templates/BooleanTemplate'; export const DiseaseAnnotationsTable = () => { @@ -929,7 +924,7 @@ export const DiseaseAnnotationsTable = () => { { field: "diseaseAnnotationSubject.symbol", header: "Subject", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.diseaseAnnotationSubjectFieldConfig, editor: (props) => subjectEditorTemplate(props), @@ -977,7 +972,7 @@ export const DiseaseAnnotationsTable = () => { { field: "with.geneSymbol.displayText", header: "With", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.withFilterConfig, editor: (props) => withEditorTemplate(props) @@ -1024,7 +1019,7 @@ export const DiseaseAnnotationsTable = () => { { field: "sgdStrainBackground.name", header: "SGD Strain Background", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.sgdStrainBackgroundFilterConfig, editor: (props) => sgdStrainBackgroundEditorSelector(props) @@ -1046,7 +1041,7 @@ export const DiseaseAnnotationsTable = () => { { field: "diseaseGeneticModifiers.symbol", header: "Genetic Modifiers", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.geneticModifiersFilterConfig, editor: (props) => geneticModifiersEditorTemplate(props), @@ -1054,14 +1049,14 @@ export const DiseaseAnnotationsTable = () => { { field: "inferredGene.geneSymbol.displayText", header: "Inferred Gene", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.inferredGeneFilterConfig, }, { field: "assertedGenes.geneSymbol.displayText", header: "Asserted Genes", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.assertedGenesFilterConfig, editor: (props) => assertedGenesEditorTemplate(props), @@ -1069,14 +1064,14 @@ export const DiseaseAnnotationsTable = () => { { field: "inferredAllele.alleleSymbol.displayText", header: "Inferred Allele", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.inferredAlleleFilterConfig, }, { field: "assertedAllele.alleleSymbol.displayText", header: "Asserted Allele", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.assertedAlleleFilterConfig, editor: (props) => assertedAlleleEditorTemplate(props), diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/__tests__/DiseaseAnnotationsTable.test.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/__tests__/DiseaseAnnotationsTable.test.js index 8a29f668c..ffcaed57f 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/__tests__/DiseaseAnnotationsTable.test.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/__tests__/DiseaseAnnotationsTable.test.js @@ -2,7 +2,7 @@ import React from "react"; import { waitFor } from "@testing-library/react"; import { renderWithClient } from '../../../tools/jest/utils'; import { DiseaseAnnotationsPage } from "../index"; -import { setLocalStorage } from "../../../tools/jest/setupTests"; +import '../../../tools/jest/setupTests'; import { setupSettingsHandler, setupFindHandler, setupSearchHandler, setupSaveSettingsHandler } from "../../../tools/jest/commonMswhandlers"; import { data } from "../mockData/mockData"; import 'core-js/features/structured-clone'; @@ -21,14 +21,14 @@ describe("", () => { await waitFor(() => { expect(result); }); - }); + }, 10000); it("Contains Correct Table Name", async () => { let result = await renderWithClient(); const tableTitle = await result.findByText(/Disease Annotations Table/i); expect(tableTitle).toBeInTheDocument(); - }); + }, 10000); it("The table contains correct data", async () => { let result = await renderWithClient(); @@ -82,6 +82,6 @@ describe("", () => { expect(updatedByCreatedByArray.length).toEqual(2); expect(dateUpdatedDateCreatedArray.length).toEqual(2); }); - }); + }, 10000); }); diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js index 13981e57d..4442d524d 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js @@ -57,7 +57,7 @@ export const data = { "curie": "sgd test curie", "name": "SGD Strain Background test" }, - "diseaseGeneticModifiers": {"symbol": "disease genetic modifier test"}, + "diseaseGeneticModifiers": [{"symbol": "disease genetic modifier test"}], "diseaseQualifiers": [{"name": "disease qualifiers test"}], "dateCreated": "2017-06-08T14:15:35Z", "dateUpdated": "2017-06-08T14:15:35Z", diff --git a/src/main/cliapp/src/tools/jest/setupTests.js b/src/main/cliapp/src/tools/jest/setupTests.js index 69e79e4db..c6a8b51d9 100644 --- a/src/main/cliapp/src/tools/jest/setupTests.js +++ b/src/main/cliapp/src/tools/jest/setupTests.js @@ -45,27 +45,29 @@ const mockOktaTokenStorage = { accessToken: "test access token", } }; +let mockConsoleError; +let mockConsoleWarn; // Establish API and local storage mocking before all tests. beforeAll(() => { server.listen({ - onUnhandledRequest: 'warn', + onUnhandledRequest: 'bypass', }); window.localStorage.clear(); setLocalStorage('okta-token-storage', mockOktaTokenStorage); }); beforeEach(() => { - jest.spyOn(console, 'error'); - jest.spyOn(console, 'warn'); - console.error.mockImplementation(() => {}); - console.warn.mockImplementation(() => {}); + mockConsoleError = jest.spyOn(console, 'error'); + mockConsoleWarn = jest.spyOn(console, 'warn'); + mockConsoleError.mockImplementation(() => {}); + mockConsoleWarn.mockImplementation(() => {}); }); // Reset any request handlers that we may add during the tests, // so they don't affect other tests. afterEach(() => { - console.error.mockRestore(); - console.warn.mockRestore(); + mockConsoleError.mockRestore(); + mockConsoleWarn.mockRestore(); server.resetHandlers(); }); diff --git a/src/main/cliapp/src/utils/utils.js b/src/main/cliapp/src/utils/utils.js index c8fec9c96..91e6250af 100644 --- a/src/main/cliapp/src/utils/utils.js +++ b/src/main/cliapp/src/utils/utils.js @@ -481,11 +481,11 @@ export const processOptionalField = (eventValue) => { return eventValue; } -export const getSubjectText = (subject) => { - if (subject.geneSymbol) return subject.geneSymbol.displayText; - if (subject.alleleSymbol) return subject.alleleSymbol.displayText; - if (subject.geneFullName) return subject.geneFullName.displayText; - if (subject.alleleFullName) return subject.alleleFullName.displayText; - if (subject.name) return subject.name; +export const getGenomicEntityText = (genomicEntity) => { + if (genomicEntity.geneSymbol) return genomicEntity.geneSymbol.displayText; + if (genomicEntity.alleleSymbol) return genomicEntity.alleleSymbol.displayText; + if (genomicEntity.geneFullName) return genomicEntity.geneFullName.displayText; + if (genomicEntity.alleleFullName) return genomicEntity.alleleFullName.displayText; + if (genomicEntity.name) return genomicEntity.name; return null; }; \ No newline at end of file From befbb9f5e5a3cd32ddee2990c1f6acdbe11c6d93 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 13 Feb 2024 12:33:48 -0600 Subject: [PATCH 095/159] replace NegatedTemplate with BooleanTemplate --- .../cliapp/src/components/Templates/NegatedTemplate.js | 9 --------- .../diseaseAnnotationsPage/DiseaseAnnotationsTable.js | 3 +-- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 src/main/cliapp/src/components/Templates/NegatedTemplate.js diff --git a/src/main/cliapp/src/components/Templates/NegatedTemplate.js b/src/main/cliapp/src/components/Templates/NegatedTemplate.js deleted file mode 100644 index ea5d2681f..000000000 --- a/src/main/cliapp/src/components/Templates/NegatedTemplate.js +++ /dev/null @@ -1,9 +0,0 @@ -import { EllipsisTableCell } from "../EllipsisTableCell"; - -export const NegatedTemplate = ({ rowData }) => { - if (rowData?.negated !== null || rowData?.negated !== undefined) { - return {JSON.stringify(rowData.negated)}; - } else { - return null; - } -}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 7b962db45..28ef65447 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -16,7 +16,6 @@ import { ConditionRelationsDialog } from './ConditionRelationsDialog'; import { EvidenceTemplate } from '../../components/Templates/EvidenceTemplate'; import { SingleReferenceBodyTemplate } from '../../components/Templates/SingleReferenceBodyTemplate'; import { DiseaseQualifiersBodyTemplate } from '../../components/Templates/DiseaseQualifiersBodyTemplate'; -import { NegatedTemplate } from '../../components/Templates/NegatedTemplate'; import { IdBodyTemplate } from '../../components/Templates/IdBodyTemplate'; import { DiseaseTemplate } from '../../components/Templates/DiseaseTemplate'; import { GenomicEntityTemplate } from '../../components/Templates/genomicEntity/GenomicEntityTemplate'; @@ -939,7 +938,7 @@ export const DiseaseAnnotationsTable = () => { { field: "negated", header: "Negated", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.negatedFilterConfig, editor: (props) => negatedEditor(props) From 1399b97f1ff43e4d6e9dcb37f32edb7a3710f142 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 13 Feb 2024 12:51:33 -0600 Subject: [PATCH 096/159] refactor EvidenceCodesTemplate --- .../Templates/EvidenceCodesTemplate.js | 30 +++++++++++++++++++ .../components/Templates/EvidenceTemplate.js | 28 ----------------- .../GenomicEntityListTemplate.js | 4 +-- .../DiseaseAnnotationsTable.js | 4 +-- 4 files changed, 34 insertions(+), 32 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/EvidenceCodesTemplate.js delete mode 100644 src/main/cliapp/src/components/Templates/EvidenceTemplate.js diff --git a/src/main/cliapp/src/components/Templates/EvidenceCodesTemplate.js b/src/main/cliapp/src/components/Templates/EvidenceCodesTemplate.js new file mode 100644 index 000000000..1db0b029c --- /dev/null +++ b/src/main/cliapp/src/components/Templates/EvidenceCodesTemplate.js @@ -0,0 +1,30 @@ +import { EllipsisTableCell } from "../EllipsisTableCell"; +import { ListTableCell } from "../ListTableCell"; +import { Tooltip } from "primereact/tooltip"; + +export const EvidenceCodesTemplate = ({ evidenceCodes }) => { + if (!evidenceCodes || evidenceCodes.length === 0) return null; + + const targetClass = `a${global.crypto.randomUUID()}`; + + const sortedEvidenceCodes = evidenceCodes.sort((a, b) => (a.abbreviation > b.abbreviation) ? 1 : (a.curie === b.curie) ? 1 : -1); + + const listTemplate = (item) => { + return ( + + {item.abbreviation + ' - ' + item.name + ' (' + item.curie + ')'} + + ); + }; + + return ( + <> +
+ +
+ + + + + ); +}; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/EvidenceTemplate.js b/src/main/cliapp/src/components/Templates/EvidenceTemplate.js deleted file mode 100644 index a98432514..000000000 --- a/src/main/cliapp/src/components/Templates/EvidenceTemplate.js +++ /dev/null @@ -1,28 +0,0 @@ -import { EllipsisTableCell } from "../EllipsisTableCell"; -import { ListTableCell } from "../ListTableCell"; -import { Tooltip } from "primereact/tooltip"; - -export const EvidenceTemplate = ({ rowData }) => { - if (rowData?.evidenceCodes && rowData.evidenceCodes.length > 0) { - const sortedEvidenceCodes = rowData.evidenceCodes.sort((a, b) => (a.abbreviation > b.abbreviation) ? 1 : (a.curie === b.curie) ? 1 : -1); - const listTemplate = (item) => { - return ( - - {item.abbreviation + ' - ' + item.name + ' (' + item.curie + ')'} - - ); - }; - return ( - <> -
- -
- - - - - ); - } else { - return null; - } -}; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityListTemplate.js b/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityListTemplate.js index 8f186a977..5ad35c7f3 100644 --- a/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityListTemplate.js +++ b/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityListTemplate.js @@ -23,10 +23,10 @@ export const GenomicEntityListTemplate = ({ genomicEntities }) => { return ( <> -
+
- + diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 28ef65447..5908c4e45 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -13,7 +13,7 @@ import { SearchService } from '../../service/SearchService'; import { DiseaseAnnotationService } from '../../service/DiseaseAnnotationService'; import { RelatedNotesDialog } from '../../components/RelatedNotesDialog'; import { ConditionRelationsDialog } from './ConditionRelationsDialog'; -import { EvidenceTemplate } from '../../components/Templates/EvidenceTemplate'; +import { EvidenceCodesTemplate } from '../../components/Templates/EvidenceCodesTemplate'; import { SingleReferenceBodyTemplate } from '../../components/Templates/SingleReferenceBodyTemplate'; import { DiseaseQualifiersBodyTemplate } from '../../components/Templates/DiseaseQualifiersBodyTemplate'; import { IdBodyTemplate } from '../../components/Templates/IdBodyTemplate'; @@ -963,7 +963,7 @@ export const DiseaseAnnotationsTable = () => { { field: "evidenceCodes.abbreviation", header: "Evidence Code", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.evidenceCodesFilterConfig, editor: (props) => evidenceEditorTemplate(props) From 7c582e07b5691fff25aaf8bd7d2a8cfce9f7822a Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 13 Feb 2024 12:58:37 -0600 Subject: [PATCH 097/159] refactor SingleReferenceBodyTemplate --- .../Templates/SingleReferenceBodyTemplate.js | 26 ------------------ .../Templates/SingleReferenceTemplate.js | 27 +++++++++++++++++++ .../DiseaseAnnotationsTable.js | 4 +-- 3 files changed, 29 insertions(+), 28 deletions(-) delete mode 100644 src/main/cliapp/src/components/Templates/SingleReferenceBodyTemplate.js create mode 100644 src/main/cliapp/src/components/Templates/SingleReferenceTemplate.js diff --git a/src/main/cliapp/src/components/Templates/SingleReferenceBodyTemplate.js b/src/main/cliapp/src/components/Templates/SingleReferenceBodyTemplate.js deleted file mode 100644 index b59ff772f..000000000 --- a/src/main/cliapp/src/components/Templates/SingleReferenceBodyTemplate.js +++ /dev/null @@ -1,26 +0,0 @@ -import { getRefString } from "../../utils/utils"; -import { Tooltip } from "primereact/tooltip"; - -export const SingleReferenceBodyTemplate = ({ rowData }) => { - if (rowData?.singleReference) { - let refString = getRefString(rowData.singleReference); - return ( - <> -
- -
- - - ); - - } else { - return null; - } -}; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/SingleReferenceTemplate.js b/src/main/cliapp/src/components/Templates/SingleReferenceTemplate.js new file mode 100644 index 000000000..098bea6cf --- /dev/null +++ b/src/main/cliapp/src/components/Templates/SingleReferenceTemplate.js @@ -0,0 +1,27 @@ +import { getRefString } from "../../utils/utils"; +import { Tooltip } from "primereact/tooltip"; + +export const SingleReferenceTemplate = ({ singleReference }) => { + if (!singleReference) return null; + + const targetClass = `a${global.crypto.randomUUID()}`; + + let refString = getRefString(singleReference); + + return ( + <> +
+ +
+ + + ); + +}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 5908c4e45..c3c8335bb 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -14,7 +14,7 @@ import { DiseaseAnnotationService } from '../../service/DiseaseAnnotationService import { RelatedNotesDialog } from '../../components/RelatedNotesDialog'; import { ConditionRelationsDialog } from './ConditionRelationsDialog'; import { EvidenceCodesTemplate } from '../../components/Templates/EvidenceCodesTemplate'; -import { SingleReferenceBodyTemplate } from '../../components/Templates/SingleReferenceBodyTemplate'; +import { SingleReferenceTemplate } from '../../components/Templates/SingleReferenceTemplate'; import { DiseaseQualifiersBodyTemplate } from '../../components/Templates/DiseaseQualifiersBodyTemplate'; import { IdBodyTemplate } from '../../components/Templates/IdBodyTemplate'; import { DiseaseTemplate } from '../../components/Templates/DiseaseTemplate'; @@ -954,7 +954,7 @@ export const DiseaseAnnotationsTable = () => { { field: "singleReference.primaryCrossReferenceCurie", header: "Reference", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.singleReferenceFilterConfig, editor: (props) => referenceEditorTemplate(props), From e695343dd4cfe5eaf34988ffb898010662b87211 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 13 Feb 2024 13:05:06 -0600 Subject: [PATCH 098/159] refactor DiseaseQualifiersBodyTemplate --- .../Templates/DiseaseQualifiersBodyTemplate.js | 15 --------------- .../Templates/DiseaseQualifiersTemplate.js | 15 +++++++++++++++ .../DiseaseAnnotationsTable.js | 4 ++-- 3 files changed, 17 insertions(+), 17 deletions(-) delete mode 100644 src/main/cliapp/src/components/Templates/DiseaseQualifiersBodyTemplate.js create mode 100644 src/main/cliapp/src/components/Templates/DiseaseQualifiersTemplate.js diff --git a/src/main/cliapp/src/components/Templates/DiseaseQualifiersBodyTemplate.js b/src/main/cliapp/src/components/Templates/DiseaseQualifiersBodyTemplate.js deleted file mode 100644 index 356b03a4f..000000000 --- a/src/main/cliapp/src/components/Templates/DiseaseQualifiersBodyTemplate.js +++ /dev/null @@ -1,15 +0,0 @@ -import { ListTableCell } from "../ListTableCell"; - -export const DiseaseQualifiersBodyTemplate = ({ rowData }) => { - if (rowData?.diseaseQualifiers) { - const sortedDiseaseQualifiers = rowData.diseaseQualifiers.sort((a, b) => (a.name > b.name) ? 1 : -1); - const listTemplate = (item) => item.name; - return ( -
- -
- ); - } else { - return null; - } -}; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/DiseaseQualifiersTemplate.js b/src/main/cliapp/src/components/Templates/DiseaseQualifiersTemplate.js new file mode 100644 index 000000000..42b154cee --- /dev/null +++ b/src/main/cliapp/src/components/Templates/DiseaseQualifiersTemplate.js @@ -0,0 +1,15 @@ +import { ListTableCell } from "../ListTableCell"; + +export const DiseaseQualifiersTemplate = ({ diseaseQualifiers }) => { + if (!diseaseQualifiers) return null; + + const sortedDiseaseQualifiers = diseaseQualifiers.sort((a, b) => (a.name > b.name) ? 1 : -1); + + const listTemplate = (item) => item.name; + + return ( +
+ +
+ ); +}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index c3c8335bb..3b3221d5f 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -15,7 +15,7 @@ import { RelatedNotesDialog } from '../../components/RelatedNotesDialog'; import { ConditionRelationsDialog } from './ConditionRelationsDialog'; import { EvidenceCodesTemplate } from '../../components/Templates/EvidenceCodesTemplate'; import { SingleReferenceTemplate } from '../../components/Templates/SingleReferenceTemplate'; -import { DiseaseQualifiersBodyTemplate } from '../../components/Templates/DiseaseQualifiersBodyTemplate'; +import { DiseaseQualifiersTemplate } from '../../components/Templates/DiseaseQualifiersTemplate'; import { IdBodyTemplate } from '../../components/Templates/IdBodyTemplate'; import { DiseaseTemplate } from '../../components/Templates/DiseaseTemplate'; import { GenomicEntityTemplate } from '../../components/Templates/genomicEntity/GenomicEntityTemplate'; @@ -1010,7 +1010,7 @@ export const DiseaseAnnotationsTable = () => { { field: "diseaseQualifiers.name", header: "Disease Qualifiers", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.diseaseQualifiersFilterConfig, editor: (props) => diseaseQualifiersEditor(props) From 84a330438a622e187f8d35fae8e729661343b3af Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 13 Feb 2024 13:11:31 -0600 Subject: [PATCH 099/159] refactor IdTemplate and DiseaseTemplate --- .../components/Templates/DiseaseTemplate.js | 21 +++++++++---------- .../{IdBodyTemplate.js => IdTemplate.js} | 5 ++++- .../DiseaseAnnotationsTable.js | 8 +++---- 3 files changed, 18 insertions(+), 16 deletions(-) rename src/main/cliapp/src/components/Templates/{IdBodyTemplate.js => IdTemplate.js} (86%) diff --git a/src/main/cliapp/src/components/Templates/DiseaseTemplate.js b/src/main/cliapp/src/components/Templates/DiseaseTemplate.js index 421136255..f188f884e 100644 --- a/src/main/cliapp/src/components/Templates/DiseaseTemplate.js +++ b/src/main/cliapp/src/components/Templates/DiseaseTemplate.js @@ -2,15 +2,14 @@ import { Tooltip } from "primereact/tooltip"; import { EllipsisTableCell } from "../EllipsisTableCell"; export const DiseaseTemplate = ({ object }) => { - const targetClass = `a${global.crypto.randomUUID()}`; - if (object) { - return ( - <> - {object.name} ({object.curie}) - - - ); - } else { - return null; - } + if (!object) return null; + + const targetClass = `a${global.crypto.randomUUID()}`; + + return ( + <> + {object.name} ({object.curie}) + + + ); }; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/IdBodyTemplate.js b/src/main/cliapp/src/components/Templates/IdTemplate.js similarity index 86% rename from src/main/cliapp/src/components/Templates/IdBodyTemplate.js rename to src/main/cliapp/src/components/Templates/IdTemplate.js index d6181b65b..66b3e4056 100644 --- a/src/main/cliapp/src/components/Templates/IdBodyTemplate.js +++ b/src/main/cliapp/src/components/Templates/IdTemplate.js @@ -1,9 +1,12 @@ import { EllipsisTableCell } from "../EllipsisTableCell"; import { Tooltip } from "primereact/tooltip"; -export const IdBodyTemplate = ({ id }) => { +export const IdTemplate = ({ id }) => { + if(!id) return null; + //the 'a' at the start is a hack since css selectors can't start with a number const targetClass = `a${global.crypto.randomUUID()}`; + return ( <> diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 3b3221d5f..5584111d7 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -16,7 +16,7 @@ import { ConditionRelationsDialog } from './ConditionRelationsDialog'; import { EvidenceCodesTemplate } from '../../components/Templates/EvidenceCodesTemplate'; import { SingleReferenceTemplate } from '../../components/Templates/SingleReferenceTemplate'; import { DiseaseQualifiersTemplate } from '../../components/Templates/DiseaseQualifiersTemplate'; -import { IdBodyTemplate } from '../../components/Templates/IdBodyTemplate'; +import { IdTemplate } from '../../components/Templates/IdTemplate'; import { DiseaseTemplate } from '../../components/Templates/DiseaseTemplate'; import { GenomicEntityTemplate } from '../../components/Templates/genomicEntity/GenomicEntityTemplate'; @@ -901,7 +901,7 @@ export const DiseaseAnnotationsTable = () => { const columns = [{ field: "uniqueId", header: "Unique ID", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.uniqueidFilterConfig, editor: (props) => uniqueIdEditorTemplate(props) @@ -909,14 +909,14 @@ export const DiseaseAnnotationsTable = () => { { field: "modEntityId", header: "MOD Annotation ID", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.modentityidFilterConfig, }, { field: "modInternalId", header: "MOD Internal ID", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.modinternalidFilterConfig, }, From 61140f5d25ad646fbd08e7b84e3bb88506e218e3 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 13 Feb 2024 13:15:24 -0600 Subject: [PATCH 100/159] moved template test folder --- .../__tests__/GenomicEntityListTemplate.test.js | 4 ++-- .../__tests__/GenomicEntityTemplate.test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename src/main/cliapp/src/components/Templates/{genomicEntity => }/__tests__/GenomicEntityListTemplate.test.js (98%) rename src/main/cliapp/src/components/Templates/{genomicEntity => }/__tests__/GenomicEntityTemplate.test.js (96%) diff --git a/src/main/cliapp/src/components/Templates/genomicEntity/__tests__/GenomicEntityListTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js similarity index 98% rename from src/main/cliapp/src/components/Templates/genomicEntity/__tests__/GenomicEntityListTemplate.test.js rename to src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js index 8300a2f6a..76feb48ee 100644 --- a/src/main/cliapp/src/components/Templates/genomicEntity/__tests__/GenomicEntityListTemplate.test.js +++ b/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js @@ -1,6 +1,6 @@ import { within, render } from '@testing-library/react'; -import { GenomicEntityListTemplate } from '../GenomicEntityListTemplate'; -import '../../../../tools/jest/setupTests'; +import { GenomicEntityListTemplate } from '../genomicEntity/GenomicEntityListTemplate'; +import '../../../tools/jest/setupTests'; describe('GenomicEntityListTemplate', () => { diff --git a/src/main/cliapp/src/components/Templates/genomicEntity/__tests__/GenomicEntityTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityTemplate.test.js similarity index 96% rename from src/main/cliapp/src/components/Templates/genomicEntity/__tests__/GenomicEntityTemplate.test.js rename to src/main/cliapp/src/components/Templates/__tests__/GenomicEntityTemplate.test.js index d4c14604d..2cfff1c34 100644 --- a/src/main/cliapp/src/components/Templates/genomicEntity/__tests__/GenomicEntityTemplate.test.js +++ b/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityTemplate.test.js @@ -1,6 +1,6 @@ import { fireEvent, render } from '@testing-library/react'; -import { GenomicEntityTemplate } from '../GenomicEntityTemplate'; -import '../../../../tools/jest/setupTests'; +import { GenomicEntityTemplate } from '../genomicEntity/GenomicEntityTemplate'; +import '../../../tools/jest/setupTests'; describe('GenomicEntityTemplate', () => { From 5f02a39655fb65a1c1ec637d7a6f423b204d27dd Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 13 Feb 2024 13:25:22 -0600 Subject: [PATCH 101/159] add BooleanTemplate tests --- .../components/Templates/BooleanTemplate.js | 2 +- .../__tests__/BooleanTemplate.test.js | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/main/cliapp/src/components/Templates/__tests__/BooleanTemplate.test.js diff --git a/src/main/cliapp/src/components/Templates/BooleanTemplate.js b/src/main/cliapp/src/components/Templates/BooleanTemplate.js index d717f797a..e29dc4fd3 100644 --- a/src/main/cliapp/src/components/Templates/BooleanTemplate.js +++ b/src/main/cliapp/src/components/Templates/BooleanTemplate.js @@ -2,6 +2,6 @@ import React from 'react' import { EllipsisTableCell } from '../EllipsisTableCell'; export const BooleanTemplate = ({ value }) => { - if (value === null || value === undefined) return null; + if (value === null || value === undefined || typeof value !== 'boolean') return null; return {JSON.stringify(value)}; } diff --git a/src/main/cliapp/src/components/Templates/__tests__/BooleanTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/BooleanTemplate.test.js new file mode 100644 index 000000000..b9e12e946 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/__tests__/BooleanTemplate.test.js @@ -0,0 +1,26 @@ +import { render } from '@testing-library/react'; +import { BooleanTemplate } from '../BooleanTemplate'; +import '../../../tools/jest/setupTests'; + +describe('BooleanTemplate', () => { + + it('should return null when value is null', () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); + + it('should render a div with correct classes', () => { + const { container } = render(); + expect(container.firstChild).toHaveClass('overflow-hidden text-overflow-ellipsis'); + }); + + it('should render the JSON stringified value inside the div', () => { + const { container } = render(); + expect(container.firstChild).toHaveTextContent('false'); + }); + + it('should return null when value is not a boolean', () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); +}); \ No newline at end of file From 9ac5305f87793b7f1fc6590219cfaf6869ab27b2 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 14 Feb 2024 09:42:39 -0600 Subject: [PATCH 102/159] add DiseaseQualifiersTemplate test --- .../Templates/DiseaseQualifiersTemplate.js | 2 +- .../DiseaseQualifiersTemplate.test.js | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 src/main/cliapp/src/components/Templates/__tests__/DiseaseQualifiersTemplate.test.js diff --git a/src/main/cliapp/src/components/Templates/DiseaseQualifiersTemplate.js b/src/main/cliapp/src/components/Templates/DiseaseQualifiersTemplate.js index 42b154cee..a6c48a786 100644 --- a/src/main/cliapp/src/components/Templates/DiseaseQualifiersTemplate.js +++ b/src/main/cliapp/src/components/Templates/DiseaseQualifiersTemplate.js @@ -1,7 +1,7 @@ import { ListTableCell } from "../ListTableCell"; export const DiseaseQualifiersTemplate = ({ diseaseQualifiers }) => { - if (!diseaseQualifiers) return null; + if (!diseaseQualifiers || diseaseQualifiers.length === 0) return null; const sortedDiseaseQualifiers = diseaseQualifiers.sort((a, b) => (a.name > b.name) ? 1 : -1); diff --git a/src/main/cliapp/src/components/Templates/__tests__/DiseaseQualifiersTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/DiseaseQualifiersTemplate.test.js new file mode 100644 index 000000000..25d5ff5a4 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/__tests__/DiseaseQualifiersTemplate.test.js @@ -0,0 +1,49 @@ +import { render } from '@testing-library/react'; +import { DiseaseQualifiersTemplate } from '../DiseaseQualifiersTemplate'; +import '../../../tools/jest/setupTests'; + +describe('DiseaseQualifiersTemplate', () => { + + describe('DiseaseQualifiersTemplate', () => { + + it('should return null when diseaseQualifiers is falsy', () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); + + it('should sort diseaseQualifiers by name', () => { + const diseaseQualifiers = [ + { name: 'Qualifier C' }, + { name: 'Qualifier A' }, + { name: 'Qualifier B' }, + ]; + + const { container } = render(); + const listItems = container.querySelectorAll('li'); + + expect(listItems[0]).toHaveTextContent('Qualifier A'); + expect(listItems[1]).toHaveTextContent('Qualifier B'); + expect(listItems[2]).toHaveTextContent('Qualifier C'); + }); + + it('should return null when diseaseQualifiers is an empty array', () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); + + it('should render diseaseQualifiers without a name property', () => { + const diseaseQualifiers = [ + { id: 1 }, + { id: 2 }, + { id: 3 }, + ]; + + const { container } = render(); + const listItems = container.querySelectorAll('li'); + + expect(listItems[0]).toHaveTextContent(''); + expect(listItems[1]).toHaveTextContent(''); + expect(listItems[2]).toHaveTextContent(''); + }); + }); +}); \ No newline at end of file From c8ec18a4f06d1f4e75712a5813f32ba6cb3b25b6 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 14 Feb 2024 15:20:38 -0600 Subject: [PATCH 103/159] add EvidenceCodesTemplate test --- .../__tests__/BooleanTemplate.test.js | 1 + .../DiseaseQualifiersTemplate.test.js | 82 +++++++++---------- .../__tests__/EvidenceCodesTemplate.test.js | 55 +++++++++++++ .../GenomicEntityListTemplate.test.js | 19 ++++- 4 files changed, 115 insertions(+), 42 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/__tests__/EvidenceCodesTemplate.test.js diff --git a/src/main/cliapp/src/components/Templates/__tests__/BooleanTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/BooleanTemplate.test.js index b9e12e946..8787e6115 100644 --- a/src/main/cliapp/src/components/Templates/__tests__/BooleanTemplate.test.js +++ b/src/main/cliapp/src/components/Templates/__tests__/BooleanTemplate.test.js @@ -16,6 +16,7 @@ describe('BooleanTemplate', () => { it('should render the JSON stringified value inside the div', () => { const { container } = render(); + //todo: change to rtl query expect(container.firstChild).toHaveTextContent('false'); }); diff --git a/src/main/cliapp/src/components/Templates/__tests__/DiseaseQualifiersTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/DiseaseQualifiersTemplate.test.js index 25d5ff5a4..667f4b3f6 100644 --- a/src/main/cliapp/src/components/Templates/__tests__/DiseaseQualifiersTemplate.test.js +++ b/src/main/cliapp/src/components/Templates/__tests__/DiseaseQualifiersTemplate.test.js @@ -2,48 +2,48 @@ import { render } from '@testing-library/react'; import { DiseaseQualifiersTemplate } from '../DiseaseQualifiersTemplate'; import '../../../tools/jest/setupTests'; + describe('DiseaseQualifiersTemplate', () => { - describe('DiseaseQualifiersTemplate', () => { - - it('should return null when diseaseQualifiers is falsy', () => { - const { container } = render(); - expect(container.firstChild).toBeNull(); - }); - - it('should sort diseaseQualifiers by name', () => { - const diseaseQualifiers = [ - { name: 'Qualifier C' }, - { name: 'Qualifier A' }, - { name: 'Qualifier B' }, - ]; - - const { container } = render(); - const listItems = container.querySelectorAll('li'); - - expect(listItems[0]).toHaveTextContent('Qualifier A'); - expect(listItems[1]).toHaveTextContent('Qualifier B'); - expect(listItems[2]).toHaveTextContent('Qualifier C'); - }); - - it('should return null when diseaseQualifiers is an empty array', () => { - const { container } = render(); - expect(container.firstChild).toBeNull(); - }); - - it('should render diseaseQualifiers without a name property', () => { - const diseaseQualifiers = [ - { id: 1 }, - { id: 2 }, - { id: 3 }, - ]; - - const { container } = render(); - const listItems = container.querySelectorAll('li'); - - expect(listItems[0]).toHaveTextContent(''); - expect(listItems[1]).toHaveTextContent(''); - expect(listItems[2]).toHaveTextContent(''); - }); + it('should return null when diseaseQualifiers is falsy', () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); + + it('should sort diseaseQualifiers by name', () => { + const diseaseQualifiers = [ + { name: 'Qualifier C' }, + { name: 'Qualifier A' }, + { name: 'Qualifier B' }, + ]; + + const { container } = render(); + //todo: change to rtl query + const listItems = container.querySelectorAll('li'); + + expect(listItems[0]).toHaveTextContent('Qualifier A'); + expect(listItems[1]).toHaveTextContent('Qualifier B'); + expect(listItems[2]).toHaveTextContent('Qualifier C'); + }); + + it('should return null when diseaseQualifiers is an empty array', () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); + + it('should render diseaseQualifiers without a name property', () => { + const diseaseQualifiers = [ + { id: 1 }, + { id: 2 }, + { id: 3 }, + ]; + + const { container } = render(); + //todo: change to rtl query + const listItems = container.querySelectorAll('li'); + + expect(listItems[0]).toHaveTextContent(''); + expect(listItems[1]).toHaveTextContent(''); + expect(listItems[2]).toHaveTextContent(''); }); }); \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/__tests__/EvidenceCodesTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/EvidenceCodesTemplate.test.js new file mode 100644 index 000000000..a6c424a42 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/__tests__/EvidenceCodesTemplate.test.js @@ -0,0 +1,55 @@ +import { render, fireEvent } from '@testing-library/react'; +import { EvidenceCodesTemplate } from '../EvidenceCodesTemplate'; +import '../../../tools/jest/setupTests'; + +describe('EvidenceCodesTemplate', () => { + + it('should render a sorted list of evidence codes', () => { + const evidenceCodes = [ + { abbreviation: 'Code B', name: 'Code B Name', curie: 'Code B Curie' }, + { abbreviation: 'Code A', name: 'Code A Name', curie: 'Code A Curie' }, + { abbreviation: 'Code C', name: 'Code C Name', curie: 'Code C Curie' }, + ]; + + const { container } = render(); + const listItems = container.querySelectorAll('li'); + + expect(listItems[0]).toHaveTextContent('Code A - Code A Name (Code A Curie)'); + expect(listItems[1]).toHaveTextContent('Code B - Code B Name (Code B Curie)'); + expect(listItems[2]).toHaveTextContent('Code C - Code C Name (Code C Curie)'); + }); + + it('should return null when evidenceCodes is undefined', () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); + + it('should return null when evidenceCodes is an empty array', () => { + const evidenceCodes = []; + + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); + + it('should display tooltip when hovering over the evidence codes list', async () => { + const evidenceCodes = [ + { abbreviation: 'ABC', name: 'Code ABC', curie: 'ABC123' }, + { abbreviation: 'DEF', name: 'Code DEF', curie: 'DEF456' }, + { abbreviation: 'GHI', name: 'Code GHI', curie: 'GHI789' } + ]; + + const result = render(); + + let listContentArray = result.getAllByText('ABC - Code ABC (ABC123)'); + expect(listContentArray).toHaveLength(1); + + fireEvent.mouseEnter(result.container.firstChild); + + //using find... here because it's async and the tooltip is dynamically added + listContentArray = await result.findAllByText('ABC - Code ABC (ABC123)'); + + expect(listContentArray).toHaveLength(2); + }); + +}); + diff --git a/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js index 76feb48ee..9ecc30c8d 100644 --- a/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js +++ b/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js @@ -1,4 +1,4 @@ -import { within, render } from '@testing-library/react'; +import { within, fireEvent, render } from '@testing-library/react'; import { GenomicEntityListTemplate } from '../genomicEntity/GenomicEntityListTemplate'; import '../../../tools/jest/setupTests'; @@ -177,4 +177,21 @@ describe('GenomicEntityListTemplate', () => { expect(genomicEntity2).toBeInTheDocument(); expect(genomicEntity3).toBeInTheDocument(); }); + it('should render genomicEntities and curie in a tooltip when genomicEntity has geneSymbol', async () => { + const genomicEntities = [ + { alleleSymbol: { displayText: 'Allele Symbol C' }, curie: 'CURIE1' }, + { alleleSymbol: { displayText: 'Allele Symbol A' }, curie: 'CURIE2' }, + { alleleSymbol: { displayText: 'Allele Symbol B' }, curie: 'CURIE3' }, + ]; + + const result = render(); + + let listContentArray = result.getAllByText('Allele Symbol A (CURIE2)'); + expect(listContentArray).toHaveLength(1); + + fireEvent.mouseEnter(result.container.firstChild); + + //using find... here because it's async and the tooltip is dynamically added + expect(await result.findAllByText('Allele Symbol A (CURIE2)')).toHaveLength(2); + }); }); From 771b8015f81bd5246830f552e19ec591cd9e8962 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 15 Feb 2024 08:24:54 -0600 Subject: [PATCH 104/159] add IdTemplate test and SingleReferenceTemplate test --- .../Templates/__tests__/IdTemplate.test.js | 33 +++++++++++++++++++ .../__tests__/SingleReferenceTemplate.test.js | 15 +++++++++ 2 files changed, 48 insertions(+) create mode 100644 src/main/cliapp/src/components/Templates/__tests__/IdTemplate.test.js create mode 100644 src/main/cliapp/src/components/Templates/__tests__/SingleReferenceTemplate.test.js diff --git a/src/main/cliapp/src/components/Templates/__tests__/IdTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/IdTemplate.test.js new file mode 100644 index 000000000..2b705f51a --- /dev/null +++ b/src/main/cliapp/src/components/Templates/__tests__/IdTemplate.test.js @@ -0,0 +1,33 @@ +import { render, fireEvent } from '@testing-library/react'; +import { IdTemplate } from '../IdTemplate'; +import '../../../tools/jest/setupTests'; + +describe("IdTemplate", () => { + + it("should return null when id is falsy", () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); + + + it("should render Tooltip component with EllipsisTableCell as target and id as content", async () => { + const result = render(); + const divArray = result.getAllByText('123'); + expect(divArray).toHaveLength(1); + fireEvent.mouseEnter(divArray[0]); + expect(await result.findAllByText('123')).toHaveLength(2); + }); + + it("should handle id as number", () => { + const { getByText } = render(); + expect(getByText('123')).toBeInTheDocument(); + }); + + it("should handle id as string", () => { + const { getByText } = render(); + expect(getByText('abc')).toBeInTheDocument(); + }); + +}); + + diff --git a/src/main/cliapp/src/components/Templates/__tests__/SingleReferenceTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/SingleReferenceTemplate.test.js new file mode 100644 index 000000000..bc63112e6 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/__tests__/SingleReferenceTemplate.test.js @@ -0,0 +1,15 @@ +import { render, fireEvent } from '@testing-library/react'; +import { SingleReferenceTemplate } from '../SingleReferenceTemplate'; +import '../../../tools/jest/setupTests'; + +describe("SingleReferenceTemplate", () => { + + it("should return null when singleReference is falsy", () => { + const singleReference = null; + const { container } = render(); + + expect(container.firstChild).toBeNull(); + }); + +}); + From 23bcef278b60d8d3a96c009ec7492422d466da9f Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 15 Feb 2024 08:48:45 -0600 Subject: [PATCH 105/159] add DiseaseTemplate test --- .../components/Templates/DiseaseTemplate.js | 14 +++- .../__tests__/DiseaseTemplate.test.js | 71 +++++++++++++++++++ 2 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/__tests__/DiseaseTemplate.test.js diff --git a/src/main/cliapp/src/components/Templates/DiseaseTemplate.js b/src/main/cliapp/src/components/Templates/DiseaseTemplate.js index f188f884e..b3a2828b8 100644 --- a/src/main/cliapp/src/components/Templates/DiseaseTemplate.js +++ b/src/main/cliapp/src/components/Templates/DiseaseTemplate.js @@ -5,11 +5,19 @@ export const DiseaseTemplate = ({ object }) => { if (!object) return null; const targetClass = `a${global.crypto.randomUUID()}`; + const textString = getTextString(object); return ( <> - {object.name} ({object.curie}) - + {textString} + ); -}; \ No newline at end of file +}; + +const getTextString = (object) => { + if(!object.name) return object.curie; + if(!object.curie) return object.name; + if(!object.curie && !object.name) return ""; + return `${object.name} (${object.curie})`; +} \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/__tests__/DiseaseTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/DiseaseTemplate.test.js new file mode 100644 index 000000000..56d186ffb --- /dev/null +++ b/src/main/cliapp/src/components/Templates/__tests__/DiseaseTemplate.test.js @@ -0,0 +1,71 @@ +import { render, fireEvent } from '@testing-library/react'; +import { DiseaseTemplate } from '../DiseaseTemplate'; +import '../../../tools/jest/setupTests'; + +describe('DiseaseTemplate', () => { + + it('should render the name and curie of the disease object in an EllipsisTableCell component', () => { + const object = { + name: 'Disease Name', + curie: 'Disease Curie' + }; + + const result = render(); + + const content = result.getByText('Disease Name (Disease Curie)'); + expect(content).toBeInTheDocument(); + }); + + it('should display a tooltip with the name and curie of the disease object when hovering over the EllipsisTableCell component', async () => { + const object = { + name: 'Disease Name', + curie: 'Disease Curie' + }; + + const result = render(); + + const divContentArray = result.getAllByText('Disease Name (Disease Curie)'); + expect(divContentArray).toHaveLength(1); + fireEvent.mouseEnter(divContentArray[0]); + + expect(await result.findAllByText('Disease Name (Disease Curie)')).toHaveLength(2); + }); + + it('should return null if the object is falsy', () => { + const result = render(); + + expect(result.container.firstChild).toBeNull(); + }); + + it('should render an empty EllipsisTableCell component if the object has no name or curie', () => { + const object = {}; + + const result = render(); + + const ellipsisTableCell = result.container.firstChild; + expect(ellipsisTableCell).toHaveTextContent(''); + }); + + it('should render an EllipsisTableCell component with only the name if the object has no curie', () => { + const object = { + name: 'Disease Name' + }; + + const result = render(); + + const ellipsisTableCell = result.getByText('Disease Name'); + expect(ellipsisTableCell).toBeInTheDocument(); + }); + + it('should render an EllipsisTableCell component with only the curie if the object has no name', () => { + const object = { + curie: 'Disease Curie' + }; + + const result = render(); + + const ellipsisTableCell = result.getByText('Disease Curie'); + expect(ellipsisTableCell).toBeInTheDocument(); + }); +}); + From 3226c2398f0edc655fc385e91d51110c625acc7b Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 15 Feb 2024 11:45:44 -0600 Subject: [PATCH 106/159] add tests for getRefString --- .../cliapp/src/utils/__tests__/utils.test.js | 48 ++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/src/main/cliapp/src/utils/__tests__/utils.test.js b/src/main/cliapp/src/utils/__tests__/utils.test.js index de9569232..07da1b92d 100644 --- a/src/main/cliapp/src/utils/__tests__/utils.test.js +++ b/src/main/cliapp/src/utils/__tests__/utils.test.js @@ -1,5 +1,5 @@ import { describe, expect, it } from '@jest/globals'; -import { removeInvalidFilters, removeInvalidSorts } from '../utils'; +import { getRefString, removeInvalidFilters, removeInvalidSorts } from '../utils'; import 'core-js/features/structured-clone'; @@ -58,7 +58,7 @@ describe('removeInvalidFilters', () => { } } }; - + const newFilters = removeInvalidFilters(localStorageFilters); expect(newFilters).toEqual({ @@ -184,4 +184,48 @@ describe('removeInvalidSorts', () => { }); }); +describe('getRefString', () => { + it('orders curies by prefix then alphabetically ', () => { + const referenceItem = { + curie: 'CURIE', + cross_references: [ + { curie: 'PMID:123' }, + { curie: 'FB:456' }, + { curie: 'MGI:789' }, + { curie: 'RGD:012' }, + { curie: 'SGD:345' }, + { curie: 'WB:678' }, + { curie: 'ZFIN:901' }, + { curie: 'XYZ:234' }, + { curie: 'ABC:567' } + ] + }; + + const result = getRefString(referenceItem); + + expect(result).toBe('PMID:123 (FB:456|MGI:789|RGD:012|SGD:345|WB:678|ZFIN:901|ABC:567|XYZ:234|CURIE)'); + }); + + it('should return without any errors when referenceItem is null', () => { + const referenceItem = null; + expect(getRefString(referenceItem)).toBeUndefined(); + }); + + it('should return referenceItem.curie when referenceItem has no cross_references or crossReferences', () => { + const referenceItem = { + curie: 'CURIE' + }; + expect(getRefString(referenceItem)).toBe(referenceItem.curie); + }); + + it('should return referenceItem.curie when referenceItem has cross_references and crossReferences with empty arrays', () => { + const referenceItem = { + curie: 'CURIE', + cross_references: [], + crossReferences: [] + }; + expect(getRefString(referenceItem)).toBe(referenceItem.curie); + }); +}) + From 1a4b7db024781212632366341458ad0979c786f1 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 15 Feb 2024 12:14:39 -0600 Subject: [PATCH 107/159] update tests --- .../__tests__/BooleanTemplate.test.js | 10 ++-------- .../DiseaseQualifiersTemplate.test.js | 18 ++++++++++-------- .../GenomicEntityListTemplate.test.js | 1 - .../__tests__/GenomicEntityTemplate.test.js | 2 +- .../__tests__/SingleReferenceTemplate.test.js | 2 +- .../DiseaseAnnotationsTable.js | 1 - 6 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/main/cliapp/src/components/Templates/__tests__/BooleanTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/BooleanTemplate.test.js index 8787e6115..0079d4320 100644 --- a/src/main/cliapp/src/components/Templates/__tests__/BooleanTemplate.test.js +++ b/src/main/cliapp/src/components/Templates/__tests__/BooleanTemplate.test.js @@ -9,15 +9,9 @@ describe('BooleanTemplate', () => { expect(container.firstChild).toBeNull(); }); - it('should render a div with correct classes', () => { - const { container } = render(); - expect(container.firstChild).toHaveClass('overflow-hidden text-overflow-ellipsis'); - }); - it('should render the JSON stringified value inside the div', () => { - const { container } = render(); - //todo: change to rtl query - expect(container.firstChild).toHaveTextContent('false'); + const result = render(); + expect(result.getByText("false")).toBeInTheDocument(); }); it('should return null when value is not a boolean', () => { diff --git a/src/main/cliapp/src/components/Templates/__tests__/DiseaseQualifiersTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/DiseaseQualifiersTemplate.test.js index 667f4b3f6..46fd3488b 100644 --- a/src/main/cliapp/src/components/Templates/__tests__/DiseaseQualifiersTemplate.test.js +++ b/src/main/cliapp/src/components/Templates/__tests__/DiseaseQualifiersTemplate.test.js @@ -1,4 +1,4 @@ -import { render } from '@testing-library/react'; +import { render, within } from '@testing-library/react'; import { DiseaseQualifiersTemplate } from '../DiseaseQualifiersTemplate'; import '../../../tools/jest/setupTests'; @@ -17,10 +17,11 @@ describe('DiseaseQualifiersTemplate', () => { { name: 'Qualifier B' }, ]; - const { container } = render(); - //todo: change to rtl query - const listItems = container.querySelectorAll('li'); - + const result = render(); + + const qualifiersList = result.getByRole('list'); + const listItems = within(qualifiersList).getAllByRole('listitem'); + expect(listItems[0]).toHaveTextContent('Qualifier A'); expect(listItems[1]).toHaveTextContent('Qualifier B'); expect(listItems[2]).toHaveTextContent('Qualifier C'); @@ -38,9 +39,10 @@ describe('DiseaseQualifiersTemplate', () => { { id: 3 }, ]; - const { container } = render(); - //todo: change to rtl query - const listItems = container.querySelectorAll('li'); + const result = render(); + + const qualifiersList = result.getByRole('list'); + const listItems = within(qualifiersList).getAllByRole('listitem'); expect(listItems[0]).toHaveTextContent(''); expect(listItems[1]).toHaveTextContent(''); diff --git a/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js index 9ecc30c8d..003d12d6b 100644 --- a/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js +++ b/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js @@ -85,7 +85,6 @@ describe('GenomicEntityListTemplate', () => { expect(genomicEntity3).toBeInTheDocument(); }); - // Handles genomic entities with missing or null properties. it('should handle genomic entities with missing or null properties', () => { const genomicEntities = [ { alleleFullName: null, curie: 'CURIE1' }, diff --git a/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityTemplate.test.js index 2cfff1c34..33d2056e7 100644 --- a/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityTemplate.test.js +++ b/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityTemplate.test.js @@ -121,4 +121,4 @@ describe('GenomicEntityTemplate', () => { let superScript = container.querySelector('sup'); expect(superScript).toBeInTheDocument(); }); -}); +}); \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/__tests__/SingleReferenceTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/SingleReferenceTemplate.test.js index bc63112e6..64104c10f 100644 --- a/src/main/cliapp/src/components/Templates/__tests__/SingleReferenceTemplate.test.js +++ b/src/main/cliapp/src/components/Templates/__tests__/SingleReferenceTemplate.test.js @@ -1,4 +1,4 @@ -import { render, fireEvent } from '@testing-library/react'; +import { render } from '@testing-library/react'; import { SingleReferenceTemplate } from '../SingleReferenceTemplate'; import '../../../tools/jest/setupTests'; diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 5584111d7..a894a0f31 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -30,7 +30,6 @@ import { useControlledVocabularyService } from '../../service/useControlledVocab import { ErrorMessageComponent } from '../../components/Error/ErrorMessageComponent'; import { TrueFalseDropdown } from '../../components/TrueFalseDropDownSelector'; import { Button } from 'primereact/button'; -import { Tooltip } from 'primereact/tooltip'; import { getRefString, autocompleteSearch, buildAutocompleteFilter, defaultAutocompleteOnChange, multipleAutocompleteOnChange, getIdentifier } from '../../utils/utils'; import { useNewAnnotationReducer } from "./useNewAnnotationReducer"; import { NewAnnotationForm } from "./NewAnnotationForm"; From 983df4127883eb7a93142e98115191cc4ddaf264 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 22 Feb 2024 11:33:39 -0600 Subject: [PATCH 108/159] update GenomicEntityTemplate --- .../Templates/genomicEntity/GenomicEntityTemplate.js | 9 +++++---- .../diseaseAnnotationsPage/DiseaseAnnotationsTable.js | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityTemplate.js b/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityTemplate.js index 268008db5..091e64895 100644 --- a/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityTemplate.js +++ b/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityTemplate.js @@ -1,24 +1,25 @@ import { Tooltip } from "primereact/tooltip"; -import { getGenomicEntityText } from "../../../utils/utils"; +import { getGenomicEntityText, getIdentifier } from "../../../utils/utils"; export const GenomicEntityTemplate = ({ genomicEntity }) => { if (!genomicEntity) return null; const targetClass = `a${global.crypto.randomUUID()}`; const subjectText = getGenomicEntityText(genomicEntity); + const indentifier = getIdentifier(genomicEntity); - if(!subjectText) return
{genomicEntity.curie}
; + if(!subjectText) return
{indentifier}
; return ( <>
diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index a894a0f31..1945d51db 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -922,7 +922,7 @@ export const DiseaseAnnotationsTable = () => { { field: "diseaseAnnotationSubject.symbol", header: "Subject", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.diseaseAnnotationSubjectFieldConfig, editor: (props) => subjectEditorTemplate(props), From e53f95bf8b1e909dd43cb6fcab10974ac95660b4 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 22 Feb 2024 11:53:22 -0600 Subject: [PATCH 109/159] update GenomicEntityListTemplate and other field names --- .../genomicEntity/GenomicEntityListTemplate.js | 10 ++++++---- .../diseaseAnnotationsPage/DiseaseAnnotationsTable.js | 10 ++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityListTemplate.js b/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityListTemplate.js index 5ad35c7f3..32d544a7d 100644 --- a/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityListTemplate.js +++ b/src/main/cliapp/src/components/Templates/genomicEntity/GenomicEntityListTemplate.js @@ -1,5 +1,5 @@ import { ListTableCell } from "../../ListTableCell"; -import { getGenomicEntityText } from "../../../utils/utils"; +import { getGenomicEntityText, getIdentifier } from "../../../utils/utils"; import { Tooltip } from "primereact/tooltip"; export const GenomicEntityListTemplate = ({ genomicEntities }) => { @@ -10,9 +10,11 @@ export const GenomicEntityListTemplate = ({ genomicEntities }) => { const genomicEntityStrings = genomicEntities.map((genomicEntity) => { const text = getGenomicEntityText(genomicEntity); - if(!text) return genomicEntity.curie; - if(!genomicEntity.curie) return text; - return `${text} (${genomicEntity.curie})`; + const indentifier = getIdentifier(genomicEntity); + + if(!text) return indentifier; + if(!indentifier) return text; + return `${text} (${indentifier})`; }); const sortedGenomicEntityStrings = genomicEntityStrings.sort(); diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 1945d51db..ad8b31a23 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -13,15 +13,15 @@ import { SearchService } from '../../service/SearchService'; import { DiseaseAnnotationService } from '../../service/DiseaseAnnotationService'; import { RelatedNotesDialog } from '../../components/RelatedNotesDialog'; import { ConditionRelationsDialog } from './ConditionRelationsDialog'; + import { EvidenceCodesTemplate } from '../../components/Templates/EvidenceCodesTemplate'; import { SingleReferenceTemplate } from '../../components/Templates/SingleReferenceTemplate'; import { DiseaseQualifiersTemplate } from '../../components/Templates/DiseaseQualifiersTemplate'; import { IdTemplate } from '../../components/Templates/IdTemplate'; import { DiseaseTemplate } from '../../components/Templates/DiseaseTemplate'; import { GenomicEntityTemplate } from '../../components/Templates/genomicEntity/GenomicEntityTemplate'; - - - +import { GenomicEntityListTemplate } from '../../components/Templates/genomicEntity/GenomicEntityListTemplate'; +import { BooleanTemplate } from '../../components/Templates/BooleanTemplate'; import { ControlledVocabularyDropdown } from '../../components/ControlledVocabularySelector'; import { ConditionRelationHandleDropdown } from '../../components/ConditionRelationHandleSelector'; @@ -36,8 +36,6 @@ import { NewAnnotationForm } from "./NewAnnotationForm"; import { AutocompleteMultiEditor } from "../../components/Autocomplete/AutocompleteMultiEditor"; import { getDefaultTableState } from '../../service/TableStateService'; import { FILTER_CONFIGS } from '../../constants/FilterFields'; -import { GenomicEntityListTemplate } from '../../components/Templates/genomicEntity/GenomicEntityListTemplate'; -import { BooleanTemplate } from '../../components/Templates/BooleanTemplate'; export const DiseaseAnnotationsTable = () => { @@ -945,7 +943,7 @@ export const DiseaseAnnotationsTable = () => { { field: "diseaseAnnotationObject.name", header: "Disease", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.diseaseAnnotationObjectFilterConfig, editor: (props) => diseaseEditorTemplate(props), From 24d673d8c50c89babc53c8d03752b8437e4aa5dc Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 22 Feb 2024 12:12:42 -0600 Subject: [PATCH 110/159] update tests --- .../GenomicEntityListTemplate.test.js | 24 ++++++++--------- .../__tests__/GenomicEntityTemplate.test.js | 26 +++++++++---------- src/main/cliapp/src/utils/utils.js | 18 ++++++------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js index 003d12d6b..dea0cb8d3 100644 --- a/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js +++ b/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityListTemplate.test.js @@ -148,49 +148,49 @@ describe('GenomicEntityListTemplate', () => { geneFullName: { displayText: "Gene Full Name 1", }, - curie: 'CURIE1' + curie: 'ID1' }, { geneSymbol: null, geneFullName: { displayText: "Gene Full Name 2", }, - curie: 'CURIE2' + modEntityId: 'ID2' }, { geneSymbol: { displayText: "Gene Symbol 3", }, geneFullName: null, - curie: 'CURIE3' + modInternalId: 'ID3' }, ]; const result = render(); - const genomicEntity1 = result.getByText('Gene Symbol 1 (CURIE1)'); - const genomicEntity2 = result.getByText('Gene Full Name 2 (CURIE2)'); - const genomicEntity3 = result.getByText('Gene Symbol 3 (CURIE3)'); + const genomicEntity1 = result.getByText('Gene Symbol 1 (ID1)'); + const genomicEntity2 = result.getByText('Gene Full Name 2 (ID2)'); + const genomicEntity3 = result.getByText('Gene Symbol 3 (ID3)'); expect(genomicEntity1).toBeInTheDocument(); expect(genomicEntity2).toBeInTheDocument(); expect(genomicEntity3).toBeInTheDocument(); }); - it('should render genomicEntities and curie in a tooltip when genomicEntity has geneSymbol', async () => { + it('should render genomicEntities and curie in a tooltip when genomicEntity has alleleSymbol', async () => { const genomicEntities = [ - { alleleSymbol: { displayText: 'Allele Symbol C' }, curie: 'CURIE1' }, - { alleleSymbol: { displayText: 'Allele Symbol A' }, curie: 'CURIE2' }, - { alleleSymbol: { displayText: 'Allele Symbol B' }, curie: 'CURIE3' }, + { alleleSymbol: { displayText: 'Allele Symbol C' }, curie: 'ID1' }, + { alleleSymbol: { displayText: 'Allele Symbol A' }, modEntityId: 'ID2' }, + { alleleSymbol: { displayText: 'Allele Symbol B' }, modInternalId: 'ID3' }, ]; const result = render(); - let listContentArray = result.getAllByText('Allele Symbol A (CURIE2)'); + let listContentArray = result.getAllByText('Allele Symbol A (ID2)'); expect(listContentArray).toHaveLength(1); fireEvent.mouseEnter(result.container.firstChild); //using find... here because it's async and the tooltip is dynamically added - expect(await result.findAllByText('Allele Symbol A (CURIE2)')).toHaveLength(2); + expect(await result.findAllByText('Allele Symbol A (ID2)')).toHaveLength(2); }); }); diff --git a/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityTemplate.test.js index 33d2056e7..14d0d569d 100644 --- a/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityTemplate.test.js +++ b/src/main/cliapp/src/components/Templates/__tests__/GenomicEntityTemplate.test.js @@ -4,7 +4,7 @@ import '../../../tools/jest/setupTests'; describe('GenomicEntityTemplate', () => { - it('should render genomicEntity text and curie when genomicEntity has geneSymbol', () => { + it('should render genomicEntity text and id when genomicEntity has geneSymbol', () => { const genomicEntity = { geneSymbol: { displayText: 'Gene Symbol' @@ -18,7 +18,7 @@ describe('GenomicEntityTemplate', () => { expect(content).toBeInTheDocument(); }); - it('should render genomicEntity text and curie when genomicEntity has alleleSymbol', () => { + it('should render genomicEntity text and id when genomicEntity has alleleSymbol', () => { const genomicEntity = { alleleSymbol: { displayText: 'Allele Symbol' @@ -32,7 +32,7 @@ describe('GenomicEntityTemplate', () => { expect(content).toBeInTheDocument(); }); - it('should render genomicEntity text and curie when genomicEntity has geneFullName', () => { + it('should render genomicEntity text and id when genomicEntity has geneFullName', () => { const genomicEntity = { geneFullName: { displayText: 'Gene Full Name' @@ -46,7 +46,7 @@ describe('GenomicEntityTemplate', () => { expect(content).toBeInTheDocument(); }); - it('should render genomicEntity text and curie when genomicEntity has alleleFullName', () => { + it('should render genomicEntity text and id when genomicEntity has alleleFullName', () => { const genomicEntity = { alleleFullName: { displayText: 'Allele Full Name' @@ -59,19 +59,19 @@ describe('GenomicEntityTemplate', () => { const content = result.getByText('Allele Full Name (CURIE)'); expect(content).toBeInTheDocument(); }); - it('should render genomicEntity name and curie when genomicEntity has name', () => { + it('should render genomicEntity name and id when genomicEntity has name', () => { const genomicEntity = { name: 'genomicEntity Name', - curie: 'CURIE' + modEntityId: 'ID' }; const result = render(); - const content = result.getByText('genomicEntity Name (CURIE)'); + const content = result.getByText('genomicEntity Name (ID)'); expect(content).toBeInTheDocument(); }); - it('should render genomicEntity curie in a div when genomicEntity has no displayable text', () => { + it('should render genomicEntity id in a div when genomicEntity has no displayable text', () => { const genomicEntity = { curie: 'CURIE' }; @@ -90,22 +90,22 @@ describe('GenomicEntityTemplate', () => { expect(container.firstChild).toBeNull(); }); - it('should render genomicEntity text and curie in a tooltip when genomicEntity has geneSymbol', async () => { + it('should render genomicEntity text and id in a tooltip when genomicEntity has geneSymbol', async () => { const genomicEntity = { geneSymbol: { displayText: 'Gene Symbol' }, - curie: 'CURIE' + modInternalId: 'ID' }; const result = render(); - let divContentArray = result.getAllByText('Gene Symbol (CURIE)'); + let divContentArray = result.getAllByText('Gene Symbol (ID)'); expect(divContentArray).toHaveLength(1); fireEvent.mouseEnter(divContentArray[0]); //using find... here because it's async and the tooltip is dynamically added - expect(await result.findAllByText('Gene Symbol (CURIE)')).toHaveLength(2); + expect(await result.findAllByText('Gene Symbol (ID)')).toHaveLength(2); }); it('should render tags in the HTML', async () => { @@ -113,7 +113,7 @@ describe('GenomicEntityTemplate', () => { geneSymbol: { displayText: 'Gene Symbol' }, - curie: 'CURIE' + modEntityId: 'ID' }; const { container } = render(); diff --git a/src/main/cliapp/src/utils/utils.js b/src/main/cliapp/src/utils/utils.js index 91e6250af..ba5e55e08 100644 --- a/src/main/cliapp/src/utils/utils.js +++ b/src/main/cliapp/src/utils/utils.js @@ -124,6 +124,15 @@ export function getIdentifier(data) { return ""; } +export const getGenomicEntityText = (genomicEntity) => { + if (genomicEntity.geneSymbol) return genomicEntity.geneSymbol.displayText; + if (genomicEntity.alleleSymbol) return genomicEntity.alleleSymbol.displayText; + if (genomicEntity.geneFullName) return genomicEntity.geneFullName.displayText; + if (genomicEntity.alleleFullName) return genomicEntity.alleleFullName.displayText; + if (genomicEntity.name) return genomicEntity.name; + return null; +}; + export function getRefStrings(referenceItems) { if (!referenceItems) return; @@ -480,12 +489,3 @@ export const processOptionalField = (eventValue) => { if (!eventValue.curie) return {curie: eventValue}; return eventValue; } - -export const getGenomicEntityText = (genomicEntity) => { - if (genomicEntity.geneSymbol) return genomicEntity.geneSymbol.displayText; - if (genomicEntity.alleleSymbol) return genomicEntity.alleleSymbol.displayText; - if (genomicEntity.geneFullName) return genomicEntity.geneFullName.displayText; - if (genomicEntity.alleleFullName) return genomicEntity.alleleFullName.displayText; - if (genomicEntity.name) return genomicEntity.name; - return null; -}; \ No newline at end of file From 472b96bee083d1632444ea9d072506d975e74dad Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 22 Feb 2024 12:19:18 -0600 Subject: [PATCH 111/159] change class to className --- .../diseaseAnnotationsPage/DiseaseAnnotationsTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index ad8b31a23..7626be0b5 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -281,7 +281,7 @@ export const DiseaseAnnotationsTable = () => { return ( From 9182f29c85b7d5783515c294854adcafdb09a67f Mon Sep 17 00:00:00 2001 From: Christian Pich Date: Tue, 27 Feb 2024 13:05:22 +0100 Subject: [PATCH 112/159] =?UTF-8?q?SCRUM-3593=20override=20search=20endpoi?= =?UTF-8?q?nt=20to=20use=20different=20JSON=20View=20to=20rem=E2=80=A6=20(?= =?UTF-8?q?#1441)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * SCRUM-3593 override search endpoint to use different JSON View to remove unused objects * Update DiseaseAnnotationCrudInterface.java --------- Co-authored-by: Olin Blodgett --- .../crud/DiseaseAnnotationCrudInterface.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/DiseaseAnnotationCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/DiseaseAnnotationCrudInterface.java index fe9097c0b..b0f17dbe7 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/DiseaseAnnotationCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/DiseaseAnnotationCrudInterface.java @@ -1,20 +1,21 @@ package org.alliancegenome.curation_api.interfaces.crud; +import jakarta.ws.rs.*; import org.alliancegenome.curation_api.interfaces.base.BaseIdCrudInterface; import org.alliancegenome.curation_api.model.entities.DiseaseAnnotation; +import org.alliancegenome.curation_api.model.entities.VocabularyTerm; import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.view.View; +import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody; import org.eclipse.microprofile.openapi.annotations.tags.Tag; import com.fasterxml.jackson.annotation.JsonView; -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.PathParam; -import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; +import java.util.HashMap; + @Path("/disease-annotation") @Tag(name = "CRUD - Disease Annotations") @Produces(MediaType.APPLICATION_JSON) @@ -26,4 +27,11 @@ public interface DiseaseAnnotationCrudInterface extends BaseIdCrudInterface get(@PathParam("identifier") String identifier); + @Override + @POST + @Path("/search") + @JsonView(View.DiseaseAnnotation.class) + @Tag(name = "Elastic Search Disease Annotations") + public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); + } From 9c1b2d8e1f6b707f56016867e8d98f2f47e4ab57 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 27 Feb 2024 16:48:02 +0000 Subject: [PATCH 113/159] Rewrite findFilteredIds method --- .../curation_api/dao/base/BaseSQLDAO.java | 191 +++++++++--------- 1 file changed, 91 insertions(+), 100 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java index 0c3d69e0f..5e1bc9ab7 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/base/BaseSQLDAO.java @@ -98,16 +98,98 @@ public E find(Long id) { } } + private List buildRestrictions(Root root, Map params, Logger.Level level) { + CriteriaBuilder builder = entityManager.getCriteriaBuilder(); + List restrictions = new ArrayList<>(); + + for (String key : params.keySet()) { + Path column = null; + Log.log(level, "Key: " + key); + if (key.contains(".")) { + String[] objects = key.split("\\."); + for (String s : objects) { + Log.log(level, "Looking up: " + s); + if (column != null) { + Log.log(level, "Looking up via column: " + s); + Path pathColumn = column.get(s); + if (pathColumn.getJavaType().equals(List.class)) { + column = ((Join) column).join(s); + } else { + column = pathColumn; + } + } else { + Log.log(level, "Looking up via root: " + s); + column = root.get(s); + if (column.getJavaType().equals(List.class)) + column = root.join(s); + } + + Log.log(level, "Column Alias: " + column.getAlias() + " Column Java Type: " + column.getJavaType() + " Column Model: " + column.getModel() + " Column Parent Path Alias: " + column.getParentPath().getAlias()); + } + } else { + Log.log(level, "Looking up via root: " + key); + column = root.get(key); + // Don't need to join to these tables if value is null, the isEmpty will catch the condition later + Object value = params.get(key); + if(value != null) { + if (column instanceof SqmPluralValuedSimplePath) + column = root.join(key); + } + } + + Log.log(level, "Column Alias: " + column.getAlias() + " Column Java Type: " + column.getJavaType() + " Column Model: " + column.getModel() + " Column Parent Path Alias: " + column.getParentPath().getAlias()); + + Object value = params.get(key); + + if(value == null) { + restrictions.add(builder.isEmpty(root.get(key))); + } else if (value instanceof Integer) { + Log.log(level, "Integer Type: " + value); + Integer desiredValue = (Integer) value; + restrictions.add(builder.equal(column, desiredValue)); + } else if (value instanceof Enum) { + Log.log(level, "Enum Type: " + value); + restrictions.add(builder.equal(column, value)); + } else if (value instanceof Long) { + Log.log(level, "Long Type: " + value); + Long desiredValue = (Long) value; + restrictions.add(builder.equal(column, desiredValue)); + } else if (value instanceof Boolean) { + Log.log(level, "Boolean Type: " + value); + Boolean desiredValue = (Boolean) value; + restrictions.add(builder.equal(column, desiredValue)); + } else if (value instanceof String) { + Log.log(level, "String Type: " + value); + String desiredValue = (String) value; + restrictions.add(builder.equal(column, desiredValue)); + } else { + // Not sure what to do here as we have a non supported value + Log.info("Unsupprted Value: " + value); + } + } + + return restrictions; + } + public List findFilteredIds(Map params) { - List primaryKeys = new ArrayList<>(); - SearchResponse results = findByParams(params); - for (E entity : results.getResults()) { - Long pk = returnId(entity); - if (pk != null) - primaryKeys.add(pk); + Logger.Level level = Level.DEBUG; + if(params.containsKey("debug")) { + level = params.remove("debug").equals("true") ? Level.INFO : Level.DEBUG; } - return primaryKeys; + CriteriaBuilder builder = entityManager.getCriteriaBuilder(); + CriteriaQuery query = builder.createQuery(Long.class); + Root root = query.from(myClass); + + List restrictions = buildRestrictions(root, params, level); + + query.orderBy(builder.asc(root.get("id"))); + query.where(builder.and(restrictions.toArray(new Predicate[0]))); + query.select(root.get("id")); + + List filteredIds = entityManager.createQuery(query).getResultList(); + + return filteredIds; } public SearchResponse findAllIds() { @@ -492,99 +574,8 @@ public SearchResponse findByParams(Pagination pagination, Map Root countRoot = countQuery.from(myClass); // System.out.println("Root: " + root); - List restrictions = new ArrayList<>(); - List countRestrictions = new ArrayList<>(); - - for (String key : params.keySet()) { - Path column = null; - Path countColumn = null; - Log.log(level, "Key: " + key); - if (key.contains(".")) { - String[] objects = key.split("\\."); - for (String s : objects) { - Log.log(level, "Looking up: " + s); - if (column != null) { - Log.log(level, "Looking up via column: " + s); - Path pathColumn = column.get(s); - if (pathColumn.getJavaType().equals(List.class)) { - column = ((Join) column).join(s); - } else { - column = pathColumn; - } - Path pathCountColumn = countColumn.get(s); - if (pathCountColumn.getJavaType().equals(List.class)) { - countColumn = ((Join) countColumn).join(s); - } else { - countColumn = pathCountColumn; - } - } else { - Log.log(level, "Looking up via root: " + s); - column = root.get(s); - if (column.getJavaType().equals(List.class)) { - column = root.join(s); - } - countColumn = countRoot.get(s); - if (countColumn.getJavaType().equals(List.class)) { - countColumn = countRoot.join(s); - } - } - - Log.log(level, "Column Alias: " + column.getAlias() + " Column Java Type: " + column.getJavaType() + " Column Model: " + column.getModel() + " Column Parent Path Alias: " + column.getParentPath().getAlias()); - Log.log(level, "Count Column Alias: " + countColumn.getAlias() + " Count Column Java Type: " + countColumn.getJavaType() + " Count Column Model: " + countColumn.getModel() + " Count Column Parent Path Alias: " + countColumn.getParentPath().getAlias()); - } - } else { - Log.log(level, "Looking up via root: " + key); - column = root.get(key); - countColumn = countRoot.get(key); - // Don't need to join to these tables if value is null, the isEmpty will catch the condition later - Object value = params.get(key); - if(value != null) { - if (column instanceof SqmPluralValuedSimplePath) { - column = root.join(key); - } - if (countColumn instanceof SqmPluralValuedSimplePath) { - countColumn = countRoot.join(key); - } - } - } - - Log.log(level, "Column Alias: " + column.getAlias() + " Column Java Type: " + column.getJavaType() + " Column Model: " + column.getModel() + " Column Parent Path Alias: " + column.getParentPath().getAlias()); - Log.log(level, "Count Column Alias: " + countColumn.getAlias() + " Count Column Java Type: " + countColumn.getJavaType() + " Count Column Model: " + countColumn.getModel() + " Count Column Parent Path Alias: " + countColumn.getParentPath().getAlias()); - - Object value = params.get(key); - - if(value == null) { - restrictions.add(builder.isEmpty(root.get(key))); - countRestrictions.add(builder.isEmpty(countRoot.get(key))); - } else if (value instanceof Integer) { - Log.log(level, "Integer Type: " + value); - Integer desiredValue = (Integer) value; - restrictions.add(builder.equal(column, desiredValue)); - countRestrictions.add(builder.equal(countColumn, desiredValue)); - } else if (value instanceof Enum) { - Log.log(level, "Enum Type: " + value); - restrictions.add(builder.equal(column, value)); - countRestrictions.add(builder.equal(countColumn, value)); - } else if (value instanceof Long) { - Log.log(level, "Long Type: " + value); - Long desiredValue = (Long) value; - restrictions.add(builder.equal(column, desiredValue)); - countRestrictions.add(builder.equal(countColumn, desiredValue)); - } else if (value instanceof Boolean) { - Log.log(level, "Boolean Type: " + value); - Boolean desiredValue = (Boolean) value; - restrictions.add(builder.equal(column, desiredValue)); - countRestrictions.add(builder.equal(countColumn, desiredValue)); - } else if (value instanceof String) { - Log.log(level, "String Type: " + value); - String desiredValue = (String) value; - restrictions.add(builder.equal(column, desiredValue)); - countRestrictions.add(builder.equal(countColumn, desiredValue)); - } else { - // Not sure what to do here as we have a non supported value - Log.info("Unsupprted Value: " + value); - } - } + List restrictions = buildRestrictions(root, params, level); + List countRestrictions = buildRestrictions(countRoot, params, level); if (orderByField != null) { query.orderBy(builder.asc(root.get(orderByField))); From 579c8c302096e989a168b1b0de465b4689ff36ec Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Mon, 26 Feb 2024 13:01:37 -0600 Subject: [PATCH 114/159] Adding GENO type ontology to persistent store --- src/main/cliapp/src/constants/Classes.js | 1 + .../src/containers/layout/SiteLayout.js | 1 + src/main/cliapp/src/routes.js | 1 + .../cliapp/src/service/DataLoadService.js | 2 +- .../crud/ontology/GenoTermCrudController.java | 23 +++++++++++++++++++ .../dao/ontology/GenoTermDAO.java | 14 +++++++++++ .../enums/OntologyBulkLoadType.java | 4 +++- .../crud/ontology/GenoTermCrudInterface.java | 17 ++++++++++++++ .../jobs/executors/OntologyExecutor.java | 6 +++++ .../model/entities/ontology/GENOTerm.java | 20 ++++++++++++++++ .../services/ontology/GenoTermService.java | 22 ++++++++++++++++++ .../db/migration/v0.31.0.2__genoterm.sql | 21 +++++++++++++++++ 12 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 src/main/java/org/alliancegenome/curation_api/controllers/crud/ontology/GenoTermCrudController.java create mode 100644 src/main/java/org/alliancegenome/curation_api/dao/ontology/GenoTermDAO.java create mode 100644 src/main/java/org/alliancegenome/curation_api/interfaces/crud/ontology/GenoTermCrudInterface.java create mode 100644 src/main/java/org/alliancegenome/curation_api/model/entities/ontology/GENOTerm.java create mode 100644 src/main/java/org/alliancegenome/curation_api/services/ontology/GenoTermService.java create mode 100644 src/main/resources/db/migration/v0.31.0.2__genoterm.sql diff --git a/src/main/cliapp/src/constants/Classes.js b/src/main/cliapp/src/constants/Classes.js index 3c301cded..10cf928a5 100644 --- a/src/main/cliapp/src/constants/Classes.js +++ b/src/main/cliapp/src/constants/Classes.js @@ -57,6 +57,7 @@ export const CLASSES = Object.freeze({ CLTerm: { name: "CL", link: "/#/ontology/cl", type: 'ontology', }, CMOTerm: { name: "CMO", link: "/#/ontology/cmo", type: 'ontology', }, BSPOTerm: { name: "BSPO", link: "/#/ontology/bspo", type: 'ontology', }, + GENOTerm: { namw: "GENO", link: "/#/ontology/geno", type: 'ontology', }, CurationReport: { name: "Curation Reports", link: "/#/reports", type: 'system', }, BulkLoad: { name: "Bulk Loads / Failed Loads", link: "/#/dataloads", type: 'system', }, diff --git a/src/main/cliapp/src/containers/layout/SiteLayout.js b/src/main/cliapp/src/containers/layout/SiteLayout.js index 6c41a769d..bc7107540 100644 --- a/src/main/cliapp/src/containers/layout/SiteLayout.js +++ b/src/main/cliapp/src/containers/layout/SiteLayout.js @@ -267,6 +267,7 @@ export const SiteLayout = (props) => { ] }, { label: 'Gene Ontology (GO)', icon: 'pi pi-fw pi-home', to: '/ontology/go' }, + { label: 'Genotype Ontology (GENO)', icon: 'pi pi-fw pi-home', to: '/ontology/geno'}, { label: 'Measurement Method Ontology (MMO)', icon: 'pi pi-fw pi-home', to: '/ontology/mmo' }, { label: 'Molecular Interactions Ontology (MI)', icon: 'pi pi-fw pi-home', to: '/ontology/mi' }, { label: 'Mouse Pathology Ontology (MPATH)', icon: 'pi pi-fw pi-home', to: '/ontology/mpath' }, diff --git a/src/main/cliapp/src/routes.js b/src/main/cliapp/src/routes.js index 77615fa6f..571821ccb 100644 --- a/src/main/cliapp/src/routes.js +++ b/src/main/cliapp/src/routes.js @@ -106,6 +106,7 @@ export default ( } /> } /> } /> + } /> } /> } /> diff --git a/src/main/cliapp/src/service/DataLoadService.js b/src/main/cliapp/src/service/DataLoadService.js index f9005e82d..698274b66 100644 --- a/src/main/cliapp/src/service/DataLoadService.js +++ b/src/main/cliapp/src/service/DataLoadService.js @@ -96,7 +96,7 @@ export class DataLoadService extends BaseAuthService { getOntologyTypes() { return [ - "APO", "ATP", "BSPO", "CHEBI", "CL", "CMO", "DAO", "DO", "DPO", "ECO", "EMAPA", "FBDV", "GO", "HP", "MA", "MI", "MMO", "MPATH", "MOD", "MMUSDV", "MP", "OBI", "PATO", "PW", "RO", "RS", "SO", "UBERON", "VT", "WBBT", "WBLS", "WBPheno", "XBA_XBS", "XBED", "XCO", "XPO", "XSMO", "ZECO", "ZFA", "ZFS" + "APO", "ATP", "BSPO", "CHEBI", "CL", "CMO", "DAO", "DO", "DPO", "ECO", "EMAPA", "FBDV","GENO", "GO", "HP", "MA", "MI", "MMO", "MPATH", "MOD", "MMUSDV", "MP", "OBI", "PATO", "PW", "RO", "RS", "SO", "UBERON", "VT", "WBBT", "WBLS", "WBPheno", "XBA_XBS", "XBED", "XCO", "XPO", "XSMO", "ZECO", "ZFA", "ZFS" ]; } diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/ontology/GenoTermCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/ontology/GenoTermCrudController.java new file mode 100644 index 000000000..895593078 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/ontology/GenoTermCrudController.java @@ -0,0 +1,23 @@ +package org.alliancegenome.curation_api.controllers.crud.ontology; + +import org.alliancegenome.curation_api.controllers.base.BaseOntologyTermController; +import org.alliancegenome.curation_api.dao.ontology.GenoTermDAO; +import org.alliancegenome.curation_api.interfaces.crud.ontology.GenoTermCrudInterface; +import org.alliancegenome.curation_api.model.entities.ontology.GENOTerm; +import org.alliancegenome.curation_api.services.ontology.GenoTermService; + +import jakarta.annotation.PostConstruct; +import jakarta.inject.Inject; + + +public class GenoTermCrudController extends BaseOntologyTermController implements GenoTermCrudInterface { + + @Inject + GenoTermService genoTermService; + + @Override + @PostConstruct + public void init() { + setService(genoTermService, GENOTerm.class); + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/dao/ontology/GenoTermDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/ontology/GenoTermDAO.java new file mode 100644 index 000000000..3005654a0 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/dao/ontology/GenoTermDAO.java @@ -0,0 +1,14 @@ +package org.alliancegenome.curation_api.dao.ontology; + +import org.alliancegenome.curation_api.dao.base.BaseSQLDAO; +import org.alliancegenome.curation_api.model.entities.ontology.GENOTerm; + +import jakarta.enterprise.context.ApplicationScoped; + +@ApplicationScoped +public class GenoTermDAO extends BaseSQLDAO { + + protected GenoTermDAO() { + super(GENOTerm.class); + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/enums/OntologyBulkLoadType.java b/src/main/java/org/alliancegenome/curation_api/enums/OntologyBulkLoadType.java index fcf90aa40..683108e9a 100644 --- a/src/main/java/org/alliancegenome/curation_api/enums/OntologyBulkLoadType.java +++ b/src/main/java/org/alliancegenome/curation_api/enums/OntologyBulkLoadType.java @@ -12,6 +12,7 @@ import org.alliancegenome.curation_api.model.entities.ontology.ECOTerm; import org.alliancegenome.curation_api.model.entities.ontology.EMAPATerm; import org.alliancegenome.curation_api.model.entities.ontology.FBDVTerm; +import org.alliancegenome.curation_api.model.entities.ontology.GENOTerm; import org.alliancegenome.curation_api.model.entities.ontology.GOTerm; import org.alliancegenome.curation_api.model.entities.ontology.HPTerm; import org.alliancegenome.curation_api.model.entities.ontology.MATerm; @@ -85,7 +86,8 @@ public enum OntologyBulkLoadType { PW(PWTerm.class), CL(CLTerm.class), CMO(CMOTerm.class), - BSPO(BSPOTerm.class); + BSPO(BSPOTerm.class), + GENO(GENOTerm.class); private Class clazz; diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ontology/GenoTermCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ontology/GenoTermCrudInterface.java new file mode 100644 index 000000000..ed9fcd284 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ontology/GenoTermCrudInterface.java @@ -0,0 +1,17 @@ +package org.alliancegenome.curation_api.interfaces.crud.ontology; + +import org.alliancegenome.curation_api.interfaces.base.BaseOntologyTermCrudInterface; +import org.alliancegenome.curation_api.model.entities.ontology.GENOTerm; +import org.eclipse.microprofile.openapi.annotations.tags.Tag; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; + +@Path("/genoterm") +@Tag(name = "CRUD - Ontology") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public interface GenoTermCrudInterface extends BaseOntologyTermCrudInterface { + +} diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java index 66e70b584..1a909a2af 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java @@ -25,6 +25,7 @@ import org.alliancegenome.curation_api.services.ontology.EcoTermService; import org.alliancegenome.curation_api.services.ontology.EmapaTermService; import org.alliancegenome.curation_api.services.ontology.FbdvTermService; +import org.alliancegenome.curation_api.services.ontology.GenoTermService; import org.alliancegenome.curation_api.services.ontology.GoTermService; import org.alliancegenome.curation_api.services.ontology.HpTermService; import org.alliancegenome.curation_api.services.ontology.MaTermService; @@ -106,6 +107,7 @@ public class OntologyExecutor { @Inject ClTermService clTermService; @Inject CmoTermService cmoTermService; @Inject BspoTermService bspoTermService; + @Inject GenoTermService genoTermService; @Inject BulkLoadFileDAO bulkLoadFileDAO; @Inject LoadProcessDisplayService loadProcessDisplayService; @@ -228,6 +230,10 @@ public void runLoad(BulkLoadFile bulkLoadFile) throws Exception { config.setLoadOnlyIRIPrefix("BSPO"); processTerms(bulkLoadFile, bspoTermService, config); } + case GENO -> { + config.setLoadOnlyIRIPrefix("GENO"); + processTerms(bulkLoadFile, genoTermService, config); + } default -> { log.info("Ontology Load: " + bulkLoadFile.getBulkLoad().getName() + " for OT: " + ontologyType + " not implemented"); throw new Exception("Ontology Load: " + bulkLoadFile.getBulkLoad().getName() + " for OT: " + ontologyType + " not implemented"); diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/GENOTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/GENOTerm.java new file mode 100644 index 000000000..816eb8ec0 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/GENOTerm.java @@ -0,0 +1,20 @@ +package org.alliancegenome.curation_api.model.entities.ontology; + +import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; +import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; + +import jakarta.persistence.Entity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Indexed +@Entity +@Data +@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@ToString(callSuper = true) +@AGRCurationSchemaVersion(min = LinkMLSchemaConstants.MIN_ONTOLOGY_RELEASE, max = LinkMLSchemaConstants.MAX_ONTOLOGY_RELEASE, dependencies = { OntologyTerm.class }) +public class GENOTerm extends OntologyTerm { + +} \ No newline at end of file diff --git a/src/main/java/org/alliancegenome/curation_api/services/ontology/GenoTermService.java b/src/main/java/org/alliancegenome/curation_api/services/ontology/GenoTermService.java new file mode 100644 index 000000000..d2a24a65f --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/services/ontology/GenoTermService.java @@ -0,0 +1,22 @@ +package org.alliancegenome.curation_api.services.ontology; + +import org.alliancegenome.curation_api.dao.ontology.GenoTermDAO; +import org.alliancegenome.curation_api.model.entities.ontology.GENOTerm; +import org.alliancegenome.curation_api.services.base.BaseOntologyTermService; + +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; + +@RequestScoped +public class GenoTermService extends BaseOntologyTermService { + + @Inject + GenoTermDAO genoTermDAO; + + @Override + @PostConstruct + protected void init() { + setSQLDao(genoTermDAO); + } +} diff --git a/src/main/resources/db/migration/v0.31.0.2__genoterm.sql b/src/main/resources/db/migration/v0.31.0.2__genoterm.sql new file mode 100644 index 000000000..a1d109c7c --- /dev/null +++ b/src/main/resources/db/migration/v0.31.0.2__genoterm.sql @@ -0,0 +1,21 @@ +-- GENOTerm tables +CREATE TABLE genoterm ( + curie character varying(255) NOT NULL +); + +ALTER TABLE ONLY genoterm + ADD CONSTRAINT genoterm_pkey PRIMARY KEY (curie); + +ALTER TABLE ONLY genoterm + ADD CONSTRAINT genoterm_curie_fk FOREIGN KEY (curie) REFERENCES ontologyterm(curie); + +CREATE TABLE genoterm_aud ( + curie character varying(255) NOT NULL, + rev integer NOT NULL +); + +ALTER TABLE genoterm_aud + ADD CONSTRAINT genoterm_aud_pkey PRIMARY KEY (curie, rev); + +ALTER TABLE ONLY genoterm_aud + ADD CONSTRAINT genoterm_aud_curie_rev_fk FOREIGN KEY (curie, rev) REFERENCES ontologyterm_aud(curie, rev); \ No newline at end of file From ebd5c19e664f65a44431ff40b5672e92ae7e0486 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Tue, 27 Feb 2024 11:00:30 -0600 Subject: [PATCH 115/159] Removed audit tables from GENOTERM migration file --- .../resources/db/migration/v0.31.0.2__genoterm.sql | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/main/resources/db/migration/v0.31.0.2__genoterm.sql b/src/main/resources/db/migration/v0.31.0.2__genoterm.sql index a1d109c7c..f1796869a 100644 --- a/src/main/resources/db/migration/v0.31.0.2__genoterm.sql +++ b/src/main/resources/db/migration/v0.31.0.2__genoterm.sql @@ -7,15 +7,4 @@ ALTER TABLE ONLY genoterm ADD CONSTRAINT genoterm_pkey PRIMARY KEY (curie); ALTER TABLE ONLY genoterm - ADD CONSTRAINT genoterm_curie_fk FOREIGN KEY (curie) REFERENCES ontologyterm(curie); - -CREATE TABLE genoterm_aud ( - curie character varying(255) NOT NULL, - rev integer NOT NULL -); - -ALTER TABLE genoterm_aud - ADD CONSTRAINT genoterm_aud_pkey PRIMARY KEY (curie, rev); - -ALTER TABLE ONLY genoterm_aud - ADD CONSTRAINT genoterm_aud_curie_rev_fk FOREIGN KEY (curie, rev) REFERENCES ontologyterm_aud(curie, rev); \ No newline at end of file + ADD CONSTRAINT genoterm_curie_fk FOREIGN KEY (curie) REFERENCES ontologyterm(curie); \ No newline at end of file From 6bc48d20a0fa430cb0a00441555acb6c5f2882e9 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Tue, 27 Feb 2024 12:31:17 -0600 Subject: [PATCH 116/159] Changed the column name from curie to id --- src/main/resources/db/migration/v0.31.0.2__genoterm.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/db/migration/v0.31.0.2__genoterm.sql b/src/main/resources/db/migration/v0.31.0.2__genoterm.sql index f1796869a..776812629 100644 --- a/src/main/resources/db/migration/v0.31.0.2__genoterm.sql +++ b/src/main/resources/db/migration/v0.31.0.2__genoterm.sql @@ -1,10 +1,10 @@ -- GENOTerm tables CREATE TABLE genoterm ( - curie character varying(255) NOT NULL + id bigint NOT NULL ); ALTER TABLE ONLY genoterm - ADD CONSTRAINT genoterm_pkey PRIMARY KEY (curie); + ADD CONSTRAINT genoterm_pkey PRIMARY KEY (id); ALTER TABLE ONLY genoterm - ADD CONSTRAINT genoterm_curie_fk FOREIGN KEY (curie) REFERENCES ontologyterm(curie); \ No newline at end of file + ADD CONSTRAINT genoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm(id); \ No newline at end of file From a804563e809a326723cb45d5298afe678d834ff2 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Tue, 27 Feb 2024 12:56:57 -0600 Subject: [PATCH 117/159] changes in UI code --- src/main/cliapp/src/constants/Classes.js | 2 +- src/main/cliapp/src/routes.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/cliapp/src/constants/Classes.js b/src/main/cliapp/src/constants/Classes.js index 10cf928a5..4996baaf3 100644 --- a/src/main/cliapp/src/constants/Classes.js +++ b/src/main/cliapp/src/constants/Classes.js @@ -57,7 +57,7 @@ export const CLASSES = Object.freeze({ CLTerm: { name: "CL", link: "/#/ontology/cl", type: 'ontology', }, CMOTerm: { name: "CMO", link: "/#/ontology/cmo", type: 'ontology', }, BSPOTerm: { name: "BSPO", link: "/#/ontology/bspo", type: 'ontology', }, - GENOTerm: { namw: "GENO", link: "/#/ontology/geno", type: 'ontology', }, + GENOTerm: { name: "GENO", link: "/#/ontology/geno", type: 'ontology', }, CurationReport: { name: "Curation Reports", link: "/#/reports", type: 'system', }, BulkLoad: { name: "Bulk Loads / Failed Loads", link: "/#/dataloads", type: 'system', }, diff --git a/src/main/cliapp/src/routes.js b/src/main/cliapp/src/routes.js index 571821ccb..c88b659fd 100644 --- a/src/main/cliapp/src/routes.js +++ b/src/main/cliapp/src/routes.js @@ -106,7 +106,7 @@ export default ( } /> } /> } /> - } /> + } /> } /> } /> From 3814e32d0c2bca1e5f7f4d3e662c762ba603ef48 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 27 Feb 2024 13:49:59 -0600 Subject: [PATCH 118/159] add getIdentifier to EditorTooltip --- .../cliapp/src/components/Autocomplete/EditorTooltip.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/cliapp/src/components/Autocomplete/EditorTooltip.js b/src/main/cliapp/src/components/Autocomplete/EditorTooltip.js index a3f304ceb..afce62234 100644 --- a/src/main/cliapp/src/components/Autocomplete/EditorTooltip.js +++ b/src/main/cliapp/src/components/Autocomplete/EditorTooltip.js @@ -1,12 +1,16 @@ import React from "react"; import {Tooltip} from "primereact/tooltip"; +import { getIdentifier } from "../../utils/utils"; export const EditorTooltip = ({op, autocompleteHoverItem}) => { + const identifier = getIdentifier(autocompleteHoverItem); + const identifierText = `Indentifier: ${identifier}`; + return ( <> - {autocompleteHoverItem.curie && -
Curie: {autocompleteHoverItem.curie} + {identifier && +
{identifierText}
} From f21b5c0bc4eb507df9e285f098c006c6164647c0 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Tue, 27 Feb 2024 15:41:07 -0600 Subject: [PATCH 119/159] Adding Null class response body for swagger --- .../interfaces/base/BaseIdCrudInterface.java | 11 +++++++++++ .../interfaces/base/CurieObjectCrudInterface.java | 11 +++++++++++ .../interfaces/base/SubmittedObjectCrudInterface.java | 11 +++++++++++ 3 files changed, 33 insertions(+) diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java index c2a4bb46b..675f94711 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java @@ -8,11 +8,16 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.view.View; +import org.eclipse.microprofile.openapi.annotations.media.Content; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody; +import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; +import org.eclipse.microprofile.openapi.annotations.responses.APIResponses; import org.eclipse.microprofile.openapi.annotations.tags.Tag; import com.fasterxml.jackson.annotation.JsonView; +import jakarta.validation.constraints.Null; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; import jakarta.ws.rs.DefaultValue; @@ -42,6 +47,12 @@ public interface BaseIdCrudInterface { @GET @Path("/{id}") @JsonView(View.FieldsOnly.class) + @APIResponses( + @APIResponse(description = "Get the entity by ID", + responseCode = "200", + content = @Content(mediaType = "application/json", + schema = @Schema(implementation = Null.class))) + ) public ObjectResponse get(@PathParam("id") Long id); @PUT diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java index 02824618e..3b50f4e02 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java @@ -8,11 +8,16 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.view.View; +import org.eclipse.microprofile.openapi.annotations.media.Content; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody; +import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; +import org.eclipse.microprofile.openapi.annotations.responses.APIResponses; import org.eclipse.microprofile.openapi.annotations.tags.Tag; import com.fasterxml.jackson.annotation.JsonView; +import jakarta.validation.constraints.Null; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; import jakarta.ws.rs.DefaultValue; @@ -42,6 +47,12 @@ public interface CurieObjectCrudInterface { @GET @Path("/{curie}") @JsonView(View.FieldsOnly.class) + @APIResponses( + @APIResponse(description = "Get the Entity by CURIE", + responseCode = "200", + content = @Content(mediaType = "application/json", + schema = @Schema(implementation = Null.class))) + ) public ObjectResponse get(@PathParam("curie") String curie); @PUT diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java index 5c03eec00..70472c198 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java @@ -3,9 +3,14 @@ import org.alliancegenome.curation_api.model.entities.base.SubmittedObject; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.view.View; +import org.eclipse.microprofile.openapi.annotations.media.Content; +import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; +import org.eclipse.microprofile.openapi.annotations.responses.APIResponses; import com.fasterxml.jackson.annotation.JsonView; +import jakarta.validation.constraints.Null; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; import jakarta.ws.rs.GET; @@ -22,6 +27,12 @@ public interface SubmittedObjectCrudInterface extends @GET @Path("/{identifierString}") @JsonView(View.FieldsOnly.class) + @APIResponses( + @APIResponse(description = "Get the Entity by Identifier String", + responseCode = "200", + content = @Content(mediaType = "application/json", + schema = @Schema(implementation = Null.class))) + ) public ObjectResponse get(@PathParam("identifierString") String identifierString); @Override From 9a8d0e07cfd7ee9f3f3f798c0577f54777eae9e0 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Wed, 28 Feb 2024 11:09:26 -0500 Subject: [PATCH 120/159] Fix indentations --- .../crud/ontology/GenoTermCrudController.java | 14 +++++++------- .../curation_api/dao/ontology/GenoTermDAO.java | 8 ++++---- .../crud/ontology/GenoTermCrudInterface.java | 4 ++-- .../services/ontology/GenoTermService.java | 16 ++++++++-------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/ontology/GenoTermCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/ontology/GenoTermCrudController.java index 895593078..b7476e7d5 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/ontology/GenoTermCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/ontology/GenoTermCrudController.java @@ -12,12 +12,12 @@ public class GenoTermCrudController extends BaseOntologyTermController implements GenoTermCrudInterface { - @Inject - GenoTermService genoTermService; + @Inject + GenoTermService genoTermService; - @Override - @PostConstruct - public void init() { - setService(genoTermService, GENOTerm.class); - } + @Override + @PostConstruct + public void init() { + setService(genoTermService, GENOTerm.class); + } } diff --git a/src/main/java/org/alliancegenome/curation_api/dao/ontology/GenoTermDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/ontology/GenoTermDAO.java index 3005654a0..0963b3374 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/ontology/GenoTermDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/ontology/GenoTermDAO.java @@ -7,8 +7,8 @@ @ApplicationScoped public class GenoTermDAO extends BaseSQLDAO { - - protected GenoTermDAO() { - super(GENOTerm.class); - } + + protected GenoTermDAO() { + super(GENOTerm.class); + } } diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ontology/GenoTermCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ontology/GenoTermCrudInterface.java index ed9fcd284..660769c2e 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ontology/GenoTermCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/ontology/GenoTermCrudInterface.java @@ -12,6 +12,6 @@ @Tag(name = "CRUD - Ontology") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface GenoTermCrudInterface extends BaseOntologyTermCrudInterface { - +public interface GenoTermCrudInterface extends BaseOntologyTermCrudInterface { + } diff --git a/src/main/java/org/alliancegenome/curation_api/services/ontology/GenoTermService.java b/src/main/java/org/alliancegenome/curation_api/services/ontology/GenoTermService.java index d2a24a65f..2e90f8027 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ontology/GenoTermService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ontology/GenoTermService.java @@ -10,13 +10,13 @@ @RequestScoped public class GenoTermService extends BaseOntologyTermService { - - @Inject - GenoTermDAO genoTermDAO; + + @Inject + GenoTermDAO genoTermDAO; - @Override - @PostConstruct - protected void init() { - setSQLDao(genoTermDAO); - } + @Override + @PostConstruct + protected void init() { + setSQLDao(genoTermDAO); + } } From 692746e2cfd2ad05a85e6f86b58b78b531d03057 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Thu, 29 Feb 2024 09:48:01 -0500 Subject: [PATCH 121/159] Added code to speed up closure queries --- Makefile | 2 +- .../jobs/executors/OntologyExecutor.java | 27 ++- .../model/entities/ontology/OntologyTerm.java | 5 +- .../base/BaseOntologyTermService.java | 106 ++-------- .../db/migration/v0.31.0.3__closure_fix.sql | 193 ++++++++++++++++++ 5 files changed, 235 insertions(+), 98 deletions(-) create mode 100644 src/main/resources/db/migration/v0.31.0.3__closure_fix.sql diff --git a/Makefile b/Makefile index 038c562a7..42b4d77b6 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ uirunlomu: run: docker-run apirun: - mvn compile quarkus:dev + mvn compile quarkus:dev -Djvm.args="-XX:ReservedCodeCacheSize=1g" docker: docker build --build-arg OVERWRITE_VERSION=${GIT_VERSION} -t ${REG}/agr_curation:${RELEASE} . diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java index 1a909a2af..f2a1d1fad 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java @@ -265,13 +265,24 @@ private void processTerms(BulkLoadFile bulkLoadFile, OntologyBulkLoadType ontolo } ph.finishProcess(); -// ProcessDisplayHelper ph1 = new ProcessDisplayHelper(10000); -// ph.addDisplayHandler(loadProcessDisplayService); -// ph1.startProcess(bulkLoadFile.getBulkLoad().getName() + ": " + ontologyType.getClazz().getSimpleName() + " Closure", termMap.size()); -// for (Entry entry : termMap.entrySet()) { -// service.processUpdateRelationships(entry.getValue()); -// ph1.progressProcess(); -// } -// ph1.finishProcess(); + ProcessDisplayHelper ph1 = new ProcessDisplayHelper(10000); + ph.addDisplayHandler(loadProcessDisplayService); + ph1.startProcess(bulkLoadFile.getBulkLoad().getName() + ": " + ontologyType.getClazz().getSimpleName() + " Closure", termMap.size()); + for (Entry entry : termMap.entrySet()) { + service.processUpdateRelationships(entry.getValue()); + //Thread.sleep(5000); + ph1.progressProcess(); + } + ph1.finishProcess(); + + ProcessDisplayHelper ph2 = new ProcessDisplayHelper(10000); + ph.addDisplayHandler(loadProcessDisplayService); + ph2.startProcess(bulkLoadFile.getBulkLoad().getName() + ": " + ontologyType.getClazz().getSimpleName() + " Counts", termMap.size()); + for (Entry entry : termMap.entrySet()) { + service.processCounts(entry.getValue()); + //Thread.sleep(5000); + ph2.progressProcess(); + } + ph2.finishProcess(); } } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java index 49ab3da5a..d5001493b 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ontology/OntologyTerm.java @@ -8,7 +8,6 @@ import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.CrossReference; import org.alliancegenome.curation_api.model.entities.Synonym; -import org.alliancegenome.curation_api.model.entities.base.AuditedObject; import org.alliancegenome.curation_api.model.entities.base.CurieObject; import org.alliancegenome.curation_api.view.View; import org.hibernate.search.engine.backend.types.Aggregable; @@ -23,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonView; import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; import jakarta.persistence.ElementCollection; import jakarta.persistence.Entity; import jakarta.persistence.Index; @@ -37,7 +37,8 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -@Inheritance(strategy = InheritanceType.JOINED) +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@DiscriminatorColumn(name = "OntologyTermType") @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) @Entity diff --git a/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java b/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java index 979b3af95..2eec79614 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/base/BaseOntologyTermService.java @@ -84,107 +84,39 @@ public E processUpdate(E inTerm) { @Transactional public E processUpdateRelationships(E inTerm) { - // TODO: 01 - figure out issues with ontologies E term = findByCurie(inTerm.getCurie()); - - HashSet incomingParents = new HashSet<>(); - HashSet parentAdds = new HashSet<>(); - HashSet dbParents = new HashSet<>(); - HashSet parentDeletes = new HashSet<>(); - - if(term.getIsaParents() != null) { - for(OntologyTerm ot: term.getIsaParents()) { - dbParents.add(ot.getCurie()); - parentDeletes.add(ot.getCurie()); - } - } - - if(inTerm.getIsaParents() != null) { - for(OntologyTerm ot: inTerm.getIsaParents()) { - incomingParents.add(ot.getCurie()); - parentAdds.add(ot.getCurie()); - } - } - - parentDeletes.removeAll(incomingParents); - parentAdds.removeAll(dbParents); - - if(term.getIsaParents() != null) { - term.getIsaParents().removeIf(f -> { - return parentDeletes.contains(f.getCurie()); + HashSet parentSet = new HashSet<>(); + if(inTerm.getIsaParents() != null) { + inTerm.getIsaParents().forEach(o -> { + E parent = findByCurie(o.getCurie()); + parentSet.add(parent); }); - if(inTerm.getIsaParents() != null) { - inTerm.getIsaParents().forEach(o -> { - if(parentAdds.contains(o.getCurie())) { - term.getIsaParents().add(o); - } - }); - } - } else { - HashSet set = new HashSet<>(); - if(inTerm.getIsaParents() != null) { - inTerm.getIsaParents().forEach(o -> { - if(parentAdds.contains(o.getCurie())) { - set.add(o); - } - }); - term.setIsaParents(set); - } + term.setIsaParents(parentSet); } - - HashSet incomingAncestors = new HashSet<>(); - HashSet ancestorAdds = new HashSet<>(); - HashSet dbAncestors = new HashSet<>(); - HashSet ancestorDeletes = new HashSet<>(); - - if(term.getIsaAncestors() != null) { - term.getIsaAncestors().forEach(o -> { - dbAncestors.add(o.getCurie()); - ancestorDeletes.add(o.getCurie()); - }); - } - + HashSet ancestorsSet = new HashSet<>(); if(inTerm.getIsaAncestors() != null) { inTerm.getIsaAncestors().forEach(o -> { - incomingAncestors.add(o.getCurie()); - ancestorAdds.add(o.getCurie()); + E ancestor = findByCurie(o.getCurie()); + ancestorsSet.add(ancestor); }); + term.setIsaAncestors(ancestorsSet); } - ancestorDeletes.removeAll(incomingAncestors); - ancestorAdds.removeAll(dbAncestors); - - - if(term.getIsaAncestors() != null) { - term.getIsaAncestors().removeIf(f -> { - return ancestorDeletes.contains(f.getCurie()); - }); - if(inTerm.getIsaAncestors() != null) { - inTerm.getIsaAncestors().forEach(o -> { - if(ancestorAdds.contains(o.getCurie())) { - term.getIsaAncestors().add(o); - } - }); - } - } else { - HashSet set = new HashSet<>(); - if(inTerm.getIsaAncestors() != null) { - inTerm.getIsaAncestors().forEach(o -> { - if(ancestorAdds.contains(o.getCurie())) { - set.add(o); - } - }); - term.setIsaAncestors(set); - } - } - + return term; + } + + + @Transactional + public E processCounts(E inTerm) { + E term = findByCurie(inTerm.getCurie()); term.setChildCount(term.getIsaChildren().size()); term.setDescendantCount(term.getIsaDescendants().size()); - return term; } + + private void handleDefinitionUrls(OntologyTerm dbTerm, OntologyTerm incomingTerm) { Set currentDefinitionUrls; diff --git a/src/main/resources/db/migration/v0.31.0.3__closure_fix.sql b/src/main/resources/db/migration/v0.31.0.3__closure_fix.sql new file mode 100644 index 000000000..183ee5b6e --- /dev/null +++ b/src/main/resources/db/migration/v0.31.0.3__closure_fix.sql @@ -0,0 +1,193 @@ +ALTER TABLE OntologyTerm ADD COLUMN OntologyTermType VARCHAR(32); + +UPDATE OntologyTerm o SET OntologyTermType = 'ECOTerm' FROM ECOTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'SOTerm' FROM SOTerm t WHERE o.id = t.id; + +UPDATE OntologyTerm o SET OntologyTermType = 'XSMOTerm' FROM XSMOTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'CHEBITerm' FROM CHEBITerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'Molecule' FROM Molecule t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'ZECOTerm' FROM ZECOTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'XCOTerm' FROM XCOTerm t WHERE o.id = t.id; + +UPDATE OntologyTerm o SET OntologyTermType = 'DOTerm' FROM DOTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'GOTerm' FROM GOTerm t WHERE o.id = t.id; + +UPDATE OntologyTerm o SET OntologyTermType = 'XBSTerm' FROM XBSTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'ZFSTerm' FROM ZFSTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'WBPhenotypeTerm' FROM WBPhenotypeTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'WBLSTerm' FROM WBLSTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'MMUSDVTerm' FROM MMUSDVTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'FBDVTerm' FROM FBDVTerm t WHERE o.id = t.id; + +UPDATE OntologyTerm o SET OntologyTermType = 'APOTerm' FROM APOTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'DPOTerm' FROM DPOTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'HPTerm' FROM HPTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'MPTerm' FROM MPTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'XPOTerm' FROM XPOTerm t WHERE o.id = t.id; + +UPDATE OntologyTerm o SET OntologyTermType = 'CLTerm' FROM CLTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'DAOTerm' FROM DAOTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'EMAPATerm' FROM EMAPATerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'MATerm' FROM MATerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'UBERONTerm' FROM UBERONTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'WBBTTerm' FROM WBBTTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'XBATerm' FROM XBATerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'ZFATerm' FROM ZFATerm t WHERE o.id = t.id; + +UPDATE OntologyTerm o SET OntologyTermType = 'ATPTerm' FROM ATPTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'BSPOTerm' FROM BSPOTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'CMOTerm' FROM CMOTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'GENOTerm' FROM GENOTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'MITerm' FROM MITerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'MMOTerm' FROM MMOTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'MODTerm' FROM MODTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'MPATHTerm' FROM MPATHTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'OBITerm' FROM OBITerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'PATOTerm' FROM PATOTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'PWTerm' FROM PWTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'ROTerm' FROM ROTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'RSTerm' FROM RSTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'VTTerm' FROM VTTerm t WHERE o.id = t.id; +UPDATE OntologyTerm o SET OntologyTermType = 'XBEDTerm' FROM XBEDTerm t WHERE o.id = t.id; + +UPDATE OntologyTerm o SET OntologyTermType = 'NCBITaxonTerm' FROM NCBITaxonTerm t WHERE o.id = t.id; + +UPDATE OntologyTerm SET OntologyTermType = 'MPTerm' WHERE namespace = 'MPheno.ontology' and OntologyTermType is null; + +CREATE INDEX ontologyterm_ontologytermtype_index ON OntologyTerm USING btree (OntologyTermType); + +-- Copy Data from old tables +ALTER TABLE OntologyTerm ADD COLUMN abbreviation varchar(255); +UPDATE OntologyTerm o SET abbreviation = e.abbreviation FROM ECOTerm e WHERE o.id = e.id; + +ALTER TABLE OntologyTerm ADD COLUMN formula varchar(255); +ALTER TABLE OntologyTerm ADD COLUMN inchi varchar(750); +ALTER TABLE OntologyTerm ADD COLUMN inchiKey varchar(255); +ALTER TABLE OntologyTerm ADD COLUMN iupac varchar(500); +ALTER TABLE OntologyTerm ADD COLUMN smiles varchar(500); +UPDATE OntologyTerm o SET inchi = ch.inchi, inchikey = ch.inchikey, iupac = ch.iupac, formula = ch.formula, smiles = ch.smiles FROM ChemicalTerm ch WHERE o.id = ch.id; + + +-- Remove FK's to term tables + +--Drop ECOTerm +ALTER TABLE diseaseAnnotation_ecoterm RENAME TO diseaseannotation_ontologyterm; +ALTER TABLE diseaseannotation_ontologyterm DROP CONSTRAINT diseaseannotation_ecoterm_evidencecodes_id_fk; +ALTER TABLE diseaseannotation_ontologyterm ADD CONSTRAINT diseaseannotation_ecoterm_evidencecodes_id_fk FOREIGN KEY (evidencecodes_id) REFERENCES OntologyTerm (id); +ALTER TABLE allelegenomicentityassociation DROP CONSTRAINT allelegenomicentityassociation_evidencecode_id_fk; +ALTER TABLE allelegenomicentityassociation ADD CONSTRAINT allelegenomicentityassociation_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES OntologyTerm (id); +ALTER TABLE genetogeneorthologycurated DROP CONSTRAINT genetogeneorthologycurated_evidencecode_id_fk; +ALTER TABLE genetogeneorthologycurated ADD CONSTRAINT genetogeneorthologycurated_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES OntologyTerm (id); +DROP TABLE ECOTerm; + +--Drop SOTerm +ALTER TABLE allelemutationtypeslotannotation_soterm RENAME TO allelemutationtypeslotannotation_ontologyterm; +ALTER TABLE allelemutationtypeslotannotation_ontologyterm DROP CONSTRAINT allelemutationtypesa_soterm_mutationtypes_id_fk; +ALTER TABLE allelemutationtypeslotannotation_ontologyterm ADD CONSTRAINT allelemutationtypesa_soterm_mutationtypes_id_fk FOREIGN KEY (mutationtypes_id) REFERENCES OntologyTerm (id); +ALTER TABLE gene DROP CONSTRAINT gene_genetype_id_fk; +ALTER TABLE gene ADD CONSTRAINT gene_genetype_id_fk FOREIGN KEY (genetype_id) REFERENCES OntologyTerm (id); +ALTER TABLE variant DROP CONSTRAINT variant_sourcegeneralconsequence_id_fk; +ALTER TABLE variant ADD CONSTRAINT variant_sourcegeneralconsequence_id_fk FOREIGN KEY (sourcegeneralconsequence_id) REFERENCES OntologyTerm (id); +ALTER TABLE variant DROP CONSTRAINT variant_varianttype_id_fk; +ALTER TABLE variant ADD CONSTRAINT variant_varianttype_id_fk FOREIGN KEY (varianttype_id) REFERENCES OntologyTerm (id); +DROP TABLE SOTerm; + +--Drop NCBITaxonTerm +ALTER TABLE biologicalentity DROP CONSTRAINT biologicalentity_taxon_id_fk; +ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES OntologyTerm (id); +ALTER TABLE constructcomponentslotannotation DROP CONSTRAINT constructcomponentslotannotation_taxon_id_fk; +ALTER TABLE constructcomponentslotannotation ADD CONSTRAINT constructcomponentslotannotation_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); +ALTER TABLE experimentalcondition DROP CONSTRAINT experimentalcondition_conditiontaxon_id_fk; +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditiontaxon_id_fk FOREIGN KEY (conditiontaxon_id) REFERENCES OntologyTerm (id); +ALTER TABLE species DROP CONSTRAINT species_taxon_id_fk; +ALTER TABLE species ADD CONSTRAINT species_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES OntologyTerm (id); +ALTER TABLE constructcomponentslotannotation DROP CONSTRAINT constructcomponentslotannotation_taxon_id_fk; +ALTER TABLE constructcomponentslotannotation ADD CONSTRAINT constructcomponentslotannotation_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id); +ALTER TABLE constructcomponentslotannotation DROP CONSTRAINT constructcomponentslotannotation_taxon_id_fk; +ALTER TABLE constructcomponentslotannotation ADD CONSTRAINT constructcomponentslotannotation_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES OntologyTerm (id); +DROP TABLE NCBITaxonTerm; + + +--Drop ChemicalTerm +ALTER TABLE experimentalcondition DROP CONSTRAINT experimentalcondition_conditionchemical_id_fk; +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionchemical_id_fk FOREIGN KEY (conditionchemical_id) REFERENCES OntologyTerm (id); +DROP TABLE XSMOTerm; +DROP TABLE CHEBITerm; +DROP TABLE Molecule; +DROP TABLE ChemicalTerm; + +--Drop ExperimentalConditionOntologyTerm +ALTER TABLE experimentalcondition DROP CONSTRAINT experimentalcondition_conditionclass_id_fk; +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionclass_id_fk FOREIGN KEY (conditionclass_id) REFERENCES OntologyTerm (id); +DROP TABLE ZECOTerm; + +DROP TABLE XCOTerm; + +ALTER TABLE experimentalcondition DROP CONSTRAINT experimentalcondition_conditionid_id_fk; +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionid_id_fk FOREIGN KEY (conditionid_id) REFERENCES OntologyTerm (id); +DROP TABLE ExperimentalConditionOntologyTerm; + + +--Drop StageTerms +DROP TABLE XBSTerm; +DROP TABLE ZFSTerm; +DROP TABLE WBLSTerm; +DROP TABLE MMUSDVTerm; +DROP TABLE FBDVTerm; +DROP TABLE StageTerm; + + +--Drop PhenotypeTerm +DROP TABLE APOTerm; +DROP TABLE DPOTerm; +DROP TABLE HPTerm; +DROP TABLE MPTerm; +DROP TABLE WBPhenotypeTerm; +DROP TABLE XPOTerm; + +ALTER TABLE allelefunctionalimpactslotannotation DROP CONSTRAINT allelefunctionalimpactslotannotation_phenotypeterm_id_fk; +ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctionalimpactslotannotation_phenotypeterm_id_fk FOREIGN KEY (phenotypeterm_id) REFERENCES OntologyTerm (id); +ALTER TABLE alleleinheritancemodeslotannotation DROP CONSTRAINT alleleinheritancemode_phenotypeterm_id_fk; +ALTER TABLE alleleinheritancemodeslotannotation ADD CONSTRAINT alleleinheritancemode_phenotypeterm_id_fk FOREIGN KEY (phenotypeterm_id) REFERENCES OntologyTerm (id); +DROP TABLE PhenotypeTerm; + + +--Drop AnatomicalTerm +DROP TABLE CLTerm; +DROP TABLE DAOTerm; +DROP TABLE EMAPATerm; +DROP TABLE MATerm; +DROP TABLE UBERONTerm; +DROP TABLE WBBTTerm; +DROP TABLE XBATerm; +DROP TABLE ZFATerm; + +ALTER TABLE experimentalcondition DROP CONSTRAINT experimentalcondition_conditionanatomy_id_fk; +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionanatomy_id_fk FOREIGN KEY (conditionanatomy_id) REFERENCES OntologyTerm (id); +DROP TABLE AnatomicalTerm; + + +--Drop All Other OntologyTerm tables +DROP TABLE ATPTerm; +DROP TABLE BSPOTerm; +DROP TABLE CMOTerm; +DROP TABLE GENOTerm; +DROP TABLE MITerm; +DROP TABLE MMOTerm; +DROP TABLE MODTerm; +DROP TABLE MPATHTerm; +DROP TABLE OBITerm; +DROP TABLE PATOTerm; +DROP TABLE PWTerm; +DROP TABLE ROTerm; +DROP TABLE RSTerm; +DROP TABLE VTTerm; +DROP TABLE XBEDTerm; + +ALTER TABLE diseaseannotation DROP CONSTRAINT diseaseannotation_diseaseannotationobject_id_fk; +ALTER TABLE diseaseannotation ADD CONSTRAINT diseaseannotation_diseaseannotationobject_id_fk FOREIGN KEY (diseaseannotationobject_id) REFERENCES OntologyTerm (id); +DROP TABLE DOTerm; + +ALTER TABLE experimentalcondition DROP CONSTRAINT experimentalcondition_conditiongeneontology_id_fk; +ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditiongeneontology_id_fk FOREIGN KEY (conditiongeneontology_id) REFERENCES OntologyTerm (id); +DROP TABLE GOTerm; From 9935fe75eb4b670fca13796b19a7e49937609ae5 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Thu, 29 Feb 2024 10:06:37 -0500 Subject: [PATCH 122/159] Fix varchar len --- src/main/resources/db/migration/v0.31.0.3__closure_fix.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/db/migration/v0.31.0.3__closure_fix.sql b/src/main/resources/db/migration/v0.31.0.3__closure_fix.sql index 183ee5b6e..cf5f2b230 100644 --- a/src/main/resources/db/migration/v0.31.0.3__closure_fix.sql +++ b/src/main/resources/db/migration/v0.31.0.3__closure_fix.sql @@ -1,4 +1,4 @@ -ALTER TABLE OntologyTerm ADD COLUMN OntologyTermType VARCHAR(32); +ALTER TABLE OntologyTerm ADD COLUMN OntologyTermType VARCHAR(64); UPDATE OntologyTerm o SET OntologyTermType = 'ECOTerm' FROM ECOTerm t WHERE o.id = t.id; UPDATE OntologyTerm o SET OntologyTermType = 'SOTerm' FROM SOTerm t WHERE o.id = t.id; From 41079f54824141d4a2f405377c185c68b48d974b Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Thu, 29 Feb 2024 09:14:21 -0600 Subject: [PATCH 123/159] SCRUM-3740 Adding Null body request and response to Base interfaces --- .../interfaces/base/BaseIdCrudInterface.java | 129 +++++++++++++++++- .../base/CurieObjectCrudInterface.java | 111 ++++++++++++++- .../base/SubmittedObjectCrudInterface.java | 20 ++- 3 files changed, 251 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java index 675f94711..dc5aed52d 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java @@ -11,6 +11,7 @@ import org.eclipse.microprofile.openapi.annotations.media.Content; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody; +import org.eclipse.microprofile.openapi.annotations.parameters.RequestBodySchema; import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; import org.eclipse.microprofile.openapi.annotations.responses.APIResponses; import org.eclipse.microprofile.openapi.annotations.tags.Tag; @@ -37,50 +38,172 @@ public interface BaseIdCrudInterface { @POST @Path("/") @JsonView(View.FieldsOnly.class) + @RequestBody( + description = "Post Request", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class + ) + ) + ) + @APIResponses( + @APIResponse( + description = "Response Entity", + responseCode = "200", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) + ) + ) + ) public ObjectResponse create(E entity); @POST @Path("/multiple") @JsonView(View.FieldsOnly.class) + @RequestBody( + description = "Post Request", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class + ) + ) + ) + @APIResponses( + @APIResponse( + description = "Response Entity", + responseCode = "200", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) + ) + ) + ) public ObjectListResponse create(List entities); @GET @Path("/{id}") @JsonView(View.FieldsOnly.class) @APIResponses( - @APIResponse(description = "Get the entity by ID", + @APIResponse( + description = "Get Entity by Id", responseCode = "200", - content = @Content(mediaType = "application/json", - schema = @Schema(implementation = Null.class))) + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) ) + ) + ) public ObjectResponse get(@PathParam("id") Long id); @PUT @Path("/") @JsonView(View.FieldsOnly.class) + @RequestBody( + description = "Put Request", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class + ) + ) + ) + @APIResponses( + @APIResponse( + description = "Response Entity", + responseCode = "200", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) + ) + ) + ) public ObjectResponse update(E entity); @DELETE @Path("/{id}") @JsonView(View.FieldsOnly.class) + @APIResponses( + @APIResponse( + description = "Delete Entity by Id", + responseCode = "200", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) + ) + ) + ) public ObjectResponse delete(@PathParam("id") Long id); @POST @Path("/find") @Tag(name = "Relational Database Browsing Endpoints") @JsonView(View.FieldsAndLists.class) + @RequestBody( + description = "Post Request", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class + ) + ) + ) + @APIResponses( + @APIResponse( + description = "Response Entity", + responseCode = "200", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) + ) + ) + ) public SearchResponse find(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); @POST @Path("/findForPublic") @Tag(name = "Public Web API Database Searching Endpoints") @JsonView(View.ForPublic.class) + @RequestBody( + description = "Post Request", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class + ) + ) + ) + @APIResponses( + @APIResponse( + description = "Response Entity", + responseCode = "200", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) + ) + ) + ) public SearchResponse findForPublic(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); @POST @Path("/search") @Tag(name = "Elastic Search Browsing Endpoints") @JsonView({ View.FieldsAndLists.class }) + @RequestBody( + description = "Post Request", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class + ) + ) + ) + @APIResponses( + @APIResponse( + description = "Response Entity", + responseCode = "200", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) + ) + ) + ) public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); @GET diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java index 3b50f4e02..6b89508fd 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java @@ -11,6 +11,7 @@ import org.eclipse.microprofile.openapi.annotations.media.Content; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody; +import org.eclipse.microprofile.openapi.annotations.parameters.RequestBodySchema; import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; import org.eclipse.microprofile.openapi.annotations.responses.APIResponses; import org.eclipse.microprofile.openapi.annotations.tags.Tag; @@ -37,44 +38,148 @@ public interface CurieObjectCrudInterface { @POST @Path("/") @JsonView(View.FieldsOnly.class) + @RequestBody( + description = "Post Request", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class + ) + ) + ) + @APIResponses( + @APIResponse( + description = "Response Entity", + responseCode = "200", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) + ) + ) + ) public ObjectResponse create(E entity); @POST @Path("/multiple") @JsonView(View.FieldsOnly.class) + @RequestBody( + description = "Post Request", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class + ) + ) + ) + @APIResponses( + @APIResponse( + description = "Response Entity", + responseCode = "200", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) + ) + ) + ) public ObjectListResponse create(List entities); @GET @Path("/{curie}") @JsonView(View.FieldsOnly.class) @APIResponses( - @APIResponse(description = "Get the Entity by CURIE", + @APIResponse( + description = "Get the Entity by Curie", responseCode = "200", - content = @Content(mediaType = "application/json", - schema = @Schema(implementation = Null.class))) + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) ) + ) + ) public ObjectResponse get(@PathParam("curie") String curie); @PUT @Path("/") @JsonView(View.FieldsOnly.class) + @RequestBody( + description = "Put Request", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class + ) + ) + ) + @APIResponses( + @APIResponse( + description = "Response Entity", + responseCode = "200", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) + ) + ) + ) public ObjectResponse update(E entity); @DELETE @Path("/{curie}") @JsonView(View.FieldsOnly.class) + @APIResponses( + @APIResponse( + description = "Delete the Entity by Curie", + responseCode = "200", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) + ) + ) + ) public ObjectResponse delete(@PathParam("curie") String curie); @POST @Path("/find") @Tag(name = "Relational Database Browsing Endpoints") @JsonView(View.FieldsAndLists.class) + @RequestBody( + description = "Post Request", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class + ) + ) + ) + @APIResponses( + @APIResponse( + description = "Response Entity", + responseCode = "200", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) + ) + ) + ) public SearchResponse find(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); @POST @Path("/search") @Tag(name = "Elastic Search Browsing Endpoints") @JsonView({ View.FieldsAndLists.class }) + @RequestBody( + description = "Post Request", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class + ) + ) + ) + @APIResponses( + @APIResponse( + description = "Response Entity", + responseCode = "200", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) + ) + ) + ) public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); @GET diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java index 70472c198..e5a025b97 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java @@ -28,17 +28,31 @@ public interface SubmittedObjectCrudInterface extends @Path("/{identifierString}") @JsonView(View.FieldsOnly.class) @APIResponses( - @APIResponse(description = "Get the Entity by Identifier String", + @APIResponse( + description = "Get the Entity by Identifier String", responseCode = "200", - content = @Content(mediaType = "application/json", - schema = @Schema(implementation = Null.class))) + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) ) + ) + ) public ObjectResponse get(@PathParam("identifierString") String identifierString); @Override @DELETE @Path("/{identifierString}") @JsonView(View.FieldsOnly.class) + @APIResponses( + @APIResponse( + description = "Delete the Entity by Identifier String", + responseCode = "200", + content = @Content( + mediaType = "application/json", + schema = @Schema(implementation = Null.class) + ) + ) + ) public ObjectResponse delete(@PathParam("identifierString") String identifierString); } From be8dc140ca681f5885f01f7e2b3ee98ca101c0d6 Mon Sep 17 00:00:00 2001 From: Andres Becerra Date: Thu, 29 Feb 2024 17:08:06 +0000 Subject: [PATCH 124/159] SCRUM-3738: force fetching the evidence list --- .../AlleleGeneAssociationValidator.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java index 1cc810ea0..ec592a901 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/associations/alleleAssociations/AlleleGeneAssociationValidator.java @@ -115,6 +115,14 @@ private Gene validateObject(AlleleGeneAssociation uiEntity, AlleleGeneAssociatio addMessageResponse(field, ValidationConstants.INVALID_MESSAGE); return null; } + else { + // fix for SCRUM-3738 + if (objectEntity.getGeneSymbol() != null){ + if(objectEntity.getGeneSymbol().getEvidence() != null) { + objectEntity.getGeneSymbol().getEvidence().size(); + } + } + } if (objectEntity.getObsolete() && (dbEntity.getAlleleGeneAssociationObject() == null || !objectEntity.getId().equals(dbEntity.getAlleleGeneAssociationObject().getId()))) { addMessageResponse(field, ValidationConstants.OBSOLETE_MESSAGE); From 18e3e86179fb1c807d07fa5493fc7d9cb61db7ba Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Thu, 29 Feb 2024 15:14:20 -0600 Subject: [PATCH 125/159] SCRUM-3740 Removed the response codes, changed the Request body schema to String class --- .../interfaces/base/BaseIdCrudInterface.java | 29 +++++-------------- .../base/CurieObjectCrudInterface.java | 27 +++++------------ .../base/SubmittedObjectCrudInterface.java | 2 -- 3 files changed, 14 insertions(+), 44 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java index dc5aed52d..03d4a08f5 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/BaseIdCrudInterface.java @@ -8,17 +8,16 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.view.View; +import org.apache.commons.lang3.ObjectUtils.Null; import org.eclipse.microprofile.openapi.annotations.media.Content; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody; -import org.eclipse.microprofile.openapi.annotations.parameters.RequestBodySchema; import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; import org.eclipse.microprofile.openapi.annotations.responses.APIResponses; import org.eclipse.microprofile.openapi.annotations.tags.Tag; import com.fasterxml.jackson.annotation.JsonView; -import jakarta.validation.constraints.Null; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; import jakarta.ws.rs.DefaultValue; @@ -42,14 +41,12 @@ public interface BaseIdCrudInterface { description = "Post Request", content = @Content( mediaType = "application/json", - schema = @Schema(implementation = Null.class - ) + schema = @Schema(implementation = String.class) ) ) @APIResponses( @APIResponse( description = "Response Entity", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) @@ -65,14 +62,12 @@ public interface BaseIdCrudInterface { description = "Post Request", content = @Content( mediaType = "application/json", - schema = @Schema(implementation = Null.class - ) + schema = @Schema(implementation = String.class) ) ) @APIResponses( @APIResponse( description = "Response Entity", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) @@ -87,7 +82,6 @@ public interface BaseIdCrudInterface { @APIResponses( @APIResponse( description = "Get Entity by Id", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) @@ -103,14 +97,12 @@ public interface BaseIdCrudInterface { description = "Put Request", content = @Content( mediaType = "application/json", - schema = @Schema(implementation = Null.class - ) + schema = @Schema(implementation = String.class) ) ) @APIResponses( @APIResponse( description = "Response Entity", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) @@ -125,7 +117,6 @@ public interface BaseIdCrudInterface { @APIResponses( @APIResponse( description = "Delete Entity by Id", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) @@ -142,14 +133,12 @@ public interface BaseIdCrudInterface { description = "Post Request", content = @Content( mediaType = "application/json", - schema = @Schema(implementation = Null.class - ) + schema = @Schema(implementation = String.class) ) ) @APIResponses( @APIResponse( description = "Response Entity", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) @@ -166,14 +155,12 @@ public interface BaseIdCrudInterface { description = "Post Request", content = @Content( mediaType = "application/json", - schema = @Schema(implementation = Null.class - ) + schema = @Schema(implementation = String.class) ) ) @APIResponses( @APIResponse( description = "Response Entity", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) @@ -190,14 +177,12 @@ public interface BaseIdCrudInterface { description = "Post Request", content = @Content( mediaType = "application/json", - schema = @Schema(implementation = Null.class - ) + schema = @Schema(implementation = String.class) ) ) @APIResponses( @APIResponse( description = "Response Entity", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java index 6b89508fd..bf45a9ee3 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/CurieObjectCrudInterface.java @@ -8,17 +8,16 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.view.View; +import org.apache.commons.lang3.ObjectUtils.Null; import org.eclipse.microprofile.openapi.annotations.media.Content; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody; -import org.eclipse.microprofile.openapi.annotations.parameters.RequestBodySchema; import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; import org.eclipse.microprofile.openapi.annotations.responses.APIResponses; import org.eclipse.microprofile.openapi.annotations.tags.Tag; import com.fasterxml.jackson.annotation.JsonView; -import jakarta.validation.constraints.Null; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; import jakarta.ws.rs.DefaultValue; @@ -42,14 +41,12 @@ public interface CurieObjectCrudInterface { description = "Post Request", content = @Content( mediaType = "application/json", - schema = @Schema(implementation = Null.class - ) + schema = @Schema(implementation = String.class) ) ) @APIResponses( @APIResponse( description = "Response Entity", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) @@ -65,14 +62,12 @@ public interface CurieObjectCrudInterface { description = "Post Request", content = @Content( mediaType = "application/json", - schema = @Schema(implementation = Null.class - ) + schema = @Schema(implementation = String.class) ) ) @APIResponses( @APIResponse( description = "Response Entity", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) @@ -87,7 +82,6 @@ public interface CurieObjectCrudInterface { @APIResponses( @APIResponse( description = "Get the Entity by Curie", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) @@ -103,14 +97,12 @@ public interface CurieObjectCrudInterface { description = "Put Request", content = @Content( mediaType = "application/json", - schema = @Schema(implementation = Null.class - ) + schema = @Schema(implementation = String.class) ) ) @APIResponses( @APIResponse( description = "Response Entity", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) @@ -125,7 +117,6 @@ public interface CurieObjectCrudInterface { @APIResponses( @APIResponse( description = "Delete the Entity by Curie", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) @@ -142,17 +133,15 @@ public interface CurieObjectCrudInterface { description = "Post Request", content = @Content( mediaType = "application/json", - schema = @Schema(implementation = Null.class - ) + schema = @Schema(implementation = String.class) ) ) @APIResponses( @APIResponse( description = "Response Entity", - responseCode = "200", content = @Content( mediaType = "application/json", - schema = @Schema(implementation = Null.class) + schema = @Schema(implementation = Null.class) ) ) ) @@ -166,14 +155,12 @@ public interface CurieObjectCrudInterface { description = "Post Request", content = @Content( mediaType = "application/json", - schema = @Schema(implementation = Null.class - ) + schema = @Schema(implementation = String.class) ) ) @APIResponses( @APIResponse( description = "Response Entity", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java index e5a025b97..ce25cb683 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/base/SubmittedObjectCrudInterface.java @@ -30,7 +30,6 @@ public interface SubmittedObjectCrudInterface extends @APIResponses( @APIResponse( description = "Get the Entity by Identifier String", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) @@ -46,7 +45,6 @@ public interface SubmittedObjectCrudInterface extends @APIResponses( @APIResponse( description = "Delete the Entity by Identifier String", - responseCode = "200", content = @Content( mediaType = "application/json", schema = @Schema(implementation = Null.class) From 9983ea9158f67717abe3b4b819047f70f253a497 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 29 Feb 2024 21:17:15 +0000 Subject: [PATCH 126/159] Initial work on loading phenotype data from FMS --- .../cliapp/src/service/DataLoadService.js | 2 +- .../constants/LinkMLSchemaConstants.java | 2 +- .../AGMDiseaseAnnotationCrudController.java | 1 - ...AlleleDiseaseAnnotationCrudController.java | 1 - .../GeneDiseaseAnnotationCrudController.java | 2 - .../crud/MoleculeCrudController.java | 1 - .../PhenotypeAnnotationCrudController.java | 39 ++++ .../dao/AGMPhenotypeAnnotationDAO.java | 15 ++ .../dao/DiseaseAnnotationDAO.java | 4 - .../dao/PhenotypeAnnotationDAO.java | 14 ++ .../enums/BackendBulkDataProvider.java | 32 ++- .../enums/FmsConditionRelation.java | 24 ++ .../crud/DiseaseAnnotationCrudInterface.java | 14 +- .../PhenotypeAnnotationCrudInterface.java | 37 +++ .../AgmDiseaseAnnotationExecutor.java | 2 +- .../AlleleDiseaseAnnotationExecutor.java | 2 +- .../GeneDiseaseAnnotationExecutor.java | 2 +- .../jobs/executors/LoadFileExecutor.java | 8 +- .../PhenotypeAnnotationExecutor.java | 101 ++++++-- .../entities/AGMPhenotypeAnnotation.java | 150 ++++++++++++ .../entities/AllelePhenotypeAnnotation.java | 131 +++++++++++ .../model/entities/DiseaseAnnotation.java | 2 +- .../entities/GenePhenotypeAnnotation.java | 98 ++++++++ .../model/entities/PhenotypeAnnotation.java | 86 +++++++ .../dto/fms/ExperimentalConditionFmsDTO.java | 2 + .../AGMPhenotypeAnnotationService.java | 102 ++++++++ .../services/DiseaseAnnotationService.java | 5 +- .../services/PhenotypeAnnotationService.java | 217 ++++++++++++++++++ .../base/BaseAnnotationCrudService.java | 12 + ...er.java => AnnotationRetrievalHelper.java} | 6 +- ...per.java => AnnotationUniqueIdHelper.java} | 79 ++++++- ...DiseaseAnnotationUniqueIdUpdateHelper.java | 2 +- .../ExperimentalConditionSummary.java | 1 + .../ConditionRelationValidator.java | 4 +- .../DiseaseAnnotationValidator.java | 4 +- .../ExperimentalConditionValidator.java | 4 +- .../dto/AGMDiseaseAnnotationDTOValidator.java | 8 +- .../AlleleDiseaseAnnotationDTOValidator.java | 8 +- .../dto/ConditionRelationDTOValidator.java | 4 +- .../ExperimentalConditionDTOValidator.java | 7 +- .../GeneDiseaseAnnotationDTOValidator.java | 8 +- .../dto/base/BaseFmsDTOValidator.java | 37 +++ ...AGMPhenotypeAnnotationFmsDTOValidator.java | 124 ++++++++++ .../fms/ConditionRelationFmsDTOValidator.java | 90 ++++++++ .../ExperimentalConditionFmsDTOValidator.java | 132 +++++++++++ .../dto/fms/OrthologyFmsDTOValidator.java | 4 +- .../PhenotypeAnnotationFmsDTOValidator.java | 120 ++++++++++ .../curation_api/view/View.java | 9 + .../v0.31.0.3__agm_phenotype_annotation.sql | 7 + 49 files changed, 1680 insertions(+), 86 deletions(-) create mode 100644 src/main/java/org/alliancegenome/curation_api/controllers/crud/PhenotypeAnnotationCrudController.java create mode 100644 src/main/java/org/alliancegenome/curation_api/dao/AGMPhenotypeAnnotationDAO.java create mode 100644 src/main/java/org/alliancegenome/curation_api/dao/PhenotypeAnnotationDAO.java create mode 100644 src/main/java/org/alliancegenome/curation_api/enums/FmsConditionRelation.java create mode 100644 src/main/java/org/alliancegenome/curation_api/interfaces/crud/PhenotypeAnnotationCrudInterface.java create mode 100644 src/main/java/org/alliancegenome/curation_api/model/entities/AGMPhenotypeAnnotation.java create mode 100644 src/main/java/org/alliancegenome/curation_api/model/entities/AllelePhenotypeAnnotation.java create mode 100644 src/main/java/org/alliancegenome/curation_api/model/entities/GenePhenotypeAnnotation.java create mode 100644 src/main/java/org/alliancegenome/curation_api/model/entities/PhenotypeAnnotation.java create mode 100644 src/main/java/org/alliancegenome/curation_api/services/AGMPhenotypeAnnotationService.java create mode 100644 src/main/java/org/alliancegenome/curation_api/services/PhenotypeAnnotationService.java create mode 100644 src/main/java/org/alliancegenome/curation_api/services/base/BaseAnnotationCrudService.java rename src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/{DiseaseAnnotationRetrievalHelper.java => AnnotationRetrievalHelper.java} (66%) rename src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/{DiseaseAnnotationUniqueIdHelper.java => AnnotationUniqueIdHelper.java} (64%) create mode 100644 src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseFmsDTOValidator.java create mode 100644 src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/AGMPhenotypeAnnotationFmsDTOValidator.java create mode 100644 src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java create mode 100644 src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ExperimentalConditionFmsDTOValidator.java create mode 100644 src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/PhenotypeAnnotationFmsDTOValidator.java create mode 100644 src/main/resources/db/migration/v0.31.0.3__agm_phenotype_annotation.sql diff --git a/src/main/cliapp/src/service/DataLoadService.js b/src/main/cliapp/src/service/DataLoadService.js index 698274b66..cff3bb8f4 100644 --- a/src/main/cliapp/src/service/DataLoadService.js +++ b/src/main/cliapp/src/service/DataLoadService.js @@ -81,7 +81,7 @@ export class DataLoadService extends BaseAuthService { getBackendBulkLoadTypes(loadType) { const bulkLoadTypes = { - BulkFMSLoad: ["MOLECULE", "ORTHOLOGY"], + BulkFMSLoad: ["MOLECULE", "ORTHOLOGY", "PHENOTYPE_ANNOTATION"], BulkURLLoad: ["ONTOLOGY", "GENE", "ALLELE", "AGM", "DISEASE_ANNOTATION", "RESOURCE_DESCRIPTOR"], BulkManualLoad: ["FULL_INGEST", "DISEASE_ANNOTATION", "GENE_DISEASE_ANNOTATION", "ALLELE_DISEASE_ANNOTATION", "AGM_DISEASE_ANNOTATION", "GENE", "ALLELE", "AGM", "VARIANT", "CONSTRUCT", "ALLELE_ASSOCIATION", "CONSTRUCT_ASSOCIATION"] }; diff --git a/src/main/java/org/alliancegenome/curation_api/constants/LinkMLSchemaConstants.java b/src/main/java/org/alliancegenome/curation_api/constants/LinkMLSchemaConstants.java index 60a458b93..857f5c3eb 100644 --- a/src/main/java/org/alliancegenome/curation_api/constants/LinkMLSchemaConstants.java +++ b/src/main/java/org/alliancegenome/curation_api/constants/LinkMLSchemaConstants.java @@ -2,7 +2,7 @@ public final class LinkMLSchemaConstants { - public static final String LATEST_RELEASE = "2.2.0"; + public static final String LATEST_RELEASE = "2.2.1"; public static final String MIN_ONTOLOGY_RELEASE = "1.2.4"; public static final String MAX_ONTOLOGY_RELEASE = LATEST_RELEASE; diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/AGMDiseaseAnnotationCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/AGMDiseaseAnnotationCrudController.java index 51e1ca6a8..5cb3f6917 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/AGMDiseaseAnnotationCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/AGMDiseaseAnnotationCrudController.java @@ -30,7 +30,6 @@ protected void init() { setService(agmDiseaseAnnotationService); } - @Override public APIResponse updateAgmDiseaseAnnotations(String dataProvider, List annotations) { return agmDiseaseAnnotationExecutor.runLoad(dataProvider, annotations); } diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/AlleleDiseaseAnnotationCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/AlleleDiseaseAnnotationCrudController.java index 4194f68a4..7fa38a5a9 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/AlleleDiseaseAnnotationCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/AlleleDiseaseAnnotationCrudController.java @@ -31,7 +31,6 @@ protected void init() { setService(alleleDiseaseAnnotationService); } - @Override public APIResponse updateAlleleDiseaseAnnotations(String dataProvider, List annotations) { return alleleDiseaseAnnotationExecutor.runLoad(dataProvider, annotations); } diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneDiseaseAnnotationCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneDiseaseAnnotationCrudController.java index 12008feff..6ba171127 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneDiseaseAnnotationCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/GeneDiseaseAnnotationCrudController.java @@ -31,12 +31,10 @@ protected void init() { setService(geneDiseaseAnnotationService); } - @Override public APIResponse updateGeneDiseaseAnnotations(String dataProvider, List annotations) { return geneDiseaseAnnotationExecutor.runLoad(dataProvider, annotations); } - @Override public ObjectResponse get(String identifierString) { return geneDiseaseAnnotationService.get(identifierString); } diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/MoleculeCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/MoleculeCrudController.java index f7ce3c29b..7091275d1 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/MoleculeCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/MoleculeCrudController.java @@ -30,7 +30,6 @@ protected void init() { setService(moleculeService); } - @Override public APIResponse updateMolecules(MoleculeIngestFmsDTO moleculeData) { BulkLoadFileHistory history = new BulkLoadFileHistory(moleculeData.getData().size()); moleculeExecutor.runLoad(history, moleculeData); diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/PhenotypeAnnotationCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/PhenotypeAnnotationCrudController.java new file mode 100644 index 000000000..ac8a9280d --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/PhenotypeAnnotationCrudController.java @@ -0,0 +1,39 @@ +package org.alliancegenome.curation_api.controllers.crud; + +import java.util.List; + +import org.alliancegenome.curation_api.controllers.base.BaseEntityCrudController; +import org.alliancegenome.curation_api.dao.PhenotypeAnnotationDAO; +import org.alliancegenome.curation_api.jobs.executors.PhenotypeAnnotationExecutor; +import org.alliancegenome.curation_api.model.entities.PhenotypeAnnotation; +import org.alliancegenome.curation_api.model.ingest.dto.fms.PhenotypeFmsDTO; +import org.alliancegenome.curation_api.response.APIResponse; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.services.PhenotypeAnnotationService; + +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; + +@RequestScoped +public class PhenotypeAnnotationCrudController extends BaseEntityCrudController implements PhenotypeAnnotationCrudInterface { + + @Inject + PhenotypeAnnotationService phenotypeAnnotationService; + @Inject + PhenotypeAnnotationExecutor phenotypeAnnotationExecutor; + + @Override + @PostConstruct + protected void init() { + setService(phenotypeAnnotationService); + } + + public ObjectResponse get(String identifierString) { + return phenotypeAnnotationService.get(identifierString); + } + + public APIResponse updatePhenotypeAnnotations(String dataProvider, List annotations) { + return phenotypeAnnotationExecutor.runLoad(dataProvider, annotations); + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/dao/AGMPhenotypeAnnotationDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/AGMPhenotypeAnnotationDAO.java new file mode 100644 index 000000000..194df3ee9 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/dao/AGMPhenotypeAnnotationDAO.java @@ -0,0 +1,15 @@ +package org.alliancegenome.curation_api.dao; + +import org.alliancegenome.curation_api.dao.base.BaseSQLDAO; +import org.alliancegenome.curation_api.model.entities.AGMPhenotypeAnnotation; + +import jakarta.enterprise.context.ApplicationScoped; + +@ApplicationScoped +public class AGMPhenotypeAnnotationDAO extends BaseSQLDAO { + + protected AGMPhenotypeAnnotationDAO() { + super(AGMPhenotypeAnnotation.class); + } + +} diff --git a/src/main/java/org/alliancegenome/curation_api/dao/DiseaseAnnotationDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/DiseaseAnnotationDAO.java index 181d8959b..fa5ac1a0f 100644 --- a/src/main/java/org/alliancegenome/curation_api/dao/DiseaseAnnotationDAO.java +++ b/src/main/java/org/alliancegenome/curation_api/dao/DiseaseAnnotationDAO.java @@ -4,14 +4,10 @@ import org.alliancegenome.curation_api.model.entities.DiseaseAnnotation; import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; @ApplicationScoped public class DiseaseAnnotationDAO extends BaseSQLDAO { - @Inject - NoteDAO noteDAO; - protected DiseaseAnnotationDAO() { super(DiseaseAnnotation.class); } diff --git a/src/main/java/org/alliancegenome/curation_api/dao/PhenotypeAnnotationDAO.java b/src/main/java/org/alliancegenome/curation_api/dao/PhenotypeAnnotationDAO.java new file mode 100644 index 000000000..9593f383c --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/dao/PhenotypeAnnotationDAO.java @@ -0,0 +1,14 @@ +package org.alliancegenome.curation_api.dao; + +import org.alliancegenome.curation_api.dao.base.BaseSQLDAO; +import org.alliancegenome.curation_api.model.entities.PhenotypeAnnotation; + +import jakarta.enterprise.context.ApplicationScoped; + +@ApplicationScoped +public class PhenotypeAnnotationDAO extends BaseSQLDAO { + + protected PhenotypeAnnotationDAO() { + super(PhenotypeAnnotation.class); + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/enums/BackendBulkDataProvider.java b/src/main/java/org/alliancegenome/curation_api/enums/BackendBulkDataProvider.java index c019beaff..3313f9e23 100644 --- a/src/main/java/org/alliancegenome/curation_api/enums/BackendBulkDataProvider.java +++ b/src/main/java/org/alliancegenome/curation_api/enums/BackendBulkDataProvider.java @@ -2,25 +2,39 @@ public enum BackendBulkDataProvider { - RGD("NCBITaxon:10116", "RGD:", 10116, "RGD"), - MGI("NCBITaxon:10090", "MGI:", 10090, "MGI"), - SGD("NCBITaxon:4932", "SGD:", 4932, "SGD"), - HUMAN("NCBITaxon:9606", "HGNC:", 9606, "RGD"), - ZFIN("NCBITaxon:7955", "ZFIN:", 7955, "ZFIN"), - FB("NCBITaxon:7227", "FB:", 7227, "FB"), - WB("NCBITaxon:6239", "WB:", 6239, "WB"), - XB("NCBITaxon:8355", "XB:", 8355, "XB"); + RGD("NCBITaxon:10116", "RGD:", 10116, "RGD", "RGD", false, false, false, false), + MGI("NCBITaxon:10090", "MGI:", 10090, "MGI", "MGI", true, false, true, false), + SGD("NCBITaxon:4932", "SGD:", 4932, "SGD", "SGD", true, false, false, false ), //TODO: needs checking + HUMAN("NCBITaxon:9606", "HGNC:", 9606, "RGD", "RGD", false, false, false, false), + ZFIN("NCBITaxon:7955", "ZFIN:", 7955, "ZFIN", "ZFIN", true, false, true, false), + FB("NCBITaxon:7227", "FB:", 7227, "FB", "FB", true, false, false, false), + WB("NCBITaxon:6239", "WB:", 6239, "WB", "WB", true, false, false, true), + XB("NCBITaxon:8355", "XB:", 8355, "XB", "Xenbase", true, false, false, false), //TODO: needs checking + XBXL("NCBITaxon:8355", "XB:", 8355, "XB", "Xenbase", true, false, false, false), //TODO: needs checking + XBXT("NCBITaxon:8364", "XB:", 8364, "XB", "Xenbase", true, false, false, false); //TODO: needs checking public String canonicalTaxonCurie; public String curiePrefix; public Integer idPart; public String sourceOrganization; //The Source Organisation Abbreviation + public String resourceDescriptor; //The organisation's name in the ResourceDescriptor file + public Boolean hasInferredGenePhenotypeAnnotations; + public Boolean hasAssertedGenePhenotypeAnnotations; + public Boolean hasInferredAllelePhenotypeAnnotations; + public Boolean hasAssertedAllelePhenotypeAnnotations; - private BackendBulkDataProvider(String canonicalTaxonCurie, String curiePrefix, Integer idPart, String sourceOrganization) { + private BackendBulkDataProvider(String canonicalTaxonCurie, String curiePrefix, Integer idPart, String sourceOrganization, String resourceDescriptor, + Boolean hasInferredGenePhenotypeAnnotations, Boolean hasAssertedGenePhenotypeAnnotations, Boolean hasInferredAllelePhenotypeAnnotations, + Boolean hasAssertedAllelePhenotypeAnnotations) { this.canonicalTaxonCurie = canonicalTaxonCurie; this.curiePrefix = curiePrefix; this.idPart = idPart; this.sourceOrganization = sourceOrganization; + this.resourceDescriptor = resourceDescriptor; + this.hasInferredGenePhenotypeAnnotations = hasInferredGenePhenotypeAnnotations; + this.hasAssertedGenePhenotypeAnnotations = hasAssertedGenePhenotypeAnnotations; + this.hasInferredAllelePhenotypeAnnotations = hasInferredAllelePhenotypeAnnotations; + this.hasAssertedAllelePhenotypeAnnotations = hasAssertedAllelePhenotypeAnnotations; } diff --git a/src/main/java/org/alliancegenome/curation_api/enums/FmsConditionRelation.java b/src/main/java/org/alliancegenome/curation_api/enums/FmsConditionRelation.java new file mode 100644 index 000000000..abc4515a2 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/enums/FmsConditionRelation.java @@ -0,0 +1,24 @@ +package org.alliancegenome.curation_api.enums; + +public enum FmsConditionRelation { + ameliorates("ameliorated_by"), + exacerbates("exacerbated_by"), + has_condition("has_condition"), + induces("induced_by"); + + public String agrRelation; + + private FmsConditionRelation(String agrRelation) { + this.agrRelation = agrRelation; + } + + public static FmsConditionRelation findByName(String name) { + + for (FmsConditionRelation relation : values()) { + if (relation.name().equals(name)) + return relation; + } + + return null; + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/DiseaseAnnotationCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/DiseaseAnnotationCrudInterface.java index b0f17dbe7..b357e5ad7 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/DiseaseAnnotationCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/DiseaseAnnotationCrudInterface.java @@ -1,9 +1,9 @@ package org.alliancegenome.curation_api.interfaces.crud; -import jakarta.ws.rs.*; +import java.util.HashMap; + import org.alliancegenome.curation_api.interfaces.base.BaseIdCrudInterface; import org.alliancegenome.curation_api.model.entities.DiseaseAnnotation; -import org.alliancegenome.curation_api.model.entities.VocabularyTerm; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.view.View; @@ -12,10 +12,16 @@ import com.fasterxml.jackson.annotation.JsonView; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DefaultValue; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; import jakarta.ws.rs.core.MediaType; -import java.util.HashMap; - @Path("/disease-annotation") @Tag(name = "CRUD - Disease Annotations") @Produces(MediaType.APPLICATION_JSON) diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/PhenotypeAnnotationCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/PhenotypeAnnotationCrudInterface.java new file mode 100644 index 000000000..1d3eccd27 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/PhenotypeAnnotationCrudInterface.java @@ -0,0 +1,37 @@ +package org.alliancegenome.curation_api.interfaces.crud; + +import jakarta.ws.rs.*; +import org.alliancegenome.curation_api.interfaces.base.BaseIdCrudInterface; +import org.alliancegenome.curation_api.model.entities.DiseaseAnnotation; +import org.alliancegenome.curation_api.model.entities.VocabularyTerm; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.view.View; +import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody; +import org.eclipse.microprofile.openapi.annotations.tags.Tag; + +import com.fasterxml.jackson.annotation.JsonView; + +import jakarta.ws.rs.core.MediaType; + +import java.util.HashMap; + +@Path("/disease-annotation") +@Tag(name = "CRUD - Disease Annotations") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public interface PhenotypeAnnotationCrudInterface extends BaseIdCrudInterface { + + @GET + @Path("/findBy/{modEntityId|modInternalId|uniqueId}") + @JsonView(View.FieldsAndLists.class) + public ObjectResponse get(@PathParam("identifier") String identifier); + + @Override + @POST + @Path("/search") + @JsonView(View.DiseaseAnnotation.class) + @Tag(name = "Elastic Search Disease Annotations") + public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); + +} diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java index cd847e7eb..b31dd49c2 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AgmDiseaseAnnotationExecutor.java @@ -61,7 +61,7 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { runLoad(history, dataProvider, annotations, annotationIdsLoaded); - if(cleanUp) runCleanup(diseaseAnnotationService, history, dataProvider.name(), annotationIdsBefore, annotationIdsLoaded, bulkLoadFile.getMd5Sum()); + if(cleanUp) runCleanup(diseaseAnnotationService, history, dataProvider.name(), annotationIdsBefore, annotationIdsLoaded, "AGM disease annotation", bulkLoadFile.getMd5Sum()); history.finishLoad(); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java index f33f21d45..b4399cd3f 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/AlleleDiseaseAnnotationExecutor.java @@ -61,7 +61,7 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { runLoad(history, dataProvider, annotations, annotationIdsLoaded); - if(cleanUp) runCleanup(diseaseAnnotationService, history, dataProvider.name(), annotationIdsBefore, annotationIdsLoaded, bulkLoadFile.getMd5Sum()); + if(cleanUp) runCleanup(diseaseAnnotationService, history, dataProvider.name(), annotationIdsBefore, annotationIdsLoaded, "allele disease annotation", bulkLoadFile.getMd5Sum()); history.finishLoad(); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java index c868410de..715b015a6 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneDiseaseAnnotationExecutor.java @@ -61,7 +61,7 @@ public void runLoad(BulkLoadFile bulkLoadFile, Boolean cleanUp) { runLoad(history, dataProvider, annotations, annotationIdsLoaded); - if(cleanUp) runCleanup(diseaseAnnotationService, history, dataProvider.name(), annotationIdsBefore, annotationIdsLoaded, bulkLoadFile.getMd5Sum()); + if(cleanUp) runCleanup(diseaseAnnotationService, history, dataProvider.name(), annotationIdsBefore, annotationIdsLoaded, "gene disease annotation", bulkLoadFile.getMd5Sum()); history.finishLoad(); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java index bbfae7847..da0f9c3d3 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java @@ -22,7 +22,7 @@ import org.alliancegenome.curation_api.model.entities.bulkloads.BulkManualLoad; import org.alliancegenome.curation_api.model.ingest.dto.IngestDTO; import org.alliancegenome.curation_api.services.APIVersionInfoService; -import org.alliancegenome.curation_api.services.DiseaseAnnotationService; +import org.alliancegenome.curation_api.services.base.BaseAnnotationCrudService; import org.alliancegenome.curation_api.services.base.BaseAssociationDTOCrudService; import org.alliancegenome.curation_api.services.base.SubmittedObjectCrudService; import org.alliancegenome.curation_api.services.processing.LoadProcessDisplayService; @@ -164,7 +164,7 @@ protected boolean validSchemaVersion(String submittedSchemaVersion, Class dto // The following methods are for bulk validation - protected void runCleanup(DiseaseAnnotationService service, BulkLoadFileHistory history, String dataProviderName, List annotationIdsBefore, List annotationIdsAfter, String md5sum) { + protected > void runCleanup(S service, BulkLoadFileHistory history, String dataProviderName, List annotationIdsBefore, List annotationIdsAfter, String loadTypeString, String md5sum) { Log.debug("runLoad: After: " + dataProviderName + " " + annotationIdsAfter.size()); List distinctAfter = annotationIdsAfter.stream().distinct().collect(Collectors.toList()); @@ -176,10 +176,10 @@ protected void runCleanup(DiseaseAnnotationService service, BulkLoadFileHistory history.setTotalDeleteRecords((long)idsToRemove.size()); ProcessDisplayHelper ph = new ProcessDisplayHelper(1000); - ph.startProcess("Deletion/deprecation of disease annotations linked to unloaded " + dataProviderName, idsToRemove.size()); + ph.startProcess("Deletion/deprecation of annotations linked to unloaded " + dataProviderName, idsToRemove.size()); for (Long id : idsToRemove) { try { - String loadDescription = dataProviderName + " disease annotation bulk load (" + md5sum + ")"; + String loadDescription = dataProviderName + " " + loadTypeString + " bulk load (" + md5sum + ")"; service.deprecateOrDeleteAnnotationAndNotes(id, false, loadDescription, true); history.incrementDeleted(); } catch (Exception e) { diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java index 8bc570af4..362d53622 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java @@ -1,17 +1,25 @@ package org.alliancegenome.curation_api.jobs.executors; import java.io.FileInputStream; +import java.util.ArrayList; +import java.util.List; import java.util.zip.GZIPInputStream; +import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.exceptions.ObjectUpdateException; +import org.alliancegenome.curation_api.exceptions.ObjectUpdateException.ObjectUpdateExceptionData; import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; import org.alliancegenome.curation_api.model.entities.Molecule; +import org.alliancegenome.curation_api.model.entities.bulkloads.BulkFMSLoad; import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFile; import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFileHistory; -import org.alliancegenome.curation_api.model.ingest.dto.fms.MoleculeFmsDTO; -import org.alliancegenome.curation_api.model.ingest.dto.fms.MoleculeIngestFmsDTO; -import org.alliancegenome.curation_api.services.MoleculeService; +import org.alliancegenome.curation_api.model.ingest.dto.fms.PhenotypeFmsDTO; +import org.alliancegenome.curation_api.model.ingest.dto.fms.PhenotypeIngestFmsDTO; +import org.alliancegenome.curation_api.response.APIResponse; +import org.alliancegenome.curation_api.response.LoadHistoryResponce; +import org.alliancegenome.curation_api.services.PhenotypeAnnotationService; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.ApplicationScoped; @@ -25,19 +33,29 @@ public class PhenotypeAnnotationExecutor extends LoadFileExecutor { public void runLoad(BulkLoadFile bulkLoadFile) { try { - MoleculeIngestFmsDTO moleculeData = mapper.readValue(new GZIPInputStream(new FileInputStream(bulkLoadFile.getLocalFilePath())), MoleculeIngestFmsDTO.class); - bulkLoadFile.setRecordCount(moleculeData.getData().size()); + + BulkFMSLoad fmsLoad = (BulkFMSLoad) bulkLoadFile.getBulkLoad(); + BackendBulkDataProvider dataProvider = BackendBulkDataProvider.valueOf(fmsLoad.getFmsDataType()); + + PhenotypeIngestFmsDTO phenotypeData = mapper.readValue(new GZIPInputStream(new FileInputStream(bulkLoadFile.getLocalFilePath())), PhenotypeIngestFmsDTO.class); + bulkLoadFile.setRecordCount(phenotypeData.getData().size()); if (bulkLoadFile.getLinkMLSchemaVersion() == null) { AGRCurationSchemaVersion version = Molecule.class.getAnnotation(AGRCurationSchemaVersion.class); bulkLoadFile.setLinkMLSchemaVersion(version.max()); } - if (moleculeData.getMetaData() != null && StringUtils.isNotBlank(moleculeData.getMetaData().getRelease())) - bulkLoadFile.setAllianceMemberReleaseVersion(moleculeData.getMetaData().getRelease()); + if (phenotypeData.getMetaData() != null && StringUtils.isNotBlank(phenotypeData.getMetaData().getRelease())) + bulkLoadFile.setAllianceMemberReleaseVersion(phenotypeData.getMetaData().getRelease()); bulkLoadFileDAO.merge(bulkLoadFile); - BulkLoadFileHistory history = new BulkLoadFileHistory(moleculeData.getData().size()); + BulkLoadFileHistory history = new BulkLoadFileHistory(phenotypeData.getData().size()); + + List annotationIdsLoaded = new ArrayList<>(); + List annotationIdsBefore = phenotypeAnnotationService.getAnnotationIdsByDataProvider(dataProvider); + + runLoad(history, phenotypeData.getData(), annotationIdsLoaded, dataProvider); - runLoad(history, moleculeData); + runCleanup(phenotypeAnnotationService, history, dataProvider.name(), annotationIdsBefore, annotationIdsLoaded, "phenotype annotation", bulkLoadFile.getMd5Sum()); + history.finishLoad(); @@ -47,25 +65,78 @@ public void runLoad(BulkLoadFile bulkLoadFile) { e.printStackTrace(); } } - + // Gets called from the API directly - public void runLoad(BulkLoadFileHistory history, MoleculeIngestFmsDTO moleculeData) { + public APIResponse runLoad(String dataProviderName, List annotations) { + List annotationIdsLoaded = new ArrayList<>(); + + BulkLoadFileHistory history = new BulkLoadFileHistory(annotations.size()); + BackendBulkDataProvider dataProvider = BackendBulkDataProvider.valueOf(dataProviderName); + runLoad(history, annotations, annotationIdsLoaded, dataProvider); + history.finishLoad(); + + return new LoadHistoryResponce(history); + } + + + private void runLoad(BulkLoadFileHistory history, List annotations, List idsAdded, BackendBulkDataProvider dataProvider) { ProcessDisplayHelper ph = new ProcessDisplayHelper(2000); ph.addDisplayHandler(loadProcessDisplayService); - ph.startProcess("Molecule DTO Update", moleculeData.getData().size()); + ph.startProcess("Phenotype annotation DTO Update for " + dataProvider.name(), annotations.size()); + + loadPrimaryAnnotations(history, annotations, idsAdded, dataProvider, ph); + loadSecondaryAnnotations(history, annotations, idsAdded, dataProvider, ph); + + ph.finishProcess(); - for (MoleculeFmsDTO molecule : moleculeData.getData()) { + } + + private void loadSecondaryAnnotations(BulkLoadFileHistory history, List annotations, List idsAdded, BackendBulkDataProvider dataProvider, ProcessDisplayHelper ph) { + for (PhenotypeFmsDTO dto : annotations) { + if (CollectionUtils.isEmpty(dto.getPrimaryGeneticEntityIds())) + continue; + try { - moleculeService.processUpdate(molecule); + phenotypeAnnotationService.addInferredOrAssertedEntities(dto, idsAdded, dataProvider); history.incrementCompleted(); } catch (ObjectUpdateException e) { history.incrementFailed(); addException(history, e.getData()); + } catch (Exception e) { + e.printStackTrace(); + history.incrementFailed(); + addException(history, new ObjectUpdateExceptionData(dto, e.getMessage(), e.getStackTrace())); } + ph.progressProcess(); } - ph.finishProcess(); + + } + + private void loadPrimaryAnnotations(BulkLoadFileHistory history, List annotations, List idsAdded, BackendBulkDataProvider dataProvider, ProcessDisplayHelper ph) { + for (PhenotypeFmsDTO dto : annotations) { + if (CollectionUtils.isNotEmpty(dto.getPrimaryGeneticEntityIds())) + continue; + + try { + Long primaryAnnotationId = phenotypeAnnotationService.upsertPrimaryAnnotation(dto, dataProvider); + if (primaryAnnotationId != null) { + history.incrementCompleted(); + if (idsAdded != null) + idsAdded.add(primaryAnnotationId); + } + } catch (ObjectUpdateException e) { + history.incrementFailed(); + addException(history, e.getData()); + } catch (Exception e) { + e.printStackTrace(); + history.incrementFailed(); + addException(history, new ObjectUpdateExceptionData(dto, e.getMessage(), e.getStackTrace())); + } + + ph.progressProcess(); + } } } diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMPhenotypeAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMPhenotypeAnnotation.java new file mode 100644 index 000000000..203a42dcd --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMPhenotypeAnnotation.java @@ -0,0 +1,150 @@ +package org.alliancegenome.curation_api.model.entities; + +import java.util.List; + +import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; +import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; +import org.alliancegenome.curation_api.view.View; +import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; +import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonView; + +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.Transient; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Indexed +@Entity +@Data +@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@Schema(name = "AGM_Phenotype_Annotation", description = "Annotation class representing a agm phenotype annotation") +@JsonTypeName("AGMPhenotypeAnnotation") +@OnDelete(action = OnDeleteAction.CASCADE) +@AGRCurationSchemaVersion(min = "2.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { PhenotypeAnnotation.class }) +@Table(indexes = { + @Index(name = "AGMPhenotypeAnnotation_inferredGene_index", columnList = "inferredGene_id"), + @Index(name = "AGMPhenotypeAnnotation_inferredAllele_index", columnList = "inferredAllele_id"), + @Index(name = "AGMPhenotypeAnnotation_assertedAllele_index", columnList = "assertedAllele_id"), + @Index(name = "AGMPhenotypeAnnotation_PhenotypeAnnotationSubject_index", columnList = "phenotypeAnnotationSubject_id") +}) +public class AGMPhenotypeAnnotation extends PhenotypeAnnotation { + + @IndexedEmbedded(includePaths = {"name", "name_keyword", "curie", "curie_keyword", "modEntityId", "modEntityId_keyword", "modInternalId", "modInternalId_keyword"}) + @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) + @ManyToOne + @Fetch(FetchMode.SELECT) + @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) + @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) + private AffectedGenomicModel phenotypeAnnotationSubject; + + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "geneSymbol.formatText", "geneSymbol.displayText", "geneSymbol.formatText_keyword", "geneSymbol.displayText_keyword", + "geneFullName.formatText", "geneFullName.displayText", "geneFullName.formatText_keyword", "geneFullName.displayText_keyword", + "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSystematicName.formatText_keyword", "geneSystematicName.displayText_keyword", + "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSynonyms.formatText_keyword", "geneSynonyms.displayText_keyword", + "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword", "name", "name_keyword", "symbol", "symbol_keyword" + }) + @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) + @ManyToOne + @Fetch(FetchMode.SELECT) + @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) + private Gene inferredGene; + + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "alleleSymbol.formatText", "alleleSymbol.displayText", "alleleSymbol.formatText_keyword", "alleleSymbol.displayText_keyword", + "alleleFullName.formatText", "alleleFullName.displayText", "alleleFullName.formatText_keyword", "alleleFullName.displayText_keyword", + "alleleSynonyms.formatText", "alleleSynonyms.displayText", "alleleSynonyms.formatText_keyword", "alleleSynonyms.displayText_keyword", + "alleleSecondaryIds.secondaryId", "alleleSecondaryIds.secondaryId_keyword" + }) + @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) + @ManyToOne + @Fetch(FetchMode.SELECT) + @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) + private Allele inferredAllele; + + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "geneSymbol.formatText", "geneSymbol.displayText", "geneSymbol.formatText_keyword", "geneSymbol.displayText_keyword", + "geneFullName.formatText", "geneFullName.displayText", "geneFullName.formatText_keyword", "geneFullName.displayText_keyword", + "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSystematicName.formatText_keyword", "geneSystematicName.displayText_keyword", + "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSynonyms.formatText_keyword", "geneSynonyms.displayText_keyword", + "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword" + }) + @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) + @ManyToMany + @Fetch(FetchMode.SELECT) + @JoinTable(indexes = @Index(name = "agmphenotypeannotation_gene_agmphenotypeannotation_index", columnList = "agmphenotypeannotation_id")) + @JsonView({ View.FieldsAndLists.class, View.PhenotypeAnnotationView.class, View.ForPublic.class }) + private List assertedGenes; + + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "alleleSymbol.formatText", "alleleSymbol.displayText", "alleleSymbol.formatText_keyword", "alleleSymbol.displayText_keyword", + "alleleFullName.formatText", "alleleFullName.displayText", "alleleFullName.formatText_keyword", "alleleFullName.displayText_keyword", + "alleleSynonyms.formatText", "alleleSynonyms.displayText", "alleleSynonyms.formatText_keyword", "alleleSynonyms.displayText_keyword", + "alleleSecondaryIds.secondaryId", "alleleSecondaryIds.secondaryId_keyword" + }) + @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) + @ManyToOne + @Fetch(FetchMode.SELECT) + @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) + private Allele assertedAllele; + + @Transient + @Override + @JsonIgnore + public String getSubjectCurie() { + if (phenotypeAnnotationSubject == null) + return null; + return phenotypeAnnotationSubject.getCurie(); + } + + @Transient + @Override + @JsonIgnore + public String getSubjectTaxonCurie() { + if (phenotypeAnnotationSubject == null) + return null; + if (phenotypeAnnotationSubject.getTaxon() == null) + return null; + return phenotypeAnnotationSubject.getTaxon().getCurie(); + } + + @Transient + @Override + @JsonIgnore + public String getSubjectIdentifier() { + if (phenotypeAnnotationSubject == null) + return null; + return phenotypeAnnotationSubject.getIdentifier(); + } + + @Transient + @Override + @JsonIgnore + public String getSubjectSpeciesName() { + if (phenotypeAnnotationSubject == null) + return null; + if (phenotypeAnnotationSubject.getTaxon() == null) + return null; + return phenotypeAnnotationSubject.getTaxon().getGenusSpecies(); + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AllelePhenotypeAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AllelePhenotypeAnnotation.java new file mode 100644 index 000000000..91655dbb1 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AllelePhenotypeAnnotation.java @@ -0,0 +1,131 @@ +package org.alliancegenome.curation_api.model.entities; + +import java.util.List; + +import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; +import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; +import org.alliancegenome.curation_api.view.View; +import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; +import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonView; + +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.Transient; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Indexed +@Entity +@Data +@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@Schema(name = "Allele_Phenotype_Annotation", description = "Annotation class representing a allele phenotype annotation") +@JsonTypeName("AllelePhenotypeAnnotation") +@OnDelete(action = OnDeleteAction.CASCADE) +@AGRCurationSchemaVersion(min = "2.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { PhenotypeAnnotation.class }) +@Table(indexes = { + @Index(name = "AllelePhenotypeAnnotation_inferredGene_index", columnList = "inferredGene_id"), + @Index(name = "AllelePhenotypeAnnotation_PhenotypeAnnotationSubject_index", columnList = "phenotypeAnnotationSubject_id") +}) +public class AllelePhenotypeAnnotation extends PhenotypeAnnotation { + + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "alleleSymbol.formatText", "alleleSymbol.displayText", "alleleSymbol.formatText_keyword", "alleleSymbol.displayText_keyword", + "alleleFullName.formatText", "alleleFullName.displayText", "alleleFullName.formatText_keyword", "alleleFullName.displayText_keyword", + "alleleSynonyms.formatText", "alleleSynonyms.displayText", "alleleSynonyms.formatText_keyword", "alleleSynonyms.displayText_keyword", + "alleleSecondaryIds.secondaryId", "alleleSecondaryIds.secondaryId_keyword", "name", "name_keyword", "symbol", "symbol_keyword" + }) + @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) + @ManyToOne + @Fetch(FetchMode.SELECT) + @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) + @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) + private Allele phenotypeAnnotationSubject; + + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "geneSymbol.formatText", "geneSymbol.displayText", "geneSymbol.formatText_keyword", "geneSymbol.displayText_keyword", + "geneFullName.formatText", "geneFullName.displayText", "geneFullName.formatText_keyword", "geneFullName.displayText_keyword", + "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSystematicName.formatText_keyword", "geneSystematicName.displayText_keyword", + "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSynonyms.formatText_keyword", "geneSynonyms.displayText_keyword", + "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword" + }) + @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) + @ManyToOne + @Fetch(FetchMode.SELECT) + @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) + private Gene inferredGene; + + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "geneSymbol.formatText", "geneSymbol.displayText", "geneSymbol.formatText_keyword", "geneSymbol.displayText_keyword", + "geneFullName.formatText", "geneFullName.displayText", "geneFullName.formatText_keyword", "geneFullName.displayText_keyword", + "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSystematicName.formatText_keyword", "geneSystematicName.displayText_keyword", + "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSynonyms.formatText_keyword", "geneSynonyms.displayText_keyword", + "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword" + }) + @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) + @ManyToMany + @Fetch(FetchMode.SELECT) + @JoinTable(indexes = { + @Index(name = "allelephenotypeannotationgene_phenotypeannotation_index", columnList = "allelephenotypeannotation_id"), + @Index(name = "allelephenotypeannotationgene_assertedgenes_index", columnList = "assertedgenes_id") + }) + @JsonView({ View.FieldsAndLists.class, View.PhenotypeAnnotationView.class, View.ForPublic.class }) + private List assertedGenes; + + @Transient + @Override + @JsonIgnore + public String getSubjectCurie() { + if (phenotypeAnnotationSubject == null) + return null; + return phenotypeAnnotationSubject.getCurie(); + } + + @Transient + @Override + @JsonIgnore + public String getSubjectTaxonCurie() { + if (phenotypeAnnotationSubject == null) + return null; + if (phenotypeAnnotationSubject.getTaxon() == null) + return null; + return phenotypeAnnotationSubject.getTaxon().getCurie(); + } + + @Transient + @Override + @JsonIgnore + public String getSubjectIdentifier() { + if (phenotypeAnnotationSubject == null) + return null; + return phenotypeAnnotationSubject.getIdentifier(); + } + + @Transient + @Override + @JsonIgnore + public String getSubjectSpeciesName() { + if (phenotypeAnnotationSubject == null) + return null; + if (phenotypeAnnotationSubject.getTaxon() == null) + return null; + return phenotypeAnnotationSubject.getTaxon().getGenusSpecies(); + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java index d013e4050..df13662b0 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/DiseaseAnnotation.java @@ -44,7 +44,7 @@ @Entity @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) -@AGRCurationSchemaVersion(min = "2.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { ConditionRelation.class, Note.class, SingleReferenceAssociation.class }) +@AGRCurationSchemaVersion(min = "2.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Annotation.class }) @Schema(name = "Disease_Annotation", description = "Annotation class representing a disease annotation") @Table(indexes = { diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/GenePhenotypeAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/GenePhenotypeAnnotation.java new file mode 100644 index 000000000..16f74db5d --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/GenePhenotypeAnnotation.java @@ -0,0 +1,98 @@ +package org.alliancegenome.curation_api.model.entities; + +import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; +import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; +import org.alliancegenome.curation_api.view.View; +import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.hibernate.annotations.OnDelete; +import org.hibernate.annotations.OnDeleteAction; +import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonView; + +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.Transient; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@Indexed +@Entity +@Data +@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@Schema(name = "Gene_Phenotype_Annotation", description = "Annotation class representing a gene phenotype annotation") +@JsonTypeName("GenePhenotypeAnnotation") +@OnDelete(action = OnDeleteAction.CASCADE) +@AGRCurationSchemaVersion(min = "2.2.0", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { PhenotypeAnnotation.class }) +@Table(indexes = { + @Index(name = "genephenotypeannotation_phenotypeannotationsubject_index", columnList = "phenotypeannotationsubject_id") +}) +public class GenePhenotypeAnnotation extends PhenotypeAnnotation { + + @IndexedEmbedded(includePaths = { + "curie", "modEntityId", "modInternalId", "curie_keyword", "modEntityId_keyword", "modInternalId_keyword", + "geneSymbol.formatText", "geneSymbol.displayText", "geneSymbol.formatText_keyword", "geneSymbol.displayText_keyword", + "geneFullName.formatText", "geneFullName.displayText", "geneFullName.formatText_keyword", "geneFullName.displayText_keyword", + "geneSystematicName.formatText", "geneSystematicName.displayText", "geneSystematicName.formatText_keyword", "geneSystematicName.displayText_keyword", + "geneSynonyms.formatText", "geneSynonyms.displayText", "geneSynonyms.formatText_keyword", "geneSynonyms.displayText_keyword", + "geneSecondaryIds.secondaryId", "geneSecondaryIds.secondaryId_keyword", "name", "name_keyword", "symbol", "symbol_keyword" + }) + @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) + @ManyToOne + @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE) + @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) + private Gene phenotypeAnnotationSubject; + + @IndexedEmbedded(includePaths = {"name", "name_keyword", "curie", "curie_keyword", "modEntityId", "modEntityId_keyword", "modInternalId", "modInternalId_keyword"}) + @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) + @ManyToOne + @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) + private AffectedGenomicModel sgdStrainBackground; + + @Transient + @Override + @JsonIgnore + public String getSubjectCurie() { + if (phenotypeAnnotationSubject == null) + return null; + return phenotypeAnnotationSubject.getCurie(); + } + + @Transient + @Override + @JsonIgnore + public String getSubjectTaxonCurie() { + if (phenotypeAnnotationSubject == null) + return null; + if (phenotypeAnnotationSubject.getTaxon() == null) + return null; + return phenotypeAnnotationSubject.getTaxon().getCurie(); + } + + @Transient + @Override + @JsonIgnore + public String getSubjectIdentifier() { + if (phenotypeAnnotationSubject == null) + return null; + return phenotypeAnnotationSubject.getIdentifier(); + } + + @Transient + @Override + @JsonIgnore + public String getSubjectSpeciesName() { + if (phenotypeAnnotationSubject == null) + return null; + if (phenotypeAnnotationSubject.getTaxon() == null) + return null; + return phenotypeAnnotationSubject.getTaxon().getGenusSpecies(); + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/PhenotypeAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/PhenotypeAnnotation.java new file mode 100644 index 000000000..88361853c --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/PhenotypeAnnotation.java @@ -0,0 +1,86 @@ +package org.alliancegenome.curation_api.model.entities; + +import java.util.List; + +import org.alliancegenome.curation_api.constants.LinkMLSchemaConstants; +import org.alliancegenome.curation_api.interfaces.AGRCurationSchemaVersion; +import org.alliancegenome.curation_api.model.entities.ontology.PhenotypeTerm; +import org.alliancegenome.curation_api.view.View; +import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.hibernate.search.engine.backend.types.Aggregable; +import org.hibernate.search.engine.backend.types.Searchable; +import org.hibernate.search.engine.backend.types.Sortable; +import org.hibernate.search.mapper.pojo.automaticindexing.ReindexOnUpdate; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexedEmbedded; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency; +import org.hibernate.search.mapper.pojo.mapping.definition.annotation.KeywordField; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonView; + +import jakarta.persistence.Entity; +import jakarta.persistence.Index; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.Transient; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonSubTypes({ @Type(value = AGMPhenotypeAnnotation.class, name = "AGMPhenotypeAnnotation"), @Type(value = AllelePhenotypeAnnotation.class, name = "AllelePhenotypeAnnotation"), + @Type(value = GenePhenotypeAnnotation.class, name = "GenePhenotypeAnnotation") }) +@Entity +@Data +@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true) +@AGRCurationSchemaVersion(min = "2.2.1", max = LinkMLSchemaConstants.LATEST_RELEASE, dependencies = { Annotation.class }) +@Schema(name = "Phenotype_Annotation", description = "Annotation class representing a phenotype annotation") +@Table(indexes = { + @Index(name = "phenotypeannotation_relation_index", columnList = "relation_id") +}) +public abstract class PhenotypeAnnotation extends Annotation { + + @FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer") + @KeywordField(name = "phenotypeAnnotationObject_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer") + @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) + private String phenotypeAnnotationObject; + + @IndexedEmbedded(includePaths = {"curie", "name", "secondaryIdentifiers", "synonyms.name", "abbreviation", + "curie_keyword", "name_keyword", "secondaryIdentifiers_keyword", "synonyms.name_keyword", "abbreviation_keyword" }) + @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) + @ManyToOne + @JsonView({ View.FieldsAndLists.class, View.PhenotypeAnnotationView.class, View.ForPublic.class }) + @JoinTable(indexes = { + @Index(name = "phenotypeannotation_phenotypeterm_phenotypeannotation_index", columnList = "phenotypeannotation_id"), + @Index(name = "phenotypeannotation_phenotypeterm_phenotypeterms_index", columnList = "phenotypeterms_id") + }) + private List phenotypeTerms; + + @IndexedEmbedded(includePaths = {"name", "name_keyword"}) + @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) + @ManyToOne + @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) + private VocabularyTerm relation; + + @Transient + public abstract String getSubjectCurie(); + + @Transient + public abstract String getSubjectTaxonCurie(); + + @Transient + public abstract String getSubjectSpeciesName(); + + @Transient + public abstract String getSubjectIdentifier(); + + @Transient + @JsonIgnore + public String getDataProviderString() { + return dataProvider.getSourceOrganization().getAbbreviation(); + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/ExperimentalConditionFmsDTO.java b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/ExperimentalConditionFmsDTO.java index bd96e313c..c47a2e9ce 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/ExperimentalConditionFmsDTO.java +++ b/src/main/java/org/alliancegenome/curation_api/model/ingest/dto/fms/ExperimentalConditionFmsDTO.java @@ -15,6 +15,8 @@ public class ExperimentalConditionFmsDTO extends BaseDTO { private String conditionStatement; + private String conditionId; + private String conditionQuantity; private String anatomicalOntologyId; diff --git a/src/main/java/org/alliancegenome/curation_api/services/AGMPhenotypeAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/AGMPhenotypeAnnotationService.java new file mode 100644 index 000000000..20cbed346 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/services/AGMPhenotypeAnnotationService.java @@ -0,0 +1,102 @@ +package org.alliancegenome.curation_api.services; + +import java.util.List; + +import org.alliancegenome.curation_api.dao.AGMPhenotypeAnnotationDAO; +import org.alliancegenome.curation_api.dao.ConditionRelationDAO; +import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; +import org.alliancegenome.curation_api.exceptions.ObjectUpdateException; +import org.alliancegenome.curation_api.model.entities.AGMPhenotypeAnnotation; +import org.alliancegenome.curation_api.model.entities.AffectedGenomicModel; +import org.alliancegenome.curation_api.model.ingest.dto.fms.PhenotypeFmsDTO; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.base.BaseEntityCrudService; +import org.alliancegenome.curation_api.services.validation.dto.fms.AGMPhenotypeAnnotationFmsDTOValidator; + +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; +import jakarta.transaction.Transactional; + +@RequestScoped +public class AGMPhenotypeAnnotationService extends BaseEntityCrudService { + + @Inject + AGMPhenotypeAnnotationDAO agmPhenotypeAnnotationDAO; + //@Inject + //AGMPhenotypeAnnotationValidator agmPhenotypeValidator; + @Inject + ConditionRelationDAO conditionRelationDAO; + @Inject + PhenotypeAnnotationService phenotypeAnnotationService; + @Inject + AGMPhenotypeAnnotationFmsDTOValidator agmPhenotypeAnnotationFmsDtoValidator; + + @Override + @PostConstruct + protected void init() { + setSQLDao(agmPhenotypeAnnotationDAO); + } + + public ObjectResponse get(String identifier) { + SearchResponse ret = findByField("curie", identifier); + if (ret != null && ret.getTotalResults() == 1) + return new ObjectResponse(ret.getResults().get(0)); + + ret = findByField("modEntityId", identifier); + if (ret != null && ret.getTotalResults() == 1) + return new ObjectResponse(ret.getResults().get(0)); + + ret = findByField("modInternalId", identifier); + if (ret != null && ret.getTotalResults() == 1) + return new ObjectResponse<>(ret.getResults().get(0)); + + ret = findByField("uniqueId", identifier); + if (ret != null && ret.getTotalResults() == 1) + return new ObjectResponse<>(ret.getResults().get(0)); + + return new ObjectResponse<>(); + } + + @Override + @Transactional + public ObjectResponse update(AGMPhenotypeAnnotation uiEntity) { + //AGMPhenotypeAnnotation dbEntity = agmPhenotypeValidator.validateAnnotationUpdate(uiEntity); + //return new ObjectResponse<>(agmPhenotypeAnnotationDAO.persist(dbEntity)); + return null; + } + + @Override + @Transactional + public ObjectResponse create(AGMPhenotypeAnnotation uiEntity) { + //AGMPhenotypeAnnotation dbEntity = agmPhenotypeValidator.validateAnnotationCreate(uiEntity); + //return new ObjectResponse<>(agmPhenotypeAnnotationDAO.persist(dbEntity)); + return null; + } + + @Transactional + public AGMPhenotypeAnnotation upsertPrimaryAnnotation(AffectedGenomicModel subject, PhenotypeFmsDTO dto, BackendBulkDataProvider dataProvider) throws ObjectUpdateException { + AGMPhenotypeAnnotation annotation = agmPhenotypeAnnotationFmsDtoValidator.validatePrimaryAnnotation(subject, dto, dataProvider); + + return agmPhenotypeAnnotationDAO.persist(annotation); + } + + @Transactional + public void addInferredOrAssertedEntities(AffectedGenomicModel primaryAnnotationSubject, PhenotypeFmsDTO secondaryAnnotationDto, List idsAdded, BackendBulkDataProvider dataProvider) throws ObjectUpdateException { + AGMPhenotypeAnnotation annotation = agmPhenotypeAnnotationFmsDtoValidator.validateInferredOrAssertedEntities(primaryAnnotationSubject, secondaryAnnotationDto, idsAdded, dataProvider); + agmPhenotypeAnnotationDAO.persist(annotation); + } + + @Override + @Transactional + public ObjectResponse delete(Long id) { + phenotypeAnnotationService.deprecateOrDeleteAnnotationAndNotes(id, true, "AGM phenotype annotation DELETE API call", false); + ObjectResponse ret = new ObjectResponse<>(); + return ret; + } + + public List getAnnotationIdsByDataProvider(BackendBulkDataProvider dataProvider) { + return phenotypeAnnotationService.getAnnotationIdsByDataProvider(agmPhenotypeAnnotationDAO, dataProvider); + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java index 98db96677..fc2985be1 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/DiseaseAnnotationService.java @@ -18,7 +18,7 @@ import org.alliancegenome.curation_api.model.entities.DiseaseAnnotation; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; -import org.alliancegenome.curation_api.services.base.BaseEntityCrudService; +import org.alliancegenome.curation_api.services.base.BaseAnnotationCrudService; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdUpdateHelper; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; import org.apache.commons.collections.CollectionUtils; @@ -32,7 +32,7 @@ @JBossLog @RequestScoped -public class DiseaseAnnotationService extends BaseEntityCrudService { +public class DiseaseAnnotationService extends BaseAnnotationCrudService { @Inject DiseaseAnnotationDAO diseaseAnnotationDAO; @@ -77,6 +77,7 @@ public ObjectResponse delete(Long id) { return ret; } + @Override @Transactional public DiseaseAnnotation deprecateOrDeleteAnnotationAndNotes(Long id, Boolean throwApiError, String loadDescription, Boolean deprecateAnnotation) { DiseaseAnnotation annotation = diseaseAnnotationDAO.find(id); diff --git a/src/main/java/org/alliancegenome/curation_api/services/PhenotypeAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/PhenotypeAnnotationService.java new file mode 100644 index 000000000..5c2fc1e3c --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/services/PhenotypeAnnotationService.java @@ -0,0 +1,217 @@ +package org.alliancegenome.curation_api.services; + +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +import org.alliancegenome.curation_api.constants.EntityFieldConstants; +import org.alliancegenome.curation_api.constants.ValidationConstants; +import org.alliancegenome.curation_api.dao.PersonDAO; +import org.alliancegenome.curation_api.dao.PhenotypeAnnotationDAO; +import org.alliancegenome.curation_api.dao.base.BaseSQLDAO; +import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; +import org.alliancegenome.curation_api.exceptions.ApiErrorException; +import org.alliancegenome.curation_api.exceptions.ObjectUpdateException; +import org.alliancegenome.curation_api.exceptions.ObjectValidationException; +import org.alliancegenome.curation_api.model.entities.AGMPhenotypeAnnotation; +import org.alliancegenome.curation_api.model.entities.AffectedGenomicModel; +import org.alliancegenome.curation_api.model.entities.Allele; +import org.alliancegenome.curation_api.model.entities.ConditionRelation; +import org.alliancegenome.curation_api.model.entities.Gene; +import org.alliancegenome.curation_api.model.entities.GenomicEntity; +import org.alliancegenome.curation_api.model.entities.PhenotypeAnnotation; +import org.alliancegenome.curation_api.model.ingest.dto.fms.PhenotypeFmsDTO; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.base.BaseAnnotationCrudService; +import org.alliancegenome.curation_api.util.ProcessDisplayHelper; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; + +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; +import jakarta.transaction.Transactional; +import lombok.extern.jbosslog.JBossLog; + +@JBossLog +@RequestScoped +public class PhenotypeAnnotationService extends BaseAnnotationCrudService { + + @Inject + PhenotypeAnnotationDAO phenotypeAnnotationDAO; + @Inject + PersonService personService; + @Inject + PersonDAO personDAO; + @Inject + GenomicEntityService genomicEntityService; + @Inject + ReferenceService referenceService; + @Inject + AGMPhenotypeAnnotationService agmPhenotypeAnnotationService; + + HashMap> unprocessedAnnotationsMap = new HashMap<>(); + + @Override + @PostConstruct + protected void init() { + setSQLDao(phenotypeAnnotationDAO); + } + + public ObjectResponse get(String identifier) { + SearchResponse ret = findByField("curie", identifier); + if (ret != null && ret.getTotalResults() == 1) + return new ObjectResponse(ret.getResults().get(0)); + + ret = findByField("modEntityId", identifier); + if (ret != null && ret.getTotalResults() == 1) + return new ObjectResponse(ret.getResults().get(0)); + + ret = findByField("modInternalId", identifier); + if (ret != null && ret.getTotalResults() == 1) + return new ObjectResponse(ret.getResults().get(0)); + + ret = findByField("uniqueId", identifier); + if (ret != null && ret.getTotalResults() == 1) + return new ObjectResponse(ret.getResults().get(0)); + + return new ObjectResponse(); + } + + @Override + @Transactional + public ObjectResponse delete(Long id) { + deprecateOrDeleteAnnotationAndNotes(id, true, "Phenotype annotation DELETE API call", false); + ObjectResponse ret = new ObjectResponse<>(); + return ret; + } + + @Transactional + public PhenotypeAnnotation deprecateOrDeleteAnnotationAndNotes(Long id, Boolean throwApiError, String loadDescription, Boolean deprecateAnnotation) { + PhenotypeAnnotation annotation = phenotypeAnnotationDAO.find(id); + + if (annotation == null) { + String errorMessage = "Could not find Phenotype Annotation with id: " + id; + if (throwApiError) { + ObjectResponse response = new ObjectResponse<>(); + response.addErrorMessage("id", errorMessage); + throw new ApiErrorException(response); + } + log.error(errorMessage); + return null; + } + + if (deprecateAnnotation) { + if (!annotation.getObsolete()) { + annotation.setObsolete(true); + if (authenticatedPerson.getId() != null) { + annotation.setUpdatedBy(personDAO.find(authenticatedPerson.getId())); + } else { + annotation.setUpdatedBy(personService.fetchByUniqueIdOrCreate(loadDescription)); + } + annotation.setDateUpdated(OffsetDateTime.now()); + return phenotypeAnnotationDAO.persist(annotation); + } else { + return annotation; + } + } else { + phenotypeAnnotationDAO.remove(id); + } + + return null; + } + + public List getAllReferencedConditionRelationIds() { + ProcessDisplayHelper pdh = new ProcessDisplayHelper(); + + List paIds = phenotypeAnnotationDAO.findAllIds().getResults(); + pdh.startProcess("Checking PAs for referenced Conditions ", paIds.size()); + + List conditionRelationIds = new ArrayList<>(); + paIds.forEach(paId -> { + PhenotypeAnnotation annotation = phenotypeAnnotationDAO.find(paId); + if (CollectionUtils.isNotEmpty(annotation.getConditionRelations())) { + List crIds = annotation.getConditionRelations().stream().map(ConditionRelation::getId).collect(Collectors.toList()); + conditionRelationIds.addAll(crIds); + } + pdh.progressProcess(); + }); + pdh.finishProcess(); + + return conditionRelationIds; + } + + public List getAnnotationIdsByDataProvider(BackendBulkDataProvider dataProvider) { + return getAnnotationIdsByDataProvider(phenotypeAnnotationDAO, dataProvider); + } + + protected > List getAnnotationIdsByDataProvider(D dao, BackendBulkDataProvider dataProvider) { + //TODO: need some rules for XenBase submissions here + + Map params = new HashMap<>(); + params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider.sourceOrganization); + + if(StringUtils.equals(dataProvider.sourceOrganization, "RGD")) + params.put(EntityFieldConstants.DA_SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); + + List annotationIds = phenotypeAnnotationDAO.findFilteredIds(params); + annotationIds.removeIf(Objects::isNull); + + if (StringUtils.equals(dataProvider.toString(), "HUMAN")) { + Map newParams = new HashMap<>(); + newParams.put(EntityFieldConstants.SECONDARY_DATA_PROVIDER, dataProvider.sourceOrganization); + newParams.put(EntityFieldConstants.DA_SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); + List additionalIds = phenotypeAnnotationDAO.findFilteredIds(newParams); + annotationIds.addAll(additionalIds); + } + + return annotationIds; + } + + public Long upsertPrimaryAnnotation(PhenotypeFmsDTO dto, BackendBulkDataProvider dataProvider) throws ObjectUpdateException { + + if (StringUtils.isBlank(dto.getObjectId())) + throw new ObjectValidationException(dto, "objectId - " + ValidationConstants.REQUIRED_MESSAGE); + GenomicEntity phenotypeAnnotationSubject = genomicEntityService.findByIdentifierString(dto.getObjectId()); + if (phenotypeAnnotationSubject == null) + throw new ObjectValidationException(dto, "objectId - " + ValidationConstants.INVALID_MESSAGE + " (" + dto.getObjectId() + ")"); + + + if (phenotypeAnnotationSubject instanceof AffectedGenomicModel) { + AGMPhenotypeAnnotation annotation = agmPhenotypeAnnotationService.upsertPrimaryAnnotation((AffectedGenomicModel) phenotypeAnnotationSubject, dto, dataProvider); + return annotation.getId(); + } else if (phenotypeAnnotationSubject instanceof Allele) { + // TODO: point to AllelePhenotypeAnnotationService method + } else if (phenotypeAnnotationSubject instanceof Gene) { + // TODO: point to GenePhenotypeAnnotationService method + } else { + throw new ObjectValidationException(dto, "objectId - " + ValidationConstants.INVALID_MESSAGE + " (" + dto.getObjectId() + ")"); + } + + return null; + } + + public void addInferredOrAssertedEntities(PhenotypeFmsDTO dto, List idsAdded, BackendBulkDataProvider dataProvider) throws ObjectUpdateException { + for (String primaryGeneticEntityCurie : dto.getPrimaryGeneticEntityIds()) { + GenomicEntity primaryAnnotationSubject = genomicEntityService.findByIdentifierString(dto.getObjectId()); + if (primaryAnnotationSubject == null) + throw new ObjectValidationException(dto, "primaryGeneticEntityIds - " + ValidationConstants.INVALID_MESSAGE + " (" + primaryGeneticEntityCurie + ")"); + + if (primaryAnnotationSubject instanceof AffectedGenomicModel) { + agmPhenotypeAnnotationService.addInferredOrAssertedEntities((AffectedGenomicModel) primaryAnnotationSubject, dto, idsAdded, dataProvider); + } else if (primaryAnnotationSubject instanceof Allele) { + // TODO: point to AllelePhenotypeAnnotationService method + } else if (primaryAnnotationSubject instanceof Gene) { + // TODO: point to GenePhenotypeAnnotationService method + } else { + throw new ObjectValidationException(dto, "objectId - " + ValidationConstants.INVALID_MESSAGE + " (" + dto.getObjectId() + ")"); + } + } + } + +} diff --git a/src/main/java/org/alliancegenome/curation_api/services/base/BaseAnnotationCrudService.java b/src/main/java/org/alliancegenome/curation_api/services/base/BaseAnnotationCrudService.java new file mode 100644 index 000000000..a1531b45c --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/services/base/BaseAnnotationCrudService.java @@ -0,0 +1,12 @@ +package org.alliancegenome.curation_api.services.base; + +import org.alliancegenome.curation_api.dao.base.BaseEntityDAO; +import org.alliancegenome.curation_api.model.entities.Annotation; + +public abstract class BaseAnnotationCrudService> extends BaseEntityCrudService { + + protected abstract void init(); + + public abstract E deprecateOrDeleteAnnotationAndNotes(Long id, Boolean throwApiError, String loadDescription, Boolean deprecate); + +} diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationRetrievalHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/AnnotationRetrievalHelper.java similarity index 66% rename from src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationRetrievalHelper.java rename to src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/AnnotationRetrievalHelper.java index f96d40c28..085d6c231 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationRetrievalHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/AnnotationRetrievalHelper.java @@ -1,12 +1,12 @@ package org.alliancegenome.curation_api.services.helpers.diseaseAnnotations; -import org.alliancegenome.curation_api.model.entities.DiseaseAnnotation; +import org.alliancegenome.curation_api.model.entities.Annotation; import org.alliancegenome.curation_api.response.SearchResponse; import org.apache.commons.collections.CollectionUtils; -public abstract class DiseaseAnnotationRetrievalHelper { +public abstract class AnnotationRetrievalHelper { - public static E getCurrentDiseaseAnnotation(E annotation, SearchResponse annotationList) { + public static E getCurrentAnnotation(E annotation, SearchResponse annotationList) { if (annotationList == null || CollectionUtils.isEmpty(annotationList.getResults())) return annotation; diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/AnnotationUniqueIdHelper.java similarity index 64% rename from src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java rename to src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/AnnotationUniqueIdHelper.java index e28f84d7b..0407ae706 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/AnnotationUniqueIdHelper.java @@ -4,22 +4,26 @@ import java.util.List; import java.util.stream.Collectors; -import org.alliancegenome.curation_api.model.entities.BiologicalEntity; +import org.alliancegenome.curation_api.enums.FmsConditionRelation; import org.alliancegenome.curation_api.model.entities.ConditionRelation; import org.alliancegenome.curation_api.model.entities.DiseaseAnnotation; import org.alliancegenome.curation_api.model.entities.ExperimentalCondition; -import org.alliancegenome.curation_api.model.entities.Gene; +import org.alliancegenome.curation_api.model.entities.PhenotypeAnnotation; import org.alliancegenome.curation_api.model.entities.VocabularyTerm; import org.alliancegenome.curation_api.model.entities.ontology.ECOTerm; import org.alliancegenome.curation_api.model.ingest.dto.ConditionRelationDTO; import org.alliancegenome.curation_api.model.ingest.dto.DiseaseAnnotationDTO; import org.alliancegenome.curation_api.model.ingest.dto.ExperimentalConditionDTO; +import org.alliancegenome.curation_api.model.ingest.dto.fms.ConditionRelationFmsDTO; import org.alliancegenome.curation_api.model.ingest.dto.fms.EvidenceFmsDTO; +import org.alliancegenome.curation_api.model.ingest.dto.fms.ExperimentalConditionFmsDTO; +import org.alliancegenome.curation_api.model.ingest.dto.fms.PhenotypeFmsDTO; +import org.alliancegenome.curation_api.model.ingest.dto.fms.PhenotypeTermIdentifierFmsDTO; import org.alliancegenome.curation_api.services.helpers.UniqueIdGeneratorHelper; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -public abstract class DiseaseAnnotationUniqueIdHelper { +public abstract class AnnotationUniqueIdHelper { public static final String DELIMITER = "|"; @@ -47,6 +51,14 @@ public static String getConditionRelationUniqueId(ConditionRelationDTO dto, Stri return uniqueId.getUniqueId(); } + public static String getConditionRelationUniqueId(ConditionRelationFmsDTO dto, String relationType) { + UniqueIdGeneratorHelper uniqueId = new UniqueIdGeneratorHelper(); + uniqueId.add(relationType); + if (CollectionUtils.isNotEmpty(dto.getConditions())) + dto.getConditions().forEach(experimentalCondition -> uniqueId.add(getExperimentalConditionUniqueId(experimentalCondition))); + return uniqueId.getUniqueId(); + } + public static String getDiseaseAnnotationUniqueId(DiseaseAnnotationDTO annotationDTO, String subjectIdentifier, String refCurie) { UniqueIdGeneratorHelper uniqueId = new UniqueIdGeneratorHelper(); uniqueId.add(subjectIdentifier); @@ -65,7 +77,7 @@ public static String getDiseaseAnnotationUniqueId(DiseaseAnnotationDTO annotatio UniqueIdGeneratorHelper gen = new UniqueIdGeneratorHelper(); gen.add(conditionDTO.getConditionRelationTypeName()); if (CollectionUtils.isNotEmpty(conditionDTO.getConditionDtos())) - gen.add(conditionDTO.getConditionDtos().stream().map(DiseaseAnnotationUniqueIdHelper::getExperimentalConditionUniqueId).collect(Collectors.joining(DELIMITER))); + gen.add(conditionDTO.getConditionDtos().stream().map(AnnotationUniqueIdHelper::getExperimentalConditionUniqueId).collect(Collectors.joining(DELIMITER))); return gen.getUniqueId(); }).collect(Collectors.toList())); } @@ -93,7 +105,7 @@ public static String getDiseaseAnnotationUniqueId(DiseaseAnnotation annotation) uniqueId.addList(annotation.getConditionRelations().stream().map(condition -> { UniqueIdGeneratorHelper gen = new UniqueIdGeneratorHelper(); gen.add(condition.getConditionRelationType().getName()); - gen.add(condition.getConditions().stream().map(DiseaseAnnotationUniqueIdHelper::getExperimentalConditionUniqueId).collect(Collectors.joining(DELIMITER))); + gen.add(condition.getConditions().stream().map(AnnotationUniqueIdHelper::getExperimentalConditionUniqueId).collect(Collectors.joining(DELIMITER))); return gen.getUniqueId(); }).collect(Collectors.toList())); } @@ -104,6 +116,48 @@ public static String getDiseaseAnnotationUniqueId(DiseaseAnnotation annotation) uniqueId.addSubmittedObjectList(annotation.getDiseaseGeneticModifiers()); return uniqueId.getUniqueId(); } + + public static String getPhenotypeAnnotationUniqueId(PhenotypeFmsDTO annotationFmsDTO, String subjectIdentifier, String refCurie) { + UniqueIdGeneratorHelper uniqueId = new UniqueIdGeneratorHelper(); + uniqueId.add(subjectIdentifier); + uniqueId.add("has_phenotype"); + uniqueId.add(annotationFmsDTO.getPhenotypeStatement()); + if (CollectionUtils.isNotEmpty(annotationFmsDTO.getPhenotypeTermIdentifiers())) + uniqueId.addList(annotationFmsDTO.getPhenotypeTermIdentifiers().stream().map(PhenotypeTermIdentifierFmsDTO::getTermId).collect(Collectors.toList())); + uniqueId.add(refCurie); + if (CollectionUtils.isNotEmpty(annotationFmsDTO.getConditionRelations())) { + uniqueId.addList(annotationFmsDTO.getConditionRelations().stream().map(conditionFmsDTO -> { + UniqueIdGeneratorHelper gen = new UniqueIdGeneratorHelper(); + gen.add(FmsConditionRelation.valueOf(conditionFmsDTO.getConditionRelationType()).agrRelation); + if (CollectionUtils.isNotEmpty(conditionFmsDTO.getConditions())) + gen.add(conditionFmsDTO.getConditions().stream().map(AnnotationUniqueIdHelper::getExperimentalConditionUniqueId).collect(Collectors.joining(DELIMITER))); + return gen.getUniqueId(); + }).collect(Collectors.toList())); + } + + return uniqueId.getUniqueId(); + } + + public static String getPhenotypeAnnotationUniqueId(PhenotypeAnnotation annotation) { + UniqueIdGeneratorHelper uniqueId = new UniqueIdGeneratorHelper(); + uniqueId.add(annotation.getSubjectIdentifier()); + if (annotation.getRelation() != null) + uniqueId.add(annotation.getRelation().getName()); + if (annotation.getPhenotypeAnnotationObject() != null) + uniqueId.add(annotation.getPhenotypeAnnotationObject()); + uniqueId.add(annotation.getRelation().getName()); + if (annotation.getSingleReference()!= null) + uniqueId.add(annotation.getSingleReference().getCurie()); + if (CollectionUtils.isNotEmpty(annotation.getConditionRelations())) { + uniqueId.addList(annotation.getConditionRelations().stream().map(condition -> { + UniqueIdGeneratorHelper gen = new UniqueIdGeneratorHelper(); + gen.add(condition.getConditionRelationType().getName()); + gen.add(condition.getConditions().stream().map(AnnotationUniqueIdHelper::getExperimentalConditionUniqueId).collect(Collectors.joining(DELIMITER))); + return gen.getUniqueId(); + }).collect(Collectors.toList())); + } + return uniqueId.getUniqueId(); + } public static String getExperimentalConditionUniqueId(ExperimentalCondition cond) { UniqueIdGeneratorHelper help = new UniqueIdGeneratorHelper(); @@ -137,7 +191,20 @@ public static String getExperimentalConditionUniqueId(ExperimentalConditionDTO d return uniqueId.getUniqueId(); } - public String getEvidenceCuri(EvidenceFmsDTO dto) { + public static String getExperimentalConditionUniqueId(ExperimentalConditionFmsDTO dto) { + UniqueIdGeneratorHelper uniqueId = new UniqueIdGeneratorHelper(); + uniqueId.add(dto.getConditionClassId()); + uniqueId.add(dto.getConditionId()); + uniqueId.add(dto.getAnatomicalOntologyId()); + uniqueId.add(dto.getChemicalOntologyId()); + uniqueId.add(dto.getGeneOntologyId()); + uniqueId.add(dto.getNcbiTaxonId()); + uniqueId.add(dto.getConditionQuantity()); + uniqueId.add(dto.getConditionStatement()); + return uniqueId.getUniqueId(); + } + + public String getEvidenceCurie(EvidenceFmsDTO dto) { UniqueIdGeneratorHelper uniqueId = new UniqueIdGeneratorHelper(); if (dto.getPublication().getCrossReference() != null) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdUpdateHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdUpdateHelper.java index c3901265d..77071e32d 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdUpdateHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdUpdateHelper.java @@ -33,7 +33,7 @@ public void updateDiseaseAnnotationUniqueId(Long id) { if (annotation == null) return; - annotation.setUniqueId(DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(annotation)); + annotation.setUniqueId(AnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(annotation)); diseaseAnnotationDAO.merge(annotation); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/ExperimentalConditionSummary.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/ExperimentalConditionSummary.java index 912c3b650..7a0d5847a 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/ExperimentalConditionSummary.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/ExperimentalConditionSummary.java @@ -8,6 +8,7 @@ import org.alliancegenome.curation_api.model.entities.ontology.NCBITaxonTerm; import org.alliancegenome.curation_api.model.entities.ontology.ZECOTerm; import org.alliancegenome.curation_api.model.ingest.dto.ExperimentalConditionDTO; +import org.alliancegenome.curation_api.model.ingest.dto.fms.ExperimentalConditionFmsDTO; import org.alliancegenome.curation_api.services.helpers.UniqueIdGeneratorHelper; import org.alliancegenome.curation_api.services.ontology.AnatomicalTermService; import org.alliancegenome.curation_api.services.ontology.ChemicalTermService; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java index 222cb6688..2b2b077a0 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java @@ -19,7 +19,7 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.ReferenceService; import org.alliancegenome.curation_api.services.VocabularyTermService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -102,7 +102,7 @@ public ConditionRelation validateConditionRelation(ConditionRelation uiEntity, C Reference singleReference = validateSingleReference(uiEntity, dbEntity); dbEntity.setSingleReference(singleReference); - String uniqueId = DiseaseAnnotationUniqueIdHelper.getConditionRelationUniqueId(dbEntity); + String uniqueId = AnnotationUniqueIdHelper.getConditionRelationUniqueId(dbEntity); if (checkUniqueness && !uniqueId.equals(dbEntity.getUniqueId())) { SearchResponse crSearchResponse = conditionRelationDAO.findByField("uniqueId", uniqueId); if (crSearchResponse != null) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java index 82217026e..97f791897 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java @@ -22,7 +22,7 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.DataProviderService; import org.alliancegenome.curation_api.services.VocabularyTermService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; import org.alliancegenome.curation_api.services.ontology.DoTermService; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; @@ -286,7 +286,7 @@ public String validateUniqueId(DiseaseAnnotation uiEntity, DiseaseAnnotation dbE if (dbEntity.getDataProvider() == null) return null; - String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(uiEntity); + String uniqueId = AnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(uiEntity); if (dbEntity.getUniqueId() == null || !uniqueId.equals(dbEntity.getUniqueId())) { SearchResponse response = diseaseAnnotationDAO.findByField("uniqueId", uniqueId); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java index 3ed10cfca..35ceaee17 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java @@ -13,7 +13,7 @@ import org.alliancegenome.curation_api.model.entities.ontology.ZECOTerm; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.ExperimentalConditionSummary; import org.alliancegenome.curation_api.services.ontology.AnatomicalTermService; import org.alliancegenome.curation_api.services.ontology.ChemicalTermService; @@ -103,7 +103,7 @@ public ExperimentalCondition validateExperimentalCondition(ExperimentalCondition dbEntity.setConditionSummary(ExperimentalConditionSummary.getConditionSummary(dbEntity)); - String uniqueId = DiseaseAnnotationUniqueIdHelper.getExperimentalConditionUniqueId(dbEntity); + String uniqueId = AnnotationUniqueIdHelper.getExperimentalConditionUniqueId(dbEntity); if (!uniqueId.equals(uiEntity.getUniqueId())) { SearchResponse dbSearchResponse = experimentalConditionDAO.findByField("uniqueId", uniqueId); if (dbSearchResponse != null) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java index c6d453d4e..c1563f960 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java @@ -22,8 +22,8 @@ import org.alliancegenome.curation_api.services.AlleleService; import org.alliancegenome.curation_api.services.GeneService; import org.alliancegenome.curation_api.services.VocabularyTermService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationRetrievalHelper; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationRetrievalHelper; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -65,7 +65,7 @@ public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotation } else { String annotationId; String identifyingField; - String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getAgmIdentifier(), refCurie); + String uniqueId = AnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getAgmIdentifier(), refCurie); if (StringUtils.isNotBlank(dto.getModEntityId())) { annotationId = dto.getModEntityId(); @@ -81,7 +81,7 @@ public AGMDiseaseAnnotation validateAGMDiseaseAnnotationDTO(AGMDiseaseAnnotation } SearchResponse annotationList = agmDiseaseAnnotationDAO.findByField(identifyingField, annotationId); - annotation = DiseaseAnnotationRetrievalHelper.getCurrentDiseaseAnnotation(annotation, annotationList); + annotation = AnnotationRetrievalHelper.getCurrentAnnotation(annotation, annotationList); annotation.setUniqueId(uniqueId); annotation.setDiseaseAnnotationSubject(agm); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java index 689bf40bf..91f02a3ce 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java @@ -20,8 +20,8 @@ import org.alliancegenome.curation_api.services.AlleleService; import org.alliancegenome.curation_api.services.GeneService; import org.alliancegenome.curation_api.services.VocabularyTermService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationRetrievalHelper; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationRetrievalHelper; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -60,7 +60,7 @@ public AlleleDiseaseAnnotation validateAlleleDiseaseAnnotationDTO(AlleleDiseaseA } else { String annotationId; String identifyingField; - String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getAlleleIdentifier(), refCurie); + String uniqueId = AnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getAlleleIdentifier(), refCurie); if (StringUtils.isNotBlank(dto.getModEntityId())) { annotationId = dto.getModEntityId(); @@ -76,7 +76,7 @@ public AlleleDiseaseAnnotation validateAlleleDiseaseAnnotationDTO(AlleleDiseaseA } SearchResponse annotationList = alleleDiseaseAnnotationDAO.findByField(identifyingField, annotationId); - annotation = DiseaseAnnotationRetrievalHelper.getCurrentDiseaseAnnotation(annotation, annotationList); + annotation = AnnotationRetrievalHelper.getCurrentAnnotation(annotation, annotationList); annotation.setUniqueId(uniqueId); annotation.setDiseaseAnnotationSubject(allele); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConditionRelationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConditionRelationDTOValidator.java index 22604f43e..7e3cd2dfe 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConditionRelationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConditionRelationDTOValidator.java @@ -18,7 +18,7 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.ReferenceService; import org.alliancegenome.curation_api.services.VocabularyTermService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; import org.alliancegenome.curation_api.services.validation.dto.base.BaseDTOValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -55,7 +55,7 @@ public ObjectResponse validateConditionRelationDTO(ConditionR } String refCurie = reference == null ? null : reference.getCurie(); - String uniqueId = DiseaseAnnotationUniqueIdHelper.getConditionRelationUniqueId(dto, refCurie); + String uniqueId = AnnotationUniqueIdHelper.getConditionRelationUniqueId(dto, refCurie); SearchResponse searchResponseRel = conditionRelationDAO.findByField("uniqueId", uniqueId); if (searchResponseRel == null || searchResponseRel.getSingleResult() == null) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java index 65ceb4e27..abf5f752c 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java @@ -13,8 +13,7 @@ import org.alliancegenome.curation_api.model.ingest.dto.ExperimentalConditionDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; -import org.alliancegenome.curation_api.services.PersonService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.ExperimentalConditionSummary; import org.alliancegenome.curation_api.services.ontology.AnatomicalTermService; import org.alliancegenome.curation_api.services.ontology.ChemicalTermService; @@ -47,13 +46,11 @@ public class ExperimentalConditionDTOValidator extends BaseDTOValidator { ExperimentalConditionOntologyTermService experimentalConditionOntologyTermService; @Inject ExperimentalConditionSummary experimentalConditionSummary; - @Inject - PersonService personService; public ObjectResponse validateExperimentalConditionDTO(ExperimentalConditionDTO dto) { ObjectResponse ecResponse = new ObjectResponse(); - String uniqueId = DiseaseAnnotationUniqueIdHelper.getExperimentalConditionUniqueId(dto); + String uniqueId = AnnotationUniqueIdHelper.getExperimentalConditionUniqueId(dto); ExperimentalCondition experimentalCondition; SearchResponse searchResponse = experimentalConditionDAO.findByField("uniqueId", uniqueId); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java index fdb96f234..8bf4fd47c 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java @@ -17,8 +17,8 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.AffectedGenomicModelService; import org.alliancegenome.curation_api.services.VocabularyTermService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationRetrievalHelper; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.DiseaseAnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationRetrievalHelper; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.RequestScoped; @@ -58,7 +58,7 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat } else { String annotationId; String identifyingField; - String uniqueId = DiseaseAnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getGeneIdentifier(), refCurie); + String uniqueId = AnnotationUniqueIdHelper.getDiseaseAnnotationUniqueId(dto, dto.getGeneIdentifier(), refCurie); if (StringUtils.isNotBlank(dto.getModEntityId())) { annotationId = dto.getModEntityId(); @@ -74,7 +74,7 @@ public GeneDiseaseAnnotation validateGeneDiseaseAnnotationDTO(GeneDiseaseAnnotat } SearchResponse annotationList = geneDiseaseAnnotationDAO.findByField(identifyingField, annotationId); - annotation = DiseaseAnnotationRetrievalHelper.getCurrentDiseaseAnnotation(annotation, annotationList); + annotation = AnnotationRetrievalHelper.getCurrentAnnotation(annotation, annotationList); annotation.setUniqueId(uniqueId); annotation.setDiseaseAnnotationSubject(gene); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseFmsDTOValidator.java new file mode 100644 index 000000000..bc81671c0 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseFmsDTOValidator.java @@ -0,0 +1,37 @@ +package org.alliancegenome.curation_api.services.validation.dto.base; + +import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; +import org.alliancegenome.curation_api.model.entities.CrossReference; +import org.alliancegenome.curation_api.model.entities.DataProvider; +import org.alliancegenome.curation_api.model.entities.Organization; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.services.OrganizationService; +import org.alliancegenome.curation_api.services.ResourceDescriptorPageService; + +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; + +@RequestScoped +public class BaseFmsDTOValidator { + + @Inject + OrganizationService organizationService; + @Inject + ResourceDescriptorPageService resourceDescriptorPageService; + + public DataProvider constructDataProvider(BackendBulkDataProvider beDataProvider) { + ObjectResponse orgResponse = organizationService.getByAbbr(beDataProvider.sourceOrganization); + if (orgResponse == null || orgResponse.getEntity() == null) + return null; + + DataProvider dataProvider = new DataProvider(); + dataProvider.setSourceOrganization(orgResponse.getEntity()); + + CrossReference homepageXref = new CrossReference(); + homepageXref.setDisplayName(beDataProvider.sourceOrganization); + homepageXref.setResourceDescriptorPage(resourceDescriptorPageService.getPageForResourceDescriptor(beDataProvider.resourceDescriptor, "homepage")); + dataProvider.setCrossReference(homepageXref); + + return dataProvider; + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/AGMPhenotypeAnnotationFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/AGMPhenotypeAnnotationFmsDTOValidator.java new file mode 100644 index 000000000..bd2def40c --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/AGMPhenotypeAnnotationFmsDTOValidator.java @@ -0,0 +1,124 @@ +package org.alliancegenome.curation_api.services.validation.dto.fms; + +import java.util.ArrayList; +import java.util.List; + +import org.alliancegenome.curation_api.constants.ValidationConstants; +import org.alliancegenome.curation_api.dao.AGMPhenotypeAnnotationDAO; +import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; +import org.alliancegenome.curation_api.exceptions.ObjectValidationException; +import org.alliancegenome.curation_api.model.entities.AGMPhenotypeAnnotation; +import org.alliancegenome.curation_api.model.entities.AffectedGenomicModel; +import org.alliancegenome.curation_api.model.entities.Allele; +import org.alliancegenome.curation_api.model.entities.Gene; +import org.alliancegenome.curation_api.model.entities.GenomicEntity; +import org.alliancegenome.curation_api.model.entities.Reference; +import org.alliancegenome.curation_api.model.ingest.dto.fms.PhenotypeFmsDTO; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.GenomicEntityService; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; +import org.apache.commons.lang3.StringUtils; + +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; + +@RequestScoped +public class AGMPhenotypeAnnotationFmsDTOValidator extends PhenotypeAnnotationFmsDTOValidator { + + @Inject + AGMPhenotypeAnnotationDAO agmPhenotypeAnnotationDAO; + @Inject + GenomicEntityService genomicEntityService; + + public AGMPhenotypeAnnotation validatePrimaryAnnotation(AffectedGenomicModel subject, PhenotypeFmsDTO dto, BackendBulkDataProvider dataProvider) throws ObjectValidationException { + + ObjectResponse apaResponse = new ObjectResponse(); + AGMPhenotypeAnnotation annotation = new AGMPhenotypeAnnotation(); + + ObjectResponse refResponse = validateReference(dto); + apaResponse.addErrorMessages(refResponse.getErrorMessages()); + + Reference reference = refResponse.getEntity(); + String refString = reference == null ? null : reference.getCurie(); + + String uniqueId = AnnotationUniqueIdHelper.getPhenotypeAnnotationUniqueId(dto, subject.getIdentifier(), refString); + SearchResponse annotationSearch = agmPhenotypeAnnotationDAO.findByField("uniqueId", uniqueId); + if (annotationSearch != null && annotationSearch.getSingleResult() != null) + annotation = annotationSearch.getSingleResult(); + + annotation.setUniqueId(uniqueId); + annotation.setSingleReference(reference); + annotation.setPhenotypeAnnotationSubject(subject); + + // Reset implied/asserted fields as secondary annotations loaded separately + annotation.setAssertedAllele(null); + annotation.setAssertedGenes(null); + annotation.setInferredAllele(null); + annotation.setInferredGene(null); + + ObjectResponse paResponse = validatePhenotypeAnnotation(annotation, dto, dataProvider); + apaResponse.addErrorMessages(paResponse.getErrorMessages()); + annotation = paResponse.getEntity(); + + if (apaResponse.hasErrors()) + throw new ObjectValidationException(dto, apaResponse.errorMessagesString()); + + return annotation; + + } + + public AGMPhenotypeAnnotation validateInferredOrAssertedEntities(AffectedGenomicModel primaryAnnotationSubject, PhenotypeFmsDTO dto, List idsAdded, BackendBulkDataProvider dataProvider) throws ObjectValidationException { + ObjectResponse apaResponse = new ObjectResponse(); + + ObjectResponse refResponse = validateReference(dto); + apaResponse.addErrorMessages(refResponse.getErrorMessages()); + + Reference reference = refResponse.getEntity(); + String refString = reference == null ? null : reference.getCurie(); + + String primaryAnnotationUniqueId = AnnotationUniqueIdHelper.getPhenotypeAnnotationUniqueId(dto, primaryAnnotationSubject.getIdentifier(), refString); + SearchResponse annotationSearch = agmPhenotypeAnnotationDAO.findByField("uniqueId", primaryAnnotationUniqueId); + if (annotationSearch == null || annotationSearch.getSingleResult() == null) + throw new ObjectValidationException(dto, "Primary annotation not found for " + primaryAnnotationSubject.getIdentifier()); + AGMPhenotypeAnnotation primaryAnnotation = annotationSearch.getSingleResult(); + if (!idsAdded.contains(primaryAnnotation.getId())) + throw new ObjectValidationException(dto, "Primary annotation not included in submitted file (" + primaryAnnotationUniqueId + ")"); + + if (StringUtils.isBlank(dto.getObjectId())) { + apaResponse.addErrorMessage("objectId", ValidationConstants.REQUIRED_MESSAGE); + } else { + GenomicEntity inferredOrAssertedEntity = genomicEntityService.findByIdentifierString(dto.getObjectId()); + if (inferredOrAssertedEntity == null) { + apaResponse.addErrorMessage("objectId", ValidationConstants.INVALID_MESSAGE + " (" + dto.getObjectId() + ")"); + } else if (inferredOrAssertedEntity instanceof Gene) { + if (dataProvider.hasInferredGenePhenotypeAnnotations) { + primaryAnnotation.setInferredGene((Gene) inferredOrAssertedEntity); + } else if (dataProvider.hasAssertedGenePhenotypeAnnotations) { + List assertedGenes = primaryAnnotation.getAssertedGenes(); + if (assertedGenes == null) + assertedGenes = new ArrayList<>(); + assertedGenes.add((Gene) inferredOrAssertedEntity); + primaryAnnotation.setAssertedGenes(assertedGenes); + } else { + apaResponse.addErrorMessage("objectId", ValidationConstants.INVALID_MESSAGE + " (" + dto.getObjectId() + ")"); + } + } else if (inferredOrAssertedEntity instanceof Allele) { + if (dataProvider.hasInferredAllelePhenotypeAnnotations) { + primaryAnnotation.setInferredAllele((Allele) inferredOrAssertedEntity); + } else if (dataProvider.hasAssertedAllelePhenotypeAnnotations) { + primaryAnnotation.setAssertedAllele((Allele) inferredOrAssertedEntity); + } else { + apaResponse.addErrorMessage("objectId", ValidationConstants.INVALID_MESSAGE + " (" + dto.getObjectId() + ")"); + } + } else { + apaResponse.addErrorMessage("objectId", ValidationConstants.INVALID_MESSAGE + " (" + dto.getObjectId() + ")"); + } + } + + if (apaResponse.hasErrors()) + throw new ObjectValidationException(dto, apaResponse.errorMessagesString()); + + return primaryAnnotation; + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java new file mode 100644 index 000000000..ffc2fb1f4 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java @@ -0,0 +1,90 @@ +package org.alliancegenome.curation_api.services.validation.dto.fms; + +import java.util.ArrayList; +import java.util.List; + +import org.alliancegenome.curation_api.constants.ValidationConstants; +import org.alliancegenome.curation_api.constants.VocabularyConstants; +import org.alliancegenome.curation_api.dao.ConditionRelationDAO; +import org.alliancegenome.curation_api.dao.ExperimentalConditionDAO; +import org.alliancegenome.curation_api.enums.FmsConditionRelation; +import org.alliancegenome.curation_api.model.entities.ConditionRelation; +import org.alliancegenome.curation_api.model.entities.ExperimentalCondition; +import org.alliancegenome.curation_api.model.entities.VocabularyTerm; +import org.alliancegenome.curation_api.model.ingest.dto.fms.ConditionRelationFmsDTO; +import org.alliancegenome.curation_api.model.ingest.dto.fms.ExperimentalConditionFmsDTO; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.VocabularyTermService; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.validation.dto.base.BaseFmsDTOValidator; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; + +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; + +@RequestScoped +public class ConditionRelationFmsDTOValidator extends BaseFmsDTOValidator { + + @Inject + ConditionRelationDAO conditionRelationDAO; + @Inject + ExperimentalConditionDAO experimentalConditionDAO; + @Inject + VocabularyTermService vocabularyTermService; + @Inject + ExperimentalConditionFmsDTOValidator experimentalConditionFmsDtoValidator; + + public ObjectResponse validateConditionRelationFmsDTO (ConditionRelationFmsDTO dto) { + ObjectResponse crResponse = new ObjectResponse<>(); + + ConditionRelation relation; + FmsConditionRelation fmsConditionRelation = null; + + if (StringUtils.isBlank(dto.getConditionRelationType())) { + crResponse.addErrorMessage("conditionRelationType", ValidationConstants.REQUIRED_MESSAGE); + } else { + fmsConditionRelation = FmsConditionRelation.findByName(dto.getConditionRelationType()); + if (fmsConditionRelation == null) + crResponse.addErrorMessage("conditionRelationType", ValidationConstants.INVALID_MESSAGE + " (" + dto.getConditionRelationType() + ")"); + } + + String relationTypeString = fmsConditionRelation == null ? null : fmsConditionRelation.agrRelation; + String uniqueId = AnnotationUniqueIdHelper.getConditionRelationUniqueId(dto, relationTypeString); + SearchResponse searchResponseRel = conditionRelationDAO.findByField("uniqueId", uniqueId); + + if (searchResponseRel == null || searchResponseRel.getSingleResult() == null) { + relation = new ConditionRelation(); + relation.setUniqueId(uniqueId); + } else { + relation = searchResponseRel.getSingleResult(); + } + + if (relationTypeString != null) { + VocabularyTerm conditionRelationTypeTerm = vocabularyTermService.getTermInVocabulary(VocabularyConstants.CONDITION_RELATION_TYPE_VOCABULARY, relationTypeString).getEntity(); + if (conditionRelationTypeTerm == null) + crResponse.addErrorMessage("conditionRelationType", ValidationConstants.INVALID_MESSAGE + " (" + relationTypeString + ")"); + relation.setConditionRelationType(conditionRelationTypeTerm); + } + + List conditions = new ArrayList<>(); + if (CollectionUtils.isEmpty(dto.getConditions())) { + crResponse.addErrorMessage("conditions", ValidationConstants.REQUIRED_MESSAGE); + } else { + for (ExperimentalConditionFmsDTO conditionFmsDTO : dto.getConditions()) { + ObjectResponse ecResponse = experimentalConditionFmsDtoValidator.validateExperimentalConditionFmsDTO(conditionFmsDTO); + if (ecResponse.hasErrors()) { + crResponse.addErrorMessage("condition_dtos", ecResponse.errorMessagesString()); + } else { + conditions.add(experimentalConditionDAO.persist(ecResponse.getEntity())); + } + } + } + relation.setConditions(conditions); + + crResponse.setEntity(relation); + + return crResponse; + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ExperimentalConditionFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ExperimentalConditionFmsDTOValidator.java new file mode 100644 index 000000000..0f256c68d --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ExperimentalConditionFmsDTOValidator.java @@ -0,0 +1,132 @@ +package org.alliancegenome.curation_api.services.validation.dto.fms; + +import org.alliancegenome.curation_api.constants.OntologyConstants; +import org.alliancegenome.curation_api.constants.ValidationConstants; +import org.alliancegenome.curation_api.dao.ExperimentalConditionDAO; +import org.alliancegenome.curation_api.model.entities.ExperimentalCondition; +import org.alliancegenome.curation_api.model.entities.ontology.AnatomicalTerm; +import org.alliancegenome.curation_api.model.entities.ontology.ChemicalTerm; +import org.alliancegenome.curation_api.model.entities.ontology.ExperimentalConditionOntologyTerm; +import org.alliancegenome.curation_api.model.entities.ontology.GOTerm; +import org.alliancegenome.curation_api.model.entities.ontology.NCBITaxonTerm; +import org.alliancegenome.curation_api.model.entities.ontology.ZECOTerm; +import org.alliancegenome.curation_api.model.ingest.dto.fms.ExperimentalConditionFmsDTO; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.ExperimentalConditionSummary; +import org.alliancegenome.curation_api.services.ontology.AnatomicalTermService; +import org.alliancegenome.curation_api.services.ontology.ChemicalTermService; +import org.alliancegenome.curation_api.services.ontology.ExperimentalConditionOntologyTermService; +import org.alliancegenome.curation_api.services.ontology.GoTermService; +import org.alliancegenome.curation_api.services.ontology.NcbiTaxonTermService; +import org.alliancegenome.curation_api.services.ontology.ZecoTermService; +import org.alliancegenome.curation_api.services.validation.dto.base.BaseFmsDTOValidator; +import org.apache.commons.lang3.StringUtils; + +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; + +@RequestScoped + +public class ExperimentalConditionFmsDTOValidator extends BaseFmsDTOValidator { + + @Inject + ExperimentalConditionDAO experimentalConditionDAO; + @Inject + ZecoTermService zecoTermService; + @Inject + ChemicalTermService chemicalTermService; + @Inject + AnatomicalTermService anatomicalTermService; + @Inject + NcbiTaxonTermService ncbiTaxonTermService; + @Inject + GoTermService goTermService; + @Inject + ExperimentalConditionOntologyTermService experimentalConditionOntologyTermService; + + public ObjectResponse validateExperimentalConditionFmsDTO (ExperimentalConditionFmsDTO dto) { + ObjectResponse ecResponse = new ObjectResponse<>(); + + String uniqueId = AnnotationUniqueIdHelper.getExperimentalConditionUniqueId(dto); + + ExperimentalCondition experimentalCondition; + SearchResponse searchResponse = experimentalConditionDAO.findByField("uniqueId", uniqueId); + if (searchResponse == null || searchResponse.getSingleResult() == null) { + experimentalCondition = new ExperimentalCondition(); + experimentalCondition.setUniqueId(uniqueId); + } else { + experimentalCondition = searchResponse.getSingleResult(); + } + + ChemicalTerm conditionChemical = null; + if (StringUtils.isNotBlank(dto.getChemicalOntologyId())) { + conditionChemical = chemicalTermService.findByCurieOrSecondaryId(dto.getChemicalOntologyId()); + if (conditionChemical == null) + ecResponse.addErrorMessage("chemicalOntologyId", ValidationConstants.INVALID_MESSAGE + " (" + dto.getChemicalOntologyId() + ")"); + } + experimentalCondition.setConditionChemical(conditionChemical); + + ExperimentalConditionOntologyTerm conditionId = null; + if (StringUtils.isNotBlank(dto.getConditionId())) { + conditionId = experimentalConditionOntologyTermService.findByCurieOrSecondaryId(dto.getConditionId()); + if (conditionId == null) + ecResponse.addErrorMessage("conditionId", ValidationConstants.INVALID_MESSAGE + " (" + dto.getConditionId() + ")"); + } + experimentalCondition.setConditionId(conditionId); + + if (StringUtils.isNotBlank(dto.getConditionClassId())) { + ZECOTerm term = zecoTermService.findByCurieOrSecondaryId(dto.getConditionClassId()); + if (term == null || term.getSubsets().isEmpty() || !term.getSubsets().contains(OntologyConstants.ZECO_AGR_SLIM_SUBSET)) + ecResponse.addErrorMessage("conditionClassId", ValidationConstants.INVALID_MESSAGE + " (" + dto.getConditionClassId() + ")"); + experimentalCondition.setConditionClass(term); + } else { + ecResponse.addErrorMessage("conditionClassId", ValidationConstants.REQUIRED_MESSAGE); + } + + AnatomicalTerm conditionAnatomy = null; + if (StringUtils.isNotBlank(dto.getAnatomicalOntologyId())) { + conditionAnatomy = anatomicalTermService.findByCurieOrSecondaryId(dto.getAnatomicalOntologyId()); + if (conditionAnatomy == null) + ecResponse.addErrorMessage("anatomicalOntologyId", ValidationConstants.INVALID_MESSAGE + " (" + dto.getAnatomicalOntologyId() + ")"); + } + experimentalCondition.setConditionAnatomy(conditionAnatomy); + + NCBITaxonTerm conditionTaxon = null; + if (StringUtils.isNotBlank(dto.getNcbiTaxonId())) { + conditionTaxon = ncbiTaxonTermService.getTaxonFromDB(dto.getNcbiTaxonId()); + if (conditionTaxon == null) + ecResponse.addErrorMessage("NCBITaxonID", ValidationConstants.INVALID_MESSAGE + " (" + dto.getNcbiTaxonId() + ")"); + } + experimentalCondition.setConditionTaxon(conditionTaxon); + + GOTerm conditionGeneOntology = null; + if (StringUtils.isNotBlank(dto.getGeneOntologyId())) { + conditionGeneOntology = goTermService.findByCurieOrSecondaryId(dto.getGeneOntologyId()); + if (conditionGeneOntology == null) + ecResponse.addErrorMessage("geneOntologyId", ValidationConstants.INVALID_MESSAGE + " (" + dto.getGeneOntologyId() + ")"); + } + experimentalCondition.setConditionGeneOntology(conditionGeneOntology); + + String conditionQuantity = null; + if (StringUtils.isNotBlank(dto.getConditionQuantity())) + conditionQuantity = dto.getConditionQuantity(); + experimentalCondition.setConditionQuantity(conditionQuantity); + + String conditionFreeText = null; + if (StringUtils.isNotBlank(dto.getConditionStatement())) + conditionFreeText = dto.getConditionStatement(); + experimentalCondition.setConditionFreeText(conditionFreeText); + + if (StringUtils.isNotBlank(dto.getConditionStatement())) { + experimentalCondition.setConditionSummary(dto.getConditionStatement()); + } else { + ecResponse.addErrorMessage("conditionStatement", ValidationConstants.REQUIRED_MESSAGE); + } + + ecResponse.setEntity(experimentalCondition); + + return ecResponse; + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java index b49600c5a..643e48323 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java @@ -20,7 +20,7 @@ import org.alliancegenome.curation_api.services.GeneService; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.ontology.NcbiTaxonTermService; -import org.alliancegenome.curation_api.services.validation.dto.base.BaseDTOValidator; +import org.alliancegenome.curation_api.services.validation.dto.base.BaseFmsDTOValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -29,7 +29,7 @@ import jakarta.transaction.Transactional; @RequestScoped -public class OrthologyFmsDTOValidator extends BaseDTOValidator { +public class OrthologyFmsDTOValidator extends BaseFmsDTOValidator { @Inject GeneToGeneOrthologyGeneratedDAO generatedOrthologyDAO; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/PhenotypeAnnotationFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/PhenotypeAnnotationFmsDTOValidator.java new file mode 100644 index 000000000..3317c8f48 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/PhenotypeAnnotationFmsDTOValidator.java @@ -0,0 +1,120 @@ +package org.alliancegenome.curation_api.services.validation.dto.fms; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeParseException; +import java.util.ArrayList; +import java.util.List; + +import org.alliancegenome.curation_api.constants.ValidationConstants; +import org.alliancegenome.curation_api.dao.ConditionRelationDAO; +import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; +import org.alliancegenome.curation_api.model.entities.ConditionRelation; +import org.alliancegenome.curation_api.model.entities.DataProvider; +import org.alliancegenome.curation_api.model.entities.PhenotypeAnnotation; +import org.alliancegenome.curation_api.model.entities.Reference; +import org.alliancegenome.curation_api.model.entities.ontology.PhenotypeTerm; +import org.alliancegenome.curation_api.model.ingest.dto.fms.ConditionRelationFmsDTO; +import org.alliancegenome.curation_api.model.ingest.dto.fms.PhenotypeFmsDTO; +import org.alliancegenome.curation_api.model.ingest.dto.fms.PhenotypeTermIdentifierFmsDTO; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.services.ReferenceService; +import org.alliancegenome.curation_api.services.ontology.PhenotypeTermService; +import org.alliancegenome.curation_api.services.validation.dto.base.BaseFmsDTOValidator; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; + +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; + +@RequestScoped +public class PhenotypeAnnotationFmsDTOValidator extends BaseFmsDTOValidator { + + @Inject + ReferenceService referenceService; + @Inject + PhenotypeTermService phenotypeTermService; + @Inject + ConditionRelationFmsDTOValidator conditionRelationFmsDtoValidator; + @Inject + ConditionRelationDAO conditionRelationDAO; + + public ObjectResponse validatePhenotypeAnnotation(E annotation, PhenotypeFmsDTO dto, BackendBulkDataProvider beDataProvider) { + + ObjectResponse paResponse = new ObjectResponse(); + + if (StringUtils.isBlank(dto.getPhenotypeStatement())) { + paResponse.addErrorMessage("phenotypeStatement", ValidationConstants.REQUIRED_MESSAGE); + } + annotation.setPhenotypeAnnotationObject(dto.getPhenotypeStatement()); + + if (CollectionUtils.isNotEmpty(dto.getPhenotypeTermIdentifiers())) { + List phenotypeTerms = new ArrayList<>(); + for (PhenotypeTermIdentifierFmsDTO phenotypeTermIdentifier : dto.getPhenotypeTermIdentifiers()) { + if (StringUtils.isNotBlank(phenotypeTermIdentifier.getTermId())) { + PhenotypeTerm phenotypeTerm = phenotypeTermService.findByCurieOrSecondaryId(phenotypeTermIdentifier.getTermId()); + if (phenotypeTerm == null) { + paResponse.addErrorMessage("phenotypeTermIdentifiers", ValidationConstants.INVALID_MESSAGE + " (" + phenotypeTermIdentifier.getTermId() + ")"); + } + } + } + annotation.setPhenotypeTerms(phenotypeTerms); + } else { + annotation.setPhenotypeTerms(null); + } + + if (CollectionUtils.isNotEmpty(dto.getConditionRelations())) { + List relations = new ArrayList<>(); + for (ConditionRelationFmsDTO conditionRelationFmsDTO : dto.getConditionRelations()) { + ObjectResponse crResponse = conditionRelationFmsDtoValidator.validateConditionRelationFmsDTO(conditionRelationFmsDTO); + if (crResponse.hasErrors()) { + paResponse.addErrorMessage("conditionRelations", crResponse.errorMessagesString()); + } else { + relations.add(conditionRelationDAO.persist(crResponse.getEntity())); + } + } + annotation.setConditionRelations(relations); + } else { + annotation.setConditionRelations(null); + } + + DataProvider dataProvider = constructDataProvider(beDataProvider); + annotation.setDataProvider(dataProvider); + + OffsetDateTime creationDate = null; + if (StringUtils.isNotBlank(dto.getDateAssigned())) { + try { + creationDate = OffsetDateTime.parse(dto.getDateAssigned()); + } catch (DateTimeParseException e) { + paResponse.addErrorMessage("dateAssigned", ValidationConstants.INVALID_MESSAGE + " (" + dto.getDateAssigned() + ")"); + } + } + annotation.setDateCreated(creationDate); + + paResponse.setEntity(annotation); + + return paResponse; + + } + + public ObjectResponse validateReference(PhenotypeFmsDTO dto) { + ObjectResponse refResponse = new ObjectResponse<>(); + Reference reference = null; + + if (ObjectUtils.isEmpty(dto.getEvidence())) { + refResponse.addErrorMessage("evidence", ValidationConstants.REQUIRED_MESSAGE); + } else { + if (StringUtils.isBlank(dto.getEvidence().getPublicationId())) { + refResponse.addErrorMessage("evidence - publicationId", ValidationConstants.REQUIRED_MESSAGE); + } else { + reference = referenceService.retrieveFromDbOrLiteratureService(dto.getEvidence().getPublicationId()); + if (reference == null) + refResponse.addErrorMessage("evidence - publicationId", ValidationConstants.INVALID_MESSAGE); + } + } + + refResponse.setEntity(reference); + return refResponse; + } + +} diff --git a/src/main/java/org/alliancegenome/curation_api/view/View.java b/src/main/java/org/alliancegenome/curation_api/view/View.java index a2c23e553..ea9a63fbc 100644 --- a/src/main/java/org/alliancegenome/curation_api/view/View.java +++ b/src/main/java/org/alliancegenome/curation_api/view/View.java @@ -54,6 +54,15 @@ public static class DiseaseAnnotationUpdate extends DiseaseAnnotation { public static class DiseaseAnnotationCreate extends DiseaseAnnotation { } + + public static class PhenotypeAnnotationView extends FieldsOnly { + } + + public static class PhenotypeAnnotationUpdate extends PhenotypeAnnotationView { + } + + public static class PhenotypeAnnotationCreate extends PhenotypeAnnotationView { + } public static class AlleleView extends FieldsOnly { } diff --git a/src/main/resources/db/migration/v0.31.0.3__agm_phenotype_annotation.sql b/src/main/resources/db/migration/v0.31.0.3__agm_phenotype_annotation.sql new file mode 100644 index 000000000..cadec15c2 --- /dev/null +++ b/src/main/resources/db/migration/v0.31.0.3__agm_phenotype_annotation.sql @@ -0,0 +1,7 @@ +-- Create phenotypeannotation tables and indexes + +-- Create agmphenotypeannotation tables and indexes + +-- Add relation vocabulary with 'has_phenotype' term + +-- Create bulk load \ No newline at end of file From 9eabdcf54692cd279995f9df085f6031c739d6a7 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Thu, 29 Feb 2024 22:38:47 -0600 Subject: [PATCH 127/159] SCRUM-3249 Fixed unecessary expansion glyphs in ontology terms tree view --- .../cliapp/src/components/GenericDataTree.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/cliapp/src/components/GenericDataTree.js b/src/main/cliapp/src/components/GenericDataTree.js index bfa025bcd..cae9f5cd8 100644 --- a/src/main/cliapp/src/components/GenericDataTree.js +++ b/src/main/cliapp/src/components/GenericDataTree.js @@ -12,7 +12,6 @@ export const GenericDataTree = (props) => { const [selectedTerm, setSelectedTerm] = useState(); const findNodeToModify = (nodes, id) => { - for(var node of nodes) { if(node.children) { var found = findNodeToModify(node.children, id); @@ -32,7 +31,6 @@ export const GenericDataTree = (props) => { setLoading(true); const ontologyService = new OntologyService(props.endpoint); - let _nodes = [...nodes]; var modifyNode = findNodeToModify(_nodes, event.node.curie); @@ -43,7 +41,12 @@ export const GenericDataTree = (props) => { for(var node of res.data.entities) { node.key = node.curie; node.label = node.name + " (" + node.curie + ")"; - node.leaf = false; + if(node?.childCount && node.childCount > 0) { + node.leaf = false; + } + else{ + node.leaf = true; + } modifyNode.children.push(node); } modifyNode.children.sort((a, b) => (a.label.toLowerCase() > b.label.toLowerCase()) ? 1 : -1); @@ -79,7 +82,12 @@ export const GenericDataTree = (props) => { for(var node of res.data.entities) { node.key = node.curie; node.label = node.name + " (" + node.curie + ")"; - node.leaf = false; + if(node?.childCount && node.childCount > 0) { + node.leaf = false; + } + else{ + node.leaf = true; + } if(node.obsolete === true) { obsoleteNode.children.push(node); } else { From 046adb01ce1cf4d9ed7d6530242d29b664a0503f Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Fri, 1 Mar 2024 13:04:24 -0500 Subject: [PATCH 128/159] Added code to remove exceptions every Saturday from history that is three loads or older ago --- .../curation_api/jobs/JobScheduler.java | 120 ++++++++++++------ 1 file changed, 80 insertions(+), 40 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/JobScheduler.java b/src/main/java/org/alliancegenome/curation_api/jobs/JobScheduler.java index 08f2d5469..1a2da163a 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/JobScheduler.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/JobScheduler.java @@ -2,9 +2,12 @@ import java.io.File; import java.time.ZonedDateTime; +import java.util.Collections; +import java.util.Comparator; import org.alliancegenome.curation_api.dao.loads.BulkLoadDAO; import org.alliancegenome.curation_api.dao.loads.BulkLoadFileDAO; +import org.alliancegenome.curation_api.dao.loads.BulkLoadFileExceptionDAO; import org.alliancegenome.curation_api.dao.loads.BulkLoadGroupDAO; import org.alliancegenome.curation_api.enums.JobStatus; import org.alliancegenome.curation_api.jobs.events.PendingBulkLoadFileJobEvent; @@ -14,9 +17,12 @@ import org.alliancegenome.curation_api.jobs.util.SlackNotifier; import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoad; import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFile; +import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFileException; +import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFileHistory; import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadGroup; import org.alliancegenome.curation_api.model.entities.bulkloads.BulkScheduledLoad; import org.alliancegenome.curation_api.response.SearchResponse; +import org.alliancegenome.curation_api.util.ProcessDisplayHelper; import org.eclipse.microprofile.config.inject.ConfigProperty; import com.cronutils.model.Cron; @@ -37,48 +43,41 @@ @ApplicationScoped public class JobScheduler { - //@Inject - //EventBus bus; - - @Inject - Event pendingJobEvents; - - @Inject - Event startedJobEvents; - - @Inject - Event startedFileJobEvents; - - @Inject - BulkLoadFileDAO bulkLoadFileDAO; - @Inject - BulkLoadGroupDAO groupDAO; - @Inject - BulkLoadDAO bulkLoadDAO; - @Inject - SlackNotifier slackNotifier; - - @ConfigProperty(name = "bulk.data.loads.schedulingEnabled") - Boolean loadSchedulingEnabled; - - @ConfigProperty(name = "reindex.schedulingEnabled", defaultValue = "false") - Boolean reindexSchedulingEnabled; + // @Inject + // EventBus bus; + + @Inject Event pendingJobEvents; + + @Inject Event startedJobEvents; + + @Inject Event startedFileJobEvents; + + @Inject BulkLoadFileDAO bulkLoadFileDAO; + @Inject BulkLoadGroupDAO groupDAO; + @Inject BulkLoadDAO bulkLoadDAO; + @Inject BulkLoadFileExceptionDAO bulkLoadFileExceptionDAO; + @Inject SlackNotifier slackNotifier; + + @ConfigProperty(name = "bulk.data.loads.schedulingEnabled") Boolean loadSchedulingEnabled; + + @ConfigProperty(name = "reindex.schedulingEnabled", defaultValue = "false") Boolean reindexSchedulingEnabled; private ZonedDateTime lastCheck = null; @PostConstruct public void init() { // Set any running jobs to failed as the server has restarted - //Log.info("Init: "); + // Log.info("Init: "); SearchResponse groups = groupDAO.findAll(); for (BulkLoadGroup g : groups.getResults()) { if (g.getLoads().size() > 0) { for (BulkLoad b : g.getLoads()) { for (BulkLoadFile bf : b.getLoadFiles()) { if (bf.getBulkloadStatus() == null || bf.getBulkloadStatus().isRunning() || bf.getBulkloadStatus().isStarted() || bf.getLocalFilePath() != null) { - if(bf.getLocalFilePath() != null) { + if (bf.getLocalFilePath() != null) { File file = new File(bf.getLocalFilePath()); - if(file.exists()) file.delete(); + if (file.exists()) + file.delete(); } bf.setLocalFilePath(null); bf.setErrorMessage("Failed due to server start up: Process never finished before the server restarted"); @@ -150,41 +149,82 @@ public void scheduleCronGroupJobs() { } public void pendingJobs(@Observes PendingBulkLoadJobEvent event) { - //Log.info("pendingJobs: " + event.getId()); + // Log.info("pendingJobs: " + event.getId()); BulkLoad load = bulkLoadDAO.find(event.getId()); - if(load != null) { + if (load != null) { if (load.getBulkloadStatus().isPending()) { load.setBulkloadStatus(load.getBulkloadStatus().getNextStatus()); bulkLoadDAO.merge(load); - //Log.info("Firing Start Event: " + load.getId()); + // Log.info("Firing Start Event: " + load.getId()); startedJobEvents.fire(new StartedBulkLoadJobEvent(load.getId())); } } } + public void pendingFileJobs(@Observes PendingBulkLoadFileJobEvent event) { - //Log.info("pendingFileJobs: " + event.getId()); + // Log.info("pendingFileJobs: " + event.getId()); BulkLoadFile fileLoad = bulkLoadFileDAO.find(event.getId()); - if(fileLoad != null) { + if (fileLoad != null) { if (fileLoad.getBulkloadStatus().isPending()) { fileLoad.setBulkloadStatus(fileLoad.getBulkloadStatus().getNextStatus()); bulkLoadFileDAO.merge(fileLoad); - //Log.info("Firing Start Event: " + fileLoad.getId()); + // Log.info("Firing Start Event: " + fileLoad.getId()); startedFileJobEvents.fire(new StartedBulkLoadFileJobEvent(fileLoad.getId())); } } } - - @Scheduled(cron = "0 0 0 ? * SUN") + + @Scheduled(cron = "0 0 0 ? * SAT") + public void cleanUpFileExceptions() { + SearchResponse groups = groupDAO.findAll(); + + Comparator c = new Comparator() { + public int compare(BulkLoadFile blf1, BulkLoadFile blf2) { + if (blf1.getDateLastLoaded() == null && blf2.getDateLastLoaded() == null) { return 0; } + if (blf1.getDateLastLoaded() == null) { return 1; } + if (blf2.getDateLastLoaded() == null) { return -1; } + return blf2.getDateLastLoaded().compareTo(blf1.getDateLastLoaded()); + } + }; + + int historyExceptionsToKeep = 3; + + ProcessDisplayHelper ph = new ProcessDisplayHelper(); + ph.startProcess("Bulk Load File History Exception Cleanup"); + + for (BulkLoadGroup g : groups.getResults()) { + Log.debug("Group Clean Up: " + g.getName()); + if (g.getLoads().size() > 0) { + for (BulkLoad b : g.getLoads()) { + Log.debug("Load Clean Up: " + b.getName()); + Collections.sort(b.getLoadFiles(), c); + if (b.getLoadFiles().size() > historyExceptionsToKeep) { + for (int i = historyExceptionsToKeep; i < b.getLoadFiles().size(); i++) { + Log.debug("File Clean Up: " + b.getLoadFiles().get(i).getDateLastLoaded()); + for(BulkLoadFileHistory h: b.getLoadFiles().get(i).getHistory()) { + for(BulkLoadFileException e: h.getExceptions()) { + bulkLoadFileExceptionDAO.remove(e.getId()); + ph.progressProcess(); + } + } + } + } + } + } + } + ph.finishProcess(); + } + + @Scheduled(cron = "0 0 0 ? * SAT") public void runMassIndexerEverything() { // Not sure what is going to happen when this time's out but should run anyway // Defaults taken from the API endpoint // DAO used doesn't matter they all have this method - if(reindexSchedulingEnabled){ + if (reindexSchedulingEnabled) { Log.info("Scheduled mass reindexing initiated."); bulkLoadDAO.reindexEverything(1000, 10000, 0, 4, 7200, 1); - } - else{ + } else { Log.info("Scheduled mass reindexing not initiated (reindex scheduling not enabled)."); } } From 4ce1b1d03e140c95d51b5f55b5d0b311231186ba Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 1 Mar 2024 22:16:56 +0000 Subject: [PATCH 129/159] Add read-only UI table --- .../ConditionRelationsDialog.js | 22 +- src/main/cliapp/src/constants/FilterFields.js | 21 ++ src/main/cliapp/src/constants/SortFields.js | 2 + .../DiseaseAnnotationsTable.js | 2 +- .../src/containers/layout/SiteLayout.js | 1 + .../PhenotypeAnnotationsPage.js | 8 + .../PhenotypeAnnotationsTable.js | 212 ++++++++++++++++++ .../phenotypeAnnotationsPage/index.js | 3 + .../useNewAnnotationReducer.js | 176 +++++++++++++++ src/main/cliapp/src/routes.js | 2 + .../cliapp/src/service/DataLoadService.js | 2 +- .../constants/VocabularyConstants.java | 2 + .../PhenotypeAnnotationCrudController.java | 1 + .../enums/BackendBulkLoadType.java | 2 +- .../AGMPhenotypeAnnotationCrudInterface.java | 47 ++++ .../PhenotypeAnnotationCrudInterface.java | 38 +++- .../BulkLoadFileHistoryCrudInterface.java | 19 +- .../jobs/executors/BulkLoadJobExecutor.java | 2 +- .../PhenotypeAnnotationExecutor.java | 6 +- .../entities/GenePhenotypeAnnotation.java | 3 +- .../model/entities/PhenotypeAnnotation.java | 11 +- .../AGMPhenotypeAnnotationService.java | 8 +- .../services/PhenotypeAnnotationService.java | 1 - .../dto/base/BaseFmsDTOValidator.java | 37 --- .../fms/ConditionRelationFmsDTOValidator.java | 3 +- .../ExperimentalConditionFmsDTOValidator.java | 4 +- .../dto/fms/OrthologyFmsDTOValidator.java | 3 +- .../PhenotypeAnnotationFmsDTOValidator.java | 14 +- .../v0.31.0.3__agm_phenotype_annotation.sql | 7 - .../v0.31.0.4__agm_phenotype_annotation.sql | 128 +++++++++++ 30 files changed, 677 insertions(+), 110 deletions(-) rename src/main/cliapp/src/{containers/diseaseAnnotationsPage => components}/ConditionRelationsDialog.js (93%) create mode 100644 src/main/cliapp/src/containers/phenotypeAnnotationsPage/PhenotypeAnnotationsPage.js create mode 100644 src/main/cliapp/src/containers/phenotypeAnnotationsPage/PhenotypeAnnotationsTable.js create mode 100644 src/main/cliapp/src/containers/phenotypeAnnotationsPage/index.js create mode 100644 src/main/cliapp/src/containers/phenotypeAnnotationsPage/useNewAnnotationReducer.js create mode 100644 src/main/java/org/alliancegenome/curation_api/interfaces/crud/AGMPhenotypeAnnotationCrudInterface.java delete mode 100644 src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseFmsDTOValidator.java delete mode 100644 src/main/resources/db/migration/v0.31.0.3__agm_phenotype_annotation.sql create mode 100644 src/main/resources/db/migration/v0.31.0.4__agm_phenotype_annotation.sql diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/ConditionRelationsDialog.js b/src/main/cliapp/src/components/ConditionRelationsDialog.js similarity index 93% rename from src/main/cliapp/src/containers/diseaseAnnotationsPage/ConditionRelationsDialog.js rename to src/main/cliapp/src/components/ConditionRelationsDialog.js index e2e218565..452bcfceb 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/ConditionRelationsDialog.js +++ b/src/main/cliapp/src/components/ConditionRelationsDialog.js @@ -5,18 +5,18 @@ import { Column } from 'primereact/column'; import { Button } from 'primereact/button'; import { ColumnGroup } from 'primereact/columngroup'; import { Row } from 'primereact/row'; -import { EllipsisTableCell } from '../../components/EllipsisTableCell'; -import { ListTableCell } from '../../components/ListTableCell'; +import { EllipsisTableCell } from './EllipsisTableCell'; +import { ListTableCell } from './ListTableCell'; import { Toast } from 'primereact/toast'; -import { useControlledVocabularyService } from '../../service/useControlledVocabularyService'; -import { ValidationService } from '../../service/ValidationService'; -import { DialogErrorMessageComponent } from '../../components/Error/DialogErrorMessageComponent'; -import { TrueFalseDropdown } from '../../components/TrueFalseDropDownSelector'; -import { ControlledVocabularyDropdown } from '../../components/ControlledVocabularySelector'; -import { ExConAutocompleteTemplate } from '../../components/Autocomplete/ExConAutocompleteTemplate'; -import { SearchService } from '../../service/SearchService'; -import {autocompleteSearch, buildAutocompleteFilter, multipleAutocompleteOnChange} from "../../utils/utils"; -import {AutocompleteMultiEditor} from "../../components/Autocomplete/AutocompleteMultiEditor"; +import { useControlledVocabularyService } from '../service/useControlledVocabularyService'; +import { ValidationService } from '../service/ValidationService'; +import { DialogErrorMessageComponent } from './Error/DialogErrorMessageComponent'; +import { TrueFalseDropdown } from './TrueFalseDropDownSelector'; +import { ControlledVocabularyDropdown } from './ControlledVocabularySelector'; +import { ExConAutocompleteTemplate } from './Autocomplete/ExConAutocompleteTemplate'; +import { SearchService } from '../service/SearchService'; +import {autocompleteSearch, buildAutocompleteFilter, multipleAutocompleteOnChange} from "../utils/utils"; +import {AutocompleteMultiEditor} from "./Autocomplete/AutocompleteMultiEditor"; export const ConditionRelationsDialog = ({ originalConditionRelationsData, setOriginalConditionRelationsData, diff --git a/src/main/cliapp/src/constants/FilterFields.js b/src/main/cliapp/src/constants/FilterFields.js index ccb21d977..56032443e 100644 --- a/src/main/cliapp/src/constants/FilterFields.js +++ b/src/main/cliapp/src/constants/FilterFields.js @@ -336,6 +336,22 @@ export const FIELD_SETS = Object.freeze({ filterName: "pageDescriptionFilter", fields: ["pageDescription"], }, + paAggregationFieldSet: { + filterName: "paAggregationFilter", + fields: ['relation.name', 'dataProvider.sourceOrganization.abbreviation'], + }, + paConditionRelationsSummaryFieldSet: { + filterName: "paConditionRelationsFilter", + fields: ["conditionRelations.conditions.conditionSummary", "conditionRelations.conditionRelationType.name"], + }, + phenotypeAnnotationObjectFieldSet: { + filterName: "phenotypeAnnotationObjectFilter", + fields: ["phenotypeAnnotationObject"], + }, + phenotypeAnnotationSubjectFieldSet: { + filterName: "phenotypeAnnotationSubjectFilter", + fields: ["phenotypeAnnotationSubject.symbol", "phenotypeAnnotationSubject.name", "phenotypeAnnotationSubject.curie", "phenotypeAnnotationSubject.modEntityId", "phenotypeAnnotationSubject.modInternalId"], + }, prefixFieldSet: { filterName: "prefixFilter", fields: ["prefix"], @@ -537,9 +553,12 @@ export const FILTER_CONFIGS = Object.freeze({ modinternalidFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.modinternalidFieldSet] }, nameFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.nameFieldSet] }, namespaceFilterConfig: { filterComponentType: 'input', fieldSets: [FIELD_SETS.namespaceFieldSet] }, + phenotypeAnnotationSubjectFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.phenotypeAnnotationSubjectFieldSet] }, + phenotypeAnnotationObjectFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.phenotypeAnnotationObjectFieldSet] }, diseaseAnnotationSubjectFieldConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.diseaseAnnotationSubjectFieldSet] }, diseaseAnnotationObjectFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.diseaseAnnotationObjectFieldSet] }, ontologySynonymsFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.ontologySynonymsFieldSet] }, + paConditionRelationsSummaryFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.paConditionRelationsSummaryFieldSet] }, pageDescriptionFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.pageDescriptionFieldSet] }, prefixFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.prefixFieldSet]}, referencesFilterConfig: { filterComponentType: "input", fieldSets: [FIELD_SETS.referencesFieldSet] }, @@ -579,12 +598,14 @@ export const FILTER_CONFIGS = Object.freeze({ annotationTypeFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.annotationTypeFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, diseaseDataProviderFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.dataProviderFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, + phenotypeDataProviderFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.dataProviderFieldSet], aggregationFieldSet: FIELD_SETS.paAggregationFieldSet, useKeywordFields: true }, alleleDataProviderFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.dataProviderFieldSet], aggregationFieldSet: FIELD_SETS.alleleAggregationFieldSet, useKeywordFields: true }, constructDataProviderFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.dataProviderFieldSet], aggregationFieldSet: FIELD_SETS.constructAggregationFieldSet, useKeywordFields: true }, geneDataProviderFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.dataProviderFieldSet], aggregationFieldSet: FIELD_SETS.geneAggregationFieldSet, useKeywordFields: true }, agmDataProviderFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.dataProviderFieldSet], aggregationFieldSet: FIELD_SETS.agmAggregationFieldSet, useKeywordFields: true }, diseaseQualifiersFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.diseaseQualifiersFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, relationFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.relationFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, + paRelationFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.relationFieldSet], aggregationFieldSet: FIELD_SETS.paAggregationFieldSet, useKeywordFields: true }, geneticModifierRelationFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.geneticModifierRelationFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, geneticSexFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.geneticSexFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, secondaryDataProviderFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.secondaryDataProviderFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, diff --git a/src/main/cliapp/src/constants/SortFields.js b/src/main/cliapp/src/constants/SortFields.js index fbece06ce..d782ffa10 100644 --- a/src/main/cliapp/src/constants/SortFields.js +++ b/src/main/cliapp/src/constants/SortFields.js @@ -3,6 +3,8 @@ export const SORT_FIELDS = Object.freeze([ "modEntityId", "modInternalId", "diseaseAnnotationSubject.symbol", + "phenotypeAnnotationSubject.symbol", + "phenotypeAnnotationObject", "relation.name", "negated", "diseaseAnnotationObject.name", diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 7626be0b5..7a49b220b 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -12,7 +12,7 @@ import { GenericDataTable } from '../../components/GenericDataTable/GenericDataT import { SearchService } from '../../service/SearchService'; import { DiseaseAnnotationService } from '../../service/DiseaseAnnotationService'; import { RelatedNotesDialog } from '../../components/RelatedNotesDialog'; -import { ConditionRelationsDialog } from './ConditionRelationsDialog'; +import { ConditionRelationsDialog } from '../../components/ConditionRelationsDialog'; import { EvidenceCodesTemplate } from '../../components/Templates/EvidenceCodesTemplate'; import { SingleReferenceTemplate } from '../../components/Templates/SingleReferenceTemplate'; diff --git a/src/main/cliapp/src/containers/layout/SiteLayout.js b/src/main/cliapp/src/containers/layout/SiteLayout.js index bc7107540..c9ebd27cf 100644 --- a/src/main/cliapp/src/containers/layout/SiteLayout.js +++ b/src/main/cliapp/src/containers/layout/SiteLayout.js @@ -222,6 +222,7 @@ export const SiteLayout = (props) => { { label: 'Alleles', icon: 'pi pi-fw pi-home', to: '/alleles' }, { label: 'Constructs', icon: 'pi pi-fw pi-home', to: '/constructs' }, { label: 'Disease Annotations', icon: 'pi pi-fw pi-home', to: '/diseaseAnnotations' }, + { label: 'Phenotype Annotations', icon: 'pi pi-fw pi-home', to: '/phenotypeAnnotations' }, { label: 'Experimental Conditions', icon: 'pi pi-fw pi-home', to: '/experimentalConditions' }, { label: 'Experiments', icon: 'pi pi-fw pi-home', to: '/conditionRelations' }, { label: 'Genes', icon: 'pi pi-fw pi-home', to: '/genes' }, diff --git a/src/main/cliapp/src/containers/phenotypeAnnotationsPage/PhenotypeAnnotationsPage.js b/src/main/cliapp/src/containers/phenotypeAnnotationsPage/PhenotypeAnnotationsPage.js new file mode 100644 index 000000000..9efc81fb3 --- /dev/null +++ b/src/main/cliapp/src/containers/phenotypeAnnotationsPage/PhenotypeAnnotationsPage.js @@ -0,0 +1,8 @@ +import React from 'react'; +import { PhenotypeAnnotationsTable } from './PhenotypeAnnotationsTable'; + +export function PhenotypeAnnotationsPage() { + return ( + + ); +} diff --git a/src/main/cliapp/src/containers/phenotypeAnnotationsPage/PhenotypeAnnotationsTable.js b/src/main/cliapp/src/containers/phenotypeAnnotationsPage/PhenotypeAnnotationsTable.js new file mode 100644 index 000000000..39c954d03 --- /dev/null +++ b/src/main/cliapp/src/containers/phenotypeAnnotationsPage/PhenotypeAnnotationsTable.js @@ -0,0 +1,212 @@ +import React, { useRef, useState } from 'react'; + +import { GenericDataTable } from '../../components/GenericDataTable/GenericDataTable'; +import { ConditionRelationsDialog } from '../../components/ConditionRelationsDialog'; +import { SingleReferenceTemplate } from '../../components/Templates/SingleReferenceTemplate'; +import { IdTemplate } from '../../components/Templates/IdTemplate'; +import { GenomicEntityTemplate } from '../../components/Templates/genomicEntity/GenomicEntityTemplate'; +import { GenomicEntityListTemplate } from '../../components/Templates/genomicEntity/GenomicEntityListTemplate'; +import { BooleanTemplate } from '../../components/Templates/BooleanTemplate'; +import { Button } from 'primereact/button'; +import { getDefaultTableState } from '../../service/TableStateService'; +import { FILTER_CONFIGS } from '../../constants/FilterFields'; + +export const PhenotypeAnnotationsTable = () => { + + const [isInEditMode, setIsInEditMode] = useState(false); //needs better name + const [conditionRelationsData, setConditionRelationsData] = useState({ + conditionRelations: [], + isInEdit: false, + dialog: false, + rowIndex: null, + mailRowProps: {}, + }); + const [errorMessages, setErrorMessages] = useState({}); + const errorMessagesRef = useRef(); + errorMessagesRef.current = errorMessages; + + const [uiErrorMessages, setUiErrorMessages] = useState([]); + const uiErrorMessagesRef = useRef(); + uiErrorMessagesRef.current = uiErrorMessages; + + const toast_topleft = useRef(null); + const toast_topright = useRef(null); + + const sortMapping = { + 'phenotypeAnnotationObject.name': ['phenotypeAnnotationObject.curie', 'phenotypeAnnotationObject.namespace'], + 'phenotypeAnnotationSubject.symbol': ['phenotypeAnnotationSubject.name', 'phenotypeAnnotationSubject.modEntityId'], + 'sgdStrainBackground.name': ['sgdStrainBackground.modEntityId'], + }; + + const handleConditionRelationsOpen = (event, rowData, isInEdit) => { + let _conditionRelationsData = {}; + _conditionRelationsData["originalConditionRelations"] = rowData.conditionRelations; + _conditionRelationsData["dialog"] = true; + _conditionRelationsData["isInEdit"] = isInEdit; + setConditionRelationsData(() => ({ + ..._conditionRelationsData + })); + }; + + const conditionRelationsTemplate = (rowData) => { + if (rowData?.conditionRelations && !rowData.conditionRelations[0]?.handle) { + return ( + + ) + } + }; + + + const columns = [{ + field: "uniqueId", + header: "Unique ID", + body: (rowData) => , + sortable: true, + filterConfig: FILTER_CONFIGS.uniqueidFilterConfig + }, + { + field: "phenotypeAnnotationSubject.symbol", + header: "Subject", + body: (rowData) => , + sortable: true, + filterConfig: FILTER_CONFIGS.phenotypeAnnotationSubjectFilterConfig + }, + { + field: "relation.name", + header: "Phenotype Relation", + sortable: true, + filterConfig: FILTER_CONFIGS.paRelationFilterConfig + }, + { + field: "phenotypeAnnotationObject", + header: "Phenotype", + body: (rowData) => , + sortable: true, + filterConfig: FILTER_CONFIGS.phenotypeAnnotationObjectFilterConfig + }, + { + field: "singleReference.primaryCrossReferenceCurie", + header: "Reference", + body: (rowData) => , + sortable: true, + filterConfig: FILTER_CONFIGS.singleReferenceFilterConfig + }, + { + field: "conditionRelations.uniqueId", + header: "Experimental Conditions", + body: conditionRelationsTemplate, + sortable: true, + filterConfig: FILTER_CONFIGS.paConditionRelationsSummaryFilterConfig + }, + { + field: "sgdStrainBackground.name", + header: "SGD Strain Background", + body: (rowData) => , + sortable: true, + filterConfig: FILTER_CONFIGS.sgdStrainBackgroundFilterConfig + }, + { + field: "inferredGene.geneSymbol.displayText", + header: "Inferred Gene", + body: (rowData) => , + sortable: true, + filterConfig: FILTER_CONFIGS.inferredGeneFilterConfig, + }, + { + field: "assertedGenes.geneSymbol.displayText", + header: "Asserted Genes", + body: (rowData) => , + sortable: true, + filterConfig: FILTER_CONFIGS.assertedGenesFilterConfig + }, + { + field: "inferredAllele.alleleSymbol.displayText", + header: "Inferred Allele", + body: (rowData) => , + sortable: true, + filterConfig: FILTER_CONFIGS.inferredAlleleFilterConfig, + }, + { + field: "assertedAllele.alleleSymbol.displayText", + header: "Asserted Allele", + body: (rowData) => , + sortable: true, + filterConfig: FILTER_CONFIGS.assertedAlleleFilterConfig + }, + { + field: "dataProvider.sourceOrganization.abbreviation", + header: "Data Provider", + sortable: true, + filterConfig: FILTER_CONFIGS.phenotypeDataProviderFilterConfig, + }, + { + field: "dateCreated", + header: "Date Created", + sortable: true, + filterConfig: FILTER_CONFIGS.dataCreatedFilterConfig, + }, + { + field: "internal", + header: "Internal", + body: (rowData) => , + sortable: true, + filterConfig: FILTER_CONFIGS.internalFilterConfig + }, + { + field: "obsolete", + header: "Obsolete", + body: (rowData) => , + sortable: true, + filterConfig: FILTER_CONFIGS.obsoleteFilterConfig + } + ]; + + const defaultColumnNames = columns.map((col) => { + return col.header; + }); + + const widthsObject = {}; + + columns.forEach((col) => { + widthsObject[col.field] = 10; + }); + + const initialTableState = getDefaultTableState("PhenotypeAnnotations", defaultColumnNames, undefined, widthsObject); + + return ( + <> +
+ +
+ + + ); +}; + diff --git a/src/main/cliapp/src/containers/phenotypeAnnotationsPage/index.js b/src/main/cliapp/src/containers/phenotypeAnnotationsPage/index.js new file mode 100644 index 000000000..f5a591806 --- /dev/null +++ b/src/main/cliapp/src/containers/phenotypeAnnotationsPage/index.js @@ -0,0 +1,3 @@ +import { PhenotypeAnnotationsPage } from "./PhenotypeAnnotationsPage"; + +export { PhenotypeAnnotationsPage }; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/phenotypeAnnotationsPage/useNewAnnotationReducer.js b/src/main/cliapp/src/containers/phenotypeAnnotationsPage/useNewAnnotationReducer.js new file mode 100644 index 000000000..42f7855bb --- /dev/null +++ b/src/main/cliapp/src/containers/phenotypeAnnotationsPage/useNewAnnotationReducer.js @@ -0,0 +1,176 @@ +import { useImmerReducer } from "use-immer"; +import 'core-js/features/structured-clone'; + +const DEFAULT_ANNOTATION = { + diseaseAnnotationSubject: { + modEntityId: "", + }, + assertedGenes : [], + assertedAllele : null, + relation: { + name: "", + }, + negated: false, + diseaseAnnotationObject: { + curie: "", + }, + singleReference: { + curie: "", + }, + evidenceCodes: [], + with: [], + relatedNotes: [], + conditionRelations: [], + geneticSex: null, + diseaseQualifiers: null, + sgdStrainBackground: null, + annotationType: null, + diseaseGeneticModifierRelation: null, + diseaseGeneticModifiers: [], + internal: false +}; +const initialNewAnnotationState = { + newAnnotation: global.structuredClone(DEFAULT_ANNOTATION), + errorMessages: {}, + relatedNotesErrorMessages: [], + exConErrorMessages: [], + submitted: false, + newAnnotationDialog: false, + showRelatedNotes: false, + relatedNotesEditingRows: {}, + showConditionRelations: false, + conditionRelationsEditingRows: {}, + isValid: false, + isAssertedGeneEnabled: false, + isAssertedAlleleEnabled: false, +}; + +const buildAnnotation = (rowData) => { + return { + diseaseAnnotationSubject: global.structuredClone(rowData.diseaseAnnotationSubject) || DEFAULT_ANNOTATION.diseaseAnnotationSubject, + assertedGenes : global.structuredClone(rowData.assertedGenes) || DEFAULT_ANNOTATION.assertedGenes, + assertedAllele : global.structuredClone(rowData.assertedAllele) || DEFAULT_ANNOTATION.assertedAllele, + relation: global.structuredClone(rowData.relation) || DEFAULT_ANNOTATION.relation, + negated: rowData.negated || DEFAULT_ANNOTATION.negated, + diseaseAnnotationObject: global.structuredClone(rowData.diseaseAnnotationObject) || DEFAULT_ANNOTATION.diseaseAnnotationObject, + singleReference: global.structuredClone(rowData.singleReference) || DEFAULT_ANNOTATION.singleReference, + evidenceCodes: global.structuredClone(rowData.evidenceCodes) || DEFAULT_ANNOTATION.subject, + with: global.structuredClone(rowData.with) || DEFAULT_ANNOTATION.with, + relatedNotes: processDupRelatedNotes(global.structuredClone(rowData.relatedNotes)) || DEFAULT_ANNOTATION.relatedNotes, + conditionRelations: global.structuredClone(rowData.conditionRelations) || DEFAULT_ANNOTATION.conditionRelations, + geneticSex: global.structuredClone(rowData.geneticSex) || DEFAULT_ANNOTATION.geneticSex, + diseaseQualifiers: global.structuredClone(rowData.diseaseQualifiers) || DEFAULT_ANNOTATION.diseaseQualifiers, + sgdStrainBackground: global.structuredClone(rowData.sgdStrainBackground)|| DEFAULT_ANNOTATION.sgdStrainBackground, + annotationType: global.structuredClone(rowData.annotationType) || DEFAULT_ANNOTATION.annotationType, + diseaseGeneticModifierRelation: global.structuredClone(rowData.diseaseGeneticModifierRelation) || DEFAULT_ANNOTATION.diseaseGeneticModifierRelation, + diseaseGeneticModifiers: global.structuredClone(rowData.diseaseGeneticModifiers) || DEFAULT_ANNOTATION.diseaseGeneticModifiers, + internal: rowData.internal || DEFAULT_ANNOTATION.internal + } +} + +const processDupRelatedNotes = (notes) => { + if(!notes) return; + notes.forEach(note => { + if(note.id){ + delete note.id; + } + }) + return notes; +} + +const newAnnotationReducer = (draft, action) => { + + switch (action.type) { + case 'RESET': + return initialNewAnnotationState; + case 'EDIT': + draft.newAnnotation[action.field] = action.value; + break; + case 'EDIT_EXPERIMENT': + if (typeof action.value === "object") { + draft.newAnnotation.conditionRelations[0] = action.value; + } else { + if(draft.newAnnotation.conditionRelations && draft.newAnnotation.conditionRelations[0]) + draft.newAnnotation.conditionRelations[0].handle = action.value; + } + break; + case 'UPDATE_ERROR_MESSAGES': + draft[action.errorType]= action.errorMessages; + draft.isValid = false; + break; + case 'SUBMIT': + draft.submitted = true; + draft.errorMessages = {}; + draft.relatedNotesErrorMessages = []; + draft.isValid = false; + break; + case 'OPEN_DIALOG': + draft.newAnnotationDialog = true; + break; + case 'DUPLICATE_ROW': + draft.newAnnotation = buildAnnotation(action.rowData); + break; + case 'CLEAR': + return {...initialNewAnnotationState, newAnnotationDialog: true} + case 'ADD_NEW_NOTE': + draft.newAnnotation.relatedNotes.push( + { + dataKey: action.count, + noteType: { + name : "" + }, + freeText: "", + } + ) + draft.relatedNotesEditingRows[`${action.count}`] = true; + draft.showRelatedNotes = true; + break; + case 'ADD_NEW_RELATION': + draft.newAnnotation.conditionRelations.push( + { + dataKey: action.count, + conditions: [], + } + ) + draft.conditionRelationsEditingRows[`${action.count}`] = true; + draft.showConditionRelations = true; + break; + case 'DELETE_ROW': + draft.newAnnotation[action.tableType].splice(action.index, 1); + if(draft.newAnnotation[action.tableType].length === 0){ + draft[action.showType] = false; + } + break; + case 'EDIT_ROW': + draft.newAnnotation[action.tableType][action.index][action.field] = action.value; + break; + case 'SET_IS_ENABLED': + draft.isEnabled = action.value; + break; + case 'SET_IS_ASSERTED_GENE_ENABLED': + draft.isAssertedGeneEnabled = action.value; + break; + case 'SET_IS_ASSERTED_ALLELE_ENABLED': + draft.isAssertedAlleleEnabled = action.value; + break; + case 'SET_RELATED_NOTES_EDITING_ROWS': + action.relatedNotes.forEach((note) => { + draft.relatedNotesEditingRows[`${note.dataKey}`] = true; + }); + draft.showRelatedNotes = true; + break; + case 'SET_CONDITION_RELATIONS_EDITING_ROWS': + action.conditionRelations.forEach((relation) => { + draft.conditionRelationsEditingRows[`${relation.dataKey}`] = true; + }); + draft.showConditionRelations = true; + break; + default: + throw Error('Unknown action: ' + action.type); + } +}; + +export const useNewAnnotationReducer = () => { + const [newAnnotationState, newAnnotationDispatch] = useImmerReducer(newAnnotationReducer, initialNewAnnotationState); + return {newAnnotationState, newAnnotationDispatch}; +} diff --git a/src/main/cliapp/src/routes.js b/src/main/cliapp/src/routes.js index c88b659fd..53f64ea12 100644 --- a/src/main/cliapp/src/routes.js +++ b/src/main/cliapp/src/routes.js @@ -9,6 +9,7 @@ import { DashboardPage } from './containers/dashboardPage'; import { DataLoadsPage } from './containers/dataLoadsPage/'; import { ReportsPage } from './containers/reportsPage/'; import { DiseaseAnnotationsPage } from './containers/diseaseAnnotationsPage'; +import { PhenotypeAnnotationsPage } from './containers/phenotypeAnnotationsPage'; import { ExperimentalConditionsPage } from './containers/experimentalConditionsPage'; import { ConditionRelationPage } from './containers/conditionRelationPage'; import { AffectedGenomicModelPage } from './containers/affectedGenomicModelPage'; @@ -45,6 +46,7 @@ export default ( } /> } /> } /> + } /> } /> } /> } /> diff --git a/src/main/cliapp/src/service/DataLoadService.js b/src/main/cliapp/src/service/DataLoadService.js index cff3bb8f4..8d3b50048 100644 --- a/src/main/cliapp/src/service/DataLoadService.js +++ b/src/main/cliapp/src/service/DataLoadService.js @@ -81,7 +81,7 @@ export class DataLoadService extends BaseAuthService { getBackendBulkLoadTypes(loadType) { const bulkLoadTypes = { - BulkFMSLoad: ["MOLECULE", "ORTHOLOGY", "PHENOTYPE_ANNOTATION"], + BulkFMSLoad: ["MOLECULE", "ORTHOLOGY", "PHENOTYPE"], BulkURLLoad: ["ONTOLOGY", "GENE", "ALLELE", "AGM", "DISEASE_ANNOTATION", "RESOURCE_DESCRIPTOR"], BulkManualLoad: ["FULL_INGEST", "DISEASE_ANNOTATION", "GENE_DISEASE_ANNOTATION", "ALLELE_DISEASE_ANNOTATION", "AGM_DISEASE_ANNOTATION", "GENE", "ALLELE", "AGM", "VARIANT", "CONSTRUCT", "ALLELE_ASSOCIATION", "CONSTRUCT_ASSOCIATION"] }; diff --git a/src/main/java/org/alliancegenome/curation_api/constants/VocabularyConstants.java b/src/main/java/org/alliancegenome/curation_api/constants/VocabularyConstants.java index 9e2071383..2f92bb611 100644 --- a/src/main/java/org/alliancegenome/curation_api/constants/VocabularyConstants.java +++ b/src/main/java/org/alliancegenome/curation_api/constants/VocabularyConstants.java @@ -14,6 +14,8 @@ public final class VocabularyConstants { public static final String ALLELE_DISEASE_RELATION_VOCABULARY_TERM_SET = "allele_disease_relation"; public static final String AGM_DISEASE_RELATION_VOCABULARY_TERM_SET = "agm_disease_relation"; + public static final String PHENOTYPE_RELATION_VOCABULARY = "phenotype_relation"; + public static final String ALLELE_INHERITANCE_MODE_VOCABULARY = "allele_inheritance_mode"; public static final String ALLELE_DATABASE_STATUS_VOCABULARY = "allele_db_status"; public static final String ALLELE_FUNCTIONAL_IMPACT_VOCABULARY = "allele_functional_impact"; diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/PhenotypeAnnotationCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/PhenotypeAnnotationCrudController.java index ac8a9280d..a44c715be 100644 --- a/src/main/java/org/alliancegenome/curation_api/controllers/crud/PhenotypeAnnotationCrudController.java +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/PhenotypeAnnotationCrudController.java @@ -4,6 +4,7 @@ import org.alliancegenome.curation_api.controllers.base.BaseEntityCrudController; import org.alliancegenome.curation_api.dao.PhenotypeAnnotationDAO; +import org.alliancegenome.curation_api.interfaces.crud.PhenotypeAnnotationCrudInterface; import org.alliancegenome.curation_api.jobs.executors.PhenotypeAnnotationExecutor; import org.alliancegenome.curation_api.model.entities.PhenotypeAnnotation; import org.alliancegenome.curation_api.model.ingest.dto.fms.PhenotypeFmsDTO; diff --git a/src/main/java/org/alliancegenome/curation_api/enums/BackendBulkLoadType.java b/src/main/java/org/alliancegenome/curation_api/enums/BackendBulkLoadType.java index 72030a2be..4dbaf959e 100644 --- a/src/main/java/org/alliancegenome/curation_api/enums/BackendBulkLoadType.java +++ b/src/main/java/org/alliancegenome/curation_api/enums/BackendBulkLoadType.java @@ -10,7 +10,7 @@ public enum BackendBulkLoadType { ALLELE_DISEASE_ANNOTATION("json"), GENE_DISEASE_ANNOTATION("json"), ONTOLOGY("owl"), - PHENOTYPE_ANNOTATION("json"), + PHENOTYPE("json"), MOLECULE("json"), FULL_INGEST("json"), RESOURCE_DESCRIPTOR("yaml"), diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AGMPhenotypeAnnotationCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AGMPhenotypeAnnotationCrudInterface.java new file mode 100644 index 000000000..ecbd7922d --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AGMPhenotypeAnnotationCrudInterface.java @@ -0,0 +1,47 @@ +package org.alliancegenome.curation_api.interfaces.crud; + +import org.alliancegenome.curation_api.interfaces.base.BaseDTOCrudControllerInterface; +import org.alliancegenome.curation_api.interfaces.base.BaseIdCrudInterface; +import org.alliancegenome.curation_api.model.entities.AGMDiseaseAnnotation; +import org.alliancegenome.curation_api.model.entities.AGMPhenotypeAnnotation; +import org.alliancegenome.curation_api.model.ingest.dto.AGMDiseaseAnnotationDTO; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.view.View; +import org.eclipse.microprofile.openapi.annotations.tags.Tag; + +import com.fasterxml.jackson.annotation.JsonView; + +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; + +@Path("/agm-phenotype-annotation") +@Tag(name = "CRUD - AGM Phenotype Annotations") +@Produces(MediaType.APPLICATION_JSON) +@Consumes(MediaType.APPLICATION_JSON) +public interface AGMPhenotypeAnnotationCrudInterface extends BaseIdCrudInterface, BaseDTOCrudControllerInterface { + + @GET + @Path("/findBy/{identifier}") + @JsonView(View.FieldsAndLists.class) + public ObjectResponse get(@PathParam("identifier") String identifier); + + @Override + @PUT + @Path("/") + @JsonView(View.PhenotypeAnnotationView.class) + public ObjectResponse update(AGMPhenotypeAnnotation entity); + + @Override + @POST + @Path("/") + @JsonView(View.PhenotypeAnnotationView.class) + public ObjectResponse create(AGMPhenotypeAnnotation entity); + + +} diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/PhenotypeAnnotationCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/PhenotypeAnnotationCrudInterface.java index 1d3eccd27..7800e7093 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/PhenotypeAnnotationCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/PhenotypeAnnotationCrudInterface.java @@ -1,9 +1,12 @@ package org.alliancegenome.curation_api.interfaces.crud; -import jakarta.ws.rs.*; +import java.util.HashMap; +import java.util.List; + import org.alliancegenome.curation_api.interfaces.base.BaseIdCrudInterface; -import org.alliancegenome.curation_api.model.entities.DiseaseAnnotation; -import org.alliancegenome.curation_api.model.entities.VocabularyTerm; +import org.alliancegenome.curation_api.model.entities.PhenotypeAnnotation; +import org.alliancegenome.curation_api.model.ingest.dto.fms.PhenotypeFmsDTO; +import org.alliancegenome.curation_api.response.APIResponse; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.view.View; @@ -12,26 +15,37 @@ import com.fasterxml.jackson.annotation.JsonView; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DefaultValue; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; import jakarta.ws.rs.core.MediaType; -import java.util.HashMap; - -@Path("/disease-annotation") -@Tag(name = "CRUD - Disease Annotations") +@Path("/phenotype-annotation") +@Tag(name = "CRUD - Phenotype Annotations") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface PhenotypeAnnotationCrudInterface extends BaseIdCrudInterface { +public interface PhenotypeAnnotationCrudInterface extends BaseIdCrudInterface { @GET @Path("/findBy/{modEntityId|modInternalId|uniqueId}") @JsonView(View.FieldsAndLists.class) - public ObjectResponse get(@PathParam("identifier") String identifier); + public ObjectResponse get(@PathParam("identifier") String identifier); @Override @POST @Path("/search") - @JsonView(View.DiseaseAnnotation.class) - @Tag(name = "Elastic Search Disease Annotations") - public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); + @JsonView(View.PhenotypeAnnotationView.class) + @Tag(name = "Elastic Search Phenotype Annotations") + public SearchResponse search(@DefaultValue("0") @QueryParam("page") Integer page, @DefaultValue("10") @QueryParam("limit") Integer limit, @RequestBody HashMap params); + + @POST + @Path("/bulk/{dataProvider}/annotationFile") + @JsonView(View.FieldsAndLists.class) + public APIResponse updatePhenotypeAnnotations(@PathParam("dataProvider") String dataProvider, List annotationData); } diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/bulkloads/BulkLoadFileHistoryCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/bulkloads/BulkLoadFileHistoryCrudInterface.java index 18a5cbcd2..7da9fc718 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/bulkloads/BulkLoadFileHistoryCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/bulkloads/BulkLoadFileHistoryCrudInterface.java @@ -1,22 +1,19 @@ package org.alliancegenome.curation_api.interfaces.crud.bulkloads; -import com.fasterxml.jackson.annotation.JsonView; -import io.smallrye.mutiny.Uni; -import io.vertx.core.json.JsonArray; -import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; -import org.alliancegenome.curation_api.exceptions.ObjectUpdateException; import org.alliancegenome.curation_api.interfaces.base.BaseIdCrudInterface; -import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFileException; import org.alliancegenome.curation_api.model.entities.bulkloads.BulkLoadFileHistory; -import org.alliancegenome.curation_api.response.ObjectListResponse; -import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.tags.Tag; -import jakarta.ws.rs.core.MediaType; +import com.fasterxml.jackson.annotation.JsonView; -import java.util.ArrayList; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; @Path("/bulkloadfilehistory") @Tag(name = "Bulk Load - CRUD") diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/BulkLoadJobExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/BulkLoadJobExecutor.java index a3f82f25b..f93b099b8 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/BulkLoadJobExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/BulkLoadJobExecutor.java @@ -91,7 +91,7 @@ public void process(BulkLoadFile bulkLoadFile, Boolean cleanUp) throws Exception } else if (bulkLoadFile.getBulkLoad().getBackendBulkLoadType() == BackendBulkLoadType.MOLECULE) { moleculeExecutor.runLoad(bulkLoadFile); - } else if (bulkLoadFile.getBulkLoad().getBackendBulkLoadType() == BackendBulkLoadType.PHENOTYPE_ANNOTATION) { + } else if (bulkLoadFile.getBulkLoad().getBackendBulkLoadType() == BackendBulkLoadType.PHENOTYPE) { phenotypeAnnotationExecutor.runLoad(bulkLoadFile); } else if (bulkLoadFile.getBulkLoad().getBackendBulkLoadType() == BackendBulkLoadType.ORTHOLOGY) { orthologyExecutor.runLoad(bulkLoadFile); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java index 362d53622..aee1002f7 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java @@ -22,6 +22,7 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; @@ -35,7 +36,7 @@ public void runLoad(BulkLoadFile bulkLoadFile) { try { BulkFMSLoad fmsLoad = (BulkFMSLoad) bulkLoadFile.getBulkLoad(); - BackendBulkDataProvider dataProvider = BackendBulkDataProvider.valueOf(fmsLoad.getFmsDataType()); + BackendBulkDataProvider dataProvider = BackendBulkDataProvider.valueOf(fmsLoad.getFmsDataSubType()); PhenotypeIngestFmsDTO phenotypeData = mapper.readValue(new GZIPInputStream(new FileInputStream(bulkLoadFile.getLocalFilePath())), PhenotypeIngestFmsDTO.class); bulkLoadFile.setRecordCount(phenotypeData.getData().size()); @@ -56,7 +57,6 @@ public void runLoad(BulkLoadFile bulkLoadFile) { runCleanup(phenotypeAnnotationService, history, dataProvider.name(), annotationIdsBefore, annotationIdsLoaded, "phenotype annotation", bulkLoadFile.getMd5Sum()); - history.finishLoad(); trackHistory(history, bulkLoadFile); @@ -118,7 +118,7 @@ private void loadPrimaryAnnotations(BulkLoadFileHistory history, List phenotypeTerms; diff --git a/src/main/java/org/alliancegenome/curation_api/services/AGMPhenotypeAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/AGMPhenotypeAnnotationService.java index 20cbed346..39a1829be 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/AGMPhenotypeAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/AGMPhenotypeAnnotationService.java @@ -14,6 +14,7 @@ import org.alliancegenome.curation_api.services.base.BaseEntityCrudService; import org.alliancegenome.curation_api.services.validation.dto.fms.AGMPhenotypeAnnotationFmsDTOValidator; +import io.quarkus.logging.Log; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Inject; @@ -24,8 +25,6 @@ public class AGMPhenotypeAnnotationService extends BaseEntityCrudService get(String identifier) { @Override @Transactional public ObjectResponse update(AGMPhenotypeAnnotation uiEntity) { - //AGMPhenotypeAnnotation dbEntity = agmPhenotypeValidator.validateAnnotationUpdate(uiEntity); - //return new ObjectResponse<>(agmPhenotypeAnnotationDAO.persist(dbEntity)); return null; } @Override @Transactional public ObjectResponse create(AGMPhenotypeAnnotation uiEntity) { - //AGMPhenotypeAnnotation dbEntity = agmPhenotypeValidator.validateAnnotationCreate(uiEntity); - //return new ObjectResponse<>(agmPhenotypeAnnotationDAO.persist(dbEntity)); return null; } @Transactional public AGMPhenotypeAnnotation upsertPrimaryAnnotation(AffectedGenomicModel subject, PhenotypeFmsDTO dto, BackendBulkDataProvider dataProvider) throws ObjectUpdateException { AGMPhenotypeAnnotation annotation = agmPhenotypeAnnotationFmsDtoValidator.validatePrimaryAnnotation(subject, dto, dataProvider); - return agmPhenotypeAnnotationDAO.persist(annotation); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/PhenotypeAnnotationService.java b/src/main/java/org/alliancegenome/curation_api/services/PhenotypeAnnotationService.java index 5c2fc1e3c..840e7155c 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/PhenotypeAnnotationService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/PhenotypeAnnotationService.java @@ -174,7 +174,6 @@ protected > List getAnnotationIdsByDataProvider(D } public Long upsertPrimaryAnnotation(PhenotypeFmsDTO dto, BackendBulkDataProvider dataProvider) throws ObjectUpdateException { - if (StringUtils.isBlank(dto.getObjectId())) throw new ObjectValidationException(dto, "objectId - " + ValidationConstants.REQUIRED_MESSAGE); GenomicEntity phenotypeAnnotationSubject = genomicEntityService.findByIdentifierString(dto.getObjectId()); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseFmsDTOValidator.java deleted file mode 100644 index bc81671c0..000000000 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/base/BaseFmsDTOValidator.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.alliancegenome.curation_api.services.validation.dto.base; - -import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; -import org.alliancegenome.curation_api.model.entities.CrossReference; -import org.alliancegenome.curation_api.model.entities.DataProvider; -import org.alliancegenome.curation_api.model.entities.Organization; -import org.alliancegenome.curation_api.response.ObjectResponse; -import org.alliancegenome.curation_api.services.OrganizationService; -import org.alliancegenome.curation_api.services.ResourceDescriptorPageService; - -import jakarta.enterprise.context.RequestScoped; -import jakarta.inject.Inject; - -@RequestScoped -public class BaseFmsDTOValidator { - - @Inject - OrganizationService organizationService; - @Inject - ResourceDescriptorPageService resourceDescriptorPageService; - - public DataProvider constructDataProvider(BackendBulkDataProvider beDataProvider) { - ObjectResponse orgResponse = organizationService.getByAbbr(beDataProvider.sourceOrganization); - if (orgResponse == null || orgResponse.getEntity() == null) - return null; - - DataProvider dataProvider = new DataProvider(); - dataProvider.setSourceOrganization(orgResponse.getEntity()); - - CrossReference homepageXref = new CrossReference(); - homepageXref.setDisplayName(beDataProvider.sourceOrganization); - homepageXref.setResourceDescriptorPage(resourceDescriptorPageService.getPageForResourceDescriptor(beDataProvider.resourceDescriptor, "homepage")); - dataProvider.setCrossReference(homepageXref); - - return dataProvider; - } -} diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java index ffc2fb1f4..c89646c9b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java @@ -17,7 +17,6 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; -import org.alliancegenome.curation_api.services.validation.dto.base.BaseFmsDTOValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -25,7 +24,7 @@ import jakarta.inject.Inject; @RequestScoped -public class ConditionRelationFmsDTOValidator extends BaseFmsDTOValidator { +public class ConditionRelationFmsDTOValidator { @Inject ConditionRelationDAO conditionRelationDAO; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ExperimentalConditionFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ExperimentalConditionFmsDTOValidator.java index 0f256c68d..2db263356 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ExperimentalConditionFmsDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ExperimentalConditionFmsDTOValidator.java @@ -14,14 +14,12 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.ExperimentalConditionSummary; import org.alliancegenome.curation_api.services.ontology.AnatomicalTermService; import org.alliancegenome.curation_api.services.ontology.ChemicalTermService; import org.alliancegenome.curation_api.services.ontology.ExperimentalConditionOntologyTermService; import org.alliancegenome.curation_api.services.ontology.GoTermService; import org.alliancegenome.curation_api.services.ontology.NcbiTaxonTermService; import org.alliancegenome.curation_api.services.ontology.ZecoTermService; -import org.alliancegenome.curation_api.services.validation.dto.base.BaseFmsDTOValidator; import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.RequestScoped; @@ -29,7 +27,7 @@ @RequestScoped -public class ExperimentalConditionFmsDTOValidator extends BaseFmsDTOValidator { +public class ExperimentalConditionFmsDTOValidator { @Inject ExperimentalConditionDAO experimentalConditionDAO; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java index 643e48323..91a5254be 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/OrthologyFmsDTOValidator.java @@ -20,7 +20,6 @@ import org.alliancegenome.curation_api.services.GeneService; import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.ontology.NcbiTaxonTermService; -import org.alliancegenome.curation_api.services.validation.dto.base.BaseFmsDTOValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -29,7 +28,7 @@ import jakarta.transaction.Transactional; @RequestScoped -public class OrthologyFmsDTOValidator extends BaseFmsDTOValidator { +public class OrthologyFmsDTOValidator { @Inject GeneToGeneOrthologyGeneratedDAO generatedOrthologyDAO; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/PhenotypeAnnotationFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/PhenotypeAnnotationFmsDTOValidator.java index 3317c8f48..5953998e2 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/PhenotypeAnnotationFmsDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/PhenotypeAnnotationFmsDTOValidator.java @@ -6,6 +6,7 @@ import java.util.List; import org.alliancegenome.curation_api.constants.ValidationConstants; +import org.alliancegenome.curation_api.constants.VocabularyConstants; import org.alliancegenome.curation_api.dao.ConditionRelationDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; import org.alliancegenome.curation_api.model.entities.ConditionRelation; @@ -17,9 +18,10 @@ import org.alliancegenome.curation_api.model.ingest.dto.fms.PhenotypeFmsDTO; import org.alliancegenome.curation_api.model.ingest.dto.fms.PhenotypeTermIdentifierFmsDTO; import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.services.DataProviderService; import org.alliancegenome.curation_api.services.ReferenceService; +import org.alliancegenome.curation_api.services.VocabularyTermService; import org.alliancegenome.curation_api.services.ontology.PhenotypeTermService; -import org.alliancegenome.curation_api.services.validation.dto.base.BaseFmsDTOValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; @@ -28,7 +30,7 @@ import jakarta.inject.Inject; @RequestScoped -public class PhenotypeAnnotationFmsDTOValidator extends BaseFmsDTOValidator { +public class PhenotypeAnnotationFmsDTOValidator { @Inject ReferenceService referenceService; @@ -38,6 +40,10 @@ public class PhenotypeAnnotationFmsDTOValidator extends BaseFmsDTOValidator { ConditionRelationFmsDTOValidator conditionRelationFmsDtoValidator; @Inject ConditionRelationDAO conditionRelationDAO; + @Inject + DataProviderService dataProviderService; + @Inject + VocabularyTermService vocabularyTermService; public ObjectResponse validatePhenotypeAnnotation(E annotation, PhenotypeFmsDTO dto, BackendBulkDataProvider beDataProvider) { @@ -78,8 +84,8 @@ public ObjectResponse validatePhenotypeAnnota annotation.setConditionRelations(null); } - DataProvider dataProvider = constructDataProvider(beDataProvider); - annotation.setDataProvider(dataProvider); + annotation.setDataProvider(dataProviderService.createOrganizationDataProvider(beDataProvider.sourceOrganization)); + annotation.setRelation(vocabularyTermService.getTermInVocabulary(VocabularyConstants.PHENOTYPE_RELATION_VOCABULARY, "has_phenotype").getEntity()); OffsetDateTime creationDate = null; if (StringUtils.isNotBlank(dto.getDateAssigned())) { diff --git a/src/main/resources/db/migration/v0.31.0.3__agm_phenotype_annotation.sql b/src/main/resources/db/migration/v0.31.0.3__agm_phenotype_annotation.sql deleted file mode 100644 index cadec15c2..000000000 --- a/src/main/resources/db/migration/v0.31.0.3__agm_phenotype_annotation.sql +++ /dev/null @@ -1,7 +0,0 @@ --- Create phenotypeannotation tables and indexes - --- Create agmphenotypeannotation tables and indexes - --- Add relation vocabulary with 'has_phenotype' term - --- Create bulk load \ No newline at end of file diff --git a/src/main/resources/db/migration/v0.31.0.4__agm_phenotype_annotation.sql b/src/main/resources/db/migration/v0.31.0.4__agm_phenotype_annotation.sql new file mode 100644 index 000000000..385de6537 --- /dev/null +++ b/src/main/resources/db/migration/v0.31.0.4__agm_phenotype_annotation.sql @@ -0,0 +1,128 @@ +-- Create phenotypeannotation tables and indexes + +CREATE TABLE phenotypeannotation ( + id bigint PRIMARY KEY, + phenotypeannotationobject varchar(255), + relation_id bigint +); + +ALTER TABLE phenotypeannotation ADD CONSTRAINT phenotypeannotation_id_fk FOREIGN KEY (id) REFERENCES annotation (id); +ALTER TABLE phenotypeannotation ADD CONSTRAINT phenotypeannotation_relation_id_fk FOREIGN KEY (relation_id) REFERENCES vocabularyterm (id); +CREATE INDEX phenotypeannotation_relation_index ON phenotypeannotation USING btree(relation_id); + +CREATE TABLE phenotypeannotation_ontologyterm ( + phenotypeannotation_id bigint, + phenotypeterms_id bigint +); + +ALTER TABLE phenotypeannotation_ontologyterm ADD CONSTRAINT phenotypeannotation_ontologyterm_phenotypeannotation_id_fk FOREIGN KEY (phenotypeannotation_id) REFERENCES phenotypeannotation (id); +ALTER TABLE phenotypeannotation_ontologyterm ADD CONSTRAINT phenotypeannotation_ontologyterm_phenotypeterms_id_fh_fk FOREIGN KEY (phenotypeterms_id) REFERENCES ontologyterm (id); +CREATE INDEX phenotypeannotation_ontologyterm_phenotypeannotation_index ON phenotypeannotation_ontologyterm USING btree (phenotypeannotation_id); +CREATE INDEX phenotypeannotation_ontologyterm_phenotypeterms_index ON phenotypeannotation_ontologyterm USING btree (phenotypeterms_id); + +CREATE TABLE agmphenotypeannotation ( + id bigint PRIMARY KEY, + phenotypeannotationsubject_id bigint, + assertedallele_id bigint, + inferredallele_id bigint, + inferredgene_id bigint +); + +ALTER TABLE agmphenotypeannotation ADD CONSTRAINT agmphenotypeannotation_id_fk FOREIGN KEY (id) REFERENCES phenotypeannotation (id); +ALTER TABLE agmphenotypeannotation ADD CONSTRAINT agmphenotypeannotation_phenotypeannotationsubject_id_fk FOREIGN KEY (phenotypeannotationsubject_id) REFERENCES affectedgenomicmodel (id); +ALTER TABLE agmphenotypeannotation ADD CONSTRAINT agmphenotypeannotation_assertedallele_id_fk FOREIGN KEY (assertedallele_id) REFERENCES allele (id); +ALTER TABLE agmphenotypeannotation ADD CONSTRAINT agmphenotypeannotation_inferredallele_id_fk FOREIGN KEY (inferredallele_id) REFERENCES allele (id); +ALTER TABLE agmphenotypeannotation ADD CONSTRAINT agmphenotypeannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id); +CREATE INDEX agmphenotypeannotation_phenotypeannotationsubject_index ON agmphenotypeannotation USING btree (phenotypeannotationsubject_id); +CREATE INDEX agmphenotypeannotation_assertedallele_index ON agmphenotypeannotation USING btree (assertedallele_id); +CREATE INDEX agmphenotypeannotation_inferredallele_index ON agmphenotypeannotation USING btree (inferredallele_id); +CREATE INDEX agmphenotypeannotation_inferredgene_index ON agmphenotypeannotation USING btree (inferredgene_id); + +CREATE TABLE agmphenotypeannotation_gene ( + agmphenotypeannotation_id bigint, + assertedgenes_id bigint +); + +ALTER TABLE agmphenotypeannotation_gene ADD CONSTRAINT agmphenotypeannotation_gene_agmphenotypeannotation_id_fk FOREIGN KEY (agmphenotypeannotation_id) REFERENCES agmphenotypeannotation (id); +ALTER TABLE agmphenotypeannotation_gene ADD CONSTRAINT agmphenotypeannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); +CREATE INDEX agmphenotypeannotation_gene_agmphenotypeannotation_index ON agmphenotypeannotation_gene USING btree (agmphenotypeannotation_id); + +CREATE TABLE allelephenotypeannotation ( + id bigint PRIMARY KEY, + phenotypeannotationsubject_id bigint, + inferredgene_id bigint +); + +ALTER TABLE allelephenotypeannotation ADD CONSTRAINT agmphenotypeannotation_id_fk FOREIGN KEY (id) REFERENCES phenotypeannotation (id); +ALTER TABLE allelephenotypeannotation ADD CONSTRAINT agmphenotypeannotation_phenotypeannotationsubject_id_fk FOREIGN KEY (phenotypeannotationsubject_id) REFERENCES allele (id); +ALTER TABLE allelephenotypeannotation ADD CONSTRAINT agmphenotypeannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id); +CREATE INDEX allelephenotypeannotation_phenotypeannotationsubject_index ON allelephenotypeannotation USING btree (phenotypeannotationsubject_id); +CREATE INDEX allelephenotypeannotation_inferredgene_index ON allelephenotypeannotation USING btree (inferredgene_id); + +CREATE TABLE allelephenotypeannotation_gene ( + allelephenotypeannotation_id bigint, + assertedgenes_id bigint +); + +ALTER TABLE allelephenotypeannotation_gene ADD CONSTRAINT allelephenotypeannotation_gene_gene_allelephenotypeannotation_id_fk FOREIGN KEY (allelephenotypeannotation_id) REFERENCES allelephenotypeannotation (id); +ALTER TABLE allelephenotypeannotation_gene ADD CONSTRAINT allelephenotypeannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); +CREATE INDEX allelephenotypeannotation_gene_allelephenotypeannotation_index ON allelephenotypeannotation_gene USING btree (allelephenotypeannotation_id); + +CREATE TABLE genephenotypeannotation ( + id bigint PRIMARY KEY, + phenotypeannotationsubject_id bigint, + sgdstrainbackground_id bigint +); + +ALTER TABLE genephenotypeannotation ADD CONSTRAINT genephenotypeannotation_id_fk FOREIGN KEY (id) REFERENCES phenotypeannotation (id); +ALTER TABLE genephenotypeannotation ADD CONSTRAINT genephenotypeannotation_phenotypeannotationsubject_id_fk FOREIGN KEY (phenotypeannotationsubject_id) REFERENCES gene (id); +ALTER TABLE genephenotypeannotation ADD CONSTRAINT genephenotypeannotation_sgdstrainbackground_id_fk FOREIGN KEY (sgdstrainbackground_id) REFERENCES affectedgenomicmodel (id); +CREATE INDEX genephenotypeannotation_phenotypeannotationsubject_index ON genephenotypeannotation USING btree (phenotypeannotationsubject_id); +CREATE INDEX genephenotypeannotation_sgdstrainbackground_index ON genephenotypeannotation USING btree (sgdstrainbackground_id); + +-- Add relation vocabulary with 'has_phenotype' term + +INSERT INTO vocabulary (id, name, vocabularylabel) VALUES (nextval('vocabulary_seq'), 'Phenotype Relation', 'phenotype_relation'); +INSERT INTO vocabularyterm (id, name, vocabulary_id) SELECT nextval('vocabularyterm_seq'), 'has_phenotype', id FROM vocabulary WHERE vocabularylabel = 'phenotype_relation'; + +-- Create bulk loads + +INSERT INTO bulkloadgroup (id, name) VALUES (nextval('bulkloadgroup_seq'), 'Phenotype Bulk Loads'); +INSERT INTO bulkload (id, backendbulkloadtype, name, bulkloadstatus, group_id) + SELECT nextval('bulkload_seq'), 'PHENOTYPE', 'FB Phenotype Load', 'STOPPED', id FROM bulkloadgroup WHERE name = 'Phenotype Bulk Loads'; +INSERT INTO bulkload (id, backendbulkloadtype, name, bulkloadstatus, group_id) + SELECT nextval('bulkload_seq'), 'PHENOTYPE', 'HUMAN Phenotype Load', 'STOPPED', id FROM bulkloadgroup WHERE name = 'Phenotype Bulk Loads'; +INSERT INTO bulkload (id, backendbulkloadtype, name, bulkloadstatus, group_id) + SELECT nextval('bulkload_seq'), 'PHENOTYPE', 'MGI Phenotype Load', 'STOPPED', id FROM bulkloadgroup WHERE name = 'Phenotype Bulk Loads'; +INSERT INTO bulkload (id, backendbulkloadtype, name, bulkloadstatus, group_id) + SELECT nextval('bulkload_seq'), 'PHENOTYPE', 'RGD Phenotype Load', 'STOPPED', id FROM bulkloadgroup WHERE name = 'Phenotype Bulk Loads'; +INSERT INTO bulkload (id, backendbulkloadtype, name, bulkloadstatus, group_id) + SELECT nextval('bulkload_seq'), 'PHENOTYPE', 'SGD Phenotype Load', 'STOPPED', id FROM bulkloadgroup WHERE name = 'Phenotype Bulk Loads'; +INSERT INTO bulkload (id, backendbulkloadtype, name, bulkloadstatus, group_id) + SELECT nextval('bulkload_seq'), 'PHENOTYPE', 'WB Phenotype Load', 'STOPPED', id FROM bulkloadgroup WHERE name = 'Phenotype Bulk Loads'; +INSERT INTO bulkload (id, backendbulkloadtype, name, bulkloadstatus, group_id) + SELECT nextval('bulkload_seq'), 'PHENOTYPE', 'XBXL Phenotype Load', 'STOPPED', id FROM bulkloadgroup WHERE name = 'Phenotype Bulk Loads'; +INSERT INTO bulkload (id, backendbulkloadtype, name, bulkloadstatus, group_id) + SELECT nextval('bulkload_seq'), 'PHENOTYPE', 'XBXT Phenotype Load', 'STOPPED', id FROM bulkloadgroup WHERE name = 'Phenotype Bulk Loads'; +INSERT INTO bulkload (id, backendbulkloadtype, name, bulkloadstatus, group_id) + SELECT nextval('bulkload_seq'), 'PHENOTYPE', 'ZFIN Phenotype Load', 'STOPPED', id FROM bulkloadgroup WHERE name = 'Phenotype Bulk Loads'; +INSERT INTO bulkscheduledload (id, cronschedule, scheduleactive) + SELECT id, '0 0 22 ? * SUN-THU', true FROM bulkload WHERE backendbulkloadtype = 'PHENOTYPE'; +INSERT INTO bulkfmsload (id, fmsdatatype, fmsdatasubtype) + SELECT id, 'PHENOTYPE', 'FB' FROM bulkload WHERE name = 'FB Phenotype Load'; +INSERT INTO bulkfmsload (id, fmsdatatype, fmsdatasubtype) + SELECT id, 'PHENOTYPE', 'HUMAN' FROM bulkload WHERE name = 'HUMAN Phenotype Load'; +INSERT INTO bulkfmsload (id, fmsdatatype, fmsdatasubtype) + SELECT id, 'PHENOTYPE', 'MGI' FROM bulkload WHERE name = 'MGI Phenotype Load'; +INSERT INTO bulkfmsload (id, fmsdatatype, fmsdatasubtype) + SELECT id, 'PHENOTYPE', 'RGD' FROM bulkload WHERE name = 'RGD Phenotype Load'; +INSERT INTO bulkfmsload (id, fmsdatatype, fmsdatasubtype) + SELECT id, 'PHENOTYPE', 'SGD' FROM bulkload WHERE name = 'SGD Phenotype Load'; +INSERT INTO bulkfmsload (id, fmsdatatype, fmsdatasubtype) + SELECT id, 'PHENOTYPE', 'WB' FROM bulkload WHERE name = 'WB Phenotype Load'; +INSERT INTO bulkfmsload (id, fmsdatatype, fmsdatasubtype) + SELECT id, 'PHENOTYPE', 'XBXL' FROM bulkload WHERE name = 'XBXL Phenotype Load'; +INSERT INTO bulkfmsload (id, fmsdatatype, fmsdatasubtype) + SELECT id, 'PHENOTYPE', 'XBXT' FROM bulkload WHERE name = 'XBXT Phenotype Load'; +INSERT INTO bulkfmsload (id, fmsdatatype, fmsdatasubtype) + SELECT id, 'PHENOTYPE', 'ZFIN' FROM bulkload WHERE name = 'ZFIN Phenotype Load'; \ No newline at end of file From 5f6b03ff11fdd53343d2ed4e68498cf5249c347d Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Mon, 4 Mar 2024 08:34:42 -0500 Subject: [PATCH 130/159] Update JobScheduler.java --- .../java/org/alliancegenome/curation_api/jobs/JobScheduler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/JobScheduler.java b/src/main/java/org/alliancegenome/curation_api/jobs/JobScheduler.java index 1a2da163a..1d1d77e83 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/JobScheduler.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/JobScheduler.java @@ -215,7 +215,7 @@ public int compare(BulkLoadFile blf1, BulkLoadFile blf2) { ph.finishProcess(); } - @Scheduled(cron = "0 0 0 ? * SAT") + @Scheduled(cron = "0 0 0 ? * SUN") public void runMassIndexerEverything() { // Not sure what is going to happen when this time's out but should run anyway // Defaults taken from the API endpoint From 565436e4ea207b92f7061d703d8d6fb38967d9d4 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 5 Mar 2024 10:04:22 +0000 Subject: [PATCH 131/159] Integration tests and fixes --- .../constants/EntityFieldConstants.java | 2 + .../AGMPhenotypeAnnotationCrudController.java | 29 +++ .../AGMPhenotypeAnnotationCrudInterface.java | 5 +- .../PhenotypeAnnotationExecutor.java | 2 +- .../dto/fms/ExperimentalConditionFmsDTO.java | 2 +- .../services/DiseaseAnnotationService.java | 2 +- .../services/PhenotypeAnnotationService.java | 28 +-- .../AnnotationRetrievalHelper.java | 2 +- .../AnnotationUniqueIdHelper.java | 23 +- ...DiseaseAnnotationUniqueIdUpdateHelper.java | 2 +- .../ExperimentalConditionSummary.java | 2 +- .../ConditionRelationValidator.java | 2 +- .../DiseaseAnnotationValidator.java | 2 +- .../ExperimentalConditionValidator.java | 4 +- .../dto/AGMDiseaseAnnotationDTOValidator.java | 4 +- .../AlleleDiseaseAnnotationDTOValidator.java | 4 +- .../dto/ConditionRelationDTOValidator.java | 2 +- .../ExperimentalConditionDTOValidator.java | 4 +- .../GeneDiseaseAnnotationDTOValidator.java | 4 +- ...AGMPhenotypeAnnotationFmsDTOValidator.java | 4 +- .../fms/ConditionRelationFmsDTOValidator.java | 2 +- .../ExperimentalConditionFmsDTOValidator.java | 9 +- .../PhenotypeAnnotationFmsDTOValidator.java | 7 +- .../curation_api/base/BaseITCase.java | 14 +- .../fms/MoleculeBulkUploadFmsITCase.java | 40 +-- .../fms/OrthologyBulkUploadFmsITCase.java | 4 +- ...henotypeAnnotationBulkUploadFmsITCase.java | 234 ++++++++++++++++++ .../ExperimentalConditionITCase.java | 4 +- .../01_all_fields.json | 0 .../02_no_id.json | 0 .../03_no_name.json | 0 .../04_no_inchi.json | 0 .../05_no_inchikey.json | 0 .../06_no_iupac.json | 0 .../07_no_formula.json | 0 .../08_no_smiles.json | 0 .../09_no_synonyms.json | 0 .../10_no_cross_references.json | 0 .../11_empty_inchi.json | 0 .../12_empty_id.json | 0 .../13_empty_iupac.json | 0 .../14_empty_inchikey.json | 0 .../15_empty_name.json | 0 .../16_empty_smiles.json | 0 .../17_empty_formula.json | 0 .../18_empty_cross_references.json | 0 .../19_empty_synonyms.json | 0 .../AF_01_all_fields.json | 0 .../ER_01_empty_gene1.json | 0 .../ER_02_empty_gene2.json | 0 .../ER_03_empty_isBestScore.json | 0 .../ER_04_empty_isBestRevScore.json | 0 .../ER_05_empty_confidence.json | 0 .../IV_01_invalid_gene1.json | 0 .../IV_02_invalid_gene2.json | 0 .../IV_03_invalid_gene1Species.json | 0 .../IV_04_invalid_gene2Species.json | 0 .../IV_05_invalid_isBestScore.json | 0 .../IV_06_invalid_isBestRevScore.json | 0 .../IV_07_invalid_confidence.json | 0 ...V_08_invalid_predictionMethodsMatched.json | 0 ...9_invalid_predictionMethodsNotMatched.json | 0 ...10_invalid_predictionMethodsNotCalled.json | 0 .../IV_11_invalid_gene1Species_for_gene1.json | 0 .../IV_12_invalid_gene2Species_for_gene2.json | 0 .../MR_01_no_gene1.json | 0 .../MR_02_no_gene2.json | 0 .../MR_03_no_gene1Species.json | 0 .../MR_04_no_gene2Species.json | 0 .../MR_05_no_isBestScore.json | 0 .../MR_06_no_isBestRevScore.json | 0 .../MR_07_no_confidence.json | 0 ...E_01_update_empty_non_required_fields.json | 0 .../UM_01_update_no_non_required_fields.json | 0 ..._01_all_fields_primary_agm_annotation.json | 40 +++ ..._annotation_to_primary_agm_annotation.json | 118 +++++++++ .../ER_01_empty_object_id.json | 40 +++ .../ER_02_empty_date_assigned.json | 40 +++ .../ER_03_empty_phenotype_statement.json | 40 +++ .../ER_04_empty_evidence.json | 33 +++ .../ER_05_empty_condition_relation_type.json | 40 +++ .../ER_06_empty_conditions.json | 29 +++ .../ER_07_empty_condition_statement.json | 40 +++ .../ER_08_empty_condition_class_id.json | 40 +++ .../IV_01_invalid_object_id.json | 40 +++ .../IV_02_invalid_primary_genetic_id.json | 41 +++ ..._03_invalid_phenotype_term_identifier.json | 40 +++ .../IV_04_invalid_evidence.json | 40 +++ .../IV_05_invalid_date_assigned.json | 40 +++ ...IV_06_invalid_condition_relation_type.json | 40 +++ .../IV_07_invalid_condition_class_id.json | 40 +++ .../IV_08_invalid_condition_id.json | 40 +++ .../IV_09_invalid_anatomical_ontology_id.json | 40 +++ .../IV_10_invalid_gene_ontology_id.json | 40 +++ .../IV_11_invalid_ncbi_taxon_id.json | 40 +++ .../IV_12_invalid_chemical_ontology_id.json | 40 +++ .../MR_01_no_object_id.json | 39 +++ .../MR_02_no_date_assigned.json | 39 +++ .../MR_03_no_phenotype_statement.json | 39 +++ .../MR_04_no_evidence.json | 30 +++ .../MR_05_no_condition_relation_type.json | 39 +++ .../MR_06_no_conditions.json | 28 +++ .../MR_07_no_condition_statement.json | 39 +++ .../MR_08_no_condition_class_id.json | 39 +++ .../SI_01_secondary_ids.json | 40 +++ 105 files changed, 1630 insertions(+), 86 deletions(-) create mode 100644 src/main/java/org/alliancegenome/curation_api/controllers/crud/AGMPhenotypeAnnotationCrudController.java rename src/main/java/org/alliancegenome/curation_api/services/helpers/{diseaseAnnotations => annotations}/AnnotationRetrievalHelper.java (89%) rename src/main/java/org/alliancegenome/curation_api/services/helpers/{diseaseAnnotations => annotations}/AnnotationUniqueIdHelper.java (93%) rename src/main/java/org/alliancegenome/curation_api/services/helpers/{diseaseAnnotations => annotations}/DiseaseAnnotationUniqueIdUpdateHelper.java (94%) rename src/main/java/org/alliancegenome/curation_api/services/helpers/{diseaseAnnotations => annotations}/ExperimentalConditionSummary.java (98%) create mode 100644 src/test/java/org/alliancegenome/curation_api/bulkupload/fms/PhenotypeAnnotationBulkUploadFmsITCase.java rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/01_all_fields.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/02_no_id.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/03_no_name.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/04_no_inchi.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/05_no_inchikey.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/06_no_iupac.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/07_no_formula.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/08_no_smiles.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/09_no_synonyms.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/10_no_cross_references.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/11_empty_inchi.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/12_empty_id.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/13_empty_iupac.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/14_empty_inchikey.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/15_empty_name.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/16_empty_smiles.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/17_empty_formula.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/18_empty_cross_references.json (100%) rename src/test/resources/bulk/fms/{05_molecule => 01_molecule}/19_empty_synonyms.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/AF_01_all_fields.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/ER_01_empty_gene1.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/ER_02_empty_gene2.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/ER_03_empty_isBestScore.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/ER_04_empty_isBestRevScore.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/ER_05_empty_confidence.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/IV_01_invalid_gene1.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/IV_02_invalid_gene2.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/IV_03_invalid_gene1Species.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/IV_04_invalid_gene2Species.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/IV_05_invalid_isBestScore.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/IV_06_invalid_isBestRevScore.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/IV_07_invalid_confidence.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/IV_08_invalid_predictionMethodsMatched.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/IV_09_invalid_predictionMethodsNotMatched.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/IV_10_invalid_predictionMethodsNotCalled.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/IV_11_invalid_gene1Species_for_gene1.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/IV_12_invalid_gene2Species_for_gene2.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/MR_01_no_gene1.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/MR_02_no_gene2.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/MR_03_no_gene1Species.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/MR_04_no_gene2Species.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/MR_05_no_isBestScore.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/MR_06_no_isBestRevScore.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/MR_07_no_confidence.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/UE_01_update_empty_non_required_fields.json (100%) rename src/test/resources/bulk/fms/{06_orthology => 02_orthology}/UM_01_update_no_non_required_fields.json (100%) create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/AF_01_all_fields_primary_agm_annotation.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/AS_01_add_secondary_allele_annotation_to_primary_agm_annotation.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/ER_01_empty_object_id.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/ER_02_empty_date_assigned.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/ER_03_empty_phenotype_statement.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/ER_04_empty_evidence.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/ER_05_empty_condition_relation_type.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/ER_06_empty_conditions.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/ER_07_empty_condition_statement.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/ER_08_empty_condition_class_id.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/IV_01_invalid_object_id.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/IV_02_invalid_primary_genetic_id.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/IV_03_invalid_phenotype_term_identifier.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/IV_04_invalid_evidence.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/IV_05_invalid_date_assigned.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/IV_06_invalid_condition_relation_type.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/IV_07_invalid_condition_class_id.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/IV_08_invalid_condition_id.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/IV_09_invalid_anatomical_ontology_id.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/IV_10_invalid_gene_ontology_id.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/IV_11_invalid_ncbi_taxon_id.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/IV_12_invalid_chemical_ontology_id.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/MR_01_no_object_id.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/MR_02_no_date_assigned.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/MR_03_no_phenotype_statement.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/MR_04_no_evidence.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/MR_05_no_condition_relation_type.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/MR_06_no_conditions.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/MR_07_no_condition_statement.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/MR_08_no_condition_class_id.json create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/SI_01_secondary_ids.json diff --git a/src/main/java/org/alliancegenome/curation_api/constants/EntityFieldConstants.java b/src/main/java/org/alliancegenome/curation_api/constants/EntityFieldConstants.java index 402678c24..10197ae87 100644 --- a/src/main/java/org/alliancegenome/curation_api/constants/EntityFieldConstants.java +++ b/src/main/java/org/alliancegenome/curation_api/constants/EntityFieldConstants.java @@ -7,6 +7,8 @@ public final class EntityFieldConstants { public static final String SECONDARY_DATA_PROVIDER = "secondaryDataProvider.sourceOrganization.abbreviation"; public static final String DA_SUBJECT = "diseaseAnnotationSubject"; public static final String DA_SUBJECT_TAXON = DA_SUBJECT+ "." + TAXON; + public static final String PA_SUBJECT = "phenotypeAnnotationSubject"; + public static final String PA_SUBJECT_TAXON = PA_SUBJECT+ "." + TAXON; public static final String ALLELE_ASSOCIATION_SUBJECT_DATA_PROVIDER = "alleleAssociationSubject." + DATA_PROVIDER; public static final String CONSTRUCT_ASSOCIATION_SUBJECT_DATA_PROVIDER = "constructAssociationSubject." + DATA_PROVIDER; diff --git a/src/main/java/org/alliancegenome/curation_api/controllers/crud/AGMPhenotypeAnnotationCrudController.java b/src/main/java/org/alliancegenome/curation_api/controllers/crud/AGMPhenotypeAnnotationCrudController.java new file mode 100644 index 000000000..c40c84513 --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/controllers/crud/AGMPhenotypeAnnotationCrudController.java @@ -0,0 +1,29 @@ +package org.alliancegenome.curation_api.controllers.crud; + +import org.alliancegenome.curation_api.controllers.base.BaseEntityCrudController; +import org.alliancegenome.curation_api.dao.AGMPhenotypeAnnotationDAO; +import org.alliancegenome.curation_api.interfaces.crud.AGMPhenotypeAnnotationCrudInterface; +import org.alliancegenome.curation_api.model.entities.AGMPhenotypeAnnotation; +import org.alliancegenome.curation_api.response.ObjectResponse; +import org.alliancegenome.curation_api.services.AGMPhenotypeAnnotationService; + +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; + +@RequestScoped +public class AGMPhenotypeAnnotationCrudController extends BaseEntityCrudController implements AGMPhenotypeAnnotationCrudInterface { + + @Inject + AGMPhenotypeAnnotationService agmPhenotypeAnnotationService; + + @Override + @PostConstruct + protected void init() { + setService(agmPhenotypeAnnotationService); + } + + public ObjectResponse get(String identifierString) { + return agmPhenotypeAnnotationService.get(identifierString); + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AGMPhenotypeAnnotationCrudInterface.java b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AGMPhenotypeAnnotationCrudInterface.java index ecbd7922d..fb7d77956 100644 --- a/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AGMPhenotypeAnnotationCrudInterface.java +++ b/src/main/java/org/alliancegenome/curation_api/interfaces/crud/AGMPhenotypeAnnotationCrudInterface.java @@ -1,10 +1,7 @@ package org.alliancegenome.curation_api.interfaces.crud; -import org.alliancegenome.curation_api.interfaces.base.BaseDTOCrudControllerInterface; import org.alliancegenome.curation_api.interfaces.base.BaseIdCrudInterface; -import org.alliancegenome.curation_api.model.entities.AGMDiseaseAnnotation; import org.alliancegenome.curation_api.model.entities.AGMPhenotypeAnnotation; -import org.alliancegenome.curation_api.model.ingest.dto.AGMDiseaseAnnotationDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.view.View; import org.eclipse.microprofile.openapi.annotations.tags.Tag; @@ -24,7 +21,7 @@ @Tag(name = "CRUD - AGM Phenotype Annotations") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) -public interface AGMPhenotypeAnnotationCrudInterface extends BaseIdCrudInterface, BaseDTOCrudControllerInterface { +public interface AGMPhenotypeAnnotationCrudInterface extends BaseIdCrudInterface { @GET @Path("/findBy/{identifier}") diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java index aee1002f7..4765011b9 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java @@ -95,7 +95,7 @@ private void loadSecondaryAnnotations(BulkLoadFileHistory history, List getAllReferencedConditionRelationIds() { } public List getAnnotationIdsByDataProvider(BackendBulkDataProvider dataProvider) { - return getAnnotationIdsByDataProvider(phenotypeAnnotationDAO, dataProvider); + List existingPhenotypeAnnotationIds = new ArrayList<>(); + existingPhenotypeAnnotationIds.addAll(getAnnotationIdsByDataProvider(agmPhenotypeAnnotationDAO, dataProvider)); + //TODO: add lists from other subtypes + return existingPhenotypeAnnotationIds; } protected > List getAnnotationIdsByDataProvider(D dao, BackendBulkDataProvider dataProvider) { - //TODO: need some rules for XenBase submissions here - Map params = new HashMap<>(); params.put(EntityFieldConstants.DATA_PROVIDER, dataProvider.sourceOrganization); - if(StringUtils.equals(dataProvider.sourceOrganization, "RGD")) - params.put(EntityFieldConstants.DA_SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); + if(StringUtils.equals(dataProvider.sourceOrganization, "RGD") || StringUtils.equals(dataProvider.sourceOrganization, "XB")) + params.put(EntityFieldConstants.PA_SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); - List annotationIds = phenotypeAnnotationDAO.findFilteredIds(params); - annotationIds.removeIf(Objects::isNull); - - if (StringUtils.equals(dataProvider.toString(), "HUMAN")) { - Map newParams = new HashMap<>(); - newParams.put(EntityFieldConstants.SECONDARY_DATA_PROVIDER, dataProvider.sourceOrganization); - newParams.put(EntityFieldConstants.DA_SUBJECT_TAXON, dataProvider.canonicalTaxonCurie); - List additionalIds = phenotypeAnnotationDAO.findFilteredIds(newParams); - annotationIds.addAll(additionalIds); - } + List annotationIds = dao.findFilteredIds(params); return annotationIds; } @@ -197,7 +191,7 @@ public Long upsertPrimaryAnnotation(PhenotypeFmsDTO dto, BackendBulkDataProvider public void addInferredOrAssertedEntities(PhenotypeFmsDTO dto, List idsAdded, BackendBulkDataProvider dataProvider) throws ObjectUpdateException { for (String primaryGeneticEntityCurie : dto.getPrimaryGeneticEntityIds()) { - GenomicEntity primaryAnnotationSubject = genomicEntityService.findByIdentifierString(dto.getObjectId()); + GenomicEntity primaryAnnotationSubject = genomicEntityService.findByIdentifierString(primaryGeneticEntityCurie); if (primaryAnnotationSubject == null) throw new ObjectValidationException(dto, "primaryGeneticEntityIds - " + ValidationConstants.INVALID_MESSAGE + " (" + primaryGeneticEntityCurie + ")"); diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/AnnotationRetrievalHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/AnnotationRetrievalHelper.java similarity index 89% rename from src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/AnnotationRetrievalHelper.java rename to src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/AnnotationRetrievalHelper.java index 085d6c231..25477f42b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/AnnotationRetrievalHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/AnnotationRetrievalHelper.java @@ -1,4 +1,4 @@ -package org.alliancegenome.curation_api.services.helpers.diseaseAnnotations; +package org.alliancegenome.curation_api.services.helpers.annotations; import org.alliancegenome.curation_api.model.entities.Annotation; import org.alliancegenome.curation_api.response.SearchResponse; diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/AnnotationUniqueIdHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/AnnotationUniqueIdHelper.java similarity index 93% rename from src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/AnnotationUniqueIdHelper.java rename to src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/AnnotationUniqueIdHelper.java index 0407ae706..236007f7e 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/AnnotationUniqueIdHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/AnnotationUniqueIdHelper.java @@ -1,5 +1,6 @@ -package org.alliancegenome.curation_api.services.helpers.diseaseAnnotations; +package org.alliancegenome.curation_api.services.helpers.annotations; +import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.stream.Collectors; @@ -126,15 +127,21 @@ public static String getPhenotypeAnnotationUniqueId(PhenotypeFmsDTO annotationFm uniqueId.addList(annotationFmsDTO.getPhenotypeTermIdentifiers().stream().map(PhenotypeTermIdentifierFmsDTO::getTermId).collect(Collectors.toList())); uniqueId.add(refCurie); if (CollectionUtils.isNotEmpty(annotationFmsDTO.getConditionRelations())) { - uniqueId.addList(annotationFmsDTO.getConditionRelations().stream().map(conditionFmsDTO -> { + List crIds = new ArrayList<>(); + for (ConditionRelationFmsDTO crFmsDto : annotationFmsDTO.getConditionRelations()) { UniqueIdGeneratorHelper gen = new UniqueIdGeneratorHelper(); - gen.add(FmsConditionRelation.valueOf(conditionFmsDTO.getConditionRelationType()).agrRelation); - if (CollectionUtils.isNotEmpty(conditionFmsDTO.getConditions())) - gen.add(conditionFmsDTO.getConditions().stream().map(AnnotationUniqueIdHelper::getExperimentalConditionUniqueId).collect(Collectors.joining(DELIMITER))); - return gen.getUniqueId(); - }).collect(Collectors.toList())); + FmsConditionRelation fmsCr = null; + if (StringUtils.isNotBlank(crFmsDto.getConditionRelationType())) + fmsCr = FmsConditionRelation.findByName(crFmsDto.getConditionRelationType()); + if (fmsCr != null) + gen.add(fmsCr.agrRelation); + if (CollectionUtils.isNotEmpty(crFmsDto.getConditions())) + gen.add(crFmsDto.getConditions().stream().map(AnnotationUniqueIdHelper::getExperimentalConditionUniqueId).collect(Collectors.joining(DELIMITER))); + crIds.add(gen.getUniqueId()); + } + uniqueId.addAll(crIds); } - + return uniqueId.getUniqueId(); } diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdUpdateHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/DiseaseAnnotationUniqueIdUpdateHelper.java similarity index 94% rename from src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdUpdateHelper.java rename to src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/DiseaseAnnotationUniqueIdUpdateHelper.java index 77071e32d..8308bf6ce 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/DiseaseAnnotationUniqueIdUpdateHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/DiseaseAnnotationUniqueIdUpdateHelper.java @@ -1,4 +1,4 @@ -package org.alliancegenome.curation_api.services.helpers.diseaseAnnotations; +package org.alliancegenome.curation_api.services.helpers.annotations; import org.alliancegenome.curation_api.dao.DiseaseAnnotationDAO; import org.alliancegenome.curation_api.model.entities.DiseaseAnnotation; diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/ExperimentalConditionSummary.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/ExperimentalConditionSummary.java similarity index 98% rename from src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/ExperimentalConditionSummary.java rename to src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/ExperimentalConditionSummary.java index 7a0d5847a..cfc641562 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/diseaseAnnotations/ExperimentalConditionSummary.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/ExperimentalConditionSummary.java @@ -1,4 +1,4 @@ -package org.alliancegenome.curation_api.services.helpers.diseaseAnnotations; +package org.alliancegenome.curation_api.services.helpers.annotations; import org.alliancegenome.curation_api.model.entities.ExperimentalCondition; import org.alliancegenome.curation_api.model.entities.ontology.AnatomicalTerm; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java index 2b2b077a0..2b2e17676 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ConditionRelationValidator.java @@ -19,7 +19,7 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.ReferenceService; import org.alliancegenome.curation_api.services.VocabularyTermService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationUniqueIdHelper; import org.alliancegenome.curation_api.services.validation.base.AuditedObjectValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java index 97f791897..b3872b946 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/DiseaseAnnotationValidator.java @@ -22,7 +22,7 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.DataProviderService; import org.alliancegenome.curation_api.services.VocabularyTermService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationUniqueIdHelper; import org.alliancegenome.curation_api.services.ontology.DoTermService; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java index 35ceaee17..f204fd15e 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/ExperimentalConditionValidator.java @@ -13,8 +13,8 @@ import org.alliancegenome.curation_api.model.entities.ontology.ZECOTerm; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.ExperimentalConditionSummary; +import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.annotations.ExperimentalConditionSummary; import org.alliancegenome.curation_api.services.ontology.AnatomicalTermService; import org.alliancegenome.curation_api.services.ontology.ChemicalTermService; import org.alliancegenome.curation_api.services.ontology.ExperimentalConditionOntologyTermService; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java index c1563f960..ed1320ad2 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AGMDiseaseAnnotationDTOValidator.java @@ -22,8 +22,8 @@ import org.alliancegenome.curation_api.services.AlleleService; import org.alliancegenome.curation_api.services.GeneService; import org.alliancegenome.curation_api.services.VocabularyTermService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationRetrievalHelper; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationRetrievalHelper; +import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationUniqueIdHelper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java index 91f02a3ce..7e3597781 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/AlleleDiseaseAnnotationDTOValidator.java @@ -20,8 +20,8 @@ import org.alliancegenome.curation_api.services.AlleleService; import org.alliancegenome.curation_api.services.GeneService; import org.alliancegenome.curation_api.services.VocabularyTermService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationRetrievalHelper; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationRetrievalHelper; +import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationUniqueIdHelper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConditionRelationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConditionRelationDTOValidator.java index 7e3cd2dfe..94c405084 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConditionRelationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ConditionRelationDTOValidator.java @@ -18,7 +18,7 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.ReferenceService; import org.alliancegenome.curation_api.services.VocabularyTermService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationUniqueIdHelper; import org.alliancegenome.curation_api.services.validation.dto.base.BaseDTOValidator; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java index abf5f752c..bbba8a1b5 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/ExperimentalConditionDTOValidator.java @@ -13,8 +13,8 @@ import org.alliancegenome.curation_api.model.ingest.dto.ExperimentalConditionDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.ExperimentalConditionSummary; +import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.annotations.ExperimentalConditionSummary; import org.alliancegenome.curation_api.services.ontology.AnatomicalTermService; import org.alliancegenome.curation_api.services.ontology.ChemicalTermService; import org.alliancegenome.curation_api.services.ontology.ExperimentalConditionOntologyTermService; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java index 8bf4fd47c..d11a0c4ec 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/GeneDiseaseAnnotationDTOValidator.java @@ -17,8 +17,8 @@ import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.AffectedGenomicModelService; import org.alliancegenome.curation_api.services.VocabularyTermService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationRetrievalHelper; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationRetrievalHelper; +import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationUniqueIdHelper; import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.RequestScoped; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/AGMPhenotypeAnnotationFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/AGMPhenotypeAnnotationFmsDTOValidator.java index bd2def40c..1f4c55b91 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/AGMPhenotypeAnnotationFmsDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/AGMPhenotypeAnnotationFmsDTOValidator.java @@ -17,7 +17,7 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.GenomicEntityService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationUniqueIdHelper; import org.apache.commons.lang3.StringUtils; import jakarta.enterprise.context.RequestScoped; @@ -83,7 +83,7 @@ public AGMPhenotypeAnnotation validateInferredOrAssertedEntities(AffectedGenomic throw new ObjectValidationException(dto, "Primary annotation not found for " + primaryAnnotationSubject.getIdentifier()); AGMPhenotypeAnnotation primaryAnnotation = annotationSearch.getSingleResult(); if (!idsAdded.contains(primaryAnnotation.getId())) - throw new ObjectValidationException(dto, "Primary annotation not included in submitted file (" + primaryAnnotationUniqueId + ")"); + throw new ObjectValidationException(dto, "Primary annotation not included in submission (" + primaryAnnotationUniqueId + ")"); if (StringUtils.isBlank(dto.getObjectId())) { apaResponse.addErrorMessage("objectId", ValidationConstants.REQUIRED_MESSAGE); diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java index c89646c9b..dbbcfcab8 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java @@ -16,7 +16,7 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.VocabularyTermService; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationUniqueIdHelper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ExperimentalConditionFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ExperimentalConditionFmsDTOValidator.java index 2db263356..ec1bd4b9a 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ExperimentalConditionFmsDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ExperimentalConditionFmsDTOValidator.java @@ -13,7 +13,7 @@ import org.alliancegenome.curation_api.model.ingest.dto.fms.ExperimentalConditionFmsDTO; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.AnnotationUniqueIdHelper; +import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationUniqueIdHelper; import org.alliancegenome.curation_api.services.ontology.AnatomicalTermService; import org.alliancegenome.curation_api.services.ontology.ChemicalTermService; import org.alliancegenome.curation_api.services.ontology.ExperimentalConditionOntologyTermService; @@ -95,7 +95,7 @@ public ObjectResponse validateExperimentalConditionFmsDTO if (StringUtils.isNotBlank(dto.getNcbiTaxonId())) { conditionTaxon = ncbiTaxonTermService.getTaxonFromDB(dto.getNcbiTaxonId()); if (conditionTaxon == null) - ecResponse.addErrorMessage("NCBITaxonID", ValidationConstants.INVALID_MESSAGE + " (" + dto.getNcbiTaxonId() + ")"); + ecResponse.addErrorMessage("NCBITaxonId", ValidationConstants.INVALID_MESSAGE + " (" + dto.getNcbiTaxonId() + ")"); } experimentalCondition.setConditionTaxon(conditionTaxon); @@ -112,11 +112,6 @@ public ObjectResponse validateExperimentalConditionFmsDTO conditionQuantity = dto.getConditionQuantity(); experimentalCondition.setConditionQuantity(conditionQuantity); - String conditionFreeText = null; - if (StringUtils.isNotBlank(dto.getConditionStatement())) - conditionFreeText = dto.getConditionStatement(); - experimentalCondition.setConditionFreeText(conditionFreeText); - if (StringUtils.isNotBlank(dto.getConditionStatement())) { experimentalCondition.setConditionSummary(dto.getConditionStatement()); } else { diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/PhenotypeAnnotationFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/PhenotypeAnnotationFmsDTOValidator.java index 5953998e2..3516d50bc 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/PhenotypeAnnotationFmsDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/PhenotypeAnnotationFmsDTOValidator.java @@ -54,13 +54,16 @@ public ObjectResponse validatePhenotypeAnnota } annotation.setPhenotypeAnnotationObject(dto.getPhenotypeStatement()); - if (CollectionUtils.isNotEmpty(dto.getPhenotypeTermIdentifiers())) { + //TODO: remove ZFIN condition once ZFIN have mapped terms to PhenotypeTerm terms in FMS submissions + if (CollectionUtils.isNotEmpty(dto.getPhenotypeTermIdentifiers()) && !StringUtils.equals(beDataProvider.sourceOrganization, "ZFIN")) { List phenotypeTerms = new ArrayList<>(); for (PhenotypeTermIdentifierFmsDTO phenotypeTermIdentifier : dto.getPhenotypeTermIdentifiers()) { if (StringUtils.isNotBlank(phenotypeTermIdentifier.getTermId())) { PhenotypeTerm phenotypeTerm = phenotypeTermService.findByCurieOrSecondaryId(phenotypeTermIdentifier.getTermId()); if (phenotypeTerm == null) { paResponse.addErrorMessage("phenotypeTermIdentifiers", ValidationConstants.INVALID_MESSAGE + " (" + phenotypeTermIdentifier.getTermId() + ")"); + } else { + phenotypeTerms.add(phenotypeTerm); } } } @@ -94,6 +97,8 @@ public ObjectResponse validatePhenotypeAnnota } catch (DateTimeParseException e) { paResponse.addErrorMessage("dateAssigned", ValidationConstants.INVALID_MESSAGE + " (" + dto.getDateAssigned() + ")"); } + } else { + paResponse.addErrorMessage("dateAssigned", ValidationConstants.REQUIRED_MESSAGE); } annotation.setDateCreated(creationDate); diff --git a/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java b/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java index 025c42538..6682fdd34 100644 --- a/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/base/BaseITCase.java @@ -12,6 +12,7 @@ import org.alliancegenome.curation_api.constants.OntologyConstants; import org.alliancegenome.curation_api.constants.VocabularyConstants; import org.alliancegenome.curation_api.model.entities.AGMDiseaseAnnotation; +import org.alliancegenome.curation_api.model.entities.AGMPhenotypeAnnotation; import org.alliancegenome.curation_api.model.entities.AffectedGenomicModel; import org.alliancegenome.curation_api.model.entities.Allele; import org.alliancegenome.curation_api.model.entities.AlleleDiseaseAnnotation; @@ -107,6 +108,10 @@ public void checkFailedBulkLoad(String endpoint, String filePath) throws Excepti } public void checkSuccessfulBulkLoad(String endpoint, String filePath) throws Exception { + checkSuccessfulBulkLoad(endpoint, filePath, 1); + } + + public void checkSuccessfulBulkLoad(String endpoint, String filePath, int nrRecords) throws Exception { String content = Files.readString(Path.of(filePath)); RestAssured.given(). @@ -116,9 +121,9 @@ public void checkSuccessfulBulkLoad(String endpoint, String filePath) throws Exc post(endpoint). then(). statusCode(200). - body("history.totalRecords", is(1)). + body("history.totalRecords", is(nrRecords)). body("history.failedRecords", is(0)). - body("history.completedRecords", is(1)); + body("history.completedRecords", is(nrRecords)); } public AffectedGenomicModel createAffectedGenomicModel(String modEntityId, String taxonCurie, String subtypeName, String name, Boolean obsolete) { @@ -970,6 +975,11 @@ public Organization getOrganization(String abbreviation) { return response.getSingleResult(); } + protected TypeRef> getSearchResponseTypeRefAGMPhenotypeAnnotation() { + return new TypeRef>() { + }; + } + private TypeRef> getSearchResponseTypeRefOrganization() { return new TypeRef>() { }; diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/MoleculeBulkUploadFmsITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/MoleculeBulkUploadFmsITCase.java index 21ec70364..fb34acfb8 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/MoleculeBulkUploadFmsITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/MoleculeBulkUploadFmsITCase.java @@ -25,7 +25,7 @@ @QuarkusTestResource(TestContainerResource.Initializer.class) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@DisplayName("06 - Molecule bulk upload - FMS") +@DisplayName("501 - Molecule bulk upload - FMS") @Order(501) public class MoleculeBulkUploadFmsITCase { @@ -40,7 +40,7 @@ public void init() { @Test @Order(1) public void moleculeBulkUploadCheckFields() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/01_all_fields.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/01_all_fields.json")); // upload file RestAssured.given(). @@ -79,7 +79,7 @@ public void moleculeBulkUploadCheckFields() throws Exception { @Test @Order(2) public void moleculeBulkUploadNoId() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/02_no_id.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/02_no_id.json")); // upload file RestAssured.given(). @@ -103,7 +103,7 @@ public void moleculeBulkUploadNoId() throws Exception { @Test @Order(3) public void moleculeBulkUploadNoName() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/03_no_name.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/03_no_name.json")); // upload file RestAssured.given(). @@ -127,7 +127,7 @@ public void moleculeBulkUploadNoName() throws Exception { @Test @Order(4) public void moleculeBulkUploadNoInchi() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/04_no_inchi.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/04_no_inchi.json")); // upload file RestAssured.given(). @@ -152,7 +152,7 @@ public void moleculeBulkUploadNoInchi() throws Exception { @Test @Order(5) public void moleculeBulkUploadNoInchiKey() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/05_no_inchikey.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/05_no_inchikey.json")); // upload file RestAssured.given(). @@ -177,7 +177,7 @@ public void moleculeBulkUploadNoInchiKey() throws Exception { @Test @Order(6) public void moleculeBulkUploadNoIupac() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/06_no_iupac.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/06_no_iupac.json")); // upload file RestAssured.given(). @@ -202,7 +202,7 @@ public void moleculeBulkUploadNoIupac() throws Exception { @Test @Order(7) public void moleculeBulkUploadNoFormula() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/07_no_formula.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/07_no_formula.json")); // upload file RestAssured.given(). @@ -227,7 +227,7 @@ public void moleculeBulkUploadNoFormula() throws Exception { @Test @Order(8) public void moleculeBulkUploadNoSmiles() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/08_no_smiles.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/08_no_smiles.json")); // upload file RestAssured.given(). @@ -252,7 +252,7 @@ public void moleculeBulkUploadNoSmiles() throws Exception { @Test @Order(9) public void moleculeBulkUploadNoSynonyms() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/09_no_synonyms.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/09_no_synonyms.json")); // upload file RestAssured.given(). @@ -277,7 +277,7 @@ public void moleculeBulkUploadNoSynonyms() throws Exception { @Test @Order(10) public void moleculeBulkUploadNoCrossReferences() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/10_no_cross_references.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/10_no_cross_references.json")); // upload file RestAssured.given(). @@ -302,7 +302,7 @@ public void moleculeBulkUploadNoCrossReferences() throws Exception { @Test @Order(11) public void moleculeBulkUploadEmptyInchi() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/11_empty_inchi.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/11_empty_inchi.json")); // upload file RestAssured.given(). @@ -327,7 +327,7 @@ public void moleculeBulkUploadEmptyInchi() throws Exception { @Test @Order(12) public void moleculeBulkUploadEmptyId() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/12_empty_id.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/12_empty_id.json")); // upload file RestAssured.given(). @@ -352,7 +352,7 @@ public void moleculeBulkUploadEmptyId() throws Exception { @Test @Order(13) public void moleculeBulkUploadEmptyIupac() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/13_empty_iupac.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/13_empty_iupac.json")); // upload file RestAssured.given(). @@ -377,7 +377,7 @@ public void moleculeBulkUploadEmptyIupac() throws Exception { @Test @Order(14) public void moleculeBulkUploadEmptyInchiKey() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/14_empty_inchikey.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/14_empty_inchikey.json")); // upload file RestAssured.given(). @@ -402,7 +402,7 @@ public void moleculeBulkUploadEmptyInchiKey() throws Exception { @Test @Order(15) public void moleculeBulkUploadEmptyName() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/15_empty_name.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/15_empty_name.json")); // upload file RestAssured.given(). @@ -427,7 +427,7 @@ public void moleculeBulkUploadEmptyName() throws Exception { @Test @Order(16) public void moleculeBulkUploadEmptySmiles() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/16_empty_smiles.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/16_empty_smiles.json")); // upload file RestAssured.given(). @@ -452,7 +452,7 @@ public void moleculeBulkUploadEmptySmiles() throws Exception { @Test @Order(17) public void moleculeBulkUploadEmptyFormula() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/17_empty_formula.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/17_empty_formula.json")); // upload file RestAssured.given(). @@ -477,7 +477,7 @@ public void moleculeBulkUploadEmptyFormula() throws Exception { @Test @Order(18) public void moleculeBulkUploadEmptyCrossReferences() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/18_empty_cross_references.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/18_empty_cross_references.json")); // upload file RestAssured.given(). @@ -502,7 +502,7 @@ public void moleculeBulkUploadEmptyCrossReferences() throws Exception { @Test @Order(19) public void moleculeBulkUploadEmptySynonyms() throws Exception { - String content = Files.readString(Path.of("src/test/resources/bulk/fms/05_molecule/19_empty_synonyms.json")); + String content = Files.readString(Path.of("src/test/resources/bulk/fms/01_molecule/19_empty_synonyms.json")); // upload file RestAssured.given(). diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/OrthologyBulkUploadFmsITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/OrthologyBulkUploadFmsITCase.java index 28b6f97d5..e6a09b382 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/OrthologyBulkUploadFmsITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/OrthologyBulkUploadFmsITCase.java @@ -25,7 +25,7 @@ @QuarkusTestResource(TestContainerResource.Initializer.class) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@DisplayName("07 - Orthology bulk upload - FMS") +@DisplayName("502 - Orthology bulk upload - FMS") @Order(502) public class OrthologyBulkUploadFmsITCase extends BaseITCase { @@ -38,7 +38,7 @@ public void init() { } private final String orthologyBulkPostEndpoint = "/api/orthologygenerated/bulk/WB/orthologyfile"; - private final String orthologyTestFilePath = "src/test/resources/bulk/fms/06_orthology/"; + private final String orthologyTestFilePath = "src/test/resources/bulk/fms/02_orthology/"; private final String orthologyFindEndpoint = "/api/orthologygenerated/find?limit=100&page=0"; @Test diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/PhenotypeAnnotationBulkUploadFmsITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/PhenotypeAnnotationBulkUploadFmsITCase.java new file mode 100644 index 000000000..63512e135 --- /dev/null +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/PhenotypeAnnotationBulkUploadFmsITCase.java @@ -0,0 +1,234 @@ +package org.alliancegenome.curation_api.bulkupload.fms; + +import static org.hamcrest.Matchers.hasKey; +import static org.hamcrest.Matchers.hasSize; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; + +import java.util.List; + +import org.alliancegenome.curation_api.base.BaseITCase; +import org.alliancegenome.curation_api.constants.OntologyConstants; +import org.alliancegenome.curation_api.constants.VocabularyConstants; +import org.alliancegenome.curation_api.model.entities.AGMPhenotypeAnnotation; +import org.alliancegenome.curation_api.model.entities.DataProvider; +import org.alliancegenome.curation_api.model.entities.Vocabulary; +import org.alliancegenome.curation_api.model.entities.VocabularyTerm; +import org.alliancegenome.curation_api.resources.TestContainerResource; +import org.alliancegenome.curation_api.response.SearchResponse; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.TestMethodOrder; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.junit.QuarkusIntegrationTest; +import io.restassured.RestAssured; +import io.restassured.config.HttpClientConfig; +import io.restassured.config.RestAssuredConfig; + +@QuarkusIntegrationTest +@QuarkusTestResource(TestContainerResource.Initializer.class) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +@DisplayName("503 - Phenotype Annotation bulk upload - FMS") +@Order(503) +public class PhenotypeAnnotationBulkUploadFmsITCase extends BaseITCase { + + @BeforeEach + public void init() { + RestAssured.config = RestAssuredConfig.config() + .httpClient(HttpClientConfig.httpClientConfig() + .setParam("http.socket.timeout", 100000) + .setParam("http.connection.timeout", 100000)); + } + + private final String phenotypeAnnotationBulkPostEndpoint = "/api/phenotype-annotation/bulk/WB/annotationFile"; + private final String phenotypeAnnotationTestFilePath = "src/test/resources/bulk/fms/03_phenotype_annotation/"; + private final String phenotypeAnnotationGetEndpoint = "/api/phenotype-annotation/"; + private final String agmPhenotypeAnnotationFindEndpoint = "/api/agm-phenotype-annotation/find?limit=100&page=0"; + private Long agmPaId; + private final String agm = "PATEST:AGM0001"; + private final String allele = "PATEST:Allele0001"; + private final String gene = "PATEST:Gene0001"; + private final String reference = "AGRKB:000000002"; + private final String conditionRelationType = "exacerbated_by"; + private final String zecoTerm = "PATEST:ExpCondTerm0001"; + private final String nonSlimZecoTerm = "PATEST:NSExpCondTerm0001"; + private final String goTerm = "PATEST:GOTerm0001"; + private final String anatomyTerm = "PATEST:AnatomyTerm0001"; + private final String chemicalTerm = "PATEST:ChemicalTerm0001"; + private final String expCondTerm = "PATEST:ExpCondTerm0002"; + private final String mpTerm = "PATEST:MPTerm001"; + private final String phenotypeStatement = "test phenotype statement"; + + private void loadRequiredEntities() throws Exception { + loadGOTerm(goTerm, "Test GOTerm"); + loadExperimentalConditionTerm(expCondTerm, "Test ExperimentalConditionOntologyTerm"); + loadZecoTerm(zecoTerm, "Test ExperimentalConditionOntologyTerm", OntologyConstants.ZECO_AGR_SLIM_SUBSET); + loadZecoTerm(nonSlimZecoTerm, "Test ExperimentalConditionOntologyTerm", null); + loadChemicalTerm(chemicalTerm, "Test ChemicalTerm"); + loadAnatomyTerm(anatomyTerm, "Test AnatomicalTerm"); + Vocabulary nameTypeVocabulary = getVocabulary(VocabularyConstants.NAME_TYPE_VOCABULARY); + VocabularyTerm symbolTerm = getVocabularyTerm(nameTypeVocabulary, "nomenclature_symbol"); + DataProvider dataProvider = createDataProvider("WB", false); + loadGenes(List.of(gene), "NCBITaxon:6239", symbolTerm, dataProvider); + loadAllele(allele, "TestAllele", "NCBITaxon:6239", symbolTerm, dataProvider); + loadAffectedGenomicModel(agm, "Test AGM", "NCBITaxon:6239", "strain", dataProvider); + loadMPTerm(mpTerm, "Test PhenotypeTerm"); + } + + @Test + @Order(1) + public void agmPhenotypeAnnotationBulkUploadCheckFields() throws Exception { + loadRequiredEntities(); + + checkSuccessfulBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "AF_01_all_fields_primary_agm_annotation.json"); + + SearchResponse response = RestAssured.given(). + when(). + header("Content-Type", "application/json"). + body("{}"). + post(agmPhenotypeAnnotationFindEndpoint). + then(). + statusCode(200). + body("totalResults", is(1)). + body("results", hasSize(1)). + body("results[0].phenotypeAnnotationSubject.modEntityId", is(agm)). + body("results[0].phenotypeAnnotationObject", is(phenotypeStatement)). + body("results[0].relation.name", is("has_phenotype")). + body("results[0].dateCreated", is("2024-01-17T15:26:56Z")). + body("results[0].conditionRelations", hasSize(1)). + body("results[0].conditionRelations[0].internal", is(false)). + body("results[0].conditionRelations[0].obsolete", is(false)). + body("results[0].conditionRelations[0].conditionRelationType.name", is(conditionRelationType)). + body("results[0].conditionRelations[0].conditions", hasSize(1)). + body("results[0].conditionRelations[0].conditions[0].internal", is(false)). + body("results[0].conditionRelations[0].conditions[0].obsolete", is(false)). + body("results[0].conditionRelations[0].conditions[0].conditionClass.curie", is(zecoTerm)). + body("results[0].conditionRelations[0].conditions[0].conditionId.curie", is(expCondTerm)). + body("results[0].conditionRelations[0].conditions[0].conditionQuantity", is("Some amount")). + body("results[0].conditionRelations[0].conditions[0].conditionAnatomy.curie", is(anatomyTerm)). + body("results[0].conditionRelations[0].conditions[0].conditionGeneOntology.curie", is(goTerm)). + body("results[0].conditionRelations[0].conditions[0].conditionTaxon.curie", is("NCBITaxon:6239")). + body("results[0].conditionRelations[0].conditions[0].conditionChemical.curie", is(chemicalTerm)). + body("results[0].conditionRelations[0].conditions[0].conditionSummary", is("condition summary test")). + body("results[0].singleReference.curie", is(reference)). + body("results[0].phenotypeTerms", hasSize(1)). + body("results[0].phenotypeTerms[0].curie", is(mpTerm)). + extract().body().as(getSearchResponseTypeRefAGMPhenotypeAnnotation()); + + agmPaId = response.getResults().get(0).getId(); + } + + @Test + @Order(2) + public void allelePhenotypeAnnotationBulkUploadCheckFields() throws Exception { + //TODO: add test for loading of primary allele phenotype annotation + } + + @Test + @Order(3) + public void genePhenotypeAnnotationBulkUploadCheckFields() throws Exception { + //TODO: add test for loading of primary gene phenotype annotation + } + + @Test + @Order(4) + public void agmPhenotypeAnnotationAddSecondaryAnnotationFields() throws Exception { + // Tests that secondary annotations are added to primary annotations as asserted/inferred entities + // as dictated by rules in BackendBulkDataProvider + checkSuccessfulBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "AS_01_add_secondary_allele_annotation_to_primary_agm_annotation.json", 3); + + RestAssured.given(). + when(). + get(phenotypeAnnotationGetEndpoint + agmPaId). + then(). + statusCode(200). + body("entity.phenotypeAnnotationSubject.modEntityId", is(agm)). + body("entity.inferredGene.modEntityId", is(gene)). + body("entity.assertedAllele.modEntityId", is(allele)); + } + + @Test + @Order(5) + public void allelePhenotypeAnnotationAddSecondaryAnnotationFields() throws Exception { + //TODO: add test for addition of secondary gene annotation + } + + @Test + @Order(6) + public void agmPhenotypeAnnotationClearSecondaryAnnotationFields() throws Exception { + // Tests that secondary annotation fields are removed upon reloading of primary annotation + checkSuccessfulBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "AF_01_all_fields_primary_agm_annotation.json"); + + RestAssured.given(). + when(). + get(phenotypeAnnotationGetEndpoint + agmPaId). + then(). + statusCode(200). + body("entity.phenotypeAnnotationSubject.modEntityId", is(agm)). + body("entity", not(hasKey("inferredGene"))). + body("entity", not(hasKey("assertedAllele"))); + } + + @Test + @Order(7) + public void allelePhenotypeAnnotationAddSecondaryAnnotationFieldsUpdate() throws Exception { + //TODO: add test for update of primary allele annotation + } + + @Test + @Order(8) + public void phenotypeAnnotationBulkUploadMissingRequiredFields() throws Exception { + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "MR_01_no_object_id.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "MR_02_no_date_assigned.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "MR_03_no_phenotype_statement.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "MR_04_no_evidence.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "MR_05_no_condition_relation_type.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "MR_06_no_conditions.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "MR_07_no_condition_statement.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "MR_08_no_condition_class_id.json"); + } + + @Test + @Order(9) + public void phenotypeAnnotationBulkUploadEmptyRequiredFields() throws Exception { + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "ER_01_empty_object_id.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "ER_02_empty_date_assigned.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "ER_03_empty_phenotype_statement.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "ER_04_empty_evidence.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "ER_05_empty_condition_relation_type.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "ER_06_empty_conditions.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "ER_07_empty_condition_statement.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "ER_08_empty_condition_class_id.json"); + } + + @Test + @Order(10) + public void phenotypeAnnotationBulkUploadInvalidFields() throws Exception { + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IV_01_invalid_object_id.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IV_02_invalid_primary_genetic_id.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IV_03_invalid_phenotype_term_identifier.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IV_04_invalid_evidence.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IV_05_invalid_date_assigned.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IV_06_invalid_condition_relation_type.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IV_07_invalid_condition_class_id.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IV_08_invalid_condition_id.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IV_09_invalid_anatomical_ontology_id.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IV_10_invalid_gene_ontology_id.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IV_11_invalid_ncbi_taxon_id.json"); + checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IV_12_invalid_chemical_ontology_id.json"); + + } + + @Test + @Order(11) + public void diseaseAnnotationBulkUploadSecondaryIds() throws Exception { + checkSuccessfulBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "SI_01_secondary_ids.json"); + } + +} diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ExperimentalConditionITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ExperimentalConditionITCase.java index ccdbfd48f..9f03cb09a 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/ExperimentalConditionITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/ExperimentalConditionITCase.java @@ -16,8 +16,7 @@ import org.alliancegenome.curation_api.model.entities.ontology.ZECOTerm; import org.alliancegenome.curation_api.model.entities.ontology.ZFATerm; import org.alliancegenome.curation_api.resources.TestContainerResource; -import org.alliancegenome.curation_api.response.ObjectResponse; -import org.alliancegenome.curation_api.services.helpers.diseaseAnnotations.ExperimentalConditionSummary; +import org.alliancegenome.curation_api.services.helpers.annotations.ExperimentalConditionSummary; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -27,7 +26,6 @@ import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusIntegrationTest; import io.restassured.RestAssured; -import io.restassured.common.mapper.TypeRef; @QuarkusIntegrationTest @QuarkusTestResource(TestContainerResource.Initializer.class) diff --git a/src/test/resources/bulk/fms/05_molecule/01_all_fields.json b/src/test/resources/bulk/fms/01_molecule/01_all_fields.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/01_all_fields.json rename to src/test/resources/bulk/fms/01_molecule/01_all_fields.json diff --git a/src/test/resources/bulk/fms/05_molecule/02_no_id.json b/src/test/resources/bulk/fms/01_molecule/02_no_id.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/02_no_id.json rename to src/test/resources/bulk/fms/01_molecule/02_no_id.json diff --git a/src/test/resources/bulk/fms/05_molecule/03_no_name.json b/src/test/resources/bulk/fms/01_molecule/03_no_name.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/03_no_name.json rename to src/test/resources/bulk/fms/01_molecule/03_no_name.json diff --git a/src/test/resources/bulk/fms/05_molecule/04_no_inchi.json b/src/test/resources/bulk/fms/01_molecule/04_no_inchi.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/04_no_inchi.json rename to src/test/resources/bulk/fms/01_molecule/04_no_inchi.json diff --git a/src/test/resources/bulk/fms/05_molecule/05_no_inchikey.json b/src/test/resources/bulk/fms/01_molecule/05_no_inchikey.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/05_no_inchikey.json rename to src/test/resources/bulk/fms/01_molecule/05_no_inchikey.json diff --git a/src/test/resources/bulk/fms/05_molecule/06_no_iupac.json b/src/test/resources/bulk/fms/01_molecule/06_no_iupac.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/06_no_iupac.json rename to src/test/resources/bulk/fms/01_molecule/06_no_iupac.json diff --git a/src/test/resources/bulk/fms/05_molecule/07_no_formula.json b/src/test/resources/bulk/fms/01_molecule/07_no_formula.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/07_no_formula.json rename to src/test/resources/bulk/fms/01_molecule/07_no_formula.json diff --git a/src/test/resources/bulk/fms/05_molecule/08_no_smiles.json b/src/test/resources/bulk/fms/01_molecule/08_no_smiles.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/08_no_smiles.json rename to src/test/resources/bulk/fms/01_molecule/08_no_smiles.json diff --git a/src/test/resources/bulk/fms/05_molecule/09_no_synonyms.json b/src/test/resources/bulk/fms/01_molecule/09_no_synonyms.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/09_no_synonyms.json rename to src/test/resources/bulk/fms/01_molecule/09_no_synonyms.json diff --git a/src/test/resources/bulk/fms/05_molecule/10_no_cross_references.json b/src/test/resources/bulk/fms/01_molecule/10_no_cross_references.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/10_no_cross_references.json rename to src/test/resources/bulk/fms/01_molecule/10_no_cross_references.json diff --git a/src/test/resources/bulk/fms/05_molecule/11_empty_inchi.json b/src/test/resources/bulk/fms/01_molecule/11_empty_inchi.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/11_empty_inchi.json rename to src/test/resources/bulk/fms/01_molecule/11_empty_inchi.json diff --git a/src/test/resources/bulk/fms/05_molecule/12_empty_id.json b/src/test/resources/bulk/fms/01_molecule/12_empty_id.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/12_empty_id.json rename to src/test/resources/bulk/fms/01_molecule/12_empty_id.json diff --git a/src/test/resources/bulk/fms/05_molecule/13_empty_iupac.json b/src/test/resources/bulk/fms/01_molecule/13_empty_iupac.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/13_empty_iupac.json rename to src/test/resources/bulk/fms/01_molecule/13_empty_iupac.json diff --git a/src/test/resources/bulk/fms/05_molecule/14_empty_inchikey.json b/src/test/resources/bulk/fms/01_molecule/14_empty_inchikey.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/14_empty_inchikey.json rename to src/test/resources/bulk/fms/01_molecule/14_empty_inchikey.json diff --git a/src/test/resources/bulk/fms/05_molecule/15_empty_name.json b/src/test/resources/bulk/fms/01_molecule/15_empty_name.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/15_empty_name.json rename to src/test/resources/bulk/fms/01_molecule/15_empty_name.json diff --git a/src/test/resources/bulk/fms/05_molecule/16_empty_smiles.json b/src/test/resources/bulk/fms/01_molecule/16_empty_smiles.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/16_empty_smiles.json rename to src/test/resources/bulk/fms/01_molecule/16_empty_smiles.json diff --git a/src/test/resources/bulk/fms/05_molecule/17_empty_formula.json b/src/test/resources/bulk/fms/01_molecule/17_empty_formula.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/17_empty_formula.json rename to src/test/resources/bulk/fms/01_molecule/17_empty_formula.json diff --git a/src/test/resources/bulk/fms/05_molecule/18_empty_cross_references.json b/src/test/resources/bulk/fms/01_molecule/18_empty_cross_references.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/18_empty_cross_references.json rename to src/test/resources/bulk/fms/01_molecule/18_empty_cross_references.json diff --git a/src/test/resources/bulk/fms/05_molecule/19_empty_synonyms.json b/src/test/resources/bulk/fms/01_molecule/19_empty_synonyms.json similarity index 100% rename from src/test/resources/bulk/fms/05_molecule/19_empty_synonyms.json rename to src/test/resources/bulk/fms/01_molecule/19_empty_synonyms.json diff --git a/src/test/resources/bulk/fms/06_orthology/AF_01_all_fields.json b/src/test/resources/bulk/fms/02_orthology/AF_01_all_fields.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/AF_01_all_fields.json rename to src/test/resources/bulk/fms/02_orthology/AF_01_all_fields.json diff --git a/src/test/resources/bulk/fms/06_orthology/ER_01_empty_gene1.json b/src/test/resources/bulk/fms/02_orthology/ER_01_empty_gene1.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/ER_01_empty_gene1.json rename to src/test/resources/bulk/fms/02_orthology/ER_01_empty_gene1.json diff --git a/src/test/resources/bulk/fms/06_orthology/ER_02_empty_gene2.json b/src/test/resources/bulk/fms/02_orthology/ER_02_empty_gene2.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/ER_02_empty_gene2.json rename to src/test/resources/bulk/fms/02_orthology/ER_02_empty_gene2.json diff --git a/src/test/resources/bulk/fms/06_orthology/ER_03_empty_isBestScore.json b/src/test/resources/bulk/fms/02_orthology/ER_03_empty_isBestScore.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/ER_03_empty_isBestScore.json rename to src/test/resources/bulk/fms/02_orthology/ER_03_empty_isBestScore.json diff --git a/src/test/resources/bulk/fms/06_orthology/ER_04_empty_isBestRevScore.json b/src/test/resources/bulk/fms/02_orthology/ER_04_empty_isBestRevScore.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/ER_04_empty_isBestRevScore.json rename to src/test/resources/bulk/fms/02_orthology/ER_04_empty_isBestRevScore.json diff --git a/src/test/resources/bulk/fms/06_orthology/ER_05_empty_confidence.json b/src/test/resources/bulk/fms/02_orthology/ER_05_empty_confidence.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/ER_05_empty_confidence.json rename to src/test/resources/bulk/fms/02_orthology/ER_05_empty_confidence.json diff --git a/src/test/resources/bulk/fms/06_orthology/IV_01_invalid_gene1.json b/src/test/resources/bulk/fms/02_orthology/IV_01_invalid_gene1.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/IV_01_invalid_gene1.json rename to src/test/resources/bulk/fms/02_orthology/IV_01_invalid_gene1.json diff --git a/src/test/resources/bulk/fms/06_orthology/IV_02_invalid_gene2.json b/src/test/resources/bulk/fms/02_orthology/IV_02_invalid_gene2.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/IV_02_invalid_gene2.json rename to src/test/resources/bulk/fms/02_orthology/IV_02_invalid_gene2.json diff --git a/src/test/resources/bulk/fms/06_orthology/IV_03_invalid_gene1Species.json b/src/test/resources/bulk/fms/02_orthology/IV_03_invalid_gene1Species.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/IV_03_invalid_gene1Species.json rename to src/test/resources/bulk/fms/02_orthology/IV_03_invalid_gene1Species.json diff --git a/src/test/resources/bulk/fms/06_orthology/IV_04_invalid_gene2Species.json b/src/test/resources/bulk/fms/02_orthology/IV_04_invalid_gene2Species.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/IV_04_invalid_gene2Species.json rename to src/test/resources/bulk/fms/02_orthology/IV_04_invalid_gene2Species.json diff --git a/src/test/resources/bulk/fms/06_orthology/IV_05_invalid_isBestScore.json b/src/test/resources/bulk/fms/02_orthology/IV_05_invalid_isBestScore.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/IV_05_invalid_isBestScore.json rename to src/test/resources/bulk/fms/02_orthology/IV_05_invalid_isBestScore.json diff --git a/src/test/resources/bulk/fms/06_orthology/IV_06_invalid_isBestRevScore.json b/src/test/resources/bulk/fms/02_orthology/IV_06_invalid_isBestRevScore.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/IV_06_invalid_isBestRevScore.json rename to src/test/resources/bulk/fms/02_orthology/IV_06_invalid_isBestRevScore.json diff --git a/src/test/resources/bulk/fms/06_orthology/IV_07_invalid_confidence.json b/src/test/resources/bulk/fms/02_orthology/IV_07_invalid_confidence.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/IV_07_invalid_confidence.json rename to src/test/resources/bulk/fms/02_orthology/IV_07_invalid_confidence.json diff --git a/src/test/resources/bulk/fms/06_orthology/IV_08_invalid_predictionMethodsMatched.json b/src/test/resources/bulk/fms/02_orthology/IV_08_invalid_predictionMethodsMatched.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/IV_08_invalid_predictionMethodsMatched.json rename to src/test/resources/bulk/fms/02_orthology/IV_08_invalid_predictionMethodsMatched.json diff --git a/src/test/resources/bulk/fms/06_orthology/IV_09_invalid_predictionMethodsNotMatched.json b/src/test/resources/bulk/fms/02_orthology/IV_09_invalid_predictionMethodsNotMatched.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/IV_09_invalid_predictionMethodsNotMatched.json rename to src/test/resources/bulk/fms/02_orthology/IV_09_invalid_predictionMethodsNotMatched.json diff --git a/src/test/resources/bulk/fms/06_orthology/IV_10_invalid_predictionMethodsNotCalled.json b/src/test/resources/bulk/fms/02_orthology/IV_10_invalid_predictionMethodsNotCalled.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/IV_10_invalid_predictionMethodsNotCalled.json rename to src/test/resources/bulk/fms/02_orthology/IV_10_invalid_predictionMethodsNotCalled.json diff --git a/src/test/resources/bulk/fms/06_orthology/IV_11_invalid_gene1Species_for_gene1.json b/src/test/resources/bulk/fms/02_orthology/IV_11_invalid_gene1Species_for_gene1.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/IV_11_invalid_gene1Species_for_gene1.json rename to src/test/resources/bulk/fms/02_orthology/IV_11_invalid_gene1Species_for_gene1.json diff --git a/src/test/resources/bulk/fms/06_orthology/IV_12_invalid_gene2Species_for_gene2.json b/src/test/resources/bulk/fms/02_orthology/IV_12_invalid_gene2Species_for_gene2.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/IV_12_invalid_gene2Species_for_gene2.json rename to src/test/resources/bulk/fms/02_orthology/IV_12_invalid_gene2Species_for_gene2.json diff --git a/src/test/resources/bulk/fms/06_orthology/MR_01_no_gene1.json b/src/test/resources/bulk/fms/02_orthology/MR_01_no_gene1.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/MR_01_no_gene1.json rename to src/test/resources/bulk/fms/02_orthology/MR_01_no_gene1.json diff --git a/src/test/resources/bulk/fms/06_orthology/MR_02_no_gene2.json b/src/test/resources/bulk/fms/02_orthology/MR_02_no_gene2.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/MR_02_no_gene2.json rename to src/test/resources/bulk/fms/02_orthology/MR_02_no_gene2.json diff --git a/src/test/resources/bulk/fms/06_orthology/MR_03_no_gene1Species.json b/src/test/resources/bulk/fms/02_orthology/MR_03_no_gene1Species.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/MR_03_no_gene1Species.json rename to src/test/resources/bulk/fms/02_orthology/MR_03_no_gene1Species.json diff --git a/src/test/resources/bulk/fms/06_orthology/MR_04_no_gene2Species.json b/src/test/resources/bulk/fms/02_orthology/MR_04_no_gene2Species.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/MR_04_no_gene2Species.json rename to src/test/resources/bulk/fms/02_orthology/MR_04_no_gene2Species.json diff --git a/src/test/resources/bulk/fms/06_orthology/MR_05_no_isBestScore.json b/src/test/resources/bulk/fms/02_orthology/MR_05_no_isBestScore.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/MR_05_no_isBestScore.json rename to src/test/resources/bulk/fms/02_orthology/MR_05_no_isBestScore.json diff --git a/src/test/resources/bulk/fms/06_orthology/MR_06_no_isBestRevScore.json b/src/test/resources/bulk/fms/02_orthology/MR_06_no_isBestRevScore.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/MR_06_no_isBestRevScore.json rename to src/test/resources/bulk/fms/02_orthology/MR_06_no_isBestRevScore.json diff --git a/src/test/resources/bulk/fms/06_orthology/MR_07_no_confidence.json b/src/test/resources/bulk/fms/02_orthology/MR_07_no_confidence.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/MR_07_no_confidence.json rename to src/test/resources/bulk/fms/02_orthology/MR_07_no_confidence.json diff --git a/src/test/resources/bulk/fms/06_orthology/UE_01_update_empty_non_required_fields.json b/src/test/resources/bulk/fms/02_orthology/UE_01_update_empty_non_required_fields.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/UE_01_update_empty_non_required_fields.json rename to src/test/resources/bulk/fms/02_orthology/UE_01_update_empty_non_required_fields.json diff --git a/src/test/resources/bulk/fms/06_orthology/UM_01_update_no_non_required_fields.json b/src/test/resources/bulk/fms/02_orthology/UM_01_update_no_non_required_fields.json similarity index 100% rename from src/test/resources/bulk/fms/06_orthology/UM_01_update_no_non_required_fields.json rename to src/test/resources/bulk/fms/02_orthology/UM_01_update_no_non_required_fields.json diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/AF_01_all_fields_primary_agm_annotation.json b/src/test/resources/bulk/fms/03_phenotype_annotation/AF_01_all_fields_primary_agm_annotation.json new file mode 100644 index 000000000..90900d377 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/AF_01_all_fields_primary_agm_annotation.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/AS_01_add_secondary_allele_annotation_to_primary_agm_annotation.json b/src/test/resources/bulk/fms/03_phenotype_annotation/AS_01_add_secondary_allele_annotation_to_primary_agm_annotation.json new file mode 100644 index 000000000..c8c2e2bec --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/AS_01_add_secondary_allele_annotation_to_primary_agm_annotation.json @@ -0,0 +1,118 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + }, + { + "objectId": "PATEST:Allele0001", + "primaryGeneticEntityIDs": ["PATEST:AGM0001"], + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + }, + { + "objectId": "PATEST:Gene0001", + "primaryGeneticEntityIDs": ["PATEST:AGM0001"], + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/ER_01_empty_object_id.json b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_01_empty_object_id.json new file mode 100644 index 000000000..a66c2970f --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_01_empty_object_id.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/ER_02_empty_date_assigned.json b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_02_empty_date_assigned.json new file mode 100644 index 000000000..41766b206 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_02_empty_date_assigned.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/ER_03_empty_phenotype_statement.json b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_03_empty_phenotype_statement.json new file mode 100644 index 000000000..2fb9b1f42 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_03_empty_phenotype_statement.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/ER_04_empty_evidence.json b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_04_empty_evidence.json new file mode 100644 index 000000000..8ac1764ad --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_04_empty_evidence.json @@ -0,0 +1,33 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "" + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/ER_05_empty_condition_relation_type.json b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_05_empty_condition_relation_type.json new file mode 100644 index 000000000..bdd2edde8 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_05_empty_condition_relation_type.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/ER_06_empty_conditions.json b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_06_empty_conditions.json new file mode 100644 index 000000000..08cefffc6 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_06_empty_conditions.json @@ -0,0 +1,29 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/ER_07_empty_condition_statement.json b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_07_empty_condition_statement.json new file mode 100644 index 000000000..82837c921 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_07_empty_condition_statement.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/ER_08_empty_condition_class_id.json b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_08_empty_condition_class_id.json new file mode 100644 index 000000000..93da1ac65 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/ER_08_empty_condition_class_id.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/IV_01_invalid_object_id.json b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_01_invalid_object_id.json new file mode 100644 index 000000000..b922bfa80 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_01_invalid_object_id.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:InvalidAGM", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/IV_02_invalid_primary_genetic_id.json b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_02_invalid_primary_genetic_id.json new file mode 100644 index 000000000..f5f9b02e5 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_02_invalid_primary_genetic_id.json @@ -0,0 +1,41 @@ +[ + { + "objectId": "PATEST:Allele0001", + "primaryGeneticEntityIDs": ["PATEST:InvalidAGM"], + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/IV_03_invalid_phenotype_term_identifier.json b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_03_invalid_phenotype_term_identifier.json new file mode 100644 index 000000000..77e9bbf28 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_03_invalid_phenotype_term_identifier.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:InvalidMPTerm", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/IV_04_invalid_evidence.json b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_04_invalid_evidence.json new file mode 100644 index 000000000..296baca2b --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_04_invalid_evidence.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:Invalid", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/IV_05_invalid_date_assigned.json b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_05_invalid_date_assigned.json new file mode 100644 index 000000000..f506658a8 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_05_invalid_date_assigned.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "invalid date string", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/IV_06_invalid_condition_relation_type.json b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_06_invalid_condition_relation_type.json new file mode 100644 index 000000000..d13d04f5f --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_06_invalid_condition_relation_type.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "invalid", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/IV_07_invalid_condition_class_id.json b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_07_invalid_condition_class_id.json new file mode 100644 index 000000000..03ee5c00d --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_07_invalid_condition_class_id.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:NSExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/IV_08_invalid_condition_id.json b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_08_invalid_condition_id.json new file mode 100644 index 000000000..4a78d719f --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_08_invalid_condition_id.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:InvalidExpCondTerm", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/IV_09_invalid_anatomical_ontology_id.json b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_09_invalid_anatomical_ontology_id.json new file mode 100644 index 000000000..d235ddc1b --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_09_invalid_anatomical_ontology_id.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:InvalidAnatomyTerm", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/IV_10_invalid_gene_ontology_id.json b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_10_invalid_gene_ontology_id.json new file mode 100644 index 000000000..f8b9b8d0e --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_10_invalid_gene_ontology_id.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:InvalidGOTerm", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/IV_11_invalid_ncbi_taxon_id.json b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_11_invalid_ncbi_taxon_id.json new file mode 100644 index 000000000..b92bcb293 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_11_invalid_ncbi_taxon_id.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:Invalid", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/IV_12_invalid_chemical_ontology_id.json b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_12_invalid_chemical_ontology_id.json new file mode 100644 index 000000000..f70296746 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/IV_12_invalid_chemical_ontology_id.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:InvalidChemicalTerm" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/MR_01_no_object_id.json b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_01_no_object_id.json new file mode 100644 index 000000000..16bf97f4e --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_01_no_object_id.json @@ -0,0 +1,39 @@ +[ + { + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/MR_02_no_date_assigned.json b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_02_no_date_assigned.json new file mode 100644 index 000000000..5ac65444f --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_02_no_date_assigned.json @@ -0,0 +1,39 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/MR_03_no_phenotype_statement.json b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_03_no_phenotype_statement.json new file mode 100644 index 000000000..14098e946 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_03_no_phenotype_statement.json @@ -0,0 +1,39 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/MR_04_no_evidence.json b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_04_no_evidence.json new file mode 100644 index 000000000..e1ed760c1 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_04_no_evidence.json @@ -0,0 +1,30 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/MR_05_no_condition_relation_type.json b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_05_no_condition_relation_type.json new file mode 100644 index 000000000..b68174b8e --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_05_no_condition_relation_type.json @@ -0,0 +1,39 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/MR_06_no_conditions.json b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_06_no_conditions.json new file mode 100644 index 000000000..f5ea765ec --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_06_no_conditions.json @@ -0,0 +1,28 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates" + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/MR_07_no_condition_statement.json b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_07_no_condition_statement.json new file mode 100644 index 000000000..1b683a7d1 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_07_no_condition_statement.json @@ -0,0 +1,39 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/MR_08_no_condition_class_id.json b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_08_no_condition_class_id.json new file mode 100644 index 000000000..38b959cd9 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/MR_08_no_condition_class_id.json @@ -0,0 +1,39 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/SI_01_secondary_ids.json b/src/test/resources/bulk/fms/03_phenotype_annotation/SI_01_secondary_ids.json new file mode 100644 index 000000000..08b1f27f2 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/SI_01_secondary_ids.json @@ -0,0 +1,40 @@ +[ + { + "objectId": "PATEST:AGM0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001secondary", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002secondary", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001secondary", + "geneOntologyId": "PATEST:GOTerm0001secondary", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001secondary" + } + ] + } + ] + } +] \ No newline at end of file From d2102e878fce3f9eae1a1817233e5c63361d6b64 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 5 Mar 2024 10:49:25 +0000 Subject: [PATCH 132/159] Add missing views --- .../alliancegenome/curation_api/model/entities/Annotation.java | 2 +- .../curation_api/model/entities/ConditionRelation.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java index 07ccf9e81..ced8e0cd0 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/Annotation.java @@ -85,7 +85,7 @@ public class Annotation extends SingleReferenceAssociation { "singleReference.crossReferences.referencedCurie_keyword", "conditions.conditionSummary_keyword", "conditions.uniqueId_keyword" }) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany - @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class, View.ForPublic.class }) + @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class, View.PhenotypeAnnotationView.class, View.ForPublic.class }) @JoinTable(indexes = { @Index(name = "annotation_conditionrelation_annotation_index", columnList = "annotation_id"), @Index(name = "annotation_conditionrelation_conditionrelations_index", columnList = "conditionrelations_id")}) private List conditionRelations; diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java index bf0eb0842..1c51e1a21 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/ConditionRelation.java @@ -66,7 +66,7 @@ public class ConditionRelation extends UniqueIdAuditedObject { @IndexedEmbedded(includeDepth = 1) @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany - @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class, View.ConditionRelationView.class, View.ForPublic.class }) + @JsonView({ View.FieldsAndLists.class, View.DiseaseAnnotation.class, View.PhenotypeAnnotationView.class, View.ConditionRelationView.class, View.ForPublic.class }) private List conditions; public void addExperimentCondition(ExperimentalCondition experimentalCondition) { From 18745637ba8a0d7d580017bc80f9ed904ddd02b4 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 5 Mar 2024 11:17:22 +0000 Subject: [PATCH 133/159] Add UI tests --- .../PhenotypeAnnotationsTable.test.js | 63 ++ .../mockData/mockData.js | 691 ++++++++++++++++++ .../useNewAnnotationReducer.js | 176 ----- 3 files changed, 754 insertions(+), 176 deletions(-) create mode 100644 src/main/cliapp/src/containers/phenotypeAnnotationsPage/__tests__/PhenotypeAnnotationsTable.test.js create mode 100644 src/main/cliapp/src/containers/phenotypeAnnotationsPage/mockData/mockData.js delete mode 100644 src/main/cliapp/src/containers/phenotypeAnnotationsPage/useNewAnnotationReducer.js diff --git a/src/main/cliapp/src/containers/phenotypeAnnotationsPage/__tests__/PhenotypeAnnotationsTable.test.js b/src/main/cliapp/src/containers/phenotypeAnnotationsPage/__tests__/PhenotypeAnnotationsTable.test.js new file mode 100644 index 000000000..e631b8f4f --- /dev/null +++ b/src/main/cliapp/src/containers/phenotypeAnnotationsPage/__tests__/PhenotypeAnnotationsTable.test.js @@ -0,0 +1,63 @@ +import React from "react"; +import { waitFor } from "@testing-library/react"; +import { renderWithClient } from '../../../tools/jest/utils'; +import { PhenotypeAnnotationsPage } from "../index"; +import '../../../tools/jest/setupTests'; +import { setupSettingsHandler, setupFindHandler, setupSearchHandler, setupSaveSettingsHandler } from "../../../tools/jest/commonMswhandlers"; +import { data } from "../mockData/mockData"; +import 'core-js/features/structured-clone'; + +describe("", () => { + beforeEach(() => { + setupFindHandler(); + setupSettingsHandler(); + setupSaveSettingsHandler(); + setupSearchHandler(data); + }); + + it("Renders without crashing", async () => { + let result = await renderWithClient(); + + await waitFor(() => { + expect(result); + }); + }, 10000); + + it("Contains Correct Table Name", async () => { + let result = await renderWithClient(); + + const tableTitle = await result.findByText(/Phenotype Annotations Table/i); + expect(tableTitle).toBeInTheDocument(); + }, 10000); + + it("The table contains correct data", async () => { + let result = await renderWithClient(); + + const uniqueIdTd = await result.findByText("ZFIN:ZDB-FISH-150901-427|has_phenotype|head decreased size, abnormal|PATO:0000587|ZFA:0001114|AGRKB:101000000388372|has_condition|ZECO:0000103|standard conditions"); + const subjectTd = await result.findByText(/slc35d1ahi3378Tg\/hi3378Tg/i); + const relationTd = await result.findByText("has_phenotype"); + const objectTd = await result.findByText("head decreased size, abnormal"); + const referenceTd = await result.findByText(/PMID:15256591/i); + const inferredGeneTd = await result.findByText("Acd (MGI:87873)"); + const inferredAlleleTd = await result.findByText("Ccdt (MGI:1856658)"); + const assertedGeneTd = await result.findByText("Acox1 (MGI:1330812)"); + const assertedAlleleTd = await result.findByText("Acox1tm1Jkr (MGI:1857811)"); + const dataProviderTd = await result.findByText("ZFIN"); + const dateCreatedTd = await result.findByText("2024-01-17T15:26:57Z"); + + await waitFor(() => { + expect(uniqueIdTd).toBeInTheDocument(); + expect(subjectTd).toBeInTheDocument(); + expect(relationTd).toBeInTheDocument(); + expect(objectTd).toBeInTheDocument(); + expect(referenceTd).toBeInTheDocument(); + expect(inferredGeneTd).toBeInTheDocument(); + expect(inferredAlleleTd).toBeInTheDocument(); + expect(assertedGeneTd).toBeInTheDocument(); + expect(assertedAlleleTd).toBeInTheDocument(); + expect(dataProviderTd).toBeInTheDocument(); + expect(dateCreatedTd).toBeInTheDocument(); + }); + }, 10000); + +}); diff --git a/src/main/cliapp/src/containers/phenotypeAnnotationsPage/mockData/mockData.js b/src/main/cliapp/src/containers/phenotypeAnnotationsPage/mockData/mockData.js new file mode 100644 index 000000000..5e506a7c9 --- /dev/null +++ b/src/main/cliapp/src/containers/phenotypeAnnotationsPage/mockData/mockData.js @@ -0,0 +1,691 @@ +export const data = { + "results": [ + { + "type": "AGMPhenotypeAnnotation", + "id": 200386977, + "dateCreated": "2024-01-17T15:26:57Z", + "internal": false, + "obsolete": false, + "dbDateCreated": "2024-03-05T10:31:10.220795Z", + "dbDateUpdated": "2024-03-05T10:31:10.22081Z", + "singleReference": { + "id": 268175, + "internal": false, + "obsolete": false, + "dbDateCreated": "2022-11-18T19:41:54.20215Z", + "dbDateUpdated": "2023-09-11T18:13:34.464961Z", + "curie": "AGRKB:101000000388372", + "crossReferences": [ + { + "id": 74254507, + "internal": false, + "obsolete": false, + "referencedCurie": "DOI:10.1073/pnas.0403929101", + "displayName": "DOI:10.1073/pnas.0403929101" + }, + { + "id": 74254508, + "internal": false, + "obsolete": false, + "referencedCurie": "PMCID:PMC516474", + "displayName": "PMCID:PMC516474" + }, + { + "id": 74254509, + "internal": false, + "obsolete": false, + "referencedCurie": "PMID:15256591", + "displayName": "PMID:15256591" + }, + { + "id": 74254510, + "internal": false, + "obsolete": false, + "referencedCurie": "SGD:S000115492", + "displayName": "SGD:S000115492" + }, + { + "id": 74254511, + "internal": false, + "obsolete": false, + "referencedCurie": "ZFIN:ZDB-PUB-040708-1", + "displayName": "ZFIN:ZDB-PUB-040708-1" + } + ], + "shortCitation": "Amsterdam A (2004) Proc Natl Acad Sci U S A 101(35):12792-7" + }, + "uniqueId": "ZFIN:ZDB-FISH-150901-427|has_phenotype|head decreased size, abnormal|PATO:0000587|ZFA:0001114|AGRKB:101000000388372|has_condition|ZECO:0000103|standard conditions", + "conditionRelations": [ + { + "id": 200000250, + "internal": false, + "obsolete": false, + "dbDateCreated": "2024-03-03T12:52:16.68015Z", + "dbDateUpdated": "2024-03-05T10:41:05.999755Z", + "uniqueId": "has_condition|ZECO:0000103|standard conditions", + "conditionRelationType": { + "id": 7662730, + "internal": false, + "obsolete": false, + "name": "has_condition" + }, + "conditions": [ + { + "id": 200000200, + "internal": false, + "obsolete": false, + "dbDateCreated": "2024-03-03T12:52:16.657856Z", + "dbDateUpdated": "2024-03-03T12:52:16.657879Z", + "uniqueId": "ZECO:0000103|standard conditions", + "conditionClass": { + "id": 5550, + "internal": false, + "obsolete": false, + "curie": "ZECO:0000103", + "name": "standard conditions", + "definition": "Experimental condition that is the standard environment for zebrafish husbandry, as described in ‘The Zebrafish Book’. In general the standard environment utilizes contaminant free tank water, heated to 28.5 degrees C, with the fish fed a normal contaminant free diet, with standard osmolarity, pH, and normal light cycle of 14hr light/10hr dark." + }, + "conditionSummary": "standard conditions", + "conditionFreeText": "standard conditions" + } + ] + } + ], + "dataProvider": { + "id": 201422341, + "internal": false, + "obsolete": false, + "dbDateCreated": "2024-03-05T10:31:10.219143Z", + "dbDateUpdated": "2024-03-05T10:31:10.21916Z", + "sourceOrganization": { + "id": 20308685, + "internal": false, + "obsolete": false, + "abbreviation": "ZFIN", + "fullName": "Zebrafish Information Network", + "homepageResourceDescriptorPage": { + "id": 41750742, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-02-20T09:26:39.466873Z", + "dbDateUpdated": "2023-08-27T22:00:03.542259Z", + "name": "homepage", + "urlTemplate": "https://zfin.org/" + } + }, + "crossReference": { + "id": 201551741, + "internal": false, + "obsolete": false, + "dbDateCreated": "2024-03-05T10:31:10.217464Z", + "dbDateUpdated": "2024-03-05T10:31:10.217477Z", + "referencedCurie": "ZFIN", + "displayName": "ZFIN", + "resourceDescriptorPage": { + "id": 41750742, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-02-20T09:26:39.466873Z", + "dbDateUpdated": "2023-08-27T22:00:03.542259Z", + "name": "homepage", + "urlTemplate": "https://zfin.org/" + } + } + }, + "phenotypeAnnotationObject": "head decreased size, abnormal", + "relation": { + "id": 200000000, + "internal": false, + "obsolete": false, + "name": "has_phenotype" + }, + "phenotypeAnnotationSubject": { + "type": "AffectedGenomicModel", + "id": 309354, + "createdBy": { + "id": 8019288, + "dateCreated": "2022-06-14T14:54:31.390724Z", + "dateUpdated": "2022-06-14T14:54:31.390724Z", + "internal": false, + "obsolete": false, + "uniqueId": "ZFIN:CURATOR" + }, + "dateCreated": "2015-09-01T07:00:00Z", + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-06-09T13:47:14.458121Z", + "dbDateUpdated": "2024-01-17T17:52:00.624187Z", + "modEntityId": "ZFIN:ZDB-FISH-150901-427", + "dataProvider": { + "id": 86992863, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-06-09T13:47:14.455058Z", + "dbDateUpdated": "2024-01-17T17:52:00.625242Z", + "sourceOrganization": { + "id": 20308685, + "internal": false, + "obsolete": false, + "abbreviation": "ZFIN", + "fullName": "Zebrafish Information Network", + "homepageResourceDescriptorPage": { + "id": 41750742, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-02-20T09:26:39.466873Z", + "dbDateUpdated": "2023-08-27T22:00:03.542259Z", + "name": "homepage", + "urlTemplate": "https://zfin.org/" + } + } + }, + "taxon": { + "id": 242039, + "internal": false, + "obsolete": false, + "curie": "NCBITaxon:7955", + "name": "Danio rerio" + }, + "name": "slc35d1ahi3378Tg/hi3378Tg", + "subtype": { + "id": 40545168, + "internal": false, + "obsolete": false, + "name": "fish" + } + }, + "inferredGene": { + "type": "Gene", + "id": 702094, + "createdBy": { + "id": 10740932, + "dateCreated": "2022-07-25T21:18:13.558556Z", + "dateUpdated": "2022-07-25T21:18:13.558556Z", + "internal": false, + "obsolete": false, + "uniqueId": "MGI:curation_staff" + }, + "updatedBy": { + "id": 10740932, + "dateCreated": "2022-07-25T21:18:13.558556Z", + "dateUpdated": "2022-07-25T21:18:13.558556Z", + "internal": false, + "obsolete": false, + "uniqueId": "MGI:curation_staff" + }, + "dateCreated": "1996-03-26T15:51:46Z", + "dateUpdated": "2005-03-07T15:16:06Z", + "internal": false, + "obsolete": false, + "dbDateUpdated": "2024-02-06T11:36:48.627505Z", + "modEntityId": "MGI:87873", + "dataProvider": { + "id": 75609905, + "internal": false, + "obsolete": false, + "dbDateUpdated": "2024-02-06T11:36:48.627101Z", + "sourceOrganization": { + "id": 20308680, + "internal": false, + "obsolete": false, + "abbreviation": "MGI", + "fullName": "Mouse Genome Informatics", + "homepageResourceDescriptorPage": { + "id": 41750686, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-02-20T09:26:39.240245Z", + "dbDateUpdated": "2023-08-27T22:00:02.941675Z", + "name": "homepage", + "urlTemplate": "http://www.informatics.jax.org/" + } + }, + "crossReference": { + "id": 80163197, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-05-17T10:39:10.026894Z", + "dbDateUpdated": "2023-08-01T16:03:04.292374Z", + "referencedCurie": "MGI:87873", + "displayName": "MGI:87873", + "resourceDescriptorPage": { + "id": 41750677, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-02-20T09:26:39.235386Z", + "dbDateUpdated": "2023-08-27T22:00:02.93439Z", + "name": "gene", + "urlTemplate": "http://www.informatics.jax.org/marker/MGI:[%s]" + } + } + }, + "taxon": { + "id": 241901, + "internal": false, + "obsolete": false, + "curie": "NCBITaxon:10090", + "name": "Mus musculus" + }, + "geneType": { + "id": 392916, + "internal": false, + "obsolete": false, + "dbDateUpdated": "2024-02-29T17:13:50.391207Z", + "curie": "SO:0001217", + "name": "protein_coding_gene", + "namespace": "sequence", + "definition": "A gene that codes for an RNA that can be translated into a protein.", + "childCount": 5, + "descendantCount": 9 + }, + "geneSymbol": { + "id": 51417904, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-03-03T20:46:17.577808Z", + "dbDateUpdated": "2024-02-06T11:36:48.628607Z", + "nameType": { + "id": 20308690, + "internal": false, + "obsolete": false, + "name": "nomenclature_symbol", + "definition": "A symbol for an object: e.g., pax6Leca2." + }, + "formatText": "Acd", + "displayText": "Acd" + }, + "geneFullName": { + "id": 51417905, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-03-03T20:46:17.579571Z", + "dbDateUpdated": "2024-02-06T11:36:48.627902Z", + "nameType": { + "id": 20308691, + "internal": false, + "obsolete": false, + "name": "full_name", + "definition": "The full length name of an entity: e.g., broad angular dumpy." + }, + "formatText": "adrenocortical dysplasia", + "displayText": "adrenocortical dysplasia" + } + }, + "inferredAllele": { + "type": "Allele", + "id": 761847, + "createdBy": { + "id": 10740932, + "dateCreated": "2022-07-25T21:18:13.558556Z", + "dateUpdated": "2022-07-25T21:18:13.558556Z", + "internal": false, + "obsolete": false, + "uniqueId": "MGI:curation_staff" + }, + "updatedBy": { + "id": 10740932, + "dateCreated": "2022-07-25T21:18:13.558556Z", + "dateUpdated": "2022-07-25T21:18:13.558556Z", + "internal": false, + "obsolete": false, + "uniqueId": "MGI:curation_staff" + }, + "dateCreated": "1998-02-04T22:00:54Z", + "dateUpdated": "2020-04-17T21:41:36Z", + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-08-08T03:48:07.853926Z", + "dbDateUpdated": "2024-02-07T09:13:21.51779Z", + "modEntityId": "MGI:1856658", + "dataProvider": { + "id": 115684900, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-08-08T03:48:07.793969Z", + "dbDateUpdated": "2024-02-07T09:13:21.518281Z", + "sourceOrganization": { + "id": 20308680, + "internal": false, + "obsolete": false, + "abbreviation": "MGI", + "fullName": "Mouse Genome Informatics", + "homepageResourceDescriptorPage": { + "id": 41750686, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-02-20T09:26:39.240245Z", + "dbDateUpdated": "2023-08-27T22:00:02.941675Z", + "name": "homepage", + "urlTemplate": "http://www.informatics.jax.org/" + } + }, + "crossReference": { + "id": 115684899, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-08-08T03:48:07.793166Z", + "dbDateUpdated": "2023-08-12T09:58:57.561821Z", + "referencedCurie": "MGI:1856658", + "displayName": "MGI:1856658", + "resourceDescriptorPage": { + "id": 41750683, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-02-20T09:26:39.238774Z", + "dbDateUpdated": "2023-08-27T22:00:02.93942Z", + "name": "allele", + "urlTemplate": "http://www.informatics.jax.org/allele/MGI:[%s]" + } + } + }, + "taxon": { + "id": 241901, + "internal": false, + "obsolete": false, + "curie": "NCBITaxon:10090", + "name": "Mus musculus" + }, + "isExtinct": false, + "alleleSymbol": { + "id": 115684904, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-08-08T03:48:07.860978Z", + "dbDateUpdated": "2024-02-07T09:13:21.561098Z", + "nameType": { + "id": 20308690, + "internal": false, + "obsolete": false, + "name": "nomenclature_symbol", + "definition": "A symbol for an object: e.g., pax6Leca2." + }, + "formatText": "Ccdt", + "displayText": "Ccdt" + }, + "alleleFullName": { + "id": 115684905, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-08-08T03:48:07.863258Z", + "dbDateUpdated": "2024-02-07T09:13:21.559681Z", + "nameType": { + "id": 20308691, + "internal": false, + "obsolete": false, + "name": "full_name", + "definition": "The full length name of an entity: e.g., broad angular dumpy." + }, + "formatText": "adrenocortical dysplasia", + "displayText": "adrenocortical dysplasia" + }, + "alleleDatabaseStatus": { + "id": 115684903, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-08-08T03:48:07.859418Z", + "dbDateUpdated": "2024-02-07T09:13:21.558892Z", + "databaseStatus": { + "id": 97840955, + "internal": false, + "obsolete": false, + "name": "approved" + } + } + }, + "assertedGenes": [ + { + "type": "Gene", + "id": 702387, + "createdBy": { + "id": 10740932, + "dateCreated": "2022-07-25T21:18:13.558556Z", + "dateUpdated": "2022-07-25T21:18:13.558556Z", + "internal": false, + "obsolete": false, + "uniqueId": "MGI:curation_staff" + }, + "updatedBy": { + "id": 10740932, + "dateCreated": "2022-07-25T21:18:13.558556Z", + "dateUpdated": "2022-07-25T21:18:13.558556Z", + "internal": false, + "obsolete": false, + "uniqueId": "MGI:curation_staff" + }, + "dateCreated": "1999-02-26T19:37:14Z", + "dateUpdated": "2013-03-15T18:38:59Z", + "internal": false, + "obsolete": false, + "dbDateUpdated": "2024-02-06T11:34:46.000823Z", + "modEntityId": "MGI:1330812", + "dataProvider": { + "id": 75135599, + "internal": false, + "obsolete": false, + "dbDateUpdated": "2024-02-06T11:34:46.000415Z", + "sourceOrganization": { + "id": 20308680, + "internal": false, + "obsolete": false, + "abbreviation": "MGI", + "fullName": "Mouse Genome Informatics", + "homepageResourceDescriptorPage": { + "id": 41750686, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-02-20T09:26:39.240245Z", + "dbDateUpdated": "2023-08-27T22:00:02.941675Z", + "name": "homepage", + "urlTemplate": "http://www.informatics.jax.org/" + } + }, + "crossReference": { + "id": 80099344, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-05-17T10:12:22.303899Z", + "dbDateUpdated": "2023-08-01T16:06:31.61257Z", + "referencedCurie": "MGI:1330812", + "displayName": "MGI:1330812", + "resourceDescriptorPage": { + "id": 41750677, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-02-20T09:26:39.235386Z", + "dbDateUpdated": "2023-08-27T22:00:02.93439Z", + "name": "gene", + "urlTemplate": "http://www.informatics.jax.org/marker/MGI:[%s]" + } + } + }, + "taxon": { + "id": 241901, + "internal": false, + "obsolete": false, + "curie": "NCBITaxon:10090", + "name": "Mus musculus" + }, + "geneType": { + "id": 392916, + "internal": false, + "obsolete": false, + "dbDateUpdated": "2024-02-29T17:13:50.391207Z", + "curie": "SO:0001217", + "name": "protein_coding_gene", + "namespace": "sequence", + "definition": "A gene that codes for an RNA that can be translated into a protein.", + "childCount": 5, + "descendantCount": 9 + }, + "geneSymbol": { + "id": 51421453, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-03-03T20:47:21.935972Z", + "dbDateUpdated": "2024-02-06T11:34:46.002042Z", + "nameType": { + "id": 20308690, + "internal": false, + "obsolete": false, + "name": "nomenclature_symbol", + "definition": "A symbol for an object: e.g., pax6Leca2." + }, + "formatText": "Acox1", + "displayText": "Acox1" + }, + "geneFullName": { + "id": 51421454, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-03-03T20:47:21.937814Z", + "dbDateUpdated": "2024-02-06T11:34:46.001262Z", + "nameType": { + "id": 20308691, + "internal": false, + "obsolete": false, + "name": "full_name", + "definition": "The full length name of an entity: e.g., broad angular dumpy." + }, + "formatText": "acyl-Coenzyme A oxidase 1, palmitoyl", + "displayText": "acyl-Coenzyme A oxidase 1, palmitoyl" + } + } + ], + "assertedAllele": { + "type": "Allele", + "id": 4234652, + "createdBy": { + "id": 10740932, + "dateCreated": "2022-07-25T21:18:13.558556Z", + "dateUpdated": "2022-07-25T21:18:13.558556Z", + "internal": false, + "obsolete": false, + "uniqueId": "MGI:curation_staff" + }, + "updatedBy": { + "id": 10740932, + "dateCreated": "2022-07-25T21:18:13.558556Z", + "dateUpdated": "2022-07-25T21:18:13.558556Z", + "internal": false, + "obsolete": false, + "uniqueId": "MGI:curation_staff" + }, + "dateCreated": "1999-09-10T15:22:24Z", + "dateUpdated": "2014-05-20T21:17:21Z", + "internal": false, + "obsolete": false, + "dbDateUpdated": "2024-02-06T23:17:33.99865Z", + "modEntityId": "MGI:1857811", + "dataProvider": { + "id": 75138053, + "internal": false, + "obsolete": false, + "dbDateUpdated": "2024-02-06T23:17:33.999278Z", + "sourceOrganization": { + "id": 20308680, + "internal": false, + "obsolete": false, + "abbreviation": "MGI", + "fullName": "Mouse Genome Informatics", + "homepageResourceDescriptorPage": { + "id": 41750686, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-02-20T09:26:39.240245Z", + "dbDateUpdated": "2023-08-27T22:00:02.941675Z", + "name": "homepage", + "urlTemplate": "http://www.informatics.jax.org/" + } + }, + "crossReference": { + "id": 80439565, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-05-18T20:53:23.514149Z", + "dbDateUpdated": "2023-08-11T14:50:04.487447Z", + "referencedCurie": "MGI:1857811", + "displayName": "MGI:1857811", + "resourceDescriptorPage": { + "id": 41750683, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-02-20T09:26:39.238774Z", + "dbDateUpdated": "2023-08-27T22:00:02.93942Z", + "name": "allele", + "urlTemplate": "http://www.informatics.jax.org/allele/MGI:[%s]" + } + } + }, + "taxon": { + "id": 241901, + "internal": false, + "obsolete": false, + "curie": "NCBITaxon:10090", + "name": "Mus musculus" + }, + "isExtinct": false, + "alleleSymbol": { + "id": 69512560, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-04-14T18:48:42.076077Z", + "dbDateUpdated": "2024-02-06T23:17:34.074274Z", + "nameType": { + "id": 20308690, + "internal": false, + "obsolete": false, + "name": "nomenclature_symbol", + "definition": "A symbol for an object: e.g., pax6Leca2." + }, + "formatText": "Acox1tm1Jkr", + "displayText": "Acox1tm1Jkr" + }, + "alleleFullName": { + "id": 69512561, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-04-14T18:48:42.07758Z", + "dbDateUpdated": "2024-02-06T23:17:34.072558Z", + "nameType": { + "id": 20308691, + "internal": false, + "obsolete": false, + "name": "full_name", + "definition": "The full length name of an entity: e.g., broad angular dumpy." + }, + "formatText": "targeted mutation 1, Janardan K Reddy", + "displayText": "targeted mutation 1, Janardan K Reddy" + }, + "alleleGermlineTransmissionStatus": { + "id": 97253061, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-07-11T23:36:09.092707Z", + "dbDateUpdated": "2024-02-06T23:17:34.073421Z", + "germlineTransmissionStatus": { + "id": 88139190, + "internal": false, + "obsolete": false, + "name": "germline", + "definition": "Allele was created in a stem cell line and a report of transmission through the germline has been annotated" + } + }, + "alleleDatabaseStatus": { + "id": 97936951, + "internal": false, + "obsolete": false, + "dbDateCreated": "2023-07-17T22:17:29.075406Z", + "dbDateUpdated": "2024-02-06T23:17:34.071521Z", + "databaseStatus": { + "id": 97840955, + "internal": false, + "obsolete": false, + "name": "approved" + } + } + } + } + ], + "totalResults": 1, + "returnedRecords": 1 +}; diff --git a/src/main/cliapp/src/containers/phenotypeAnnotationsPage/useNewAnnotationReducer.js b/src/main/cliapp/src/containers/phenotypeAnnotationsPage/useNewAnnotationReducer.js deleted file mode 100644 index 42f7855bb..000000000 --- a/src/main/cliapp/src/containers/phenotypeAnnotationsPage/useNewAnnotationReducer.js +++ /dev/null @@ -1,176 +0,0 @@ -import { useImmerReducer } from "use-immer"; -import 'core-js/features/structured-clone'; - -const DEFAULT_ANNOTATION = { - diseaseAnnotationSubject: { - modEntityId: "", - }, - assertedGenes : [], - assertedAllele : null, - relation: { - name: "", - }, - negated: false, - diseaseAnnotationObject: { - curie: "", - }, - singleReference: { - curie: "", - }, - evidenceCodes: [], - with: [], - relatedNotes: [], - conditionRelations: [], - geneticSex: null, - diseaseQualifiers: null, - sgdStrainBackground: null, - annotationType: null, - diseaseGeneticModifierRelation: null, - diseaseGeneticModifiers: [], - internal: false -}; -const initialNewAnnotationState = { - newAnnotation: global.structuredClone(DEFAULT_ANNOTATION), - errorMessages: {}, - relatedNotesErrorMessages: [], - exConErrorMessages: [], - submitted: false, - newAnnotationDialog: false, - showRelatedNotes: false, - relatedNotesEditingRows: {}, - showConditionRelations: false, - conditionRelationsEditingRows: {}, - isValid: false, - isAssertedGeneEnabled: false, - isAssertedAlleleEnabled: false, -}; - -const buildAnnotation = (rowData) => { - return { - diseaseAnnotationSubject: global.structuredClone(rowData.diseaseAnnotationSubject) || DEFAULT_ANNOTATION.diseaseAnnotationSubject, - assertedGenes : global.structuredClone(rowData.assertedGenes) || DEFAULT_ANNOTATION.assertedGenes, - assertedAllele : global.structuredClone(rowData.assertedAllele) || DEFAULT_ANNOTATION.assertedAllele, - relation: global.structuredClone(rowData.relation) || DEFAULT_ANNOTATION.relation, - negated: rowData.negated || DEFAULT_ANNOTATION.negated, - diseaseAnnotationObject: global.structuredClone(rowData.diseaseAnnotationObject) || DEFAULT_ANNOTATION.diseaseAnnotationObject, - singleReference: global.structuredClone(rowData.singleReference) || DEFAULT_ANNOTATION.singleReference, - evidenceCodes: global.structuredClone(rowData.evidenceCodes) || DEFAULT_ANNOTATION.subject, - with: global.structuredClone(rowData.with) || DEFAULT_ANNOTATION.with, - relatedNotes: processDupRelatedNotes(global.structuredClone(rowData.relatedNotes)) || DEFAULT_ANNOTATION.relatedNotes, - conditionRelations: global.structuredClone(rowData.conditionRelations) || DEFAULT_ANNOTATION.conditionRelations, - geneticSex: global.structuredClone(rowData.geneticSex) || DEFAULT_ANNOTATION.geneticSex, - diseaseQualifiers: global.structuredClone(rowData.diseaseQualifiers) || DEFAULT_ANNOTATION.diseaseQualifiers, - sgdStrainBackground: global.structuredClone(rowData.sgdStrainBackground)|| DEFAULT_ANNOTATION.sgdStrainBackground, - annotationType: global.structuredClone(rowData.annotationType) || DEFAULT_ANNOTATION.annotationType, - diseaseGeneticModifierRelation: global.structuredClone(rowData.diseaseGeneticModifierRelation) || DEFAULT_ANNOTATION.diseaseGeneticModifierRelation, - diseaseGeneticModifiers: global.structuredClone(rowData.diseaseGeneticModifiers) || DEFAULT_ANNOTATION.diseaseGeneticModifiers, - internal: rowData.internal || DEFAULT_ANNOTATION.internal - } -} - -const processDupRelatedNotes = (notes) => { - if(!notes) return; - notes.forEach(note => { - if(note.id){ - delete note.id; - } - }) - return notes; -} - -const newAnnotationReducer = (draft, action) => { - - switch (action.type) { - case 'RESET': - return initialNewAnnotationState; - case 'EDIT': - draft.newAnnotation[action.field] = action.value; - break; - case 'EDIT_EXPERIMENT': - if (typeof action.value === "object") { - draft.newAnnotation.conditionRelations[0] = action.value; - } else { - if(draft.newAnnotation.conditionRelations && draft.newAnnotation.conditionRelations[0]) - draft.newAnnotation.conditionRelations[0].handle = action.value; - } - break; - case 'UPDATE_ERROR_MESSAGES': - draft[action.errorType]= action.errorMessages; - draft.isValid = false; - break; - case 'SUBMIT': - draft.submitted = true; - draft.errorMessages = {}; - draft.relatedNotesErrorMessages = []; - draft.isValid = false; - break; - case 'OPEN_DIALOG': - draft.newAnnotationDialog = true; - break; - case 'DUPLICATE_ROW': - draft.newAnnotation = buildAnnotation(action.rowData); - break; - case 'CLEAR': - return {...initialNewAnnotationState, newAnnotationDialog: true} - case 'ADD_NEW_NOTE': - draft.newAnnotation.relatedNotes.push( - { - dataKey: action.count, - noteType: { - name : "" - }, - freeText: "", - } - ) - draft.relatedNotesEditingRows[`${action.count}`] = true; - draft.showRelatedNotes = true; - break; - case 'ADD_NEW_RELATION': - draft.newAnnotation.conditionRelations.push( - { - dataKey: action.count, - conditions: [], - } - ) - draft.conditionRelationsEditingRows[`${action.count}`] = true; - draft.showConditionRelations = true; - break; - case 'DELETE_ROW': - draft.newAnnotation[action.tableType].splice(action.index, 1); - if(draft.newAnnotation[action.tableType].length === 0){ - draft[action.showType] = false; - } - break; - case 'EDIT_ROW': - draft.newAnnotation[action.tableType][action.index][action.field] = action.value; - break; - case 'SET_IS_ENABLED': - draft.isEnabled = action.value; - break; - case 'SET_IS_ASSERTED_GENE_ENABLED': - draft.isAssertedGeneEnabled = action.value; - break; - case 'SET_IS_ASSERTED_ALLELE_ENABLED': - draft.isAssertedAlleleEnabled = action.value; - break; - case 'SET_RELATED_NOTES_EDITING_ROWS': - action.relatedNotes.forEach((note) => { - draft.relatedNotesEditingRows[`${note.dataKey}`] = true; - }); - draft.showRelatedNotes = true; - break; - case 'SET_CONDITION_RELATIONS_EDITING_ROWS': - action.conditionRelations.forEach((relation) => { - draft.conditionRelationsEditingRows[`${relation.dataKey}`] = true; - }); - draft.showConditionRelations = true; - break; - default: - throw Error('Unknown action: ' + action.type); - } -}; - -export const useNewAnnotationReducer = () => { - const [newAnnotationState, newAnnotationDispatch] = useImmerReducer(newAnnotationReducer, initialNewAnnotationState); - return {newAnnotationState, newAnnotationDispatch}; -} From cdea262338ee9ad405a922dda1d48149a89996ee Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 5 Mar 2024 12:53:44 +0000 Subject: [PATCH 134/159] Extra allele-gene association validation --- .../constants/ValidationConstants.java | 1 + .../constants/VocabularyConstants.java | 1 + .../AssociationIdentityHelper.java | 23 +++++++ .../services/validation/AlleleValidator.java | 23 +++++++ .../crud/controllers/AlleleITCase.java | 62 ++++++++++++++++++- 5 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 src/main/java/org/alliancegenome/curation_api/services/helpers/associations/AssociationIdentityHelper.java diff --git a/src/main/java/org/alliancegenome/curation_api/constants/ValidationConstants.java b/src/main/java/org/alliancegenome/curation_api/constants/ValidationConstants.java index 14d1d5aec..8fdb7c06f 100644 --- a/src/main/java/org/alliancegenome/curation_api/constants/ValidationConstants.java +++ b/src/main/java/org/alliancegenome/curation_api/constants/ValidationConstants.java @@ -10,5 +10,6 @@ public final class ValidationConstants { public static final String NON_UNIQUE_MESSAGE = "Field value is not unique"; public static final String UNSUPPORTED_MESSAGE = "Unsupported value specified"; public static final String DUPLICATE_MESSAGE = "Duplicate entries found"; + public static final String DUPLICATE_RELATION_PREFIX = "Entries found with same relation field - "; } \ No newline at end of file diff --git a/src/main/java/org/alliancegenome/curation_api/constants/VocabularyConstants.java b/src/main/java/org/alliancegenome/curation_api/constants/VocabularyConstants.java index 9e2071383..a49574cf6 100644 --- a/src/main/java/org/alliancegenome/curation_api/constants/VocabularyConstants.java +++ b/src/main/java/org/alliancegenome/curation_api/constants/VocabularyConstants.java @@ -52,4 +52,5 @@ public final class VocabularyConstants { public static final String VARIANT_STATUS_VOCABULARY = "variant_status"; + public static final String ALLELE_OF_VOCABULARY_TERM = "is_allele_of"; } \ No newline at end of file diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/associations/AssociationIdentityHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/associations/AssociationIdentityHelper.java new file mode 100644 index 000000000..b1e835e2e --- /dev/null +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/associations/AssociationIdentityHelper.java @@ -0,0 +1,23 @@ +package org.alliancegenome.curation_api.services.helpers.associations; + +import org.alliancegenome.curation_api.model.entities.associations.alleleAssociations.AlleleGeneAssociation; +import org.alliancegenome.curation_api.services.ReferenceService; +import org.alliancegenome.curation_api.services.helpers.UniqueIdGeneratorHelper; + +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Inject; + +@RequestScoped +public class AssociationIdentityHelper { + + @Inject ReferenceService refService; + + public static String alleleGeneAssociationIdentity(AlleleGeneAssociation association) { + UniqueIdGeneratorHelper uniqueId = new UniqueIdGeneratorHelper(); + uniqueId.add(association.getAlleleAssociationSubject().getIdentifier()); + uniqueId.add(association.getRelation().getName()); + uniqueId.add(association.getAlleleGeneAssociationObject().getIdentifier()); + + return uniqueId.getUniqueId(); + } +} diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java index 8c124e4be..9242786a2 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/AlleleValidator.java @@ -31,6 +31,7 @@ import org.alliancegenome.curation_api.model.entities.slotAnnotations.alleleSlotAnnotations.AlleleSynonymSlotAnnotation; import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.services.VocabularyTermService; +import org.alliancegenome.curation_api.services.helpers.associations.AssociationIdentityHelper; import org.alliancegenome.curation_api.services.helpers.notes.NoteIdentityHelper; import org.alliancegenome.curation_api.services.validation.associations.alleleAssociations.AlleleGeneAssociationValidator; import org.alliancegenome.curation_api.services.validation.slotAnnotations.alleleSlotAnnotations.AlleleDatabaseStatusSlotAnnotationValidator; @@ -43,6 +44,7 @@ import org.alliancegenome.curation_api.services.validation.slotAnnotations.alleleSlotAnnotations.AlleleSecondaryIdSlotAnnotationValidator; import org.alliancegenome.curation_api.services.validation.slotAnnotations.alleleSlotAnnotations.AlleleSymbolSlotAnnotationValidator; import org.alliancegenome.curation_api.services.validation.slotAnnotations.alleleSlotAnnotations.AlleleSynonymSlotAnnotationValidator; +import org.apache.commons.codec.binary.StringUtils; import org.apache.commons.collections.CollectionUtils; import jakarta.enterprise.context.RequestScoped; @@ -605,6 +607,8 @@ private List validateAlleleGeneAssociations(Allele uiEnti List validatedGeneAssociations = new ArrayList(); Boolean allValid = true; + Boolean hasIsAlleleOfRelation = false; + Set validatedAssociationIdentities = new HashSet<>(); if (CollectionUtils.isNotEmpty(uiAssociations)) { for (int ix = 0; ix < uiAssociations.size(); ix++) { AlleleGeneAssociation ga = uiAssociations.get(ix); @@ -614,7 +618,26 @@ private List validateAlleleGeneAssociations(Allele uiEnti response.addErrorMessages(field, ix, gaResponse.getErrorMessages()); } else { ga = gaResponse.getEntity(); + if (ga.getRelation().getName().equals(VocabularyConstants.ALLELE_OF_VOCABULARY_TERM)) { + if (hasIsAlleleOfRelation) { + Map duplicateRelationError = new HashMap<>(); + duplicateRelationError.put("relation", ValidationConstants.DUPLICATE_RELATION_PREFIX + VocabularyConstants.ALLELE_OF_VOCABULARY_TERM); + response.addErrorMessages(field, ix, duplicateRelationError); + allValid = false; + continue; + } + hasIsAlleleOfRelation = true; + } ga.setAlleleAssociationSubject(dbEntity); + String associationIdentity = AssociationIdentityHelper.alleleGeneAssociationIdentity(ga); + if (validatedAssociationIdentities.contains(associationIdentity)) { + Map duplicateError = new HashMap<>(); + duplicateError.put("relation", ValidationConstants.DUPLICATE_MESSAGE + " (" + associationIdentity + ")"); + response.addErrorMessages(field, ix, duplicateError); + allValid = false; + continue; + } + validatedAssociationIdentities.add(associationIdentity); validatedGeneAssociations.add(ga); } } diff --git a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java index afaaae8e3..e6202f4a9 100644 --- a/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/crud/controllers/AlleleITCase.java @@ -127,7 +127,9 @@ public class AlleleITCase extends BaseITCase { private DataProvider obsoleteDataProvider; private Organization nonPersistedOrganization; private Gene gene; + private Gene gene2; private VocabularyTerm geneAssociationRelation; + private VocabularyTerm geneAssociationRelation2; private void loadRequiredEntities() { @@ -203,8 +205,10 @@ private void loadRequiredEntities() { nonPersistedOrganization.setAbbreviation("INV"); VocabularyTerm symbolNameType = getVocabularyTerm(nameTypeVocabulary, "nomenclature_symbol"); gene = createGene("TEST:AssociatedGene1", "NCBITaxon:6239", false, symbolNameType); + gene2 = createGene("TEST:AssociatedGene2", "NCBITaxon:6239", false, symbolNameType); Vocabulary relationVocabulary = getVocabulary(VocabularyConstants.ALLELE_RELATION_VOCABULARY); geneAssociationRelation = getVocabularyTerm(relationVocabulary, "is_allele_of"); + geneAssociationRelation2 = getVocabularyTerm(relationVocabulary, "duplication"); } @@ -1519,9 +1523,65 @@ public void updateAlleleDetailWithInvalidAssociations() { body("errorMessages", is(aMapWithSize(1))). body("errorMessages.alleleGeneAssociations", is("relation - " + ValidationConstants.INVALID_MESSAGE)); } - + @Test @Order(25) + public void updateAlleleDetailsWithMultipleIsAlleleOfAssociations() { + Allele allele = getAllele(ALLELE); + + AlleleGeneAssociation geneAssociation = new AlleleGeneAssociation(); + geneAssociation.setAlleleGeneAssociationObject(gene); + geneAssociation.setRelation(geneAssociationRelation); + + AlleleGeneAssociation geneAssociation2 = new AlleleGeneAssociation(); + geneAssociation2.setAlleleGeneAssociationObject(gene2); + geneAssociation2.setRelation(geneAssociationRelation); + + allele.setAlleleGeneAssociations(List.of(geneAssociation, geneAssociation2)); + + RestAssured.given(). + contentType("application/json"). + body(allele). + when(). + put("/api/allele/updateDetail"). + then(). + statusCode(400). + body("errorMessages", is(aMapWithSize(1))). + body("errorMessages.alleleGeneAssociations", is("relation - " + ValidationConstants.DUPLICATE_RELATION_PREFIX + VocabularyConstants.ALLELE_OF_VOCABULARY_TERM)); + } + + @Test + @Order(26) + public void updateAlleleDetailsWithDuplicateAssociation() { + Allele allele = getAllele(ALLELE); + + AlleleGeneAssociation geneAssociation = new AlleleGeneAssociation(); + geneAssociation.setAlleleGeneAssociationObject(gene); + geneAssociation.setRelation(geneAssociationRelation); + + AlleleGeneAssociation geneAssociation2 = new AlleleGeneAssociation(); + geneAssociation2.setAlleleGeneAssociationObject(gene2); + geneAssociation2.setRelation(geneAssociationRelation2); + + AlleleGeneAssociation geneAssociation3 = new AlleleGeneAssociation(); + geneAssociation3.setAlleleGeneAssociationObject(gene2); + geneAssociation3.setRelation(geneAssociationRelation2); + + allele.setAlleleGeneAssociations(List.of(geneAssociation, geneAssociation2, geneAssociation3)); + + RestAssured.given(). + contentType("application/json"). + body(allele). + when(). + put("/api/allele/updateDetail"). + then(). + statusCode(400). + body("errorMessages", is(aMapWithSize(1))). + body("errorMessages.alleleGeneAssociations", is("relation - " + ValidationConstants.DUPLICATE_MESSAGE + " (Allele:0001|duplication|TEST:AssociatedGene2)")); + } + + @Test + @Order(27) public void deleteAllele() { RestAssured.given(). From d607943065d7398d5d54ca756270bcc5f1a6b70b Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 5 Mar 2024 14:10:43 +0000 Subject: [PATCH 135/159] Rename enum --- ...nditionRelation.java => ConditionRelationFmsEnum.java} | 8 ++++---- .../helpers/annotations/AnnotationUniqueIdHelper.java | 6 +++--- .../dto/fms/ConditionRelationFmsDTOValidator.java | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) rename src/main/java/org/alliancegenome/curation_api/enums/{FmsConditionRelation.java => ConditionRelationFmsEnum.java} (60%) diff --git a/src/main/java/org/alliancegenome/curation_api/enums/FmsConditionRelation.java b/src/main/java/org/alliancegenome/curation_api/enums/ConditionRelationFmsEnum.java similarity index 60% rename from src/main/java/org/alliancegenome/curation_api/enums/FmsConditionRelation.java rename to src/main/java/org/alliancegenome/curation_api/enums/ConditionRelationFmsEnum.java index abc4515a2..a75f8f209 100644 --- a/src/main/java/org/alliancegenome/curation_api/enums/FmsConditionRelation.java +++ b/src/main/java/org/alliancegenome/curation_api/enums/ConditionRelationFmsEnum.java @@ -1,6 +1,6 @@ package org.alliancegenome.curation_api.enums; -public enum FmsConditionRelation { +public enum ConditionRelationFmsEnum { ameliorates("ameliorated_by"), exacerbates("exacerbated_by"), has_condition("has_condition"), @@ -8,13 +8,13 @@ public enum FmsConditionRelation { public String agrRelation; - private FmsConditionRelation(String agrRelation) { + private ConditionRelationFmsEnum(String agrRelation) { this.agrRelation = agrRelation; } - public static FmsConditionRelation findByName(String name) { + public static ConditionRelationFmsEnum findByName(String name) { - for (FmsConditionRelation relation : values()) { + for (ConditionRelationFmsEnum relation : values()) { if (relation.name().equals(name)) return relation; } diff --git a/src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/AnnotationUniqueIdHelper.java b/src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/AnnotationUniqueIdHelper.java index 236007f7e..55d5da82c 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/AnnotationUniqueIdHelper.java +++ b/src/main/java/org/alliancegenome/curation_api/services/helpers/annotations/AnnotationUniqueIdHelper.java @@ -5,7 +5,7 @@ import java.util.List; import java.util.stream.Collectors; -import org.alliancegenome.curation_api.enums.FmsConditionRelation; +import org.alliancegenome.curation_api.enums.ConditionRelationFmsEnum; import org.alliancegenome.curation_api.model.entities.ConditionRelation; import org.alliancegenome.curation_api.model.entities.DiseaseAnnotation; import org.alliancegenome.curation_api.model.entities.ExperimentalCondition; @@ -130,9 +130,9 @@ public static String getPhenotypeAnnotationUniqueId(PhenotypeFmsDTO annotationFm List crIds = new ArrayList<>(); for (ConditionRelationFmsDTO crFmsDto : annotationFmsDTO.getConditionRelations()) { UniqueIdGeneratorHelper gen = new UniqueIdGeneratorHelper(); - FmsConditionRelation fmsCr = null; + ConditionRelationFmsEnum fmsCr = null; if (StringUtils.isNotBlank(crFmsDto.getConditionRelationType())) - fmsCr = FmsConditionRelation.findByName(crFmsDto.getConditionRelationType()); + fmsCr = ConditionRelationFmsEnum.findByName(crFmsDto.getConditionRelationType()); if (fmsCr != null) gen.add(fmsCr.agrRelation); if (CollectionUtils.isNotEmpty(crFmsDto.getConditions())) diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java index dbbcfcab8..7cb574270 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/ConditionRelationFmsDTOValidator.java @@ -7,7 +7,7 @@ import org.alliancegenome.curation_api.constants.VocabularyConstants; import org.alliancegenome.curation_api.dao.ConditionRelationDAO; import org.alliancegenome.curation_api.dao.ExperimentalConditionDAO; -import org.alliancegenome.curation_api.enums.FmsConditionRelation; +import org.alliancegenome.curation_api.enums.ConditionRelationFmsEnum; import org.alliancegenome.curation_api.model.entities.ConditionRelation; import org.alliancegenome.curation_api.model.entities.ExperimentalCondition; import org.alliancegenome.curation_api.model.entities.VocabularyTerm; @@ -39,12 +39,12 @@ public ObjectResponse validateConditionRelationFmsDTO (Condit ObjectResponse crResponse = new ObjectResponse<>(); ConditionRelation relation; - FmsConditionRelation fmsConditionRelation = null; + ConditionRelationFmsEnum fmsConditionRelation = null; if (StringUtils.isBlank(dto.getConditionRelationType())) { crResponse.addErrorMessage("conditionRelationType", ValidationConstants.REQUIRED_MESSAGE); } else { - fmsConditionRelation = FmsConditionRelation.findByName(dto.getConditionRelationType()); + fmsConditionRelation = ConditionRelationFmsEnum.findByName(dto.getConditionRelationType()); if (fmsConditionRelation == null) crResponse.addErrorMessage("conditionRelationType", ValidationConstants.INVALID_MESSAGE + " (" + dto.getConditionRelationType() + ")"); } From 0d805f361cf83bb036e595896d6304bacadd4804 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 5 Mar 2024 14:31:46 +0000 Subject: [PATCH 136/159] Add missing indexes and set scheduleactive to false for new loads --- .../curation_api/model/entities/AGMPhenotypeAnnotation.java | 5 ++++- .../db/migration/v0.31.0.4__agm_phenotype_annotation.sql | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMPhenotypeAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMPhenotypeAnnotation.java index 203a42dcd..f94284d6f 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/AGMPhenotypeAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/AGMPhenotypeAnnotation.java @@ -91,7 +91,10 @@ public class AGMPhenotypeAnnotation extends PhenotypeAnnotation { @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) @ManyToMany @Fetch(FetchMode.SELECT) - @JoinTable(indexes = @Index(name = "agmphenotypeannotation_gene_agmphenotypeannotation_index", columnList = "agmphenotypeannotation_id")) + @JoinTable(indexes = { + @Index(name = "agmphenotypeannotation_gene_agmphenotypeannotation_index", columnList = "agmphenotypeannotation_id"), + @Index(name = "agmphenotypeannotation_gene_assertedgenes_index", columnList = "assertedgenes_id") + }) @JsonView({ View.FieldsAndLists.class, View.PhenotypeAnnotationView.class, View.ForPublic.class }) private List assertedGenes; diff --git a/src/main/resources/db/migration/v0.31.0.4__agm_phenotype_annotation.sql b/src/main/resources/db/migration/v0.31.0.4__agm_phenotype_annotation.sql index 385de6537..443147fe6 100644 --- a/src/main/resources/db/migration/v0.31.0.4__agm_phenotype_annotation.sql +++ b/src/main/resources/db/migration/v0.31.0.4__agm_phenotype_annotation.sql @@ -46,6 +46,7 @@ CREATE TABLE agmphenotypeannotation_gene ( ALTER TABLE agmphenotypeannotation_gene ADD CONSTRAINT agmphenotypeannotation_gene_agmphenotypeannotation_id_fk FOREIGN KEY (agmphenotypeannotation_id) REFERENCES agmphenotypeannotation (id); ALTER TABLE agmphenotypeannotation_gene ADD CONSTRAINT agmphenotypeannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); CREATE INDEX agmphenotypeannotation_gene_agmphenotypeannotation_index ON agmphenotypeannotation_gene USING btree (agmphenotypeannotation_id); +CREATE INDEX agmphenotypeannotation_gene_assertedgenes_index ON agmphenotypeannotation_gene USING btree (assertedgenes_id); CREATE TABLE allelephenotypeannotation ( id bigint PRIMARY KEY, @@ -67,6 +68,7 @@ CREATE TABLE allelephenotypeannotation_gene ( ALTER TABLE allelephenotypeannotation_gene ADD CONSTRAINT allelephenotypeannotation_gene_gene_allelephenotypeannotation_id_fk FOREIGN KEY (allelephenotypeannotation_id) REFERENCES allelephenotypeannotation (id); ALTER TABLE allelephenotypeannotation_gene ADD CONSTRAINT allelephenotypeannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id); CREATE INDEX allelephenotypeannotation_gene_allelephenotypeannotation_index ON allelephenotypeannotation_gene USING btree (allelephenotypeannotation_id); +CREATE INDEX allelephenotypeannotation_gene_assertedgenes_index ON allelephenotypeannotation_gene USING btree (assertedgenes_id); CREATE TABLE genephenotypeannotation ( id bigint PRIMARY KEY, @@ -107,7 +109,7 @@ INSERT INTO bulkload (id, backendbulkloadtype, name, bulkloadstatus, group_id) INSERT INTO bulkload (id, backendbulkloadtype, name, bulkloadstatus, group_id) SELECT nextval('bulkload_seq'), 'PHENOTYPE', 'ZFIN Phenotype Load', 'STOPPED', id FROM bulkloadgroup WHERE name = 'Phenotype Bulk Loads'; INSERT INTO bulkscheduledload (id, cronschedule, scheduleactive) - SELECT id, '0 0 22 ? * SUN-THU', true FROM bulkload WHERE backendbulkloadtype = 'PHENOTYPE'; + SELECT id, '0 0 22 ? * SUN-THU', false FROM bulkload WHERE backendbulkloadtype = 'PHENOTYPE'; INSERT INTO bulkfmsload (id, fmsdatatype, fmsdatasubtype) SELECT id, 'PHENOTYPE', 'FB' FROM bulkload WHERE name = 'FB Phenotype Load'; INSERT INTO bulkfmsload (id, fmsdatatype, fmsdatasubtype) From fb12ed4a71cffff44c71e83443b83bfc3f2fca9d Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 5 Mar 2024 14:32:46 +0000 Subject: [PATCH 137/159] Remove unnecessary @Transient annotations --- .../curation_api/model/entities/PhenotypeAnnotation.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/model/entities/PhenotypeAnnotation.java b/src/main/java/org/alliancegenome/curation_api/model/entities/PhenotypeAnnotation.java index 67f9eac9c..aac7a9771 100644 --- a/src/main/java/org/alliancegenome/curation_api/model/entities/PhenotypeAnnotation.java +++ b/src/main/java/org/alliancegenome/curation_api/model/entities/PhenotypeAnnotation.java @@ -67,16 +67,12 @@ public abstract class PhenotypeAnnotation extends Annotation { @JsonView({ View.FieldsOnly.class, View.ForPublic.class }) private VocabularyTerm relation; - @Transient public abstract String getSubjectCurie(); - @Transient public abstract String getSubjectTaxonCurie(); - @Transient public abstract String getSubjectSpeciesName(); - @Transient public abstract String getSubjectIdentifier(); @Transient From 83bb35ae44cf46fa61b7f759b3ed20cdcbd53894 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Tue, 5 Mar 2024 10:46:46 -0600 Subject: [PATCH 138/159] Added warning and openAPI definition download link --- .../curation_api/config/RestApplication.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/config/RestApplication.java b/src/main/java/org/alliancegenome/curation_api/config/RestApplication.java index 0c2e59500..826d61c59 100644 --- a/src/main/java/org/alliancegenome/curation_api/config/RestApplication.java +++ b/src/main/java/org/alliancegenome/curation_api/config/RestApplication.java @@ -4,9 +4,12 @@ import org.eclipse.microprofile.openapi.annotations.Components; import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition; import org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType; +import org.eclipse.microprofile.openapi.annotations.info.Contact; import org.eclipse.microprofile.openapi.annotations.info.Info; import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement; import org.eclipse.microprofile.openapi.annotations.security.SecurityScheme; +import org.eclipse.microprofile.openapi.annotations.servers.Server; +import org.eclipse.microprofile.openapi.annotations.servers.ServerVariable; import jakarta.ws.rs.ApplicationPath; import jakarta.ws.rs.core.Application; @@ -16,15 +19,19 @@ @OpenAPIDefinition( info = @Info( description = "This is the Alliance Curation Java API", - title = "Alliance of Genome Resources Curation API", - version = "1.0 Alpha"), + title = "Alliance of Genome Resources Curation API " + "!!!" + " Please note: Some Swagger widgets may crash this page when expanded " + "!!!", + version = "1.0 Alpha" + ), security = { @SecurityRequirement(name = "api_token") }, components = @Components(securitySchemes = { @SecurityScheme( securitySchemeName = "api_token", type = SecuritySchemeType.HTTP, description = "Curator API Token", scheme = "bearer") - }) + }), + externalDocs = @org.eclipse.microprofile.openapi.annotations.ExternalDocumentation( + description = "For flat file of API documentation click on this text", + url = "http://localhost:8080/openapi") ) public class RestApplication extends Application { From c6e93362e7aff6973ae72e55a9c6d23acd13c9aa Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Tue, 5 Mar 2024 15:06:45 -0600 Subject: [PATCH 139/159] Added warning and provided openAPI definition download link --- .../curation_api/config/RestApplication.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/config/RestApplication.java b/src/main/java/org/alliancegenome/curation_api/config/RestApplication.java index 826d61c59..897028ed7 100644 --- a/src/main/java/org/alliancegenome/curation_api/config/RestApplication.java +++ b/src/main/java/org/alliancegenome/curation_api/config/RestApplication.java @@ -4,12 +4,9 @@ import org.eclipse.microprofile.openapi.annotations.Components; import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition; import org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType; -import org.eclipse.microprofile.openapi.annotations.info.Contact; import org.eclipse.microprofile.openapi.annotations.info.Info; import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement; import org.eclipse.microprofile.openapi.annotations.security.SecurityScheme; -import org.eclipse.microprofile.openapi.annotations.servers.Server; -import org.eclipse.microprofile.openapi.annotations.servers.ServerVariable; import jakarta.ws.rs.ApplicationPath; import jakarta.ws.rs.core.Application; @@ -18,8 +15,10 @@ @ApplicationPath("/api") @OpenAPIDefinition( info = @Info( - description = "This is the Alliance Curation Java API", - title = "Alliance of Genome Resources Curation API " + "!!!" + " Please note: Some Swagger widgets may crash this page when expanded " + "!!!", + description = "

This is the Alliance Curation Java API

" + // + "

!!! Please note: Some Swagger widgets may crash this page when expanded !!!

" + // + "

For flat file of API documentation click on the link below

OpenAPI definition download

", + title = "Alliance of Genome Resources Curation API ", version = "1.0 Alpha" ), security = { @SecurityRequirement(name = "api_token") }, @@ -28,10 +27,7 @@ securitySchemeName = "api_token", type = SecuritySchemeType.HTTP, description = "Curator API Token", scheme = "bearer") - }), - externalDocs = @org.eclipse.microprofile.openapi.annotations.ExternalDocumentation( - description = "For flat file of API documentation click on this text", - url = "http://localhost:8080/openapi") + }) ) public class RestApplication extends Application { From 1d0e4e22d000807ba7a192d46a03c5158601e2e9 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Thu, 7 Mar 2024 15:55:19 -0600 Subject: [PATCH 140/159] refactored the agm table templates --- .../src/components/Templates/NameTemplate.js | 14 ++++++++ .../components/Templates/TaxonBodyTemplate.js | 17 ++++++++++ .../AffectedGenomicModelTable.js | 33 +++---------------- 3 files changed, 36 insertions(+), 28 deletions(-) create mode 100644 src/main/cliapp/src/components/Templates/NameTemplate.js create mode 100644 src/main/cliapp/src/components/Templates/TaxonBodyTemplate.js diff --git a/src/main/cliapp/src/components/Templates/NameTemplate.js b/src/main/cliapp/src/components/Templates/NameTemplate.js new file mode 100644 index 000000000..c7b3e5282 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/NameTemplate.js @@ -0,0 +1,14 @@ +import React from 'react' +import { Tooltip } from 'primereact/tooltip'; + +export const NameTemplate = (props) => { + const { name, modEntityId } = props; + return ( + <> +
+ +
+ + + ) +} \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/TaxonBodyTemplate.js b/src/main/cliapp/src/components/Templates/TaxonBodyTemplate.js new file mode 100644 index 000000000..ef6331f6f --- /dev/null +++ b/src/main/cliapp/src/components/Templates/TaxonBodyTemplate.js @@ -0,0 +1,17 @@ +import React from 'react' +import { Tooltip } from 'primereact/tooltip'; +import { EllipsisTableCell } from "../EllipsisTableCell"; + +export const TaxonBodyTemplate = (props) => { + const { taxon, modEntityId } = props; + if (taxon) { + return ( + <> + + {taxon.name} ({taxon.curie}) + + + + ); + } +}; \ No newline at end of file diff --git a/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js b/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js index f6803331c..bacd47f77 100644 --- a/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js +++ b/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js @@ -7,7 +7,8 @@ import { Toast } from 'primereact/toast'; import { getDefaultTableState } from '../../service/TableStateService'; import { FILTER_CONFIGS } from '../../constants/FilterFields'; import { internalTemplate, obsoleteTemplate } from '../../components/AuditedObjectComponent'; - +import { NameTemplate } from '../../components/Templates/NameTemplate'; +import { TaxonBodyTemplate } from '../../components/Templates/TaxonBodyTemplate'; export const AffectedGenomicModelTable = () => { @@ -16,31 +17,7 @@ export const AffectedGenomicModelTable = () => { const toast_topleft = useRef(null); const toast_topright = useRef(null); - - const nameTemplate = (rowData) => { - return ( - <> -
- -
- - - ) - } - - const taxonBodyTemplate = (rowData) => { - if (rowData.taxon) { - return ( - <> - - {rowData.taxon.name} ({rowData.taxon.curie}) - - - - ); - } - }; - + const columns = [ { field: "curie", @@ -63,7 +40,7 @@ export const AffectedGenomicModelTable = () => { { field: "name", header: "Name", - body: nameTemplate, + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.nameFilterConfig }, @@ -77,7 +54,7 @@ export const AffectedGenomicModelTable = () => { field: "taxon.name", header: "Taxon", sortable: true, - body: taxonBodyTemplate, + body: (rowData) => , filterConfig: FILTER_CONFIGS.taxonFilterConfig }, { From cbcd225c2655a1c925197af5487c463ceef07460 Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Thu, 7 Mar 2024 16:05:02 -0600 Subject: [PATCH 141/159] Removed unused imports --- .../affectedGenomicModelPage/AffectedGenomicModelTable.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js b/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js index bacd47f77..e80fccd2f 100644 --- a/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js +++ b/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js @@ -1,8 +1,5 @@ import React, { useState, useRef } from 'react'; import { GenericDataTable } from '../../components/GenericDataTable/GenericDataTable'; -import { EllipsisTableCell } from "../../components/EllipsisTableCell"; - -import { Tooltip } from 'primereact/tooltip'; import { Toast } from 'primereact/toast'; import { getDefaultTableState } from '../../service/TableStateService'; import { FILTER_CONFIGS } from '../../constants/FilterFields'; @@ -17,7 +14,7 @@ export const AffectedGenomicModelTable = () => { const toast_topleft = useRef(null); const toast_topright = useRef(null); - + const columns = [ { field: "curie", From 9a38c8823ffa1bcedf9532b094c2bd179b28d4de Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Thu, 7 Mar 2024 16:46:58 -0600 Subject: [PATCH 142/159] refactoring --- src/main/cliapp/src/components/Templates/NameTemplate.js | 3 +-- src/main/cliapp/src/components/Templates/TaxonBodyTemplate.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/cliapp/src/components/Templates/NameTemplate.js b/src/main/cliapp/src/components/Templates/NameTemplate.js index c7b3e5282..4cad4a98e 100644 --- a/src/main/cliapp/src/components/Templates/NameTemplate.js +++ b/src/main/cliapp/src/components/Templates/NameTemplate.js @@ -1,8 +1,7 @@ import React from 'react' import { Tooltip } from 'primereact/tooltip'; -export const NameTemplate = (props) => { - const { name, modEntityId } = props; +export const NameTemplate = ({name, modEntityId}) => { return ( <>
diff --git a/src/main/cliapp/src/components/Templates/TaxonBodyTemplate.js b/src/main/cliapp/src/components/Templates/TaxonBodyTemplate.js index ef6331f6f..913e2d4e3 100644 --- a/src/main/cliapp/src/components/Templates/TaxonBodyTemplate.js +++ b/src/main/cliapp/src/components/Templates/TaxonBodyTemplate.js @@ -2,8 +2,7 @@ import React from 'react' import { Tooltip } from 'primereact/tooltip'; import { EllipsisTableCell } from "../EllipsisTableCell"; -export const TaxonBodyTemplate = (props) => { - const { taxon, modEntityId } = props; +export const TaxonBodyTemplate = ({taxon, modEntityId}) => { if (taxon) { return ( <> From d120c1fdd33868727d4c9480b3a6a50bc159ba0f Mon Sep 17 00:00:00 2001 From: VarunReddy1111 Date: Fri, 8 Mar 2024 11:58:16 -0600 Subject: [PATCH 143/159] Added tests for the new templates --- .../src/components/Templates/NameTemplate.js | 8 ++- .../components/Templates/TaxonBodyTemplate.js | 16 ----- .../src/components/Templates/TaxonTemplate.js | 23 ++++++ .../Templates/__tests__/NameTemplate.test.js | 17 +++++ .../Templates/__tests__/TaxonTemplate.test.js | 71 +++++++++++++++++++ .../AffectedGenomicModelTable.js | 15 ++-- 6 files changed, 125 insertions(+), 25 deletions(-) delete mode 100644 src/main/cliapp/src/components/Templates/TaxonBodyTemplate.js create mode 100644 src/main/cliapp/src/components/Templates/TaxonTemplate.js create mode 100644 src/main/cliapp/src/components/Templates/__tests__/NameTemplate.test.js create mode 100644 src/main/cliapp/src/components/Templates/__tests__/TaxonTemplate.test.js diff --git a/src/main/cliapp/src/components/Templates/NameTemplate.js b/src/main/cliapp/src/components/Templates/NameTemplate.js index 4cad4a98e..824fbaf0a 100644 --- a/src/main/cliapp/src/components/Templates/NameTemplate.js +++ b/src/main/cliapp/src/components/Templates/NameTemplate.js @@ -1,11 +1,13 @@ import React from 'react' import { Tooltip } from 'primereact/tooltip'; -export const NameTemplate = ({name, modEntityId}) => { +export const NameTemplate = ({name}) => { + const targetClass = `a${global.crypto.randomUUID()}`; + if(!name) return null; return ( <> -
- +
+
diff --git a/src/main/cliapp/src/components/Templates/TaxonBodyTemplate.js b/src/main/cliapp/src/components/Templates/TaxonBodyTemplate.js deleted file mode 100644 index 913e2d4e3..000000000 --- a/src/main/cliapp/src/components/Templates/TaxonBodyTemplate.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react' -import { Tooltip } from 'primereact/tooltip'; -import { EllipsisTableCell } from "../EllipsisTableCell"; - -export const TaxonBodyTemplate = ({taxon, modEntityId}) => { - if (taxon) { - return ( - <> - - {taxon.name} ({taxon.curie}) - - - - ); - } -}; \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/TaxonTemplate.js b/src/main/cliapp/src/components/Templates/TaxonTemplate.js new file mode 100644 index 000000000..1efa7d434 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/TaxonTemplate.js @@ -0,0 +1,23 @@ +import React from 'react' +import { Tooltip } from 'primereact/tooltip'; +import { EllipsisTableCell } from "../EllipsisTableCell"; + +export const TaxonTemplate = ({ taxon }) => { + if (!taxon) return null; + const targetClass = `a${global.crypto.randomUUID()}`; + const textString = getTextString(taxon); + + return ( + <> + {textString} + + + ); +}; + +const getTextString = (taxon) => { + if (!taxon.name) return taxon.curie; + if (!taxon.curie) return taxon.name; + if (!taxon.curie && !taxon.name) return ""; + return `${taxon.name} (${taxon.curie})`; +} \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/__tests__/NameTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/NameTemplate.test.js new file mode 100644 index 000000000..a7c600a55 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/__tests__/NameTemplate.test.js @@ -0,0 +1,17 @@ +import { render } from '@testing-library/react'; +import { NameTemplate } from '../NameTemplate'; +import '../../../tools/jest/setupTests'; + +describe('NameTemplate', () => { + + it('should return null when value is null', () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); + + it('should render the name inside the div', () => { + const result = render(); + expect(result.getByText("test")).toBeInTheDocument(); + }); + +}); \ No newline at end of file diff --git a/src/main/cliapp/src/components/Templates/__tests__/TaxonTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/TaxonTemplate.test.js new file mode 100644 index 000000000..c53ef9118 --- /dev/null +++ b/src/main/cliapp/src/components/Templates/__tests__/TaxonTemplate.test.js @@ -0,0 +1,71 @@ +import { render, fireEvent } from '@testing-library/react'; +import { TaxonTemplate } from '../TaxonTemplate'; +import '../../../tools/jest/setupTests'; + +describe('TaxonTemplate', () => { + + it('should return null when object is null/falsy', () => { + const result = render(); + expect(result.container.firstChild).toBeNull(); + }); + + it('should render an empty EllipsisTableCell component if the object has no name or curie', () => { + const object = {}; + + const result = render(); + + const ellipsisTableCell = result.container.firstChild; + expect(ellipsisTableCell).toHaveTextContent(''); + }); + + it('should render an EllipsisTableCell component with only the name if the object has no curie', () => { + const object = { + name: 'Taxon Name' + }; + + const result = render(); + + const ellipsisTableCell = result.getByText('Taxon Name'); + expect(ellipsisTableCell).toBeInTheDocument(); + }); + + it('should render an EllipsisTableCell component with only the curie if the object has no name', () => { + const object = { + curie: 'Taxon Curie' + }; + + const result = render(); + + const ellipsisTableCell = result.getByText('Taxon Curie'); + expect(ellipsisTableCell).toBeInTheDocument(); + }); + + + it('should render the name and curie of the Taxon object in an EllipsisTableCell component', () => { + const object = { + name: 'Taxon Name', + curie: 'Taxon Curie' + }; + + const result = render(); + + const content = result.getByText('Taxon Name (Taxon Curie)'); + expect(content).toBeInTheDocument(); + }); + + it('should display a tooltip with the name and curie of the Taxon object when hovering over the EllipsisTableCell component', async () => { + const object = { + name: 'Taxon Name', + curie: 'Taxon Curie' + }; + + const result = render(); + + const divContentArray = result.getAllByText('Taxon Name (Taxon Curie)'); + expect(divContentArray).toHaveLength(1); + fireEvent.mouseEnter(divContentArray[0]); + + expect(await result.findAllByText('Taxon Name (Taxon Curie)')).toHaveLength(2); + }); + +}); \ No newline at end of file diff --git a/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js b/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js index e80fccd2f..df32480f9 100644 --- a/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js +++ b/src/main/cliapp/src/containers/affectedGenomicModelPage/AffectedGenomicModelTable.js @@ -3,9 +3,10 @@ import { GenericDataTable } from '../../components/GenericDataTable/GenericDataT import { Toast } from 'primereact/toast'; import { getDefaultTableState } from '../../service/TableStateService'; import { FILTER_CONFIGS } from '../../constants/FilterFields'; -import { internalTemplate, obsoleteTemplate } from '../../components/AuditedObjectComponent'; import { NameTemplate } from '../../components/Templates/NameTemplate'; -import { TaxonBodyTemplate } from '../../components/Templates/TaxonBodyTemplate'; +import { TaxonTemplate } from '../../components/Templates/TaxonTemplate'; +import { IdTemplate } from '../../components/Templates/IdTemplate'; +import { BooleanTemplate } from '../../components/Templates/BooleanTemplate'; export const AffectedGenomicModelTable = () => { @@ -25,19 +26,21 @@ export const AffectedGenomicModelTable = () => { { field: "modEntityId", header: "MOD Entity ID", + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.modentityidFilterConfig, }, { field: "modInternalId", header: "MOD Internal ID", + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.modinternalidFilterConfig, }, { field: "name", header: "Name", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.nameFilterConfig }, @@ -51,7 +54,7 @@ export const AffectedGenomicModelTable = () => { field: "taxon.name", header: "Taxon", sortable: true, - body: (rowData) => , + body: (rowData) => , filterConfig: FILTER_CONFIGS.taxonFilterConfig }, { @@ -90,7 +93,7 @@ export const AffectedGenomicModelTable = () => { { field: "internal", header: "Internal", - body: internalTemplate, + body: (rowData) => , filter: true, filterConfig: FILTER_CONFIGS.internalFilterConfig, sortable: true @@ -98,7 +101,7 @@ export const AffectedGenomicModelTable = () => { { field: "obsolete", header: "Obsolete", - body: obsoleteTemplate, + body: (rowData) => , filter: true, filterConfig: FILTER_CONFIGS.obsoleteFilterConfig, sortable: true From 06e23a5378698ac205e9acf892b2c0a564222bbc Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Fri, 8 Mar 2024 18:28:49 +0000 Subject: [PATCH 144/159] Infer primary annotation if not in load file --- ...AGMPhenotypeAnnotationFmsDTOValidator.java | 37 ++++++++++-- ...henotypeAnnotationBulkUploadFmsITCase.java | 57 +++++++++++++++++-- ...tion_from_secondary_allele_annotation.json | 41 +++++++++++++ 3 files changed, 125 insertions(+), 10 deletions(-) create mode 100644 src/test/resources/bulk/fms/03_phenotype_annotation/IF_01_infer_primary_agm_annotation_from_secondary_allele_annotation.json diff --git a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/AGMPhenotypeAnnotationFmsDTOValidator.java b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/AGMPhenotypeAnnotationFmsDTOValidator.java index 1f4c55b91..0cb431145 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/AGMPhenotypeAnnotationFmsDTOValidator.java +++ b/src/main/java/org/alliancegenome/curation_api/services/validation/dto/fms/AGMPhenotypeAnnotationFmsDTOValidator.java @@ -6,6 +6,7 @@ import org.alliancegenome.curation_api.constants.ValidationConstants; import org.alliancegenome.curation_api.dao.AGMPhenotypeAnnotationDAO; import org.alliancegenome.curation_api.enums.BackendBulkDataProvider; +import org.alliancegenome.curation_api.exceptions.ObjectUpdateException; import org.alliancegenome.curation_api.exceptions.ObjectValidationException; import org.alliancegenome.curation_api.model.entities.AGMPhenotypeAnnotation; import org.alliancegenome.curation_api.model.entities.AffectedGenomicModel; @@ -17,6 +18,7 @@ import org.alliancegenome.curation_api.response.ObjectResponse; import org.alliancegenome.curation_api.response.SearchResponse; import org.alliancegenome.curation_api.services.GenomicEntityService; +import org.alliancegenome.curation_api.services.PhenotypeAnnotationService; import org.alliancegenome.curation_api.services.helpers.annotations.AnnotationUniqueIdHelper; import org.apache.commons.lang3.StringUtils; @@ -30,6 +32,8 @@ public class AGMPhenotypeAnnotationFmsDTOValidator extends PhenotypeAnnotationFm AGMPhenotypeAnnotationDAO agmPhenotypeAnnotationDAO; @Inject GenomicEntityService genomicEntityService; + @Inject + PhenotypeAnnotationService phenotypeAnnotationService; public AGMPhenotypeAnnotation validatePrimaryAnnotation(AffectedGenomicModel subject, PhenotypeFmsDTO dto, BackendBulkDataProvider dataProvider) throws ObjectValidationException { @@ -78,12 +82,22 @@ public AGMPhenotypeAnnotation validateInferredOrAssertedEntities(AffectedGenomic String refString = reference == null ? null : reference.getCurie(); String primaryAnnotationUniqueId = AnnotationUniqueIdHelper.getPhenotypeAnnotationUniqueId(dto, primaryAnnotationSubject.getIdentifier(), refString); + AGMPhenotypeAnnotation primaryAnnotation = null; + SearchResponse annotationSearch = agmPhenotypeAnnotationDAO.findByField("uniqueId", primaryAnnotationUniqueId); - if (annotationSearch == null || annotationSearch.getSingleResult() == null) - throw new ObjectValidationException(dto, "Primary annotation not found for " + primaryAnnotationSubject.getIdentifier()); - AGMPhenotypeAnnotation primaryAnnotation = annotationSearch.getSingleResult(); - if (!idsAdded.contains(primaryAnnotation.getId())) - throw new ObjectValidationException(dto, "Primary annotation not included in submission (" + primaryAnnotationUniqueId + ")"); + if (annotationSearch == null || annotationSearch.getSingleResult() == null) { + PhenotypeFmsDTO inferredPrimaryDTO = createPrimaryAnnotationDTO(dto, primaryAnnotationSubject.getIdentifier()); + try { + Long primaryAnnotationId = phenotypeAnnotationService.upsertPrimaryAnnotation(inferredPrimaryDTO, dataProvider); + primaryAnnotation = agmPhenotypeAnnotationDAO.find(primaryAnnotationId); + } catch (ObjectUpdateException e) { + throw new ObjectValidationException(dto, "Could not construct primary annotation for " + inferredPrimaryDTO.getObjectId() + ": " + e.getData().getMessage()); + } catch (Exception e) { + throw new ObjectValidationException(dto, e.getMessage()); + } + } else { + primaryAnnotation = annotationSearch.getSingleResult(); + } if (StringUtils.isBlank(dto.getObjectId())) { apaResponse.addErrorMessage("objectId", ValidationConstants.REQUIRED_MESSAGE); @@ -121,4 +135,17 @@ public AGMPhenotypeAnnotation validateInferredOrAssertedEntities(AffectedGenomic return primaryAnnotation; } + + private PhenotypeFmsDTO createPrimaryAnnotationDTO(PhenotypeFmsDTO dto, String primarySubjectId) { + PhenotypeFmsDTO primaryAnnotationDTO = new PhenotypeFmsDTO(); + + primaryAnnotationDTO.setObjectId(primarySubjectId); + primaryAnnotationDTO.setPhenotypeStatement(dto.getPhenotypeStatement()); + primaryAnnotationDTO.setPhenotypeTermIdentifiers(dto.getPhenotypeTermIdentifiers()); + primaryAnnotationDTO.setEvidence(dto.getEvidence()); + primaryAnnotationDTO.setDateAssigned(dto.getDateAssigned()); + primaryAnnotationDTO.setConditionRelations(dto.getConditionRelations()); + + return primaryAnnotationDTO; + } } diff --git a/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/PhenotypeAnnotationBulkUploadFmsITCase.java b/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/PhenotypeAnnotationBulkUploadFmsITCase.java index 63512e135..2272368c9 100644 --- a/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/PhenotypeAnnotationBulkUploadFmsITCase.java +++ b/src/test/java/org/alliancegenome/curation_api/bulkupload/fms/PhenotypeAnnotationBulkUploadFmsITCase.java @@ -5,6 +5,8 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.not; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.List; import org.alliancegenome.curation_api.base.BaseITCase; @@ -52,6 +54,7 @@ public void init() { private final String agmPhenotypeAnnotationFindEndpoint = "/api/agm-phenotype-annotation/find?limit=100&page=0"; private Long agmPaId; private final String agm = "PATEST:AGM0001"; + private final String agm2 = "PATEST:AGM0002"; private final String allele = "PATEST:Allele0001"; private final String gene = "PATEST:Gene0001"; private final String reference = "AGRKB:000000002"; @@ -77,7 +80,8 @@ private void loadRequiredEntities() throws Exception { DataProvider dataProvider = createDataProvider("WB", false); loadGenes(List.of(gene), "NCBITaxon:6239", symbolTerm, dataProvider); loadAllele(allele, "TestAllele", "NCBITaxon:6239", symbolTerm, dataProvider); - loadAffectedGenomicModel(agm, "Test AGM", "NCBITaxon:6239", "strain", dataProvider); + loadAffectedGenomicModel(agm, "Test AGM", "NCBITaxon:6239", "strain", dataProvider); + loadAffectedGenomicModel(agm2, "Test AGM2", "NCBITaxon:6239", "strain", dataProvider); loadMPTerm(mpTerm, "Test PhenotypeTerm"); } @@ -180,9 +184,52 @@ public void agmPhenotypeAnnotationClearSecondaryAnnotationFields() throws Except public void allelePhenotypeAnnotationAddSecondaryAnnotationFieldsUpdate() throws Exception { //TODO: add test for update of primary allele annotation } - + @Test @Order(8) + public void agmPhenotypeAnnotationInferredPrimaryAnnotation() throws Exception { + // Tests that an AGM primary annotation is inferred correctly if secondary annotation is loaded without primary annotation in database + checkSuccessfulBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IF_01_infer_primary_agm_annotation_from_secondary_allele_annotation.json"); + + RestAssured.given(). + when(). + header("Content-Type", "application/json"). + body("{\"phenotypeAnnotationSubject.modEntityId\" : \"" + agm2 + "\"}"). + post(agmPhenotypeAnnotationFindEndpoint). + then(). + statusCode(200). + body("totalResults", is(1)). + body("results", hasSize(1)). + body("results[0].phenotypeAnnotationSubject.modEntityId", is(agm2)). + body("results[0].phenotypeAnnotationObject", is(phenotypeStatement)). + body("results[0].relation.name", is("has_phenotype")). + body("results[0].dateCreated", is("2024-01-17T15:26:56Z")). + body("results[0].conditionRelations", hasSize(1)). + body("results[0].conditionRelations[0].internal", is(false)). + body("results[0].conditionRelations[0].obsolete", is(false)). + body("results[0].conditionRelations[0].conditionRelationType.name", is(conditionRelationType)). + body("results[0].conditionRelations[0].conditions", hasSize(1)). + body("results[0].conditionRelations[0].conditions[0].internal", is(false)). + body("results[0].conditionRelations[0].conditions[0].obsolete", is(false)). + body("results[0].conditionRelations[0].conditions[0].conditionClass.curie", is(zecoTerm)). + body("results[0].conditionRelations[0].conditions[0].conditionId.curie", is(expCondTerm)). + body("results[0].conditionRelations[0].conditions[0].conditionQuantity", is("Some amount")). + body("results[0].conditionRelations[0].conditions[0].conditionAnatomy.curie", is(anatomyTerm)). + body("results[0].conditionRelations[0].conditions[0].conditionGeneOntology.curie", is(goTerm)). + body("results[0].conditionRelations[0].conditions[0].conditionTaxon.curie", is("NCBITaxon:6239")). + body("results[0].conditionRelations[0].conditions[0].conditionChemical.curie", is(chemicalTerm)). + body("results[0].conditionRelations[0].conditions[0].conditionSummary", is("condition summary test")). + body("results[0].inferredGene.modEntityId", is(gene)); + } + + @Test + @Order(9) + public void allelePhenotypeAnnotationInferredPrimaryAnnotation() throws Exception { + // TODO: add test for inferring Allele primary annotation from secondary annotation is loaded without primary annotation in database + } + + @Test + @Order(10) public void phenotypeAnnotationBulkUploadMissingRequiredFields() throws Exception { checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "MR_01_no_object_id.json"); checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "MR_02_no_date_assigned.json"); @@ -195,7 +242,7 @@ public void phenotypeAnnotationBulkUploadMissingRequiredFields() throws Exceptio } @Test - @Order(9) + @Order(11) public void phenotypeAnnotationBulkUploadEmptyRequiredFields() throws Exception { checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "ER_01_empty_object_id.json"); checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "ER_02_empty_date_assigned.json"); @@ -208,7 +255,7 @@ public void phenotypeAnnotationBulkUploadEmptyRequiredFields() throws Exception } @Test - @Order(10) + @Order(12) public void phenotypeAnnotationBulkUploadInvalidFields() throws Exception { checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IV_01_invalid_object_id.json"); checkFailedBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "IV_02_invalid_primary_genetic_id.json"); @@ -226,7 +273,7 @@ public void phenotypeAnnotationBulkUploadInvalidFields() throws Exception { } @Test - @Order(11) + @Order(13) public void diseaseAnnotationBulkUploadSecondaryIds() throws Exception { checkSuccessfulBulkLoad(phenotypeAnnotationBulkPostEndpoint, phenotypeAnnotationTestFilePath + "SI_01_secondary_ids.json"); } diff --git a/src/test/resources/bulk/fms/03_phenotype_annotation/IF_01_infer_primary_agm_annotation_from_secondary_allele_annotation.json b/src/test/resources/bulk/fms/03_phenotype_annotation/IF_01_infer_primary_agm_annotation_from_secondary_allele_annotation.json new file mode 100644 index 000000000..a0b4b0169 --- /dev/null +++ b/src/test/resources/bulk/fms/03_phenotype_annotation/IF_01_infer_primary_agm_annotation_from_secondary_allele_annotation.json @@ -0,0 +1,41 @@ +[ + { + "objectId": "PATEST:Gene0001", + "phenotypeTermIdentifiers": [ + { + "termId": "PATEST:MPTerm001", + "termOrder": 1 + } + ], + "phenotypeStatement": "test phenotype statement", + "evidence": { + "publicationId": "PMID:25920554", + "crossReference": { + "id": "ZFIN:ZDB-PUB-130927-9", + "pages": [ + "reference" + ], + "curie": "ZFIN:ZDB-PUB-130927-9" + } + }, + "dateAssigned": "2024-01-17T07:26:56-08:00", + "conditionRelations": [ + { + "conditionRelationType": "exacerbates", + "conditions": [ + { + "conditionClassId": "PATEST:ExpCondTerm0001", + "conditionStatement": "condition summary test", + "conditionId": "PATEST:ExpCondTerm0002", + "conditionQuantity": "Some amount", + "anatomicalOntologyId": "PATEST:AnatomyTerm0001", + "geneOntologyId": "PATEST:GOTerm0001", + "NCBITaxonId": "NCBITaxon:6239", + "chemicalOntologyId": "PATEST:ChemicalTerm0001" + } + ] + } + ], + "primaryGeneticEntityIDs": ["PATEST:AGM0002"] + } +] \ No newline at end of file From 19799c0eb8465c72fd4d26648751a2f992b16ec0 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 7 Mar 2024 08:35:51 -0600 Subject: [PATCH 145/159] SCRUM-3794 add NOTTemplate --- src/main/cliapp/src/components/Templates/NotTemplate.js | 8 ++++++++ .../diseaseAnnotationsPage/DiseaseAnnotationsTable.js | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/main/cliapp/src/components/Templates/NotTemplate.js diff --git a/src/main/cliapp/src/components/Templates/NotTemplate.js b/src/main/cliapp/src/components/Templates/NotTemplate.js new file mode 100644 index 000000000..5538a06fa --- /dev/null +++ b/src/main/cliapp/src/components/Templates/NotTemplate.js @@ -0,0 +1,8 @@ +import React from 'react' +import { EllipsisTableCell } from '../EllipsisTableCell'; + +export const NotTemplate = ({ value }) => { + if (value === null || value === undefined || typeof value !== 'boolean') return null; + const textString = value ? "NOT" : ""; + return {textString}; +} diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 7a49b220b..bc63b0376 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -22,6 +22,7 @@ import { DiseaseTemplate } from '../../components/Templates/DiseaseTemplate'; import { GenomicEntityTemplate } from '../../components/Templates/genomicEntity/GenomicEntityTemplate'; import { GenomicEntityListTemplate } from '../../components/Templates/genomicEntity/GenomicEntityListTemplate'; import { BooleanTemplate } from '../../components/Templates/BooleanTemplate'; +import { NotTemplate } from '../../components/Templates/NotTemplate'; import { ControlledVocabularyDropdown } from '../../components/ControlledVocabularySelector'; import { ConditionRelationHandleDropdown } from '../../components/ConditionRelationHandleSelector'; @@ -935,7 +936,7 @@ export const DiseaseAnnotationsTable = () => { { field: "negated", header: "Negated", - body: (rowData) => , + body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.negatedFilterConfig, editor: (props) => negatedEditor(props) From a0d0e7c89669eaecbfc71a1b684cb2c6a4aa50d0 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Thu, 7 Mar 2024 09:03:42 -0600 Subject: [PATCH 146/159] SCRUM-3794 add tests for NotTemplate --- .../Templates/__tests__/NotTemplate.test.js | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/main/cliapp/src/components/Templates/__tests__/NotTemplate.test.js diff --git a/src/main/cliapp/src/components/Templates/__tests__/NotTemplate.test.js b/src/main/cliapp/src/components/Templates/__tests__/NotTemplate.test.js new file mode 100644 index 000000000..0118a4c0e --- /dev/null +++ b/src/main/cliapp/src/components/Templates/__tests__/NotTemplate.test.js @@ -0,0 +1,25 @@ +import { render } from '@testing-library/react'; +import { NotTemplate } from '../NotTemplate'; +import '../../../tools/jest/setupTests'; + +describe('NotTemplate', () => { + + it('should return null when value is null', () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); + + it('should return a component with the text "NOT" when the value is true', () => { + const { getByText } = render(); + expect(getByText("NOT")).toBeInTheDocument(); + }); + it('should return a component with an empty string when the value is false', () => { + const { container } = render(); + expect(container.textContent).toBe(''); + }); + + it('should return null when value is not a boolean', () => { + const { container } = render(); + expect(container.firstChild).toBeNull(); + }); +}); \ No newline at end of file From 6a4f71574291e685cc5dbf21478b57bd1d5fdb4b Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Fri, 8 Mar 2024 08:42:07 -0600 Subject: [PATCH 147/159] SCRUM-3794 add NotEditor --- .../src/components/Editors/NotEditor.js | 29 +++++++++++++++++++ .../DiseaseAnnotationsTable.js | 28 +++++------------- 2 files changed, 37 insertions(+), 20 deletions(-) create mode 100644 src/main/cliapp/src/components/Editors/NotEditor.js diff --git a/src/main/cliapp/src/components/Editors/NotEditor.js b/src/main/cliapp/src/components/Editors/NotEditor.js new file mode 100644 index 000000000..803f10964 --- /dev/null +++ b/src/main/cliapp/src/components/Editors/NotEditor.js @@ -0,0 +1,29 @@ +import React, { useState } from 'react'; +import { Dropdown } from "primereact/dropdown"; + +export function NotEditor({ props, value, editorChange }) { + const [selectedValue, setSelectedValue] = useState(value); + const textString = value ? "NOT" : ""; + const options = [ + { label: "NOT", value: true }, + { label: "null", value: false } + ]; + + const onChange = (e) => { + setSelectedValue(e.value); + editorChange(e, props); + } + + return ( + <> + onChange(e)} + showClear={false} + placeholder={textString} + style={{ width: '100%' }} + /> + + ); +} diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index bc63b0376..ba40bf144 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -24,6 +24,8 @@ import { GenomicEntityListTemplate } from '../../components/Templates/genomicEnt import { BooleanTemplate } from '../../components/Templates/BooleanTemplate'; import { NotTemplate } from '../../components/Templates/NotTemplate'; +import { NotEditor } from '../../components/Editors/NotEditor'; + import { ControlledVocabularyDropdown } from '../../components/ControlledVocabularySelector'; import { ConditionRelationHandleDropdown } from '../../components/ConditionRelationHandleSelector'; import { ControlledVocabularyMultiSelectDropdown } from '../../components/ControlledVocabularyMultiSelector'; @@ -429,26 +431,12 @@ export const DiseaseAnnotationsTable = () => { ); }; - const onNegatedEditorValueChange = (props, event) => { - let updatedAnnotations = [...props.props.value]; - if (event.value || event.value === '') { - updatedAnnotations[props.rowIndex].negated = JSON.parse(event.value.name); - } - }; + const onNegatedEditorValueChange = (event, props) => { + if(event.value === undefined || event.value === null) return; - const negatedEditor = (props) => { - return ( - <> - - - - ); - }; + let updatedAnnotations = [...props.props.value]; + updatedAnnotations[props.rowIndex].negated = event.value; + } const onInternalEditorValueChange = (props, event) => { let updatedAnnotations = [...props.props.value]; @@ -939,7 +927,7 @@ export const DiseaseAnnotationsTable = () => { body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.negatedFilterConfig, - editor: (props) => negatedEditor(props) + editor: (props) => }, { field: "diseaseAnnotationObject.name", From 9fc618df9e79b015d8b614831eb2a7f1319d03c1 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 11 Mar 2024 09:12:51 -0500 Subject: [PATCH 148/159] SCRUM-3794 add tests for NotEditor --- .../src/components/Editors/NotEditor.js | 1 + .../Editors/__tests__/NotEditor.test.js | 64 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 src/main/cliapp/src/components/Editors/__tests__/NotEditor.test.js diff --git a/src/main/cliapp/src/components/Editors/NotEditor.js b/src/main/cliapp/src/components/Editors/NotEditor.js index 803f10964..f73b9aa6f 100644 --- a/src/main/cliapp/src/components/Editors/NotEditor.js +++ b/src/main/cliapp/src/components/Editors/NotEditor.js @@ -17,6 +17,7 @@ export function NotEditor({ props, value, editorChange }) { return ( <> onChange(e)} diff --git a/src/main/cliapp/src/components/Editors/__tests__/NotEditor.test.js b/src/main/cliapp/src/components/Editors/__tests__/NotEditor.test.js new file mode 100644 index 000000000..46575434c --- /dev/null +++ b/src/main/cliapp/src/components/Editors/__tests__/NotEditor.test.js @@ -0,0 +1,64 @@ +import { render, fireEvent, within } from '@testing-library/react'; +import { NotEditor } from '../NotEditor'; +import '../../../tools/jest/setupTests'; + +describe('NotEditor', () => { + it('should display "null" as the placeholder text when the initial value is false', () => { + const props = {}; + const value = false; + const editorChange = jest.fn(); + + const result = render(); + + expect(result.getAllByText("null")).toHaveLength(2); + }); + + it('should render a Dropdown component with no options when value prop is undefined', () => { + const props = {}; + const value = undefined; + const editorChange = jest.fn(); + + const result = render(); + + + expect(result.getByText("empty")).toBeInTheDocument(); + }); + + it('should update the selected value when an option is selected', () => { + const props = {}; + const value = false; + const editorChange = jest.fn(); + + + const result = render(); + const span = result.container.getElementsByTagName('span')[0]; + + expect(within(span).getByText('null')).toBeInTheDocument(); + + fireEvent.click(span); + + const option = result.getAllByText('NOT'); + fireEvent.click(option[0]); + const updatedSpan = result.container.getElementsByTagName('span')[0]; + + + expect(within(updatedSpan).getByText('NOT')).toBeInTheDocument(); + }); + + it('should call editorChange when an option is selected', () => { + const props = {}; + const value = true; + const editorChange = jest.fn(); + const result = render(); + const span = result.container.getElementsByTagName('span')[0]; + + fireEvent.click(span); + + + const option = result.getAllByText('null'); + fireEvent.click(option[0]); + + expect(editorChange).toHaveBeenCalledTimes(1); + }); + +}); \ No newline at end of file From 52725d046bb9fffc502bc30cd9485ac38deba112 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 11 Mar 2024 11:21:43 -0500 Subject: [PATCH 149/159] SCRUM-3794 update filter dropdown and header name --- .../components/Filters/FilterComponentBinaryDropDown.js | 2 +- src/main/cliapp/src/constants/FilterFields.js | 8 ++++---- .../diseaseAnnotationsPage/DiseaseAnnotationsTable.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/cliapp/src/components/Filters/FilterComponentBinaryDropDown.js b/src/main/cliapp/src/components/Filters/FilterComponentBinaryDropDown.js index e15175c72..fb80666fd 100644 --- a/src/main/cliapp/src/components/Filters/FilterComponentBinaryDropDown.js +++ b/src/main/cliapp/src/components/Filters/FilterComponentBinaryDropDown.js @@ -2,7 +2,7 @@ import React, { useRef } from "react"; import { Dropdown } from "primereact/dropdown"; export function FilterComponentBinaryDropDown({ isInEditMode, filterConfig, currentFilters, onFilter }) { - const options = useRef(["true", "false"]); + const options = useRef(filterConfig.options || ["true", "false"]); const fieldSet = filterConfig.fieldSets[0]; diff --git a/src/main/cliapp/src/constants/FilterFields.js b/src/main/cliapp/src/constants/FilterFields.js index 56032443e..e1b604f48 100644 --- a/src/main/cliapp/src/constants/FilterFields.js +++ b/src/main/cliapp/src/constants/FilterFields.js @@ -594,7 +594,7 @@ export const FILTER_CONFIGS = Object.freeze({ isExtinctFilterConfig: { filterComponentType: "dropdown", fieldSets: [FIELD_SETS.isExtinctFieldSet] }, obsoleteFilterConfig: { filterComponentType: "dropdown", fieldSets: [FIELD_SETS.obsoleteFieldSet] }, internalFilterConfig: { filterComponentType: "dropdown", fieldSets: [FIELD_SETS.internalFieldSet] }, - negatedFilterConfig: { filterComponentType: "dropdown", fieldSets: [FIELD_SETS.negatedFieldSet] }, + negatedFilterConfig: { filterComponentType: "dropdown", fieldSets: [FIELD_SETS.negatedFieldSet], options: [ { label: "NOT", value: "true" }, { label: "null", value: "false" } ] }, annotationTypeFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.annotationTypeFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, diseaseDataProviderFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.dataProviderFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, @@ -605,12 +605,12 @@ export const FILTER_CONFIGS = Object.freeze({ agmDataProviderFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.dataProviderFieldSet], aggregationFieldSet: FIELD_SETS.agmAggregationFieldSet, useKeywordFields: true }, diseaseQualifiersFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.diseaseQualifiersFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, relationFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.relationFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, - paRelationFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.relationFieldSet], aggregationFieldSet: FIELD_SETS.paAggregationFieldSet, useKeywordFields: true }, + paRelationFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.relationFieldSet], aggregationFieldSet: FIELD_SETS.paAggregationFieldSet, useKeywordFields: true }, geneticModifierRelationFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.geneticModifierRelationFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, geneticSexFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.geneticSexFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, secondaryDataProviderFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.secondaryDataProviderFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, - speciesDataProviderFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.dataProviderFieldSet], aggregationFieldSet: FIELD_SETS.speciesAggregationFieldSet, useKeywordFields: true }, - evidenceCodesFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.evidenceCodesFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, + speciesDataProviderFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.dataProviderFieldSet], aggregationFieldSet: FIELD_SETS.speciesAggregationFieldSet, useKeywordFields: true }, + evidenceCodesFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.evidenceCodesFieldSet], aggregationFieldSet: FIELD_SETS.daAggregationFieldSet, useKeywordFields: true }, variantDataProviderFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.dataProviderFieldSet], aggregationFieldSet: FIELD_SETS.variantAggregationFieldSet, useKeywordFields: true }, variantStatusFilterConfig: { filterComponentType: "multiselect", fieldSets: [FIELD_SETS.variantStatusFieldSet], aggregationFieldSet: FIELD_SETS.variantAggregationFieldSet,useKeywordFields: true }, diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index ba40bf144..6e155a4aa 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -923,7 +923,7 @@ export const DiseaseAnnotationsTable = () => { }, { field: "negated", - header: "Negated", + header: "Not", body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.negatedFilterConfig, From 060f9626e945ab8f0b3744fd6ee7ee05d3eb0df0 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 11 Mar 2024 11:50:04 -0500 Subject: [PATCH 150/159] SCRUM-3794 add NotEditor to NewAnnotationForm --- .../cliapp/src/components/Editors/NotEditor.js | 1 + .../diseaseAnnotationsPage/NewAnnotationForm.js | 17 +++++------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/main/cliapp/src/components/Editors/NotEditor.js b/src/main/cliapp/src/components/Editors/NotEditor.js index f73b9aa6f..c9dec2ae1 100644 --- a/src/main/cliapp/src/components/Editors/NotEditor.js +++ b/src/main/cliapp/src/components/Editors/NotEditor.js @@ -18,6 +18,7 @@ export function NotEditor({ props, value, editorChange }) { <> onChange(e)} diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js index 6c0982ce5..8ce4d7f90 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js @@ -6,6 +6,7 @@ import { Toast } from "primereact/toast"; import { MultiSelect } from 'primereact/multiselect'; import { useMutation, useQueryClient } from "react-query"; import { FormErrorMessageComponent } from "../../components/Error/FormErrorMessageComponent"; +import { NotEditor } from "../../components/Editors/NotEditor"; import { classNames } from "primereact/utils"; import { DiseaseAnnotationService } from "../../service/DiseaseAnnotationService"; import { Splitter, SplitterPanel } from "primereact/splitter"; @@ -75,7 +76,7 @@ export const NewAnnotationForm = ({ const geneticModifierRelationTerms = useControlledVocabularyService('disease_genetic_modifier_relation'); const [uiErrorMessages, setUiErrorMessages] = useState({}); const areUiErrors = useRef(false); - const newAnnotationOptionalFields = ["Asserted Genes", "Asserted Allele", "Negated", "With", "Related Notes", "Experimental Conditions", "Experiments", "Genetic Sex", + const newAnnotationOptionalFields = ["Asserted Genes", "Asserted Allele", "Not", "With", "Related Notes", "Experimental Conditions", "Experiments", "Genetic Sex", "Disease Qualifiers", "SGD Strain Background", "Annotation Type", "Genetic Modifier Relation", "Genetic Modifiers","Internal"]; let defaultUserSettings = getDefaultFormState("DiseaseAnnotations", newAnnotationOptionalFields, undefined); const { settings: settingsKey , mutate: setSettingsKey } = useGetUserSettings('DiseaseAnnotationsFormSettings', defaultUserSettings, false); @@ -566,22 +567,14 @@ export const NewAnnotationForm = ({
- {selectedFormFields?.includes("Negated") && ( + {selectedFormFields?.includes("Not") && ( <>
- +
- +
From 569709408bc68771e1ca1bb5f3af300f10c398b1 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Mon, 11 Mar 2024 12:10:31 -0500 Subject: [PATCH 151/159] SCRUM-3794 update case --- .../diseaseAnnotationsPage/DiseaseAnnotationsTable.js | 2 +- .../containers/diseaseAnnotationsPage/NewAnnotationForm.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index 6e155a4aa..f842525b2 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -923,7 +923,7 @@ export const DiseaseAnnotationsTable = () => { }, { field: "negated", - header: "Not", + header: "NOT", body: (rowData) => , sortable: true, filterConfig: FILTER_CONFIGS.negatedFilterConfig, diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js index 8ce4d7f90..b7457df74 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/NewAnnotationForm.js @@ -76,7 +76,7 @@ export const NewAnnotationForm = ({ const geneticModifierRelationTerms = useControlledVocabularyService('disease_genetic_modifier_relation'); const [uiErrorMessages, setUiErrorMessages] = useState({}); const areUiErrors = useRef(false); - const newAnnotationOptionalFields = ["Asserted Genes", "Asserted Allele", "Not", "With", "Related Notes", "Experimental Conditions", "Experiments", "Genetic Sex", + const newAnnotationOptionalFields = ["Asserted Genes", "Asserted Allele", "NOT", "With", "Related Notes", "Experimental Conditions", "Experiments", "Genetic Sex", "Disease Qualifiers", "SGD Strain Background", "Annotation Type", "Genetic Modifier Relation", "Genetic Modifiers","Internal"]; let defaultUserSettings = getDefaultFormState("DiseaseAnnotations", newAnnotationOptionalFields, undefined); const { settings: settingsKey , mutate: setSettingsKey } = useGetUserSettings('DiseaseAnnotationsFormSettings', defaultUserSettings, false); @@ -567,11 +567,11 @@ export const NewAnnotationForm = ({
- {selectedFormFields?.includes("Not") && ( + {selectedFormFields?.includes("NOT") && ( <>
- +
From e094318720606f629ace6f7d452c7e3f9c6e5de8 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Tue, 12 Mar 2024 08:57:25 -0500 Subject: [PATCH 152/159] SCRUM-3794 update DiseaseAnnotationsTable tests --- .../__tests__/DiseaseAnnotationsTable.test.js | 6 ++++-- .../containers/diseaseAnnotationsPage/mockData/mockData.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/__tests__/DiseaseAnnotationsTable.test.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/__tests__/DiseaseAnnotationsTable.test.js index ffcaed57f..2318a7d09 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/__tests__/DiseaseAnnotationsTable.test.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/__tests__/DiseaseAnnotationsTable.test.js @@ -37,7 +37,8 @@ describe("", () => { const modInternalIdTd = await result.findByText("mockModInternalId"); const subjectTd = await result.findByText(/C57BL\/6J-Rfx3/i); const relationTd = await result.findByText("is_model_of"); - const negatedInternalObsoleteArray = await result.findAllByText("false"); + const internalObsoleteArray = await result.findAllByText("false"); + const NOTArray = await result.findAllByText("NOT"); const diseaseTd = await result.findByText(/visceral heterotaxy/i); const referenceTd = await result.findByText(/MGI:5284969/i); const evidenceCodeTd = await result.findByText(/TAS/i); @@ -63,7 +64,8 @@ describe("", () => { expect(modInternalIdTd).toBeInTheDocument(); expect(subjectTd).toBeInTheDocument(); expect(relationTd).toBeInTheDocument(); - expect(negatedInternalObsoleteArray.length).toEqual(3); + expect(internalObsoleteArray.length).toEqual(2); + expect(NOTArray.length).toEqual(2); expect(diseaseTd).toBeInTheDocument(); expect(referenceTd).toBeInTheDocument(); expect(evidenceCodeTd).toBeInTheDocument(); diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js index 4442d524d..5e423d5f2 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/mockData/mockData.js @@ -96,7 +96,7 @@ export const data = { } ] }, - "negated": false, + "negated": true, "relation": { "dateCreated": "2022-01-26T09:40:54.020724Z", "dateUpdated": "2022-01-26T09:40:54.020726Z", From bb2a2e6996e40087c90cf4454e4cab7e551db874 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 13 Mar 2024 13:55:32 -0500 Subject: [PATCH 153/159] SCRUM-3794 remove null option from NotEditor --- .../cliapp/src/components/Editors/NotEditor.js | 18 ++++++++++++++---- .../DiseaseAnnotationsTable.js | 4 ++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/main/cliapp/src/components/Editors/NotEditor.js b/src/main/cliapp/src/components/Editors/NotEditor.js index c9dec2ae1..3d5ba1cd8 100644 --- a/src/main/cliapp/src/components/Editors/NotEditor.js +++ b/src/main/cliapp/src/components/Editors/NotEditor.js @@ -6,12 +6,22 @@ export function NotEditor({ props, value, editorChange }) { const textString = value ? "NOT" : ""; const options = [ { label: "NOT", value: true }, - { label: "null", value: false } ]; const onChange = (e) => { - setSelectedValue(e.value); - editorChange(e, props); + let event; + if(e.value === undefined){ + event = { + target: { + value: false, + name: e.target.name + } + } + } else { + event = e; + } + setSelectedValue(event.target.value); + editorChange(event, props); } return ( @@ -22,7 +32,7 @@ export function NotEditor({ props, value, editorChange }) { value={selectedValue} options={options} onChange={(e) => onChange(e)} - showClear={false} + showClear={true} placeholder={textString} style={{ width: '100%' }} /> diff --git a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js index f842525b2..d2151ead2 100644 --- a/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js +++ b/src/main/cliapp/src/containers/diseaseAnnotationsPage/DiseaseAnnotationsTable.js @@ -432,10 +432,10 @@ export const DiseaseAnnotationsTable = () => { }; const onNegatedEditorValueChange = (event, props) => { - if(event.value === undefined || event.value === null) return; + if(event.target.value === undefined || event.target.value === null) return; let updatedAnnotations = [...props.props.value]; - updatedAnnotations[props.rowIndex].negated = event.value; + updatedAnnotations[props.rowIndex].negated = event.target.value; } const onInternalEditorValueChange = (props, event) => { From 963684db6173932d19a8f9cf417a6f01f6de490c Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 13 Mar 2024 13:58:41 -0500 Subject: [PATCH 154/159] SCRUM-3794 update NotEditor tests --- .../components/Editors/__tests__/NotEditor.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/cliapp/src/components/Editors/__tests__/NotEditor.test.js b/src/main/cliapp/src/components/Editors/__tests__/NotEditor.test.js index 46575434c..bb1c66886 100644 --- a/src/main/cliapp/src/components/Editors/__tests__/NotEditor.test.js +++ b/src/main/cliapp/src/components/Editors/__tests__/NotEditor.test.js @@ -3,14 +3,14 @@ import { NotEditor } from '../NotEditor'; import '../../../tools/jest/setupTests'; describe('NotEditor', () => { - it('should display "null" as the placeholder text when the initial value is false', () => { + it('should display "NOT" as the placeholder text when the initial value is true', () => { const props = {}; - const value = false; + const value = true; const editorChange = jest.fn(); const result = render(); - expect(result.getAllByText("null")).toHaveLength(2); + expect(result.getAllByText("NOT")).toHaveLength(2); }); it('should render a Dropdown component with no options when value prop is undefined', () => { @@ -33,7 +33,7 @@ describe('NotEditor', () => { const result = render(); const span = result.container.getElementsByTagName('span')[0]; - expect(within(span).getByText('null')).toBeInTheDocument(); + expect(within(span).getByText('empty')).toBeInTheDocument(); fireEvent.click(span); @@ -47,7 +47,7 @@ describe('NotEditor', () => { it('should call editorChange when an option is selected', () => { const props = {}; - const value = true; + const value = false; const editorChange = jest.fn(); const result = render(); const span = result.container.getElementsByTagName('span')[0]; @@ -55,7 +55,7 @@ describe('NotEditor', () => { fireEvent.click(span); - const option = result.getAllByText('null'); + const option = result.getAllByText('NOT'); fireEvent.click(option[0]); expect(editorChange).toHaveBeenCalledTimes(1); From 12bf3dd0e4a01c2a2a95e7b9fe928b7fab22d77e Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Wed, 13 Mar 2024 14:02:05 -0500 Subject: [PATCH 155/159] SCRUM-3794 update placeholder text --- src/main/cliapp/src/components/Editors/NotEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/cliapp/src/components/Editors/NotEditor.js b/src/main/cliapp/src/components/Editors/NotEditor.js index 3d5ba1cd8..75e8a6264 100644 --- a/src/main/cliapp/src/components/Editors/NotEditor.js +++ b/src/main/cliapp/src/components/Editors/NotEditor.js @@ -3,7 +3,7 @@ import { Dropdown } from "primereact/dropdown"; export function NotEditor({ props, value, editorChange }) { const [selectedValue, setSelectedValue] = useState(value); - const textString = value ? "NOT" : ""; + const textString = selectedValue ? "NOT" : ""; const options = [ { label: "NOT", value: true }, ]; From 0a96f39d25adede0202467115c243bf956011ff2 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 14 Mar 2024 15:14:43 +0000 Subject: [PATCH 156/159] Fix lazy loading error for Molecule load --- .../curation_api/services/CrossReferenceService.java | 1 + .../curation_api/services/ResourceDescriptorPageService.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/org/alliancegenome/curation_api/services/CrossReferenceService.java b/src/main/java/org/alliancegenome/curation_api/services/CrossReferenceService.java index 82f0b1e3c..24c0cd7ec 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/CrossReferenceService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/CrossReferenceService.java @@ -31,6 +31,7 @@ protected void init() { setSQLDao(crossReferenceDAO); } + @Transactional public List getMergedFmsXrefList(List fmsCrossReferences, List existingCrossReferences) { Map incomingXrefMap = new HashedMap<>(); if (CollectionUtils.isNotEmpty(fmsCrossReferences)) { diff --git a/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorPageService.java b/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorPageService.java index 9d15a7254..a24b7d48b 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorPageService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorPageService.java @@ -55,6 +55,7 @@ public ResourceDescriptorPage getPageForResourceDescriptor(String resourceDescri page = getPageForResourceDescriptorFromDB(resourceDescriptorPrefix, pageName); resourceRequestMap.put(resourceDescriptorPrefix, new Date()); } + page.getResourceDescriptor().getSynonyms().size(); return page; From a86e9b15fdb500c17bf9d736deae327764b5dc7e Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 14 Mar 2024 15:16:11 +0000 Subject: [PATCH 157/159] Remove unnecessary @Transactional --- .../curation_api/services/CrossReferenceService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/alliancegenome/curation_api/services/CrossReferenceService.java b/src/main/java/org/alliancegenome/curation_api/services/CrossReferenceService.java index 24c0cd7ec..82f0b1e3c 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/CrossReferenceService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/CrossReferenceService.java @@ -31,7 +31,6 @@ protected void init() { setSQLDao(crossReferenceDAO); } - @Transactional public List getMergedFmsXrefList(List fmsCrossReferences, List existingCrossReferences) { Map incomingXrefMap = new HashedMap<>(); if (CollectionUtils.isNotEmpty(fmsCrossReferences)) { From b762c9092ddbee8812ada8a60fef939923791b62 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 14 Mar 2024 15:35:16 +0000 Subject: [PATCH 158/159] Fix NPE --- .../services/ResourceDescriptorPageService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorPageService.java b/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorPageService.java index a24b7d48b..51b7df452 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorPageService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorPageService.java @@ -55,7 +55,11 @@ public ResourceDescriptorPage getPageForResourceDescriptor(String resourceDescri page = getPageForResourceDescriptorFromDB(resourceDescriptorPrefix, pageName); resourceRequestMap.put(resourceDescriptorPrefix, new Date()); } - page.getResourceDescriptor().getSynonyms().size(); + + if (page.getResourceDescriptor() != null) { + if (page.getResourceDescriptor().getSynonyms() != null) + page.getResourceDescriptor().getSynonyms().size(); + } return page; From 19a12dea39526c9433f40cdea15d057a3e57dcdc Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 14 Mar 2024 15:45:14 +0000 Subject: [PATCH 159/159] Another NPE fix --- .../services/ResourceDescriptorPageService.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorPageService.java b/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorPageService.java index 51b7df452..905e42d1d 100644 --- a/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorPageService.java +++ b/src/main/java/org/alliancegenome/curation_api/services/ResourceDescriptorPageService.java @@ -56,11 +56,9 @@ public ResourceDescriptorPage getPageForResourceDescriptor(String resourceDescri resourceRequestMap.put(resourceDescriptorPrefix, new Date()); } - if (page.getResourceDescriptor() != null) { - if (page.getResourceDescriptor().getSynonyms() != null) - page.getResourceDescriptor().getSynonyms().size(); - } - + if (page != null && page.getResourceDescriptor() != null && page.getResourceDescriptor().getSynonyms() != null) + page.getResourceDescriptor().getSynonyms().size(); + return page; }