diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7df3480415c742159af12bd1c3e36c778000c472..b2bde70c9a2ad6bdcb46c0ef7ad1edd966c10ef8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,7 +22,7 @@ variables: JAR_PATH: "backend/build/libs/${APP_NAME}.jar" GIT_DEPTH: 0 IMAGE_TAG: $CI_COMMIT_REF_SLUG - ELASTIC_VERSION: "6.6.2" + ELASTIC_VERSION: "7.13.2" DOCKER_OPTS: "--mtu=1450" # Gradle cache for all jobs @@ -50,6 +50,7 @@ build-loader-docker-image: - if [ "master" == "${CI_COMMIT_REF_SLUG}" ] ; then docker push registry.forgemia.inra.fr/urgi-is/docker-rare/faidare-loader:latest ; fi; only: changes: + - Dockerfile - scripts/* - backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/*_mapping.json - backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/settings.json diff --git a/.secrets.baseline b/.secrets.baseline index 58672400dda7618e0fea2e3886828061441b2b73..46d11502408f9906c3d1fbec2ae9ae30afaefb76 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "frontend/package-lock.json|^.secrets.baseline$", "lines": null }, - "generated_at": "2021-08-02T15:23:45Z", + "generated_at": "2021-10-01T17:08:35Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -58,14 +58,14 @@ "hashed_secret": "dd447c7c799dd4ebaacca8f0ad3da45a097d7211", "is_secret": false, "is_verified": false, - "line_number": 228, + "line_number": 204, "type": "Base64 High Entropy String" }, { "hashed_secret": "8074db38f8a8acec1a147bc5daf2799ff6693fff", "is_secret": false, "is_verified": false, - "line_number": 247, + "line_number": 248, "type": "Base64 High Entropy String" } ], @@ -412,15 +412,6 @@ "type": "Base64 High Entropy String" } ], - "backend/src/main/java/fr/inra/urgi/faidare/domain/xref/XRefDocumentSearchCriteria.java": [ - { - "hashed_secret": "115a9779753641744ba0e30c3ff8586c823b6f7e", - "is_secret": false, - "is_verified": false, - "line_number": 18, - "type": "Base64 High Entropy String" - } - ], "backend/src/main/java/fr/inra/urgi/faidare/elasticsearch/query/impl/ESGenericQueryFactory.java": [ { "hashed_secret": "084c833a01fb1d770f994aaec6a07f282e41827a", @@ -2552,6 +2543,22 @@ "type": "Base64 High Entropy String" } ], + "gradle.properties": [ + { + "hashed_secret": "93220646d2e029229894cf6f9e5d170c8fc59dbb", + "is_secret": true, + "is_verified": false, + "line_number": 5, + "type": "Base64 High Entropy String" + }, + { + "hashed_secret": "93220646d2e029229894cf6f9e5d170c8fc59dbb", + "is_secret": true, + "is_verified": false, + "line_number": 5, + "type": "Hex High Entropy String" + } + ], "scripts/harvest.sh": [ { "hashed_secret": "9b4ea0964706f977148ec989e7373d9622613547", diff --git a/Dockerfile b/Dockerfile index d9b28b366813c26130f7cfbbc39bd3bf9eb3e172..75b15021ab79c72735bec70dc527e7c2c3708269 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ FROM alpine LABEL Author="Raphaël FLORES <raphael.flores@inrae.fr>" COPY scripts/harvest.sh /opt/scripts/ +COPY scripts/to_bulk.jq /opt/scripts/ # COPY dao settings COPY backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/settings.json /opt/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/settings.json diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts index a91c75abfd1edbb442f123dafa5734870d2108f6..f7c5237f03012eb05b1f612036e0d46b3bf7767f 100644 --- a/backend/build.gradle.kts +++ b/backend/build.gradle.kts @@ -110,8 +110,8 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-thymeleaf") // Elasticsearch - implementation("org.elasticsearch:elasticsearch:6.6.2") - implementation("org.elasticsearch.client:elasticsearch-rest-high-level-client:6.6.2") + implementation("org.elasticsearch:elasticsearch:7.13.2") + implementation("org.elasticsearch.client:elasticsearch-rest-high-level-client:7.13.2") // Swagger implementation("io.swagger:swagger-annotations:1.5.21") diff --git a/backend/src/main/java/fr/inra/urgi/faidare/api/faidare/v1/XRefDocumentController.java b/backend/src/main/java/fr/inra/urgi/faidare/api/faidare/v1/XRefDocumentController.java index 14b8f046089a6df7d267700a8c00f784c94081b0..09c5c25d93cce30a19f6ddc52586ca990c60863c 100644 --- a/backend/src/main/java/fr/inra/urgi/faidare/api/faidare/v1/XRefDocumentController.java +++ b/backend/src/main/java/fr/inra/urgi/faidare/api/faidare/v1/XRefDocumentController.java @@ -31,12 +31,12 @@ public class XRefDocumentController { @ApiOperation("Find xref documents") @GetMapping(value = "/faidare/v1/xref/documentbyfulltextid") public PaginatedList<XRefDocumentVO> documentByFullTextId( - @RequestParam(required = false, value = "entry_type") String entryType, - @RequestParam(required = false) List<String> linkedRessourcesID + @RequestParam(required = false, value = "entryType") String entryType, + @RequestParam(required = false) List<String> linkedResourcesID ) { XRefDocumentSearchCriteria criteria = new XRefDocumentSearchCriteria(); criteria.setEntryType(entryType); - criteria.setLinkedRessourcesID(linkedRessourcesID); + criteria.setLinkedResourcesID(linkedResourcesID); return repository.find(criteria); } diff --git a/backend/src/main/java/fr/inra/urgi/faidare/domain/xref/DocumentFields.java b/backend/src/main/java/fr/inra/urgi/faidare/domain/xref/DocumentFields.java index af7420a01082796fdd1d467fdec2cca8d3efdccf..5a43e4d68a5522e54a328ae8fae803297da68eef 100644 --- a/backend/src/main/java/fr/inra/urgi/faidare/domain/xref/DocumentFields.java +++ b/backend/src/main/java/fr/inra/urgi/faidare/domain/xref/DocumentFields.java @@ -5,7 +5,7 @@ package fr.inra.urgi.faidare.domain.xref; */ public enum DocumentFields { - ENTRY_TYPE("entry_type"), LINKEDRESSOURCESID("linkedRessourcesID"); + ENTRY_TYPE("entryType"), LINKED_RESOURCES_ID("linkedResourcesID"); private String field; diff --git a/backend/src/main/java/fr/inra/urgi/faidare/domain/xref/XRefDocumentSearchCriteria.java b/backend/src/main/java/fr/inra/urgi/faidare/domain/xref/XRefDocumentSearchCriteria.java index 6dde515e2d0fa5fedf1d2b36d7d2b30de43dd5f5..e205689d39491b94e1ede89ef8d5a86397587c5d 100644 --- a/backend/src/main/java/fr/inra/urgi/faidare/domain/xref/XRefDocumentSearchCriteria.java +++ b/backend/src/main/java/fr/inra/urgi/faidare/domain/xref/XRefDocumentSearchCriteria.java @@ -13,15 +13,15 @@ import java.util.List; @CriteriaForDocument(XRefDocumentVO.class) public class XRefDocumentSearchCriteria extends PaginationCriteriaImpl { - @DocumentPath("entry_type") + @DocumentPath("entryType") private String entryType; - @DocumentPath("linkedRessourcesID") - private List<String> linkedRessourcesID; + @DocumentPath("linkedResourcesID") // pragma: allowlist secret + private List<String> linkedResourcesID; public static XRefDocumentSearchCriteria forXRefId(String resourceId) { XRefDocumentSearchCriteria criteria = new XRefDocumentSearchCriteria(); - criteria.setLinkedRessourcesID(Collections.singletonList(resourceId)); + criteria.setLinkedResourcesID(Collections.singletonList(resourceId)); return criteria; } @@ -33,11 +33,11 @@ public class XRefDocumentSearchCriteria extends PaginationCriteriaImpl { this.entryType = entryType; } - public List<String> getLinkedRessourcesID() { - return linkedRessourcesID; + public List<String> getLinkedResourcesID() { + return linkedResourcesID; } - public void setLinkedRessourcesID(List<String> linkedRessourcesID) { - this.linkedRessourcesID = linkedRessourcesID; + public void setLinkedResourcesID(List<String> linkedResourcesID) { + this.linkedResourcesID = linkedResourcesID; } } diff --git a/backend/src/main/java/fr/inra/urgi/faidare/domain/xref/XRefDocumentVO.java b/backend/src/main/java/fr/inra/urgi/faidare/domain/xref/XRefDocumentVO.java index b6ae340faf0b51cffd5914df39958e687bd09ca5..0cc7e84fbcf7822596b938d142e8e48fc1649ed0 100644 --- a/backend/src/main/java/fr/inra/urgi/faidare/domain/xref/XRefDocumentVO.java +++ b/backend/src/main/java/fr/inra/urgi/faidare/domain/xref/XRefDocumentVO.java @@ -11,23 +11,20 @@ import java.util.List; * * @author fphilippe */ -@Document(type = "transplant") +@Document(type = "xref") public class XRefDocumentVO { - @JsonProperty("group_id") + @JsonProperty("groupId") private String groupId; - @JsonProperty("entry_type") + @JsonProperty("entryType") private String entryType; - @JsonProperty("database_name") + @JsonProperty("databaseName") private String databaseName; - @JsonProperty("db_id") - private String dbId; - - @JsonProperty("db_version") - private String dbVersion; + @JsonProperty("identifier") + private String identifier; @JsonProperty("name") private String name; @@ -41,58 +38,7 @@ public class XRefDocumentVO { @JsonProperty("species") private String species; - @JsonProperty("xref") - private String xref; - - @JsonProperty("feature_type") - private String featureType; - - @JsonProperty("sequence_id") - private String sequenceId; - - @JsonProperty("sequence_version") - private String sequence_version; - - @JsonProperty("start_position") - private String startPosition; - - @JsonProperty("end_position") - private String endPosition; - - @JsonProperty("map") - private String map; - - @JsonProperty("map_position") - private String mapPosition; - - @JsonProperty("authority") - private String authority; - - @JsonProperty("trait") - private String trait; - - @JsonProperty("trait_id") - private String traitId; - - @JsonProperty("environment") - private String environment; - - @JsonProperty("environment_id") - private String environmentId; - - @JsonProperty("statistic") - private String statistic; - - @JsonProperty("unit") - private String unit; - - @JsonProperty("genotype") - private String genotype; - - @JsonProperty("experiment_type") - private String experimentType; - - private List<String> linkedRessourcesID; + private List<String> linkedResourcesID; public String getGroupId() { return groupId; @@ -118,20 +64,12 @@ public class XRefDocumentVO { this.databaseName = databaseName; } - public String getDbId() { - return dbId; + public String getIdentifier() { + return identifier; } - public void setDbId(String dbId) { - this.dbId = dbId; - } - - public String getDbVersion() { - return dbVersion; - } - - public void setDbVersion(String dbVersion) { - this.dbVersion = dbVersion; + public void setIdentifier(String identifier) { + this.identifier = identifier; } public String getName() { @@ -166,148 +104,12 @@ public class XRefDocumentVO { this.species = species; } - public String getXref() { - return xref; - } - - public void setXref(String xref) { - this.xref = xref; - } - - public String getFeatureType() { - return featureType; - } - - public void setFeatureType(String featureType) { - this.featureType = featureType; - } - - public String getSequenceId() { - return sequenceId; - } - - public void setSequenceId(String sequenceId) { - this.sequenceId = sequenceId; - } - - public String getSequence_version() { - return sequence_version; - } - - public void setSequence_version(String sequence_version) { - this.sequence_version = sequence_version; - } - - public String getStartPosition() { - return startPosition; - } - - public void setStartPosition(String startPosition) { - this.startPosition = startPosition; - } - - public String getEndPosition() { - return endPosition; - } - - public void setEndPosition(String endPosition) { - this.endPosition = endPosition; - } - - public String getMap() { - return map; - } - - public void setMap(String map) { - this.map = map; - } - - public String getMapPosition() { - return mapPosition; - } - - public void setMapPosition(String mapPosition) { - this.mapPosition = mapPosition; - } - - public String getAuthority() { - return authority; - } - - public void setAuthority(String authority) { - this.authority = authority; - } - - public String getTrait() { - return trait; - } - - public void setTrait(String trait) { - this.trait = trait; - } - - public String getTraitId() { - return traitId; - } - - public void setTraitId(String traitId) { - this.traitId = traitId; - } - - public String getEnvironment() { - return environment; - } - - public void setEnvironment(String environment) { - this.environment = environment; - } - - public String getEnvironmentId() { - return environmentId; - } - - public void setEnvironmentId(String environmentId) { - this.environmentId = environmentId; - } - - public String getStatistic() { - return statistic; - } - - public void setStatistic(String statistic) { - this.statistic = statistic; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - - public String getGenotype() { - return genotype; - } - - public void setGenotype(String genotype) { - this.genotype = genotype; - } - - public String getExperimentType() { - return experimentType; - } - - public void setExperimentType(String experimentType) { - this.experimentType = experimentType; - } - - public List<String> getLinkedRessourcesID() { - return linkedRessourcesID; + public List<String> getLinkedResourcesID() { + return linkedResourcesID; } - public void setLinkedRessourcesID(List<String> linkedRessourcesID) { - this.linkedRessourcesID = linkedRessourcesID; + public void setLinkedResourcesID(List<String> linkedResourcesID) { + this.linkedResourcesID = linkedResourcesID; } } diff --git a/backend/src/main/java/fr/inra/urgi/faidare/elasticsearch/ESRequestFactory.java b/backend/src/main/java/fr/inra/urgi/faidare/elasticsearch/ESRequestFactory.java index 21102c83919f51e9633045de96d5ba94a4aa2b34..6b558514e7205ddeaf14cc8b631774776aefd45c 100644 --- a/backend/src/main/java/fr/inra/urgi/faidare/elasticsearch/ESRequestFactory.java +++ b/backend/src/main/java/fr/inra/urgi/faidare/elasticsearch/ESRequestFactory.java @@ -58,10 +58,6 @@ public class ESRequestFactory { request.source(new SearchSourceBuilder()); request.indicesOptions(indicesOptions); - if (documentType != null) { - request.types(documentType); - } - if (query != null) { request.source().query(query); } diff --git a/backend/src/main/java/fr/inra/urgi/faidare/elasticsearch/ESResponseParser.java b/backend/src/main/java/fr/inra/urgi/faidare/elasticsearch/ESResponseParser.java index 092892399f62f7820670f3c057665c55d11c7857..c73afbcd5fa99aaaab4e62c08e7ea53e6f1ea1cd 100644 --- a/backend/src/main/java/fr/inra/urgi/faidare/elasticsearch/ESResponseParser.java +++ b/backend/src/main/java/fr/inra/urgi/faidare/elasticsearch/ESResponseParser.java @@ -44,7 +44,7 @@ public class ESResponseParser { if (response == null) return null; SearchHits hits = response.getHits(); if (hits == null) return null; - return hits.totalHits; + return hits.getTotalHits().value; } /** diff --git a/backend/src/main/java/fr/inra/urgi/faidare/elasticsearch/ESScrollIterator.java b/backend/src/main/java/fr/inra/urgi/faidare/elasticsearch/ESScrollIterator.java index 04b8d4e2993512412b57f9acedafd4217cd4c245..45080159421b1d797ffb41e23847458f96e3df8d 100644 --- a/backend/src/main/java/fr/inra/urgi/faidare/elasticsearch/ESScrollIterator.java +++ b/backend/src/main/java/fr/inra/urgi/faidare/elasticsearch/ESScrollIterator.java @@ -83,7 +83,7 @@ public class ESScrollIterator<T> implements Iterator<T> { } this.scrollId = response.getScrollId(); - this.totalHits = response.getHits().getTotalHits(); + this.totalHits = response.getHits().getTotalHits().value; this.hitIndex = 0; this.currentIterator = parseIterator(response); } diff --git a/backend/src/main/java/fr/inra/urgi/faidare/repository/es/GermplasmRepositoryImpl.java b/backend/src/main/java/fr/inra/urgi/faidare/repository/es/GermplasmRepositoryImpl.java index d5af326a0bb8df2f51206c0408ac2c6cc060255c..7069f1959790845d95793b111c3912e395a4f76d 100644 --- a/backend/src/main/java/fr/inra/urgi/faidare/repository/es/GermplasmRepositoryImpl.java +++ b/backend/src/main/java/fr/inra/urgi/faidare/repository/es/GermplasmRepositoryImpl.java @@ -182,7 +182,7 @@ public class GermplasmRepositoryImpl implements GermplasmRepository { LOGGER.debug("\n\nQuery from findPedigree :\n" + termQuery.toString() + "\n\n"); - if (hits.totalHits == 1) { + if (hits.getTotalHits().value == 1) { // result found! \o/ SearchHit hit = hits.getAt(0); String source = hit.getSourceAsString(); @@ -191,7 +191,7 @@ public class GermplasmRepositoryImpl implements GermplasmRepository { } catch (IOException e) { LOGGER.error("Error occured when converting ES response to PedigreeVO: " + e.getMessage(), e); } - } else if (hits.totalHits > 1) { + } else if (hits.getTotalHits().value > 1) { throw new IllegalStateException("Expected only 1 result for pedigree with germplasmDbId: " + germplasmDbId); } return pedigreeVO; @@ -211,7 +211,7 @@ public class GermplasmRepositoryImpl implements GermplasmRepository { final SearchHits hits = response.getHits(); LOGGER.debug("\n\nQuery from findProgeny :\n" + termQuery.toString() + "\n\n"); - if (hits.totalHits == 1) { + if (hits.getTotalHits().value == 1) { SearchHit hit = hits.getAt(0); String source = hit.getSourceAsString(); try { @@ -219,7 +219,7 @@ public class GermplasmRepositoryImpl implements GermplasmRepository { } catch (IOException e) { LOGGER.error("Error occured when converting ES response to ProgenyVO: " + e.getMessage(), e); } - } else if (hits.totalHits > 1) { + } else if (hits.getTotalHits().value > 1) { throw new IllegalStateException("Expected only 1 result for progeny with germplasmDbId: " + germplasmDbId); } return progenyVO; diff --git a/backend/src/test/java/fr/inra/urgi/faidare/elasticsearch/ESResponseParserTest.java b/backend/src/test/java/fr/inra/urgi/faidare/elasticsearch/ESResponseParserTest.java index dc757ee986e8ea325665b28420ae087d2796846e..c215c6a81403124c3be7182741532bca017d9325 100644 --- a/backend/src/test/java/fr/inra/urgi/faidare/elasticsearch/ESResponseParserTest.java +++ b/backend/src/test/java/fr/inra/urgi/faidare/elasticsearch/ESResponseParserTest.java @@ -2,6 +2,7 @@ package fr.inra.urgi.faidare.elasticsearch; import com.fasterxml.jackson.databind.ObjectMapper; import fr.inra.urgi.faidare.elasticsearch.fixture.DocumentObject; +import org.apache.lucene.search.TotalHits; import org.assertj.core.util.Lists; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.bytes.BytesReference; @@ -50,7 +51,7 @@ class ESResponseParserTest { float maxScore = 100; // Can't mock SearchHits since it is a final class - SearchHits hits = new SearchHits(hitsArray, expectedTotalHits, maxScore); + SearchHits hits = new SearchHits(hitsArray, new TotalHits(expectedTotalHits, TotalHits.Relation.EQUAL_TO), maxScore); SearchResponse response = mock(SearchResponse.class); when(response.getHits()).thenReturn(hits); @@ -98,7 +99,7 @@ class ESResponseParserTest { SearchHit hit3 = mockSearchHit(object3); // Can't mock SearchHits since it is a final class - SearchHits hits = new SearchHits(new SearchHit[]{hit1, hit2, hit3}, 3, 100); + SearchHits hits = new SearchHits(new SearchHit[]{hit1, hit2, hit3}, new TotalHits(3L, TotalHits.Relation.EQUAL_TO), 100); SearchResponse response = mock(SearchResponse.class); when(response.getHits()).thenReturn(hits); @@ -132,7 +133,7 @@ class ESResponseParserTest { assertThat(result).isNull(); // Return null if no hits in hits - SearchHits hits = new SearchHits(null, 0, 100); + SearchHits hits = new SearchHits(null, new TotalHits(0, TotalHits.Relation.EQUAL_TO), 100); when(response.getHits()).thenReturn(hits); List<DocumentObject> result2 = parser.parseHits(response, DocumentObject.class); diff --git a/backend/src/test/java/fr/inra/urgi/faidare/repository/es/XRefDocumentRepositoryTest.java b/backend/src/test/java/fr/inra/urgi/faidare/repository/es/XRefDocumentRepositoryTest.java index 8d488134985ba82d9197472b2b0a349873dd0343..f7ae93de08663973ab75a23410820fe8232d3998 100644 --- a/backend/src/test/java/fr/inra/urgi/faidare/repository/es/XRefDocumentRepositoryTest.java +++ b/backend/src/test/java/fr/inra/urgi/faidare/repository/es/XRefDocumentRepositoryTest.java @@ -62,12 +62,12 @@ class XRefDocumentRepositoryTest { @Test void should_Find_By_Linked_Id() { String id = "ID2"; - List<String> linkedRessourcesID = Collections.singletonList(id); + List<String> linkedResourcesID = Collections.singletonList(id); XRefDocumentSearchCriteria criteria = new XRefDocumentSearchCriteria(); - criteria.setLinkedRessourcesID(linkedRessourcesID); + criteria.setLinkedResourcesID(linkedResourcesID); PaginatedList<XRefDocumentVO> documents = repository.find(criteria); assertThat(documents).isNotNull().hasSize(2) - .flatExtracting("linkedRessourcesID") + .flatExtracting("linkedResourcesID") .contains(id); } diff --git a/backend/src/test/java/fr/inra/urgi/faidare/repository/es/setup/ESSetUp.java b/backend/src/test/java/fr/inra/urgi/faidare/repository/es/setup/ESSetUp.java index 235e03b61c1439246e811b7ba02355d4f2fe6cd7..760e5d3ff3c9caacdfc41e16730e9b139a093209 100644 --- a/backend/src/test/java/fr/inra/urgi/faidare/repository/es/setup/ESSetUp.java +++ b/backend/src/test/java/fr/inra/urgi/faidare/repository/es/setup/ESSetUp.java @@ -7,10 +7,7 @@ import fr.inra.urgi.faidare.config.FaidareProperties; import fr.inra.urgi.faidare.domain.xref.XRefDocumentVO; import fr.inra.urgi.faidare.elasticsearch.document.DocumentAnnotationUtil; import fr.inra.urgi.faidare.repository.es.XRefDocumentRepositoryImpl; -import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; -import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; -import org.elasticsearch.action.admin.indices.get.GetIndexRequest; import org.elasticsearch.action.admin.indices.refresh.RefreshRequest; import org.elasticsearch.action.admin.indices.refresh.RefreshResponse; import org.elasticsearch.action.bulk.BulkRequest; @@ -19,8 +16,12 @@ import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RestHighLevelClient; +import org.elasticsearch.client.indices.CreateIndexRequest; +import org.elasticsearch.client.indices.CreateIndexResponse; +import org.elasticsearch.client.indices.GetIndexRequest; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.common.xcontent.XContentType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -47,8 +48,7 @@ public class ESSetUp { * Delete index/alias if it exists */ private void deleteIndex(String indexName) throws IOException { - GetIndexRequest existsRequest = new GetIndexRequest(); - existsRequest.indices(indexName); + GetIndexRequest existsRequest = new GetIndexRequest(indexName); boolean exists = client.indices().exists(existsRequest, RequestOptions.DEFAULT); if (!exists) { // Do not delete non existing index @@ -76,11 +76,11 @@ public class ESSetUp { // with document mappings String mapping = readResource("./index/" + documentType + "_mapping.json"); - createIndex.mapping(documentType, toXContentBuilder(mapping)); + createIndex.mapping(mapping, XContentType.JSON); CreateIndexResponse createResponse = client.indices().create(createIndex, RequestOptions.DEFAULT); if (!createResponse.isAcknowledged()) { - throw new RuntimeException("Could not create index '" + indexName + "': " + createResponse.toString()); + throw new RuntimeException("Could not create index '" + indexName + "': " + createResponse); } // Bulk index fixture data @@ -93,7 +93,7 @@ public class ESSetUp { while (elements.hasNext()) { JsonNode document = elements.next(); - IndexRequest indexRequest = new IndexRequest(indexName, documentType); + IndexRequest indexRequest = new IndexRequest(indexName); indexRequest.source(toXContentBuilder(document.toString())); bulkRequest.add(indexRequest); } diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/elasticsearch/query/impl/expected/query3.json b/backend/src/test/resources/fr/inra/urgi/faidare/elasticsearch/query/impl/expected/query3.json index b4977699d6f3ed71f2827c4bc2e44864b7f2818b..2e066801302bf694bcec337405ec4d5f6fbed810 100644 --- a/backend/src/test/resources/fr/inra/urgi/faidare/elasticsearch/query/impl/expected/query3.json +++ b/backend/src/test/resources/fr/inra/urgi/faidare/elasticsearch/query/impl/expected/query3.json @@ -1,48 +1,49 @@ { - "nested" : { - "query" : { - "bool" : { - "must" : [ + "nested": { + "query": { + "bool": { + "must": [ { - "term" : { - "field2.schema:identifier" : { - "value" : "5", - "boost" : 1.0 + "term": { + "field2.schema:identifier": { + "value": "5", + "boost": 1.0 } } }, { - "term" : { - "field2.field4.subField" : { - "value" : "4", - "boost" : 1.0 + "term": { + "field2.field4.subField": { + "value": "4", + "boost": 1.0 } } }, { - "term" : { - "field2.field3" : { - "value" : "3", - "boost" : 1.0 + "term": { + "field2.field3": { + "value": "3", + "boost": 1.0 } } } ], - "adjust_pure_negative" : true, - "boost" : 1.0 + "adjust_pure_negative": true, + "boost": 1.0 } }, - "path" : "field2", - "ignore_unmapped" : false, - "score_mode" : "none", - "boost" : 1.0, - "inner_hits" : { - "ignore_unmapped" : false, - "from" : 0, - "size" : 10000, - "version" : false, - "explain" : false, - "track_scores" : false + "path": "field2", + "ignore_unmapped": false, + "score_mode": "none", + "boost": 1.0, + "inner_hits": { + "ignore_unmapped": false, + "from": 0, + "size": 10000, + "version": false, + "seq_no_primary_term": false, + "explain": false, + "track_scores": false } } -} \ No newline at end of file +} diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/fixture/urgi_xref_test-group0.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/fixture/urgi_xref_test-group0.json index 05809a8ce030a613e8cb4cc1d2649afe33e08063..a91de2ba3d914716f9b07eec2bef2d7e549b6b36 100644 --- a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/fixture/urgi_xref_test-group0.json +++ b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/fixture/urgi_xref_test-group0.json @@ -1,46 +1,28 @@ [ { - "linkedRessourcesID": [ + "linkedResourcesID": [ "ID2" ], - "group_id": "0", - "entry_type": "Accession", - "database_name": "GnpIS", - "db_id": "ID1", - "db_version": "ACCESSION_https://doi.org/10.15454/KFQTFL_1", + "groupId": "0", + "entryType": "Accession", + "databaseName": "GnpIS", + "identifier": "ID1", "name": "355", "description": "Lorem ipsum....", "url": "https://urgi.versailles.inra.fr/gnpis-core/#accessionCard/id=aHR0cHM6Ly9kb2kub3JnLzEwLjE1NDU0L0tGUVRGTA==", - "species": "Quercus petraea", - "xref": "", - "feature_type": "", - "sequence_id": "", - "sequence_version": "", - "start_position": "", - "end_position": "", - "map": "", - "map_position": "", - "authority": "INRA-UMR1202-BIOGECO (Biodiversité Gènes et Communauté)", - "trait": "", - "trait_id": "", - "environment": "", - "environment_id": "", - "statistic": "", - "unit": "", - "genotype": "", - "experiment_type": "" + "species": "Quercus petraea" }, { - "linkedRessourcesID": [ + "linkedResourcesID": [ "ID3" ], - "entry_type": "Site" + "entryType": "Site" }, { - "linkedRessourcesID": [ + "linkedResourcesID": [ "ID2", "ID3" ], - "entry_type": "Site" + "entryType": "Site" } ] diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/datadiscovery_mapping.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/datadiscovery_mapping.json index 076ea76a3a21ac105d82610d6f3205304b9ec993..a6f320ff698518aa6f70a01b94b5c851dde26f49 100644 --- a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/datadiscovery_mapping.json +++ b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/datadiscovery_mapping.json @@ -1,92 +1,92 @@ { - "datadiscovery": { - "dynamic": "false", - "_source": { - "includes": ["@id", "@type", "schema:*", "groupId"] - }, - "properties": { - "groupId": { - "type": "long" - }, - "@type": { - "type": "keyword" - }, - "@id": { - "type": "keyword" - }, - "schema:includedInDataCatalog": { - "type": "keyword" - }, - "schema:identifier": { - "type": "keyword" - }, - "schema:name": { - "type": "keyword" - }, - "schema:url": { - "type": "keyword" - }, - "schema:description": { - "type": "keyword" - }, - - "germplasmURI": { - "type": "keyword" - }, - "germplasmDbId": { - "type": "keyword" - }, - "studyURIs": { - "type": "keyword" - }, - "studyDbIds": { - "type": "keyword" - }, - - "germplasm": { - "type": "object", - "properties": { - "cropName": { - "type": "keyword", - "fields": { - "suggest": { - "type": "text", - "search_analyzer": "search_suggester", - "analyzer": "index_suggester" - } - } - }, - "germplasmList": { - "type": "keyword", - "fields": { - "suggest": { - "type": "text", - "search_analyzer": "search_suggester", - "analyzer": "index_suggester" - } - } - }, - "accession": { - "type": "keyword", - "fields": { - "suggest": { - "type": "text", - "search_analyzer": "search_suggester", - "analyzer": "index_suggester" - } - } - } - } - }, - - "trait": { - "type": "object", - "properties": { - "observationVariableIds": { - "type": "keyword" - } - } - } - } - } + "dynamic": false, + "_source": { + "includes": [ + "@id", + "@type", + "schema:*", + "groupId" + ] + }, + "properties": { + "groupId": { + "type": "long" + }, + "@type": { + "type": "keyword" + }, + "@id": { + "type": "keyword" + }, + "schema:includedInDataCatalog": { + "type": "keyword" + }, + "schema:identifier": { + "type": "keyword" + }, + "schema:name": { + "type": "keyword" + }, + "schema:url": { + "type": "keyword" + }, + "schema:description": { + "type": "keyword" + }, + "germplasmURI": { + "type": "keyword" + }, + "germplasmDbId": { + "type": "keyword" + }, + "studyURIs": { + "type": "keyword" + }, + "studyDbIds": { + "type": "keyword" + }, + "germplasm": { + "type": "object", + "properties": { + "cropName": { + "type": "keyword", + "fields": { + "suggest": { + "type": "text", + "search_analyzer": "search_suggester", + "analyzer": "index_suggester" + } + } + }, + "germplasmList": { + "type": "keyword", + "fields": { + "suggest": { + "type": "text", + "search_analyzer": "search_suggester", + "analyzer": "index_suggester" + } + } + }, + "accession": { + "type": "keyword", + "fields": { + "suggest": { + "type": "text", + "search_analyzer": "search_suggester", + "analyzer": "index_suggester" + } + } + } + } + }, + "trait": { + "type": "object", + "properties": { + "observationVariableIds": { + "type": "keyword" + } + } + } + } } diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmAttribute_mapping.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmAttribute_mapping.json index d0133c0bb3e2a0592d960b80e007b1385494494d..9d79936d58df6ce6af7e7896368c3a1b587fb452 100644 --- a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmAttribute_mapping.json +++ b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmAttribute_mapping.json @@ -1,68 +1,65 @@ { - "germplasmAttribute": { - "dynamic": "strict", - "properties": { - "germplasmAttributeURI": { - "type": "keyword" - }, - "germplasmAttributeDbId": { - "type": "keyword" - }, - "germplasmURI": { - "type": "keyword" - }, - "germplasmDbId": { - "type": "keyword" - }, - "data": { - "type": "nested", - "properties": { - "attributeURI": { - "type": "keyword" - }, - "attributeDbId": { - "type": "keyword" - }, - "attributeCode": { - "type": "keyword" - }, - "attributeName": { - "type": "keyword" - }, - "determinedDate": { - "type": "date", - "format": "YYYY-MM-dd" - }, - "value": { - "type": "keyword" - } - } - }, - - "source": { - "type": "keyword" - }, - "groupId": { - "type": "long" - }, - "@type": { - "type": "keyword" - }, - "@id": { - "type": "keyword" - }, - "schema:includedInDataCatalog": { - "type": "keyword" - }, - "schema:identifier": { - "type": "keyword" - }, - "schema:name": { - "type": "keyword" - }, - "schema:url": { - "type": "keyword" - } - } - } + "dynamic": "strict", + "properties": { + "germplasmAttributeURI": { + "type": "keyword" + }, + "germplasmAttributeDbId": { + "type": "keyword" + }, + "germplasmURI": { + "type": "keyword" + }, + "germplasmDbId": { + "type": "keyword" + }, + "data": { + "type": "nested", + "properties": { + "attributeURI": { + "type": "keyword" + }, + "attributeDbId": { + "type": "keyword" + }, + "attributeCode": { + "type": "keyword" + }, + "attributeName": { + "type": "keyword" + }, + "determinedDate": { + "type": "date", + "format": "YYYY-MM-dd" + }, + "value": { + "type": "keyword" + } + } + }, + "source": { + "type": "keyword" + }, + "groupId": { + "type": "long" + }, + "@type": { + "type": "keyword" + }, + "@id": { + "type": "keyword" + }, + "schema:includedInDataCatalog": { + "type": "keyword" + }, + "schema:identifier": { + "type": "keyword" + }, + "schema:name": { + "type": "keyword" + }, + "schema:url": { + "type": "keyword" + } + } } diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmMcpd_mapping.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmMcpd_mapping.json index e26ea0b6ab897bd65e7bfd81a90b4c2575eeb0c1..acface400a728cde1de8daf376b67e66ff4c1f31 100644 --- a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmMcpd_mapping.json +++ b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmMcpd_mapping.json @@ -1,455 +1,450 @@ { - "germplasmMcpd": { - "dynamic": "false", - "properties": { - "germplasmURI": { - "type": "keyword" - }, - "germplasmName": { - "type": "keyword", - "doc_values": true - }, - "accessionNames": { - "type": "keyword", - "doc_values": true - }, - "accessionNumber": { - "type": "keyword", - "doc_values": true - }, - "acquisitionDate": { - "type": "integer" - }, - "acquisitionSourceCode": { - "type": "keyword" - }, - "alternateIDs": { - "type": "keyword" - }, - "ancestralData": { - "type": "keyword" - }, - "biologicalStatusOfAccessionCode": { - "type": "keyword" - }, - "breedingInstitutes": { - "properties": { - "instituteCode": { - "type": "keyword" - }, - "instituteName": { - "type": "keyword" - }, - "acronym": { - "type": "keyword" - }, - "organisation": { - "type": "keyword" - }, - "instituteType": { - "type": "keyword" - }, - "webSite": { - "type": "keyword" - }, - "instituteAddress": { - "type": "keyword" - }, - "logo": { - "type": "keyword" - } + "dynamic": false, + "properties": { + "germplasmURI": { + "type": "keyword" + }, + "germplasmName": { + "type": "keyword", + "doc_values": true + }, + "accessionNames": { + "type": "keyword", + "doc_values": true + }, + "accessionNumber": { + "type": "keyword", + "doc_values": true + }, + "acquisitionDate": { + "type": "integer" + }, + "acquisitionSourceCode": { + "type": "keyword" + }, + "alternateIDs": { + "type": "keyword" + }, + "ancestralData": { + "type": "keyword" + }, + "biologicalStatusOfAccessionCode": { + "type": "keyword" + }, + "breedingInstitutes": { + "properties": { + "instituteCode": { + "type": "keyword" + }, + "instituteName": { + "type": "keyword" + }, + "acronym": { + "type": "keyword" + }, + "organisation": { + "type": "keyword" + }, + "instituteType": { + "type": "keyword" + }, + "webSite": { + "type": "keyword" + }, + "instituteAddress": { + "type": "keyword" + }, + "logo": { + "type": "keyword" } - }, - "breedingMethodDbId": { - "type": "keyword" - }, - "breederAccessionNumber": { - "type": "keyword" - }, - "breedingCreationYear": { - "type": "keyword" - }, - "catalogRegistrationYear": { - "type": "keyword" - }, - "catalogDeregistrationYear": { - "type": "keyword" - }, - "collectingInfo": { - "properties": { - "collectingDate": { - "type": "integer" - }, - "collectingInstitutes": { - "properties": { - "instituteCode": { - "type": "keyword" - }, - "instituteName": { - "type": "keyword" - }, - "acronym": { - "type": "keyword" - }, - "organisation": { - "type": "keyword" - }, - "instituteType": { - "type": "keyword" - }, - "webSite": { - "type": "keyword" - }, - "instituteAddress": { - "type": "keyword" - }, - "logo": { - "type": "keyword" - } + } + }, + "breedingMethodDbId": { + "type": "keyword" + }, + "breederAccessionNumber": { + "type": "keyword" + }, + "breedingCreationYear": { + "type": "keyword" + }, + "catalogRegistrationYear": { + "type": "keyword" + }, + "catalogDeregistrationYear": { + "type": "keyword" + }, + "collectingInfo": { + "properties": { + "collectingDate": { + "type": "integer" + }, + "collectingInstitutes": { + "properties": { + "instituteCode": { + "type": "keyword" + }, + "instituteName": { + "type": "keyword" + }, + "acronym": { + "type": "keyword" + }, + "organisation": { + "type": "keyword" + }, + "instituteType": { + "type": "keyword" + }, + "webSite": { + "type": "keyword" + }, + "instituteAddress": { + "type": "keyword" + }, + "logo": { + "type": "keyword" } - }, - "collectingMissionIdentifier": { - "type": "keyword" - }, - "collectingNumber": { - "type": "keyword" - }, - "collectors": { - "type": "keyword" - }, - "materialType": { - "type": "keyword" - }, - "collectingSite": { - "properties": { - "locationDbId": { - "type": "keyword" - }, - "locationName": { - "type": "keyword" - }, - "coordinateUncertainty": { - "type": "keyword" - }, - "elevation": { - "type": "keyword" - }, - "georeferencingMethod":{ - "type": "keyword" - }, - "latitudeDecimal": { - "type": "keyword" - }, - "latitudeDegrees": { - "type": "keyword" - }, - "locationDescription": { - "type": "keyword" - }, - "longitudeDecimal": { - "type": "keyword" - }, - "longitudeDegrees": { - "type": "keyword" - }, - "spatialReferenceSystem": { - "type": "keyword" - }, - "locationURI": { - "type": "keyword" - } - + } + }, + "collectingMissionIdentifier": { + "type": "keyword" + }, + "collectingNumber": { + "type": "keyword" + }, + "collectors": { + "type": "keyword" + }, + "materialType": { + "type": "keyword" + }, + "collectingSite": { + "properties": { + "locationDbId": { + "type": "keyword" + }, + "locationName": { + "type": "keyword" + }, + "coordinateUncertainty": { + "type": "keyword" + }, + "elevation": { + "type": "keyword" + }, + "georeferencingMethod": { + "type": "keyword" + }, + "latitudeDecimal": { + "type": "keyword" + }, + "latitudeDegrees": { + "type": "keyword" + }, + "locationDescription": { + "type": "keyword" + }, + "longitudeDecimal": { + "type": "keyword" + }, + "longitudeDegrees": { + "type": "keyword" + }, + "spatialReferenceSystem": { + "type": "keyword" + }, + "locationURI": { + "type": "keyword" } - } - } - }, - "commonCropName": { - "type": "keyword", - "doc_values": true - }, - "countryOfOrigin": { - "type": "keyword" - }, - "countryOfOriginCode": { - "type": "keyword" - }, - "originLocationDbId": { - "type": "keyword" - }, - "originLocationName": { - "type": "keyword" - }, - "documentationURL": { - "type": "keyword" - }, - "donors": { - "properties": { - "donorInstituteCode": { - "type": "keyword" - }, - "donorGermplasmPUI": { - "type": "keyword" - }, - "germplasmPUI": { - "type": "keyword" - }, - "donorAccessionNumber": { - "type": "keyword" - }, - "donorInstitute": { - "properties": { - "instituteName": { - "type": "keyword" - }, - "instituteCode": { - "type": "keyword" - }, - "acronym": { - "type": "keyword" - }, - "organisation": { - "type": "keyword" - }, - "instituteType": { - "type": "keyword" - }, - "webSite": { - "type": "keyword" - }, - "address": { - "type": "keyword" - }, - "logo": { - "type": "keyword" - } + } + }, + "commonCropName": { + "type": "keyword", + "doc_values": true + }, + "countryOfOrigin": { + "type": "keyword" + }, + "countryOfOriginCode": { + "type": "keyword" + }, + "originLocationDbId": { + "type": "keyword" + }, + "originLocationName": { + "type": "keyword" + }, + "documentationURL": { + "type": "keyword" + }, + "donors": { + "properties": { + "donorInstituteCode": { + "type": "keyword" + }, + "donorGermplasmPUI": { + "type": "keyword" + }, + "germplasmPUI": { + "type": "keyword" + }, + "donorAccessionNumber": { + "type": "keyword" + }, + "donorInstitute": { + "properties": { + "instituteName": { + "type": "keyword" + }, + "instituteCode": { + "type": "keyword" + }, + "acronym": { + "type": "keyword" + }, + "organisation": { + "type": "keyword" + }, + "instituteType": { + "type": "keyword" + }, + "webSite": { + "type": "keyword" + }, + "address": { + "type": "keyword" + }, + "logo": { + "type": "keyword" } - }, - "donationDate": { - "type": "integer" } + }, + "donationDate": { + "type": "integer" } - }, - "donorInfo": { - "properties":{ - "donorAccessionNumber": { - "type": "keyword" - }, - "donorAccessionPui": { - "type": "keyword" - }, - "donationDate": { - "type": "keyword" - }, - "donorInstitute": { - "properties":{ - "instituteCode": { - "type": "keyword" - }, - "instituteName": { - "type": "keyword" - }, - "acronym": { - "type": "keyword" - }, - "organisation": { - "type": "keyword" - }, - "instituteType": { - "type": "keyword" - }, - "webSite": { - "type": "keyword" - }, - "instituteAddress": { - "type": "keyword" - }, - "logo": { - "type": "keyword" - } + } + }, + "donorInfo": { + "properties": { + "donorAccessionNumber": { + "type": "keyword" + }, + "donorAccessionPui": { + "type": "keyword" + }, + "donationDate": { + "type": "keyword" + }, + "donorInstitute": { + "properties": { + "instituteCode": { + "type": "keyword" + }, + "instituteName": { + "type": "keyword" + }, + "acronym": { + "type": "keyword" + }, + "organisation": { + "type": "keyword" + }, + "instituteType": { + "type": "keyword" + }, + "webSite": { + "type": "keyword" + }, + "instituteAddress": { + "type": "keyword" + }, + "logo": { + "type": "keyword" } } } - }, - "genus":{ - "type": "keyword", - "doc_values": true - }, - "genusSpecies": { - "type": "keyword", - "doc_values": true - }, - "germplasmDbId": { - "type": "keyword" - }, - "germplasmMcpdDbId": { - "type": "keyword" - }, - "germplasmMcpdURI": { - "type": "keyword" - }, - "germplasmGenus": { - "type": "keyword", - "doc_values": true - }, - "germplasmPUI": { - "type": "keyword" - }, - "germplasmSpecies": { - "type": "keyword", - "doc_values": true - }, - "holdingInstitute": { - "properties": { - "instituteName": { - "type": "keyword" - }, - "instituteCode": { - "type": "keyword" - }, - "acronym": { - "type": "keyword" - }, - "organisation": { - "type": "keyword" - }, - "instituteType": { - "type": "keyword" - }, - "webSite": { - "type": "keyword" - }, - "instituteAddress": { - "type": "keyword" - }, - "logo": { - "type": "keyword" - } + } + }, + "genus": { + "type": "keyword", + "doc_values": true + }, + "genusSpecies": { + "type": "keyword", + "doc_values": true + }, + "germplasmDbId": { + "type": "keyword" + }, + "germplasmMcpdDbId": { + "type": "keyword" + }, + "germplasmMcpdURI": { + "type": "keyword" + }, + "germplasmGenus": { + "type": "keyword", + "doc_values": true + }, + "germplasmPUI": { + "type": "keyword" + }, + "germplasmSpecies": { + "type": "keyword", + "doc_values": true + }, + "holdingInstitute": { + "properties": { + "instituteName": { + "type": "keyword" + }, + "instituteCode": { + "type": "keyword" + }, + "acronym": { + "type": "keyword" + }, + "organisation": { + "type": "keyword" + }, + "instituteType": { + "type": "keyword" + }, + "webSite": { + "type": "keyword" + }, + "instituteAddress": { + "type": "keyword" + }, + "logo": { + "type": "keyword" } - }, - "holdingGenbank": { - "properties": { - "instituteName": { - "type": "keyword", - "doc_values": true - }, - "instituteCode": { - "type": "keyword" - }, - "webSite": { - "type": "keyword" - }, - "logo": { - "type": "keyword" - } + } + }, + "holdingGenbank": { + "properties": { + "instituteName": { + "type": "keyword", + "doc_values": true + }, + "instituteCode": { + "type": "keyword" + }, + "webSite": { + "type": "keyword" + }, + "logo": { + "type": "keyword" } - }, - "distributorInfos": { - "properties": { - "institute": { - "properties": { - "instituteName": { - "type": "keyword" - }, - "instituteCode": { - "type": "keyword" - }, - "acronym": { - "type": "keyword" - }, - "organisation": { - "type": "keyword" - }, - "instituteType": { - "type": "keyword" - }, - "webSite": { - "type": "keyword" - }, - "instituteAddress": { - "type": "keyword" - }, - "logo": { - "type": "keyword" - } + } + }, + "distributorInfos": { + "properties": { + "institute": { + "properties": { + "instituteName": { + "type": "keyword" + }, + "instituteCode": { + "type": "keyword" + }, + "acronym": { + "type": "keyword" + }, + "organisation": { + "type": "keyword" + }, + "instituteType": { + "type": "keyword" + }, + "webSite": { + "type": "keyword" + }, + "instituteAddress": { + "type": "keyword" + }, + "logo": { + "type": "keyword" } - }, - "accessionNumber": { - "type": "keyword" - }, - "distributionStatus": { - "type": "keyword" } + }, + "accessionNumber": { + "type": "keyword" + }, + "distributionStatus": { + "type": "keyword" } - }, - "instituteCode": { - "type": "keyword" - }, - "mlsStatus": { - "type": "keyword" - }, - "remarks": { - "type": "keyword" - }, - "safetyDuplicateInstitutes": { - "properties":{ - "instituteCode": { - "type": "keyword" - }, - "instituteName": { - "type": "keyword" - } + } + }, + "instituteCode": { + "type": "keyword" + }, + "mlsStatus": { + "type": "keyword" + }, + "remarks": { + "type": "keyword" + }, + "safetyDuplicateInstitutes": { + "properties": { + "instituteCode": { + "type": "keyword" + }, + "instituteName": { + "type": "keyword" } - }, - "geneticNature": { - "type": "keyword" - }, - "species": { - "type": "keyword" - }, - "speciesAuthority": { - "type": "keyword" - }, - "storageTypeCodes": { - "type": "keyword" - }, - "subtaxon": { - "type": "keyword" - }, - "subtaxonAuthority": { - "type": "keyword" - }, - "subtaxaAuthority": { - "type": "keyword" - }, - "groupId": { - "type": "long" - }, - "presenceStatus": { - "type": "keyword" - }, - "@type": { - "type": "keyword" - }, - "@id": { - "type": "keyword" - }, - "schema:includedInDataCatalog": { - "type": "keyword" - }, - "schema:identifier": { - "type": "keyword" - }, - "schema:name": { - "type": "keyword" - }, - "schema:url": { - "type": "keyword" - }, - "defaultDisplayName": { - "type": "keyword" } + }, + "geneticNature": { + "type": "keyword" + }, + "species": { + "type": "keyword" + }, + "speciesAuthority": { + "type": "keyword" + }, + "storageTypeCodes": { + "type": "keyword" + }, + "subtaxon": { + "type": "keyword" + }, + "subtaxonAuthority": { + "type": "keyword" + }, + "subtaxaAuthority": { + "type": "keyword" + }, + "groupId": { + "type": "long" + }, + "presenceStatus": { + "type": "keyword" + }, + "@type": { + "type": "keyword" + }, + "@id": { + "type": "keyword" + }, + "schema:includedInDataCatalog": { + "type": "keyword" + }, + "schema:identifier": { + "type": "keyword" + }, + "schema:name": { + "type": "keyword" + }, + "schema:url": { + "type": "keyword" + }, + "defaultDisplayName": { + "type": "keyword" } } } diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmPedigree_mapping.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmPedigree_mapping.json index 79986a17f373b0614bd6d2385c39b1a41b56bb83..a83d4a1278042917264d181f59d95b477514dec4 100644 --- a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmPedigree_mapping.json +++ b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmPedigree_mapping.json @@ -1,96 +1,93 @@ { - "germplasmPedigree": { - "dynamic": "strict", - "properties": { - "germplasmPedigreeURI": { - "type": "keyword" - }, - "germplasmPedigreeDbId": { - "type": "keyword" - }, - "germplasmURI": { - "type": "keyword" - }, - "germplasmDbId": { - "type": "keyword" - }, - "defaultDisplayName": { - "type": "keyword" - }, - "crossingPlan": { - "type": "keyword" - }, - "crossingYear": { - "type": "keyword" - }, - "familyCode": { - "type": "keyword" - }, - "parent1URI": { - "type": "keyword" - }, - "parent1DbId": { - "type": "keyword" - }, - "parent1Name": { - "type": "keyword" - }, - "parent1Type": { - "type": "keyword" - }, - "parent2URI": { - "type": "keyword" - }, - "parent2DbId": { - "type": "keyword" - }, - "parent2Name": { - "type": "keyword" - }, - "parent2Type": { - "type": "keyword" - }, - "pedigree": { - "type": "keyword" - }, - "siblings": { - "properties": { - "germplasmURI": { - "type": "keyword" - }, - "germplasmDbId": { - "type": "keyword" - }, - "defaultDisplayName": { - "type": "keyword" - } - } - }, - - "source": { - "type": "keyword" - }, - "groupId": { - "type": "long" - }, - "@type": { - "type": "keyword" - }, - "@id": { - "type": "keyword" - }, - "schema:includedInDataCatalog": { - "type": "keyword" - }, - "schema:identifier": { - "type": "keyword" - }, - "schema:name": { - "type": "keyword" - }, - "schema:url": { - "type": "keyword" - } - } - } + "dynamic": "strict", + "properties": { + "germplasmPedigreeURI": { + "type": "keyword" + }, + "germplasmPedigreeDbId": { + "type": "keyword" + }, + "germplasmURI": { + "type": "keyword" + }, + "germplasmDbId": { + "type": "keyword" + }, + "defaultDisplayName": { + "type": "keyword" + }, + "crossingPlan": { + "type": "keyword" + }, + "crossingYear": { + "type": "keyword" + }, + "familyCode": { + "type": "keyword" + }, + "parent1URI": { + "type": "keyword" + }, + "parent1DbId": { + "type": "keyword" + }, + "parent1Name": { + "type": "keyword" + }, + "parent1Type": { + "type": "keyword" + }, + "parent2URI": { + "type": "keyword" + }, + "parent2DbId": { + "type": "keyword" + }, + "parent2Name": { + "type": "keyword" + }, + "parent2Type": { + "type": "keyword" + }, + "pedigree": { + "type": "keyword" + }, + "siblings": { + "properties": { + "germplasmURI": { + "type": "keyword" + }, + "germplasmDbId": { + "type": "keyword" + }, + "defaultDisplayName": { + "type": "keyword" + } + } + }, + "source": { + "type": "keyword" + }, + "groupId": { + "type": "long" + }, + "@type": { + "type": "keyword" + }, + "@id": { + "type": "keyword" + }, + "schema:includedInDataCatalog": { + "type": "keyword" + }, + "schema:identifier": { + "type": "keyword" + }, + "schema:name": { + "type": "keyword" + }, + "schema:url": { + "type": "keyword" + } + } } diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmProgeny_mapping.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmProgeny_mapping.json index 58eb7a9b73713a0c9cf9220f9813c38349ca0c55..5c4a867ed43af5eca4da361b0f332deab831ae0b 100644 --- a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmProgeny_mapping.json +++ b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasmProgeny_mapping.json @@ -1,63 +1,60 @@ { - "germplasmProgeny": { - "dynamic": "strict", - "properties": { - "germplasmProgenyURI": { - "type": "keyword" - }, - "germplasmProgenyDbId": { - "type": "keyword" - }, - "germplasmURI": { - "type": "keyword" - }, - "germplasmDbId": { - "type": "keyword" - }, - "defaultDisplayName": { - "type": "keyword" - }, - "progeny": { - "properties": { - "germplasmURI": { - "type": "keyword" - }, - "germplasmDbId": { - "type": "keyword" - }, - "defaultDisplayName": { - "type": "keyword" - }, - "parentType": { - "type": "keyword" - } - } - }, - - "source": { - "type": "keyword" - }, - "groupId": { - "type": "long" - }, - "@type": { - "type": "keyword" - }, - "@id": { - "type": "keyword" - }, - "schema:includedInDataCatalog": { - "type": "keyword" - }, - "schema:identifier": { - "type": "keyword" - }, - "schema:name": { - "type": "keyword" - }, - "schema:url": { - "type": "keyword" - } - } - } + "dynamic": "strict", + "properties": { + "germplasmProgenyURI": { + "type": "keyword" + }, + "germplasmProgenyDbId": { + "type": "keyword" + }, + "germplasmURI": { + "type": "keyword" + }, + "germplasmDbId": { + "type": "keyword" + }, + "defaultDisplayName": { + "type": "keyword" + }, + "progeny": { + "properties": { + "germplasmURI": { + "type": "keyword" + }, + "germplasmDbId": { + "type": "keyword" + }, + "defaultDisplayName": { + "type": "keyword" + }, + "parentType": { + "type": "keyword" + } + } + }, + "source": { + "type": "keyword" + }, + "groupId": { + "type": "long" + }, + "@type": { + "type": "keyword" + }, + "@id": { + "type": "keyword" + }, + "schema:includedInDataCatalog": { + "type": "keyword" + }, + "schema:identifier": { + "type": "keyword" + }, + "schema:name": { + "type": "keyword" + }, + "schema:url": { + "type": "keyword" + } + } } diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasm_mapping.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasm_mapping.json index ab6abaf77b9fd90ccefa0eb08793644490fdb39c..1650c665883c60adec8cc8cbdbb83ce1455efee5 100644 --- a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasm_mapping.json +++ b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/germplasm_mapping.json @@ -1,617 +1,613 @@ { - "germplasm": { - "dynamic": "strict", - "properties": { - "germplasmURI": { - "type": "keyword" - }, - "germplasmDbId": { - "type": "keyword" - }, - "germplasmPUI": { - "type": "keyword" - }, - "germplasmName": { - "type": "keyword", - "doc_values": true - }, - "accessionNumber": { - "type": "keyword", - "doc_values": true - }, - "acquisitionDate": { - "type": "keyword" - }, - "biologicalStatusOfAccessionCode": { - "type": "keyword" - }, - "breedingMethodDbId": { - "type": "keyword" - }, - "commonCropName": { - "type": "keyword", - "doc_values": true - }, - "countryOfOriginCode": { - "type": "keyword" - }, - "countryOfOrigin": { - "type": "keyword" - }, - "defaultDisplayName": { - "type": "keyword" - }, - "documentationURL": { - "type": "keyword" - }, - "donors": { - "properties": { - "donorInstituteCode": { - "type": "keyword" - }, - "donorGermplasmPUI": { - "type": "keyword" - }, - "germplasmPUI": { - "type": "keyword" - }, - "donorAccessionNumber": { - "type": "keyword" - }, - "donorInstitute": { - "properties": { - "instituteName": { - "type": "keyword" - }, - "instituteCode": { - "type": "keyword" - }, - "acronym": { - "type": "keyword" - }, - "organisation": { - "type": "keyword" - }, - "instituteType": { - "type": "keyword" - }, - "webSite": { - "type": "keyword" - }, - "address": { - "type": "keyword" - }, - "logo": { - "type": "keyword" - } - } - }, - "donationDate": { - "type": "integer" - } - } - }, - "genus": { - "type": "keyword", - "doc_values": true - }, - "germplasmGenus": { - "type": "keyword", - "doc_values": true - }, - "species": { - "type": "keyword" - }, - "germplasmSpecies": { - "type": "keyword", - "doc_values": true - }, - "genusSpecies": { - "type": "keyword", - "doc_values": true - }, - "speciesAuthority": { - "type": "keyword" - }, - "subtaxa": { - "type": "keyword" - }, - "subTaxa": { - "type": "keyword" - }, - "genusSpeciesSubtaxa": { - "type": "keyword", - "doc_values": true - }, - "subtaxaAuthority": { - "type": "keyword" - }, - "instituteCode": { - "type": "keyword" - }, - "instituteName": { - "type": "keyword" - }, - "pedigree": { - "type": "keyword" - }, - "seedSource": { - "type": "keyword" - }, - "SeedSource": { - "type": "keyword" - }, - "synonyms": { - "type": "keyword", - "doc_values": true - }, - "taxonIds": { - "properties": { - "sourceName": { - "type": "keyword" - }, - "taxonId": { - "type": "keyword" - } - } - }, - "taxonSynonyms": { - "type": "keyword", - "doc_values": true - }, - "taxonCommonNames": { - "type": "keyword", - "doc_values": true - }, - "taxonComment": { - "type": "keyword" - }, - "typeOfGermplasmStorageCode": { - "type": "keyword" - }, - "geneticNature": { - "type": "keyword" - }, - "comment": { - "type": "keyword" - }, - "photo": { - "properties": { - "file": { - "type": "keyword" - }, - "thumbnailFile": { - "type": "keyword" - }, - "photoName": { - "type": "keyword" - }, - "description": { - "type": "keyword" - }, - "copyright": { - "type": "keyword" - } - } - }, - "holdingInstitute": { - "properties": { - "instituteName": { - "type": "keyword" - }, - "instituteCode": { - "type": "keyword" - }, - "acronym": { - "type": "keyword" - }, - "organisation": { - "type": "keyword" - }, - "instituteType": { - "type": "keyword" - }, - "webSite": { - "type": "keyword" - }, - "address": { - "type": "keyword" - }, - "logo": { - "type": "keyword" - } - } - }, - "holdingGenbank": { - "properties": { - "instituteName": { - "type": "keyword", - "doc_values": true - }, - "instituteCode": { - "type": "keyword" - }, - "webSite": { - "type": "keyword" - }, - "logo": { - "type": "keyword" - } - } - }, - "presenceStatus": { - "type": "keyword" - }, - "genealogy": { - "properties": { - "crossingPlan": { - "type": "keyword" - }, - "crossingYear": { - "type": "keyword" - }, - "familyCode": { - "type": "keyword" - }, - "firstParentName": { - "type": "keyword" - }, - "firstParentPUI": { - "type": "keyword" - }, - "firstParentType": { - "type": "keyword" - }, - "secondParentName": { - "type": "keyword" - }, - "secondParentPUI": { - "type": "keyword" - }, - "secondParentType": { - "type": "keyword" - }, - "sibblings": { - "properties": { - "pui": { - "type": "keyword" - }, - "name": { - "type": "keyword" - } - } - } - } - }, - "children": { - "properties": { - "firstParentName": { - "type": "keyword" - }, - "firstParentPUI": { - "type": "keyword" - }, - "secondParentName": { - "type": "keyword" - }, - "secondParentPUI": { - "type": "keyword" - }, - "sibblings": { - "properties": { - "pui": { - "type": "keyword" - }, - "name": { - "type": "keyword" - } - } - } - } - }, - "descriptors": { - "properties": { - "name": { - "type": "keyword" - }, - "value": { - "type": "keyword" - } - } - }, - "originSite": { - "properties": { - "siteId": { - "type": "long" - }, - "siteName": { - "type": "keyword" - }, - "latitude": { - "type": "float" - }, - "longitude": { - "type": "float" - }, - "siteType": { - "type": "keyword" - } - } - }, - "collectingSite": { - "properties": { - "siteId": { - "type": "long" - }, - "siteName": { - "type": "keyword" - }, - "latitude": { - "type": "float" - }, - "longitude": { - "type": "float" - }, - "siteType": { - "type": "keyword" - } - } - }, - "evaluationSites": { - "properties": { - "siteId": { - "type": "long" - }, - "siteName": { - "type": "keyword" - }, - "latitude": { - "type": "float" - }, - "longitude": { - "type": "float" - }, - "siteType": { - "type": "keyword" - } - } - }, - "collector": { - "properties": { - "institute": { - "properties": { - "instituteName": { - "type": "keyword" - }, - "instituteCode": { - "type": "keyword" - }, - "acronym": { - "type": "keyword" - }, - "organisation": { - "type": "keyword" - }, - "instituteType": { - "type": "keyword" - }, - "webSite": { - "type": "keyword" - }, - "address": { - "type": "keyword" - }, - "logo": { - "type": "keyword" - } - } - }, - "accessionNumber": { - "type": "keyword" - }, - "accessionCreationDate": { - "type": "integer" - }, - "materialType": { - "type": "keyword" - }, - "collectors": { - "type": "keyword" - } - } - }, - "breeder": { - "properties": { - "institute": { - "properties": { - "instituteName": { - "type": "keyword" - }, - "instituteCode": { - "type": "keyword" - }, - "acronym": { - "type": "keyword" - }, - "organisation": { - "type": "keyword" - }, - "instituteType": { - "type": "keyword" - }, - "webSite": { - "type": "keyword" - }, - "address": { - "type": "keyword" - }, - "logo": { - "type": "keyword" - } - } - }, - "accessionNumber": { - "type": "keyword" - }, - "accessionCreationDate": { - "type": "integer" - }, - "registrationYear": { - "type": "integer" - }, - "deregistrationYear": { - "type": "integer" - } - } - }, - "distributors": { - "properties": { - "institute": { - "properties": { - "instituteName": { - "type": "keyword" - }, - "instituteCode": { - "type": "keyword" - }, - "acronym": { - "type": "keyword" - }, - "organisation": { - "type": "keyword" - }, - "instituteType": { - "type": "keyword" - }, - "webSite": { - "type": "keyword" - }, - "address": { - "type": "keyword" - }, - "logo": { - "type": "keyword" - } - } - }, - "accessionNumber": { - "type": "keyword" - }, - "distributionStatus": { - "type": "keyword" - } - } - }, - "panel": { - "properties": { - "id": { - "type": "long" - }, - "name": { - "type": "keyword", - "doc_values": true - }, - "germplasmCount": { - "type": "integer" - } - } - }, - "collection": { - "properties": { - "id": { - "type": "long" - }, - "name": { - "type": "keyword", - "doc_values": true - }, - "type": { - "type": "keyword" - }, - "germplasmCount": { - "type": "integer" - } - } - }, - "population": { - "properties": { - "id": { - "type": "long" - }, - "name": { - "type": "keyword", - "doc_values": true - }, - "type": { - "type": "keyword" - }, - "germplasmRef": { - "properties": { - "pui": { - "type": "keyword" - }, - "name": { - "type": "keyword" - } - } - }, - "germplasmCount": { - "type": "integer" - } - } - }, - "xref": { - "properties": { - "id": { - "type": "keyword" - }, - "source": { - "type": "keyword" - } - } - }, - "additionalInfo": { - "dynamic": "true", - "properties": {} - }, - - "studyURIs": { - "type": "keyword" - }, - "studyDbIds": { - "type": "keyword" - }, - "studyURI": { - "type": "keyword" - }, - "studyDbId": { - "type": "keyword" - }, - - "source": { - "type": "keyword" - }, - "groupId": { - "type": "long" - }, - "@type": { - "type": "keyword" - }, - "@id": { - "type": "keyword" - }, - "schema:includedInDataCatalog": { - "type": "keyword" - }, - "schema:identifier": { - "type": "keyword" - }, - "schema:name": { - "type": "keyword" - }, - "schema:url": { - "type": "keyword" - } - } - } + "dynamic": "strict", + "properties": { + "germplasmURI": { + "type": "keyword" + }, + "germplasmDbId": { + "type": "keyword" + }, + "germplasmPUI": { + "type": "keyword" + }, + "germplasmName": { + "type": "keyword", + "doc_values": true + }, + "accessionNumber": { + "type": "keyword", + "doc_values": true + }, + "acquisitionDate": { + "type": "keyword" + }, + "biologicalStatusOfAccessionCode": { + "type": "keyword" + }, + "breedingMethodDbId": { + "type": "keyword" + }, + "commonCropName": { + "type": "keyword", + "doc_values": true + }, + "countryOfOriginCode": { + "type": "keyword" + }, + "countryOfOrigin": { + "type": "keyword" + }, + "defaultDisplayName": { + "type": "keyword" + }, + "documentationURL": { + "type": "keyword" + }, + "donors": { + "properties": { + "donorInstituteCode": { + "type": "keyword" + }, + "donorGermplasmPUI": { + "type": "keyword" + }, + "germplasmPUI": { + "type": "keyword" + }, + "donorAccessionNumber": { + "type": "keyword" + }, + "donorInstitute": { + "properties": { + "instituteName": { + "type": "keyword" + }, + "instituteCode": { + "type": "keyword" + }, + "acronym": { + "type": "keyword" + }, + "organisation": { + "type": "keyword" + }, + "instituteType": { + "type": "keyword" + }, + "webSite": { + "type": "keyword" + }, + "address": { + "type": "keyword" + }, + "logo": { + "type": "keyword" + } + } + }, + "donationDate": { + "type": "integer" + } + } + }, + "genus": { + "type": "keyword", + "doc_values": true + }, + "germplasmGenus": { + "type": "keyword", + "doc_values": true + }, + "species": { + "type": "keyword" + }, + "germplasmSpecies": { + "type": "keyword", + "doc_values": true + }, + "genusSpecies": { + "type": "keyword", + "doc_values": true + }, + "speciesAuthority": { + "type": "keyword" + }, + "subtaxa": { + "type": "keyword" + }, + "subTaxa": { + "type": "keyword" + }, + "genusSpeciesSubtaxa": { + "type": "keyword", + "doc_values": true + }, + "subtaxaAuthority": { + "type": "keyword" + }, + "instituteCode": { + "type": "keyword" + }, + "instituteName": { + "type": "keyword" + }, + "pedigree": { + "type": "keyword" + }, + "seedSource": { + "type": "keyword" + }, + "SeedSource": { + "type": "keyword" + }, + "synonyms": { + "type": "keyword", + "doc_values": true + }, + "taxonIds": { + "properties": { + "sourceName": { + "type": "keyword" + }, + "taxonId": { + "type": "keyword" + } + } + }, + "taxonSynonyms": { + "type": "keyword", + "doc_values": true + }, + "taxonCommonNames": { + "type": "keyword", + "doc_values": true + }, + "taxonComment": { + "type": "keyword" + }, + "typeOfGermplasmStorageCode": { + "type": "keyword" + }, + "geneticNature": { + "type": "keyword" + }, + "comment": { + "type": "keyword" + }, + "photo": { + "properties": { + "file": { + "type": "keyword" + }, + "thumbnailFile": { + "type": "keyword" + }, + "photoName": { + "type": "keyword" + }, + "description": { + "type": "keyword" + }, + "copyright": { + "type": "keyword" + } + } + }, + "holdingInstitute": { + "properties": { + "instituteName": { + "type": "keyword" + }, + "instituteCode": { + "type": "keyword" + }, + "acronym": { + "type": "keyword" + }, + "organisation": { + "type": "keyword" + }, + "instituteType": { + "type": "keyword" + }, + "webSite": { + "type": "keyword" + }, + "address": { + "type": "keyword" + }, + "logo": { + "type": "keyword" + } + } + }, + "holdingGenbank": { + "properties": { + "instituteName": { + "type": "keyword", + "doc_values": true + }, + "instituteCode": { + "type": "keyword" + }, + "webSite": { + "type": "keyword" + }, + "logo": { + "type": "keyword" + } + } + }, + "presenceStatus": { + "type": "keyword" + }, + "genealogy": { + "properties": { + "crossingPlan": { + "type": "keyword" + }, + "crossingYear": { + "type": "keyword" + }, + "familyCode": { + "type": "keyword" + }, + "firstParentName": { + "type": "keyword" + }, + "firstParentPUI": { + "type": "keyword" + }, + "firstParentType": { + "type": "keyword" + }, + "secondParentName": { + "type": "keyword" + }, + "secondParentPUI": { + "type": "keyword" + }, + "secondParentType": { + "type": "keyword" + }, + "sibblings": { + "properties": { + "pui": { + "type": "keyword" + }, + "name": { + "type": "keyword" + } + } + } + } + }, + "children": { + "properties": { + "firstParentName": { + "type": "keyword" + }, + "firstParentPUI": { + "type": "keyword" + }, + "secondParentName": { + "type": "keyword" + }, + "secondParentPUI": { + "type": "keyword" + }, + "sibblings": { + "properties": { + "pui": { + "type": "keyword" + }, + "name": { + "type": "keyword" + } + } + } + } + }, + "descriptors": { + "properties": { + "name": { + "type": "keyword" + }, + "value": { + "type": "keyword" + } + } + }, + "originSite": { + "properties": { + "siteId": { + "type": "long" + }, + "siteName": { + "type": "keyword" + }, + "latitude": { + "type": "float" + }, + "longitude": { + "type": "float" + }, + "siteType": { + "type": "keyword" + } + } + }, + "collectingSite": { + "properties": { + "siteId": { + "type": "long" + }, + "siteName": { + "type": "keyword" + }, + "latitude": { + "type": "float" + }, + "longitude": { + "type": "float" + }, + "siteType": { + "type": "keyword" + } + } + }, + "evaluationSites": { + "properties": { + "siteId": { + "type": "long" + }, + "siteName": { + "type": "keyword" + }, + "latitude": { + "type": "float" + }, + "longitude": { + "type": "float" + }, + "siteType": { + "type": "keyword" + } + } + }, + "collector": { + "properties": { + "institute": { + "properties": { + "instituteName": { + "type": "keyword" + }, + "instituteCode": { + "type": "keyword" + }, + "acronym": { + "type": "keyword" + }, + "organisation": { + "type": "keyword" + }, + "instituteType": { + "type": "keyword" + }, + "webSite": { + "type": "keyword" + }, + "address": { + "type": "keyword" + }, + "logo": { + "type": "keyword" + } + } + }, + "accessionNumber": { + "type": "keyword" + }, + "accessionCreationDate": { + "type": "integer" + }, + "materialType": { + "type": "keyword" + }, + "collectors": { + "type": "keyword" + } + } + }, + "breeder": { + "properties": { + "institute": { + "properties": { + "instituteName": { + "type": "keyword" + }, + "instituteCode": { + "type": "keyword" + }, + "acronym": { + "type": "keyword" + }, + "organisation": { + "type": "keyword" + }, + "instituteType": { + "type": "keyword" + }, + "webSite": { + "type": "keyword" + }, + "address": { + "type": "keyword" + }, + "logo": { + "type": "keyword" + } + } + }, + "accessionNumber": { + "type": "keyword" + }, + "accessionCreationDate": { + "type": "integer" + }, + "registrationYear": { + "type": "integer" + }, + "deregistrationYear": { + "type": "integer" + } + } + }, + "distributors": { + "properties": { + "institute": { + "properties": { + "instituteName": { + "type": "keyword" + }, + "instituteCode": { + "type": "keyword" + }, + "acronym": { + "type": "keyword" + }, + "organisation": { + "type": "keyword" + }, + "instituteType": { + "type": "keyword" + }, + "webSite": { + "type": "keyword" + }, + "address": { + "type": "keyword" + }, + "logo": { + "type": "keyword" + } + } + }, + "accessionNumber": { + "type": "keyword" + }, + "distributionStatus": { + "type": "keyword" + } + } + }, + "panel": { + "properties": { + "id": { + "type": "long" + }, + "name": { + "type": "keyword", + "doc_values": true + }, + "germplasmCount": { + "type": "integer" + } + } + }, + "collection": { + "properties": { + "id": { + "type": "long" + }, + "name": { + "type": "keyword", + "doc_values": true + }, + "type": { + "type": "keyword" + }, + "germplasmCount": { + "type": "integer" + } + } + }, + "population": { + "properties": { + "id": { + "type": "long" + }, + "name": { + "type": "keyword", + "doc_values": true + }, + "type": { + "type": "keyword" + }, + "germplasmRef": { + "properties": { + "pui": { + "type": "keyword" + }, + "name": { + "type": "keyword" + } + } + }, + "germplasmCount": { + "type": "integer" + } + } + }, + "xref": { + "properties": { + "id": { + "type": "keyword" + }, + "source": { + "type": "keyword" + } + } + }, + "additionalInfo": { + "dynamic": true, + "properties": {} + }, + "studyURIs": { + "type": "keyword" + }, + "studyDbIds": { + "type": "keyword" + }, + "studyURI": { + "type": "keyword" + }, + "studyDbId": { + "type": "keyword" + }, + "source": { + "type": "keyword" + }, + "groupId": { + "type": "long" + }, + "@type": { + "type": "keyword" + }, + "@id": { + "type": "keyword" + }, + "schema:includedInDataCatalog": { + "type": "keyword" + }, + "schema:identifier": { + "type": "keyword" + }, + "schema:name": { + "type": "keyword" + }, + "schema:url": { + "type": "keyword" + } + } } diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/location_mapping.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/location_mapping.json index 06aad559d35c1994b73b1bcb52a0dc0e469f24b8..47147329ca272423b9de5a5c975755e3b36b58d8 100644 --- a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/location_mapping.json +++ b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/location_mapping.json @@ -1,94 +1,90 @@ { - "location": { - "dynamic": "strict", - "properties": { - "locationURI": { - "type": "keyword" - }, - "locationDbId": { - "type": "keyword" - }, - "locationName": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "abbreviation": { - "type": "keyword" - }, - "abreviation": { - "type": "keyword" - }, - "locationType": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "countryCode": { - "type": "keyword" - }, - "countryName": { - "type": "keyword" - }, - "documentationURL": { - "type": "keyword" - }, - "instituteName": { - "type": "keyword" - }, - "instituteAddress": { - "type": "keyword" - }, - "instituteAdress": { - "type": "keyword" - }, - "altitude": { - "type": "double" - }, - "latitude": { - "type": "double" - }, - "longitude": { - "type": "double" - }, - "additionalInfo": { - "dynamic": "true", - "properties": {} - }, - - "studyDbIds": { - "type": "keyword" - }, - "studyURIs": { - "type": "keyword" - }, - - "source": { - "type": "keyword" - }, - "groupId": { - "type": "long" - }, - "@type": { - "type": "keyword" - }, - "@id": { - "type": "keyword" - }, - "schema:includedInDataCatalog": { - "type": "keyword" - }, - "schema:identifier": { - "type": "keyword" - }, - "schema:name": { - "type": "keyword" - }, - "schema:url": { - "type": "keyword" - } - } - } + "dynamic": "strict", + "properties": { + "locationURI": { + "type": "keyword" + }, + "locationDbId": { + "type": "keyword" + }, + "locationName": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "abbreviation": { + "type": "keyword" + }, + "abreviation": { + "type": "keyword" + }, + "locationType": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "countryCode": { + "type": "keyword" + }, + "countryName": { + "type": "keyword" + }, + "documentationURL": { + "type": "keyword" + }, + "instituteName": { + "type": "keyword" + }, + "instituteAddress": { + "type": "keyword" + }, + "instituteAdress": { + "type": "keyword" + }, + "altitude": { + "type": "double" + }, + "latitude": { + "type": "double" + }, + "longitude": { + "type": "double" + }, + "additionalInfo": { + "dynamic": true, + "properties": {} + }, + "studyDbIds": { + "type": "keyword" + }, + "studyURIs": { + "type": "keyword" + }, + "source": { + "type": "keyword" + }, + "groupId": { + "type": "long" + }, + "@type": { + "type": "keyword" + }, + "@id": { + "type": "keyword" + }, + "schema:includedInDataCatalog": { + "type": "keyword" + }, + "schema:identifier": { + "type": "keyword" + }, + "schema:name": { + "type": "keyword" + }, + "schema:url": { + "type": "keyword" + } + } } diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/observationUnit_mapping.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/observationUnit_mapping.json index 5bce2cd447deb3100f170bd0b1acb74cd3385be0..36a02c19506a097d50875c05885e37cee4ced4da 100644 --- a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/observationUnit_mapping.json +++ b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/observationUnit_mapping.json @@ -1,244 +1,241 @@ { - "observationUnit": { - "dynamic": "strict", - "properties": { - "observationUnitURI": { - "type": "keyword" - }, - "observationUnitDbId": { - "type": "keyword" - }, - "observationUnitName": { - "type": "keyword" - }, - "X": { - "type": "keyword" - }, - "Y": { - "type": "keyword" - }, - "Xname": { - "type": "keyword" - }, - "Yname": { - "type": "keyword" - }, - "Xm": { - "type": "keyword" - }, - "Ym": { - "type": "keyword" - }, - "blockNumber": { - "type": "keyword", - "index": false - }, - "entryNumber": { - "type": "keyword", - "index": false - }, - "entryType": { - "type": "keyword", - "index": false - }, - "germplasmURI": { - "type": "keyword" - }, - "germplasmDbId": { - "type": "keyword" - }, - "germplasmPUI": { - "type": "keyword" - }, - "germplasmName": { - "type": "keyword" - }, - "accessionNumber": { - "type": "keyword" - }, - "observationLevel": { - "type": "keyword" - }, - "observationLevels": { - "type": "keyword" - }, - "observationLevelDetails": { - "properties": { - "type": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "value": { - "type": "keyword" - } - } - }, - "observationUnitXref": { - "properties": { - "id": { - "type": "keyword" - }, - "source": { - "type": "keyword" - } - } - }, - "observations": { - "type": "nested", - "properties": { - "observationURI": { - "type": "keyword" - }, - "observationDbId": { - "type": "keyword" - }, - "collector": { - "type": "keyword", - "index": false - }, - "observationTimeStamp": { - "type": "date", - "format": "yyyy-MM-dd'T'HH:mm:ss'Z'" - }, - "gdd": { - "type": "float" - }, - "observationVariableURI": { - "type": "keyword" - }, - "observationVariableDbId": { - "type": "keyword" - }, - "observationVariableName": { - "type": "keyword" - }, - "specificName": { - "type": "keyword" - }, - "season": { - "type": "keyword" - }, - "value": { - "type": "keyword" - }, - "isDataFile": { - "type": "boolean", - "index": false - } - } - }, - "plantNumber": { - "type": "keyword", - "index": false - }, - "plotNumber": { - "type": "keyword", - "index": false - }, - "programURI": { - "type": "keyword" - }, - "programDbId": { - "type": "keyword" - }, - "programName": { - "type": "keyword" - }, - "replicate": { - "type": "keyword", - "index": false - }, - "studyURI": { - "type": "keyword" - }, - "studyDbId": { - "type": "keyword" - }, - "studyName": { - "type": "keyword" - }, - "studyLocationURI": { - "type": "keyword" - }, - "studyLocationDbId": { - "type": "keyword" - }, - "studyLocation": { - "type": "keyword" - }, - "treatments": { - "properties": { - "factor": { - "type": "keyword" - }, - "modality": { - "type": "keyword" - } - } - }, - "trials": { - "properties": { - "id": { - "type": "long" - }, - "name": { - "type": "keyword" - } - } - }, - "taxonScientificName": { - "type": "keyword" - }, - "germplasmGenus": { - "type": "keyword" - }, - "germplasmCollections": { - "properties": { - "id": { - "type": "long" - }, - "name": { - "type": "keyword" - } - } - }, - "germplasmPanels": { - "properties": { - "id": { - "type": "long" - }, - "name": { - "type": "keyword" - } - } - }, - - "source": { - "type": "keyword" - }, - "groupId": { - "type": "long" - }, - "@type": { - "type": "keyword" - }, - "@id": { - "type": "keyword" - }, - "schema:includedInDataCatalog": { - "type": "keyword" - }, - "schema:identifier": { - "type": "keyword" - }, - "schema:name": { - "type": "keyword" - }, - "schema:url": { - "type": "keyword" - } - } - } + "dynamic": "strict", + "properties": { + "observationUnitURI": { + "type": "keyword" + }, + "observationUnitDbId": { + "type": "keyword" + }, + "observationUnitName": { + "type": "keyword" + }, + "X": { + "type": "keyword" + }, + "Y": { + "type": "keyword" + }, + "Xname": { + "type": "keyword" + }, + "Yname": { + "type": "keyword" + }, + "Xm": { + "type": "keyword" + }, + "Ym": { + "type": "keyword" + }, + "blockNumber": { + "type": "keyword", + "index": false + }, + "entryNumber": { + "type": "keyword", + "index": false + }, + "entryType": { + "type": "keyword", + "index": false + }, + "germplasmURI": { + "type": "keyword" + }, + "germplasmDbId": { + "type": "keyword" + }, + "germplasmPUI": { + "type": "keyword" + }, + "germplasmName": { + "type": "keyword" + }, + "accessionNumber": { + "type": "keyword" + }, + "observationLevel": { + "type": "keyword" + }, + "observationLevels": { + "type": "keyword" + }, + "observationLevelDetails": { + "properties": { + "type": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "value": { + "type": "keyword" + } + } + }, + "observationUnitXref": { + "properties": { + "id": { + "type": "keyword" + }, + "source": { + "type": "keyword" + } + } + }, + "observations": { + "type": "nested", + "properties": { + "observationURI": { + "type": "keyword" + }, + "observationDbId": { + "type": "keyword" + }, + "collector": { + "type": "keyword", + "index": false + }, + "observationTimeStamp": { + "type": "date", + "format": "yyyy-MM-dd'T'HH:mm:ss'Z'" + }, + "gdd": { + "type": "float" + }, + "observationVariableURI": { + "type": "keyword" + }, + "observationVariableDbId": { + "type": "keyword" + }, + "observationVariableName": { + "type": "keyword" + }, + "specificName": { + "type": "keyword" + }, + "season": { + "type": "keyword" + }, + "value": { + "type": "keyword" + }, + "isDataFile": { + "type": "boolean", + "index": false + } + } + }, + "plantNumber": { + "type": "keyword", + "index": false + }, + "plotNumber": { + "type": "keyword", + "index": false + }, + "programURI": { + "type": "keyword" + }, + "programDbId": { + "type": "keyword" + }, + "programName": { + "type": "keyword" + }, + "replicate": { + "type": "keyword", + "index": false + }, + "studyURI": { + "type": "keyword" + }, + "studyDbId": { + "type": "keyword" + }, + "studyName": { + "type": "keyword" + }, + "studyLocationURI": { + "type": "keyword" + }, + "studyLocationDbId": { + "type": "keyword" + }, + "studyLocation": { + "type": "keyword" + }, + "treatments": { + "properties": { + "factor": { + "type": "keyword" + }, + "modality": { + "type": "keyword" + } + } + }, + "trials": { + "properties": { + "id": { + "type": "long" + }, + "name": { + "type": "keyword" + } + } + }, + "taxonScientificName": { + "type": "keyword" + }, + "germplasmGenus": { + "type": "keyword" + }, + "germplasmCollections": { + "properties": { + "id": { + "type": "long" + }, + "name": { + "type": "keyword" + } + } + }, + "germplasmPanels": { + "properties": { + "id": { + "type": "long" + }, + "name": { + "type": "keyword" + } + } + }, + "source": { + "type": "keyword" + }, + "groupId": { + "type": "long" + }, + "@type": { + "type": "keyword" + }, + "@id": { + "type": "keyword" + }, + "schema:includedInDataCatalog": { + "type": "keyword" + }, + "schema:identifier": { + "type": "keyword" + }, + "schema:name": { + "type": "keyword" + }, + "schema:url": { + "type": "keyword" + } + } } diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/program_mapping.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/program_mapping.json index abd710be92a05aafcddf83272895aa94d07d006a..da076dfbaddff16c0a3c112c49662c4cf53942f0 100644 --- a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/program_mapping.json +++ b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/program_mapping.json @@ -1,78 +1,74 @@ { - "program": { - "dynamic": "strict", - "properties": { - "programURI": { - "type": "keyword" - }, - "programDbId": { - "type": "keyword" - }, - "programName": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "abbreviation": { - "type": "keyword" - }, - "commonCropName": { - "type": "keyword" - }, - "documentationURL": { - "type": "keyword" - }, - "leadPerson": { - "type": "keyword" - }, - "leadPersonDbId": { - "type": "keyword" - }, - "leadPersonName": { - "type": "keyword" - }, - "objective": { - "type": "keyword" - }, - - "trialDbIds": { - "type": "keyword" - }, - "trialURIs": { - "type": "keyword" - }, - "studyDbIds": { - "type": "keyword" - }, - "studyURIs": { - "type": "keyword" - }, - - "source": { - "type": "keyword" - }, - "groupId": { - "type": "long" - }, - "@type": { - "type": "keyword" - }, - "@id": { - "type": "keyword" - }, - "schema:includedInDataCatalog": { - "type": "keyword" - }, - "schema:identifier": { - "type": "keyword" - }, - "schema:name": { - "type": "keyword" - }, - "schema:url": { - "type": "keyword" - } - } - } + "dynamic": "strict", + "properties": { + "programURI": { + "type": "keyword" + }, + "programDbId": { + "type": "keyword" + }, + "programName": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "abbreviation": { + "type": "keyword" + }, + "commonCropName": { + "type": "keyword" + }, + "documentationURL": { + "type": "keyword" + }, + "leadPerson": { + "type": "keyword" + }, + "leadPersonDbId": { + "type": "keyword" + }, + "leadPersonName": { + "type": "keyword" + }, + "objective": { + "type": "keyword" + }, + "trialDbIds": { + "type": "keyword" + }, + "trialURIs": { + "type": "keyword" + }, + "studyDbIds": { + "type": "keyword" + }, + "studyURIs": { + "type": "keyword" + }, + "source": { + "type": "keyword" + }, + "groupId": { + "type": "long" + }, + "@type": { + "type": "keyword" + }, + "@id": { + "type": "keyword" + }, + "schema:includedInDataCatalog": { + "type": "keyword" + }, + "schema:identifier": { + "type": "keyword" + }, + "schema:name": { + "type": "keyword" + }, + "schema:url": { + "type": "keyword" + } + } } diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/settings.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/settings.json index db9668c85c563b29b19c16aa5b65d9969ae5a3b1..c4cef5da29524b7efab7d8a46edbd1a3f6cb3f2b 100644 --- a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/settings.json +++ b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/settings.json @@ -5,7 +5,7 @@ "analysis": { "filter": { "1-20-edgeNGram": { - "type": "edgeNGram", + "type": "edge_ngram", "side": "front", "min_gram": 1, "max_gram": 20 @@ -22,7 +22,6 @@ "type": "custom", "tokenizer": "special_tokenizer", "filter": [ - "standard", "lowercase", "asciifolding" ] @@ -31,7 +30,6 @@ "type": "custom", "tokenizer": "special_tokenizer", "filter": [ - "standard", "lowercase", "asciifolding", "1-20-edgeNGram" diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/study_mapping.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/study_mapping.json index ea2a7e22c3449595e0957cc812be2051d3dc37d2..b9c0443923b33fd5f4f894a7cbd0030a2f2fc452 100644 --- a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/study_mapping.json +++ b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/study_mapping.json @@ -1,275 +1,272 @@ { - "study": { - "dynamic": "strict", - "properties": { - "studyURI": { - "type": "keyword" - }, - "studyDbId": { - "type": "keyword" - }, - "studyName": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "active": { - "type": "boolean" - }, - "commonCropName": { - "type": "keyword" - }, - "cropDbId": { - "type": "keyword" - }, - "statisticalDesign": { - "dynamic": "true", - "properties": {} - }, - "description": { - "type": "keyword" - }, - "organism": { - "type": "keyword" - }, - "contactURIs": { - "type": "keyword" - }, - "contactDbIds": { - "type": "keyword" - }, - "contacts": { - "properties": { - "contactURI": { - "type": "keyword" - }, - "contactDbId": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "instituteName": { - "type": "keyword" - }, - "email": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "orcid": { - "type": "keyword" - } - } - }, - "dataLinks": { - "properties": { - "dataLinkName": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "url": { - "type": "keyword" - } - } - }, - "documentationURL": { - "type": "keyword" - }, - "startDate": { - "type": "date", - "format": "YYYY-MM-dd" - }, - "endDate": { - "type": "date", - "format": "YYYY-MM-dd" - }, - "year": { - "type": "keyword" - }, - "lastUpdate": { - "properties": { - "version": { - "type": "keyword" - }, - "timestamp": { - "type": "date", - "format": "yyyy-MM-dd||yyyy-MM-dd'T'HH:mm:ss'Z'" - } - } - }, - "license": { - "type": "keyword" - }, - "locationURIs": { - "type": "keyword" - }, - "locationDbIds": { - "type": "keyword" - }, - "locationURI": { - "type": "keyword" - }, - "locationDbId": { - "type": "keyword" - }, - "locationName": { - "type": "keyword" - }, - "location": { - "properties": { - "locationURI": { - "type": "keyword" - }, - "locationDbId": { - "type": "keyword" - }, - "locationName": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "abbreviation": { - "type": "keyword" - }, - "abreviation": { - "type": "keyword" - }, - "locationType": { - "type": "keyword" - }, - "countryCode": { - "type": "keyword" - }, - "countryName": { - "type": "keyword" - }, - "documentationURL": { - "type": "keyword" - }, - "instituteName": { - "type": "keyword" - }, - "instituteAddress": { - "type": "keyword" - }, - "instituteAdress": { - "type": "keyword" - }, - "altitude": { - "type": "double" - }, - "latitude": { - "type": "double" - }, - "longitude": { - "type": "double" - }, - "additionalInfo": { - "dynamic": "true", - "type": "object", - "properties": {} - } - } - }, - "programURIs": { - "type": "keyword" - }, - "programDbIds": { - "type": "keyword" - }, - "programURI": { - "type": "keyword" - }, - "programDbId": { - "type": "keyword" - }, - "programName": { - "type": "keyword" - }, - "seasons": { - "type": "keyword" - }, - "studyDescription": { - "type": "keyword" - }, - "studyTypeURI": { - "type": "keyword" - }, - "studyTypeDbId": { - "type": "keyword" - }, - "studyType": { - "type": "keyword" - }, - "studyTypeName": { - "type": "keyword" - }, - "trialURIs": { - "type": "keyword" - }, - "trialDbIds": { - "type": "keyword" - }, - "trialURI": { - "type": "keyword" - }, - "trialDbId": { - "type": "keyword" - }, - "trialName": { - "type": "keyword" - }, - "germplasmURIs": { - "type": "keyword" - }, - "germplasmDbIds": { - "type": "keyword" - }, - "observationVariableURIs": { - "type": "keyword" - }, - "observationVariableDbIds": { - "type": "keyword" - }, - "additionalInfo": { - "dynamic": "true", - "type": "object", - "properties": {} - }, - - "source": { - "type": "keyword" - }, - "groupId": { - "type": "long" - }, - "@type": { - "type": "keyword" - }, - "@id": { - "type": "keyword" - }, - "schema:includedInDataCatalog": { - "type": "keyword" - }, - "schema:identifier": { - "type": "keyword" - }, - "schema:name": { - "type": "keyword" - }, - "schema:url": { - "type": "keyword" - } - } - } + "dynamic": "strict", + "properties": { + "studyURI": { + "type": "keyword" + }, + "studyDbId": { + "type": "keyword" + }, + "studyName": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "active": { + "type": "boolean" + }, + "commonCropName": { + "type": "keyword" + }, + "cropDbId": { + "type": "keyword" + }, + "statisticalDesign": { + "dynamic": true, + "properties": {} + }, + "description": { + "type": "keyword" + }, + "organism": { + "type": "keyword" + }, + "contactURIs": { + "type": "keyword" + }, + "contactDbIds": { + "type": "keyword" + }, + "contacts": { + "properties": { + "contactURI": { + "type": "keyword" + }, + "contactDbId": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "instituteName": { + "type": "keyword" + }, + "email": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "orcid": { + "type": "keyword" + } + } + }, + "dataLinks": { + "properties": { + "dataLinkName": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "url": { + "type": "keyword" + } + } + }, + "documentationURL": { + "type": "keyword" + }, + "startDate": { + "type": "date", + "format": "YYYY-MM-dd" + }, + "endDate": { + "type": "date", + "format": "YYYY-MM-dd" + }, + "year": { + "type": "keyword" + }, + "lastUpdate": { + "properties": { + "version": { + "type": "keyword" + }, + "timestamp": { + "type": "date", + "format": "yyyy-MM-dd||yyyy-MM-dd'T'HH:mm:ss'Z'" + } + } + }, + "license": { + "type": "keyword" + }, + "locationURIs": { + "type": "keyword" + }, + "locationDbIds": { + "type": "keyword" + }, + "locationURI": { + "type": "keyword" + }, + "locationDbId": { + "type": "keyword" + }, + "locationName": { + "type": "keyword" + }, + "location": { + "properties": { + "locationURI": { + "type": "keyword" + }, + "locationDbId": { + "type": "keyword" + }, + "locationName": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "abbreviation": { + "type": "keyword" + }, + "abreviation": { + "type": "keyword" + }, + "locationType": { + "type": "keyword" + }, + "countryCode": { + "type": "keyword" + }, + "countryName": { + "type": "keyword" + }, + "documentationURL": { + "type": "keyword" + }, + "instituteName": { + "type": "keyword" + }, + "instituteAddress": { + "type": "keyword" + }, + "instituteAdress": { + "type": "keyword" + }, + "altitude": { + "type": "double" + }, + "latitude": { + "type": "double" + }, + "longitude": { + "type": "double" + }, + "additionalInfo": { + "dynamic": true, + "type": "object", + "properties": {} + } + } + }, + "programURIs": { + "type": "keyword" + }, + "programDbIds": { + "type": "keyword" + }, + "programURI": { + "type": "keyword" + }, + "programDbId": { + "type": "keyword" + }, + "programName": { + "type": "keyword" + }, + "seasons": { + "type": "keyword" + }, + "studyDescription": { + "type": "keyword" + }, + "studyTypeURI": { + "type": "keyword" + }, + "studyTypeDbId": { + "type": "keyword" + }, + "studyType": { + "type": "keyword" + }, + "studyTypeName": { + "type": "keyword" + }, + "trialURIs": { + "type": "keyword" + }, + "trialDbIds": { + "type": "keyword" + }, + "trialURI": { + "type": "keyword" + }, + "trialDbId": { + "type": "keyword" + }, + "trialName": { + "type": "keyword" + }, + "germplasmURIs": { + "type": "keyword" + }, + "germplasmDbIds": { + "type": "keyword" + }, + "observationVariableURIs": { + "type": "keyword" + }, + "observationVariableDbIds": { + "type": "keyword" + }, + "additionalInfo": { + "dynamic": true, + "type": "object", + "properties": {} + }, + "source": { + "type": "keyword" + }, + "groupId": { + "type": "long" + }, + "@type": { + "type": "keyword" + }, + "@id": { + "type": "keyword" + }, + "schema:includedInDataCatalog": { + "type": "keyword" + }, + "schema:identifier": { + "type": "keyword" + }, + "schema:name": { + "type": "keyword" + }, + "schema:url": { + "type": "keyword" + } + } } diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/transplant_mapping.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/transplant_mapping.json deleted file mode 100644 index 5aec114caea1a5828d00461d3ce98b73ce4921e0..0000000000000000000000000000000000000000 --- a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/transplant_mapping.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "transplant": { - "dynamic": "true", - "properties": { - "entry_type": { - "type": "keyword" - }, - "linkedRessourcesID": { - "type": "keyword" - } - } - } -} diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/trial_mapping.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/trial_mapping.json index 3793e3f8d9f6ae182cba6aa2ee70fc48b65487b1..f48ef19cd8a7b7e4e6fa3fc65a73a4b5d9a167a8 100644 --- a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/trial_mapping.json +++ b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/trial_mapping.json @@ -1,362 +1,357 @@ { - "trial": { - "dynamic": "strict", - "properties": { - "trialURI": { - "type": "keyword" - }, - "trialDbId": { - "type": "keyword" - }, - "trialName": { - "type": "keyword" - }, - "trialPUI": { - "type": "keyword" - }, - "trialType": { - "type": "keyword" - }, - "active": { - "type": "boolean" - }, - "commonCropName": { - "type": "keyword" - }, - "cropDbId": { - "type": "keyword" - }, - "trialDescription": { - "type": "keyword" - }, - "documentationURL": { - "type": "keyword" - }, - "startDate": { - "type": "date", - "format": "YYYY-MM-dd" - }, - "endDate": { - "type": "date", - "format": "YYYY-MM-dd" - }, - "publications": { - "properties": { - "publicationReference": { - "type": "keyword" - }, - "publicationPUI": { - "type": "keyword" - } - } - }, - "programURIs": { - "type": "keyword" - }, - "programDbIds": { - "type": "keyword" - }, - "programURI": { - "type": "keyword" - }, - "programDbId": { - "type": "keyword" - }, - "programName": { - "type": "keyword" - }, - "studyURIs": { - "type": "keyword" - }, - "studyDbIds": { - "type": "keyword" - }, - "studies": { - "properties": { - "studyURI": { - "type": "keyword" - }, - "studyDbId": { - "type": "keyword" - }, - "studyName": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "studyDescription": { - "type": "keyword" - }, - "description": { - "type": "keyword" - }, - "locationURI": { - "type": "keyword" - }, - "locationDbId": { - "type": "keyword" - }, - "locationName": { - "type": "keyword" - }, - "active": { - "type": "boolean" - }, - "commonCropName": { - "type": "keyword" - }, - "cropDbId": { - "type": "keyword" - }, - "contactURIs": { - "type": "keyword" - }, - "contactDbIds": { - "type": "keyword" - }, - "dataLinks": { - "properties": { - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "url": { - "type": "keyword" - } - } - }, - "documentationURL": { - "type": "keyword" - }, - "startDate": { - "type": "date", - "format": "YYYY-MM-dd" - }, - "endDate": { - "type": "date", - "format": "YYYY-MM-dd" - }, - "lastUpdate": { - "dynamic": "true", - "properties": {} - }, - "license": { - "type": "keyword" - }, - "programURIs": { - "type": "keyword" - }, - "programDbIds": { - "type": "keyword" - }, - "programURI": { - "type": "keyword" - }, - "programDbId": { - "type": "keyword" - }, - "programName": { - "type": "keyword" - }, - "seasons": { - "dynamic": "true", - "properties": {} - }, - "studyType": { - "type": "keyword" - }, - "studyTypeName": { - "type": "keyword" - }, - "trialURIs": { - "type": "keyword" - }, - "trialDbIds": { - "type": "keyword" - }, - "trialURI": { - "type": "keyword" - }, - "trialDbId": { - "type": "keyword" - }, - "trialName": { - "type": "keyword" - }, - "germplasmURIs": { - "type": "keyword" - }, - "germplasmDbIds": { - "type": "keyword" - }, - "observationVariableURIs": { - "type": "keyword" - }, - "observationVariableDbIds": { - "type": "keyword" - }, - "locationURIs": { - "type": "keyword" - }, - "locationDbIds": { - "type": "keyword" - }, - "additionalInfo": { - "dynamic": "true", - "type": "object", - "properties": {} - }, - - "source": { - "type": "keyword" - }, - "groupId": { - "type": "long" - }, - "@type": { - "type": "keyword" - }, - "@id": { - "type": "keyword" - }, - "schema:includedInDataCatalog": { - "type": "keyword" - }, - "schema:identifier": { - "type": "keyword" - }, - "schema:name": { - "type": "keyword" - }, - "schema:url": { - "type": "keyword" - } - } - }, - "datasetAuthorship": { - "properties": { - "license": { - "type": "keyword" - }, - "datasetPUI": { - "type": "keyword" - } - } - }, - "datasetAuthorships": { - "properties": { - "license": { - "type": "keyword" - }, - "datasetPUI": { - "type": "keyword" - } - } - }, - "contactURIs": { - "type": "keyword" - }, - "contactDbIds": { - "type": "keyword" - }, - "contacts": { - "properties": { - "contactURI": { - "type": "keyword" - }, - "contactDbId": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "instituteName": { - "type": "keyword" - }, - "institutionName": { - "type": "keyword" - }, - "email": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "orcid": { - "type": "keyword" - }, - "studyURIs": { - "type": "keyword" - }, - "studyDbIds": { - "type": "keyword" - }, - "trialURIs": { - "type": "keyword" - }, - "trialDbIds": { - "type": "keyword" - }, - - "source": { - "type": "keyword" - }, - "groupId": { - "type": "long" - }, - "@type": { - "type": "keyword" - }, - "@id": { - "type": "keyword" - }, - "schema:includedInDataCatalog": { - "type": "keyword" - }, - "schema:identifier": { - "type": "keyword" - }, - "schema:name": { - "type": "keyword" - }, - "schema:url": { - "type": "keyword" - } - } - }, - "additionalInfo": { - "dynamic": "true", - "type": "object", - "properties": {} - }, - - "source": { - "type": "keyword" - }, - "groupId": { - "type": "long" - }, - "@type": { - "type": "keyword" - }, - "@id": { - "type": "keyword" - }, - "schema:includedInDataCatalog": { - "type": "keyword" - }, - "schema:identifier": { - "type": "keyword" - }, - "schema:name": { - "type": "keyword" - }, - "schema:url": { - "type": "keyword" - } - } - } + "dynamic": "strict", + "properties": { + "trialURI": { + "type": "keyword" + }, + "trialDbId": { + "type": "keyword" + }, + "trialName": { + "type": "keyword" + }, + "trialPUI": { + "type": "keyword" + }, + "trialType": { + "type": "keyword" + }, + "active": { + "type": "boolean" + }, + "commonCropName": { + "type": "keyword" + }, + "cropDbId": { + "type": "keyword" + }, + "trialDescription": { + "type": "keyword" + }, + "documentationURL": { + "type": "keyword" + }, + "startDate": { + "type": "date", + "format": "YYYY-MM-dd" + }, + "endDate": { + "type": "date", + "format": "YYYY-MM-dd" + }, + "publications": { + "properties": { + "publicationReference": { + "type": "keyword" + }, + "publicationPUI": { + "type": "keyword" + } + } + }, + "programURIs": { + "type": "keyword" + }, + "programDbIds": { + "type": "keyword" + }, + "programURI": { + "type": "keyword" + }, + "programDbId": { + "type": "keyword" + }, + "programName": { + "type": "keyword" + }, + "studyURIs": { + "type": "keyword" + }, + "studyDbIds": { + "type": "keyword" + }, + "studies": { + "properties": { + "studyURI": { + "type": "keyword" + }, + "studyDbId": { + "type": "keyword" + }, + "studyName": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "studyDescription": { + "type": "keyword" + }, + "description": { + "type": "keyword" + }, + "locationURI": { + "type": "keyword" + }, + "locationDbId": { + "type": "keyword" + }, + "locationName": { + "type": "keyword" + }, + "active": { + "type": "boolean" + }, + "commonCropName": { + "type": "keyword" + }, + "cropDbId": { + "type": "keyword" + }, + "contactURIs": { + "type": "keyword" + }, + "contactDbIds": { + "type": "keyword" + }, + "dataLinks": { + "properties": { + "name": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "url": { + "type": "keyword" + } + } + }, + "documentationURL": { + "type": "keyword" + }, + "startDate": { + "type": "date", + "format": "YYYY-MM-dd" + }, + "endDate": { + "type": "date", + "format": "YYYY-MM-dd" + }, + "lastUpdate": { + "dynamic": true, + "properties": {} + }, + "license": { + "type": "keyword" + }, + "programURIs": { + "type": "keyword" + }, + "programDbIds": { + "type": "keyword" + }, + "programURI": { + "type": "keyword" + }, + "programDbId": { + "type": "keyword" + }, + "programName": { + "type": "keyword" + }, + "seasons": { + "dynamic": true, + "properties": {} + }, + "studyType": { + "type": "keyword" + }, + "studyTypeName": { + "type": "keyword" + }, + "trialURIs": { + "type": "keyword" + }, + "trialDbIds": { + "type": "keyword" + }, + "trialURI": { + "type": "keyword" + }, + "trialDbId": { + "type": "keyword" + }, + "trialName": { + "type": "keyword" + }, + "germplasmURIs": { + "type": "keyword" + }, + "germplasmDbIds": { + "type": "keyword" + }, + "observationVariableURIs": { + "type": "keyword" + }, + "observationVariableDbIds": { + "type": "keyword" + }, + "locationURIs": { + "type": "keyword" + }, + "locationDbIds": { + "type": "keyword" + }, + "additionalInfo": { + "dynamic": true, + "type": "object", + "properties": {} + }, + "source": { + "type": "keyword" + }, + "groupId": { + "type": "long" + }, + "@type": { + "type": "keyword" + }, + "@id": { + "type": "keyword" + }, + "schema:includedInDataCatalog": { + "type": "keyword" + }, + "schema:identifier": { + "type": "keyword" + }, + "schema:name": { + "type": "keyword" + }, + "schema:url": { + "type": "keyword" + } + } + }, + "datasetAuthorship": { + "properties": { + "license": { + "type": "keyword" + }, + "datasetPUI": { + "type": "keyword" + } + } + }, + "datasetAuthorships": { + "properties": { + "license": { + "type": "keyword" + }, + "datasetPUI": { + "type": "keyword" + } + } + }, + "contactURIs": { + "type": "keyword" + }, + "contactDbIds": { + "type": "keyword" + }, + "contacts": { + "properties": { + "contactURI": { + "type": "keyword" + }, + "contactDbId": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "instituteName": { + "type": "keyword" + }, + "institutionName": { + "type": "keyword" + }, + "email": { + "type": "keyword" + }, + "type": { + "type": "keyword" + }, + "orcid": { + "type": "keyword" + }, + "studyURIs": { + "type": "keyword" + }, + "studyDbIds": { + "type": "keyword" + }, + "trialURIs": { + "type": "keyword" + }, + "trialDbIds": { + "type": "keyword" + }, + "source": { + "type": "keyword" + }, + "groupId": { + "type": "long" + }, + "@type": { + "type": "keyword" + }, + "@id": { + "type": "keyword" + }, + "schema:includedInDataCatalog": { + "type": "keyword" + }, + "schema:identifier": { + "type": "keyword" + }, + "schema:name": { + "type": "keyword" + }, + "schema:url": { + "type": "keyword" + } + } + }, + "additionalInfo": { + "dynamic": true, + "type": "object", + "properties": {} + }, + "source": { + "type": "keyword" + }, + "groupId": { + "type": "long" + }, + "@type": { + "type": "keyword" + }, + "@id": { + "type": "keyword" + }, + "schema:includedInDataCatalog": { + "type": "keyword" + }, + "schema:identifier": { + "type": "keyword" + }, + "schema:name": { + "type": "keyword" + }, + "schema:url": { + "type": "keyword" + } + } } diff --git a/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/xref_mapping.json b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/xref_mapping.json new file mode 100644 index 0000000000000000000000000000000000000000..f7a05def483a981c7de315ccc0ef7fe3c90f6835 --- /dev/null +++ b/backend/src/test/resources/fr/inra/urgi/faidare/repository/es/setup/index/xref_mapping.json @@ -0,0 +1,11 @@ +{ + "dynamic": "true", + "properties": { + "entryType": { + "type": "keyword" + }, + "linkedResourcesID": { + "type": "keyword" + } + } +} diff --git a/data/test/json-bulk/IBET/contact-1.json.gz b/data/test/json-bulk/IBET/contact-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..4937fbcef827c2e0e0d0c5bf599f7464f57cbcd7 Binary files /dev/null and b/data/test/json-bulk/IBET/contact-1.json.gz differ diff --git a/data/test/json-bulk/IBET/datadiscovery-1.json.gz b/data/test/json-bulk/IBET/datadiscovery-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..7752e8e9b8b6db8ac4ff7b1b00464a122e1c7aff Binary files /dev/null and b/data/test/json-bulk/IBET/datadiscovery-1.json.gz differ diff --git a/data/test/json-bulk/IBET/germplasm-1.json.gz b/data/test/json-bulk/IBET/germplasm-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..17338b8848321dec454cc1b4a14dd53b865e099b Binary files /dev/null and b/data/test/json-bulk/IBET/germplasm-1.json.gz differ diff --git a/data/test/json-bulk/IBET/location-1.json.gz b/data/test/json-bulk/IBET/location-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..5d1d2056da4bb126b6911c89e50e28411bc4ef15 Binary files /dev/null and b/data/test/json-bulk/IBET/location-1.json.gz differ diff --git a/data/test/json-bulk/IBET/observationVariable-1.json.gz b/data/test/json-bulk/IBET/observationVariable-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..190036c3ef9003e7e81513b22b6b95f6edcad906 Binary files /dev/null and b/data/test/json-bulk/IBET/observationVariable-1.json.gz differ diff --git a/data/test/json-bulk/IBET/ontology-1.json.gz b/data/test/json-bulk/IBET/ontology-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..fb6947bb15fcf5ec5eba045523d6da8f414fab1a Binary files /dev/null and b/data/test/json-bulk/IBET/ontology-1.json.gz differ diff --git a/data/test/json-bulk/IBET/program-1.json.gz b/data/test/json-bulk/IBET/program-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..58e375320bfccd312286f8e2fbc8767367e60acd Binary files /dev/null and b/data/test/json-bulk/IBET/program-1.json.gz differ diff --git a/data/test/json-bulk/IBET/study-1.json.gz b/data/test/json-bulk/IBET/study-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..551b0d47ab390ff7dfeb155db17477aa28cd9ab9 Binary files /dev/null and b/data/test/json-bulk/IBET/study-1.json.gz differ diff --git a/data/test/json-bulk/IBET/trial-1.json.gz b/data/test/json-bulk/IBET/trial-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..521ba6f31f3e5b746af6afdeb14e55767aac61f4 Binary files /dev/null and b/data/test/json-bulk/IBET/trial-1.json.gz differ diff --git a/data/test/json-bulk/URGI/datadiscovery-1.json.gz b/data/test/json-bulk/URGI/datadiscovery-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..6ac74719f5f4812c9305a67857eaeca758641cfd Binary files /dev/null and b/data/test/json-bulk/URGI/datadiscovery-1.json.gz differ diff --git a/data/test/json-bulk/URGI/germplasm-1.json.gz b/data/test/json-bulk/URGI/germplasm-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..4182f9911e850dbf705867510a784b8c8b2ecfa1 Binary files /dev/null and b/data/test/json-bulk/URGI/germplasm-1.json.gz differ diff --git a/data/test/json-bulk/URGI/germplasmAttribute-1.json.gz b/data/test/json-bulk/URGI/germplasmAttribute-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..2fbdf922e61a6f255f6052c9897190d201b5046f Binary files /dev/null and b/data/test/json-bulk/URGI/germplasmAttribute-1.json.gz differ diff --git a/data/test/json-bulk/URGI/germplasmMcpd-1.json.gz b/data/test/json-bulk/URGI/germplasmMcpd-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..051c565d78c4d77cc2d6c7d0ea7e0e6345b1758a Binary files /dev/null and b/data/test/json-bulk/URGI/germplasmMcpd-1.json.gz differ diff --git a/data/test/json-bulk/URGI/germplasmPedigree-1.json.gz b/data/test/json-bulk/URGI/germplasmPedigree-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..b265e2d8ff5806fa069feef69025c573d2e56435 Binary files /dev/null and b/data/test/json-bulk/URGI/germplasmPedigree-1.json.gz differ diff --git a/data/test/json-bulk/URGI/germplasmProgeny-1.json.gz b/data/test/json-bulk/URGI/germplasmProgeny-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..0a71aa221bd0ed854dc294b73050a21b9412301b Binary files /dev/null and b/data/test/json-bulk/URGI/germplasmProgeny-1.json.gz differ diff --git a/data/test/json-bulk/URGI/location-1.json.gz b/data/test/json-bulk/URGI/location-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..9ee1c92b5c4f86999dfafd34c157cf24d092127b Binary files /dev/null and b/data/test/json-bulk/URGI/location-1.json.gz differ diff --git a/data/test/json-bulk/URGI/location-2.json.gz b/data/test/json-bulk/URGI/location-2.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..52eb39da219fb55040b8a113615c168c87b35ec7 Binary files /dev/null and b/data/test/json-bulk/URGI/location-2.json.gz differ diff --git a/data/test/json-bulk/URGI/program-1.json.gz b/data/test/json-bulk/URGI/program-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..0a3c14b414e7cf2292b50d548125051e85e4fd26 Binary files /dev/null and b/data/test/json-bulk/URGI/program-1.json.gz differ diff --git a/data/test/json-bulk/URGI/study-1.json.gz b/data/test/json-bulk/URGI/study-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..46c09ea4cdb10a37cc5d0a29185cfe53551e3539 Binary files /dev/null and b/data/test/json-bulk/URGI/study-1.json.gz differ diff --git a/data/test/json-bulk/URGI/trial-1.json.gz b/data/test/json-bulk/URGI/trial-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..62b52333712c59eed3df6ea037a3c7a3ad8752cc Binary files /dev/null and b/data/test/json-bulk/URGI/trial-1.json.gz differ diff --git a/data/test/json-bulk/URGI/xref-1.json.gz b/data/test/json-bulk/URGI/xref-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..5a9cfc6637a35c665533c8a3e3fe56f01d16dbe9 Binary files /dev/null and b/data/test/json-bulk/URGI/xref-1.json.gz differ diff --git a/data/test/json-bulk/VIB/contact-1.json.gz b/data/test/json-bulk/VIB/contact-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..089c776191f7cc07dc3267c75c93ee362da16ec6 Binary files /dev/null and b/data/test/json-bulk/VIB/contact-1.json.gz differ diff --git a/data/test/json-bulk/VIB/datadiscovery-1.json.gz b/data/test/json-bulk/VIB/datadiscovery-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..5d4c9845913870ffb259b9393c6eec9bd668a370 Binary files /dev/null and b/data/test/json-bulk/VIB/datadiscovery-1.json.gz differ diff --git a/data/test/json-bulk/VIB/germplasm-1.json.gz b/data/test/json-bulk/VIB/germplasm-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..b8b68786ccb9fbbb5f05b53f203a64d51c11d1ab Binary files /dev/null and b/data/test/json-bulk/VIB/germplasm-1.json.gz differ diff --git a/data/test/json-bulk/VIB/location-1.json.gz b/data/test/json-bulk/VIB/location-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..63bf7880687a80a86fb6a440420173bbe778e1af Binary files /dev/null and b/data/test/json-bulk/VIB/location-1.json.gz differ diff --git a/data/test/json-bulk/VIB/observationVariable-1.json.gz b/data/test/json-bulk/VIB/observationVariable-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..f4e805c8cd3b49dfc93191c483ec574953aab200 Binary files /dev/null and b/data/test/json-bulk/VIB/observationVariable-1.json.gz differ diff --git a/data/test/json-bulk/VIB/study-1.json.gz b/data/test/json-bulk/VIB/study-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..1709a4ceb888f6c61cf9f1b6fe3c5f1ec56a11b5 Binary files /dev/null and b/data/test/json-bulk/VIB/study-1.json.gz differ diff --git a/data/test/json-bulk/VIB/trial-1.json.gz b/data/test/json-bulk/VIB/trial-1.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..accb4bd36814ce7ed4faa362fc5efe59f5537bc1 Binary files /dev/null and b/data/test/json-bulk/VIB/trial-1.json.gz differ diff --git a/docker-compose.yml b/docker-compose.yml index fd9fbf1fe581e4a17e00bea4a3548ba0a2e316c4..c3a08db1a896e6e89d0579c4f2132d82233eefef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.3' services: elasticsearch: - image: docker.elastic.co/elasticsearch/elasticsearch:6.6.2 + image: docker.elastic.co/elasticsearch/elasticsearch:7.13.2 container_name: elasticsearch-faidare environment: - discovery.type=single-node @@ -9,7 +9,7 @@ services: - 9200:9200 kibana: - image: docker.elastic.co/kibana/kibana:6.6.2 + image: docker.elastic.co/kibana/kibana:7.13.2 container_name: kibana-faidare environment: - "ELASTICSEARCH_URL=http://elasticsearch:9200" diff --git a/frontend/src/app/gnpis.service.ts b/frontend/src/app/gnpis.service.ts index bf0b3b2a44fe9862498e028673e6562d80aa6dac..45d9de46dbcf8b1fed27bd4dd4355f101d1a2e2f 100644 --- a/frontend/src/app/gnpis.service.ts +++ b/frontend/src/app/gnpis.service.ts @@ -24,7 +24,7 @@ export const BASE_URL = 'faidare/v1'; providedIn: 'root' }) export class GnpisService { - static URGI_SOURCE_URI = 'https://urgi.versailles.inra.fr'; + static URGI_SOURCE_URI = 'https://urgi.versailles.inrae.fr'; sourceByURI$ = new ReplaySubject<Record<string, DataDiscoverySource>>(1); sources$ = new ReplaySubject<DataDiscoverySource[]>(1); @@ -136,7 +136,7 @@ export class GnpisService { } xref(xrefId: string): Observable<XrefResponse> { - return this.http.get<XrefResponse>(`${BASE_URL}/xref/documentbyfulltextid?linkedRessourcesID=${xrefId}`); + return this.http.get<XrefResponse>(`${BASE_URL}/xref/documentbyfulltextid?linkedResourcesID=${xrefId}`); } // TODO Change the service's response to return an object with the number of results and handle here if the number is over the limit diff --git a/frontend/src/app/models/xref.model.ts b/frontend/src/app/models/xref.model.ts index c204f787c40384df66d385d62c03eaa5bfdfa4ee..011b222b42b7b2ca79ae2cb739859f0482dfe326 100644 --- a/frontend/src/app/models/xref.model.ts +++ b/frontend/src/app/models/xref.model.ts @@ -2,9 +2,9 @@ export interface XrefModel { url: string; description: string; - database_name: string; - entry_type: string; - db_version: string; + databaseName: string; + entryType: string; + identifier: string; name: string; } diff --git a/frontend/src/app/xrefs/xrefs.component.html b/frontend/src/app/xrefs/xrefs.component.html index a6bdbff8e7b0e37d2e6b26d0fbfe7df44369a036..e0b4ded030e60a3d7f2e697cf2c066563a0b6f21 100644 --- a/frontend/src/app/xrefs/xrefs.component.html +++ b/frontend/src/app/xrefs/xrefs.component.html @@ -13,8 +13,8 @@ <ng-template let-crossRef> <tr> <td><a [href]="crossRef.url" target="_blank">{{ crossRef.name }}</a></td> - <td>{{ crossRef.database_name }}</td> - <td>{{ crossRef.entry_type }}</td> + <td>{{ crossRef.databaseName }}</td> + <td>{{ crossRef.entryType }}</td> <td>{{ crossRef.description | slice:0:120 }}...</td> </tr> </ng-template> diff --git a/frontend/src/app/xrefs/xrefs.component.spec.ts b/frontend/src/app/xrefs/xrefs.component.spec.ts index f09708ac219d67fcabfdd62ae1f5e20a92fd7f1b..470dfda4520885db2aa1b0f9aac2fd392c392eb1 100644 --- a/frontend/src/app/xrefs/xrefs.component.spec.ts +++ b/frontend/src/app/xrefs/xrefs.component.spec.ts @@ -35,9 +35,9 @@ describe('XrefsComponent', () => { url: 'https://urgi.versailles.inra.fr/association/association/viewer.do#results/analysisIds=1808038', description: 'Col-Fa-b*_MLM+Q+K is a GWASd anté paneCol-Fa-b*_MLM+Q+K is aGAS anlysis involving CC_Qualité' + 'djs dsqdsq djsqpodsjqodsqdsqkpdqpdWOLOLOLOOOOOOOsqpkdsqkdsqkdsqdsdsqdsqdsqddsqffjùsodfusjùfsfsd', - database_name: 'GnpIS', - entry_type: 'GWAS analysis', - db_version: 'GWAS_ANALYSIS_1808038_1', + databaseName: 'GnpIS', + entryType: 'GWAS analysis', + identifier: 'GWAS_ANALYSIS_1808038_1', name: 'Col-Fa-b*_MLM+Q+K' }]; @@ -64,8 +64,8 @@ describe('XrefsComponent', () => { expect(tester.cardHeader).toContainText('Cross References'); expect(tester.columns[0]).toContainText(xref[0].name); - expect(tester.columns[1]).toContainText(xref[0].database_name); - expect(tester.columns[2]).toContainText(xref[0].entry_type); + expect(tester.columns[1]).toContainText(xref[0].databaseName); + expect(tester.columns[2]).toContainText(xref[0].entryType); expect(tester.columns[3].textContent.length).toBeLessThanOrEqual(124); })); diff --git a/scripts/harvest.sh b/scripts/harvest.sh index 7f8672e4784179d5cf5ce8ab14def43b8d3eb267..21ae52506059639772435564483d4764221aeecf 100755 --- a/scripts/harvest.sh +++ b/scripts/harvest.sh @@ -7,10 +7,9 @@ ES_PORT="9200" ENV="dev" DOCUMENT_TYPES="all" -ALL_DOCUMENT_TYPES="germplasm germplasmMcpd germplasmAttribute germplasmPedigree germplasmProgeny location program study trial observationUnit datadiscovery" +ALL_DOCUMENT_TYPES="germplasm germplasmMcpd germplasmAttribute germplasmPedigree germplasmProgeny location program study trial observationUnit xref" ALL_ENVS="dev beta staging int prod test" -BASEDIR=$(dirname "$0") -TMP_FILE="log.tmp" +BASEDIR=$(readlink -f "$(dirname $0)") RED='\033[0;31m' GREEN='\033[0;32m' @@ -79,7 +78,7 @@ while [ -n "$1" ]; do -h|--help) help;; -v|--verbose) VERBOSE=1;shift 1;; --debug) set -x;shift 1;; - -jsonDir) DATA_DIR="$2"; shift 2;; + -jsonDir) DATA_DIR="$(readlink -f $2)"; shift 2;; -es_host) ES_HOST="$2"; shift 2;; -es_port) ES_PORT="$2"; shift 2;; -env) ENV="$2"; shift 2;; @@ -113,11 +112,6 @@ for DOCUMENT_TYPE in ${DOCUMENT_TYPES}; do fi done -# Compress JSON files -for FILE in $(find "${DATA_DIR}" -name "*.json"); do - gzip "$FILE" -done - LOG_DIR="${DATA_DIR%/}/indexing-log" if [[ -d ${LOG_DIR} ]] @@ -125,22 +119,27 @@ then rm -r "${LOG_DIR}" fi -export ES_HOST ES_PORT INDEX_NAME LOG_DIR +TMP_FILE="/tmp/bulk/log.tmp" +[ -f "$TMP_FILE" ] && rm -f "$TMP_FILE" + +OUTDIR="/tmp/bulk/${INDEX_NAME}" +[ -d "$OUTDIR" ] && rm -rf "$OUTDIR" +mkdir -p "$OUTDIR" -process_file() { - file=$(basename "$1") - logfile="${file%.*}.log.gz" - source=$(basename "$(dirname "$1")") +export ES_HOST ES_PORT INDEX_NAME LOG_DIR OUTDIR BASEDIR - if ! [[ -d "${LOG_DIR}/$source" ]] - then - mkdir -p "${LOG_DIR}/$source" - fi - curl -s -H 'Content-Type: application/x-ndjson' -H 'Content-Encoding: gzip' -H 'Accept-Encoding: gzip' -XPOST "${ES_HOST}:${ES_PORT}/${INDEX_NAME}/_bulk" --data-binary @"$1" > "${LOG_DIR}/$source/$logfile" +index_resources() { + SOURCE=$(basename $(dirname "$1")) + bash -c "set -o pipefail; gunzip -c $1 \ + | jq -c -f ${BASEDIR}/to_bulk.jq 2> ${OUTDIR}/${SOURCE}-$2.jq.err \ + | gzip -c \ + | curl -s -H 'Content-Type: application/x-ndjson' -H 'Content-Encoding: gzip' -H 'Accept-Encoding: gzip' \ + -XPOST \"${ES_HOST}:${ES_PORT}/${INDEX_NAME}/_bulk\"\ + --data-binary '@-' 2> ${OUTDIR}/${SOURCE}-$2.jq.err > ${OUTDIR}/${SOURCE}-$2-resources.log.gz " } -export -f process_file +export -f index_resources for DOCUMENT_TYPE in ${DOCUMENT_TYPES}; do echo && echo -e "${BOLD}Manage ${DOCUMENT_TYPE} documents...${NC}" @@ -163,13 +162,16 @@ for DOCUMENT_TYPE in ${DOCUMENT_TYPES}; do INDEX_NAME="${INDEX_PATTERN}-d"$(date +%s) echo -e "* Index documents into ${ES_HOST}:${ES_PORT}/${INDEX_NAME} indice..." { - parallel -j 2 --bar process_file ::: $(find "${DATA_DIR}" -name "${DOCUMENT_TYPE}-*.json.gz") - } || { - code=$? - echo -e "${RED}ERROR: a problem occurred when trying to index data with parallel program.${NC}" - exit $code + parallel -j 4 --bar index_resources {1} {1/.} ::: "$(find "${DATA_DIR}" -name "${DOCUMENT_TYPE}-*.json.gz")" } - parallel "gunzip -c {} | jq '.errors' | grep -q true && echo -e '${ORANGE}ERROR found in {}${NC}' >> ${TMP_FILE} ;" ::: $(find "${DATA_DIR}" -name "${DOCUMENT_TYPE}-*.log.gz") + + # check all JQ err files... + FILES_IN_ERROR=$(find "${OUTDIR}" -size "+0" -name "*${DOCUMENT_TYPE}*jq.err") + [ -n "${FILES_IN_ERROR}" ] && { echo -e "${RED}ERROR: some problems occured with JQ processing, look at files:${ORANGE} ${FILES_IN_ERROR}${NC}" ; exit 4 ; } + + parallel "gunzip -c {} | jq '.errors' | grep -q true && echo -e '${ORANGE}ERROR found in {}${NC}' >> ${TMP_FILE} ;" ::: "$(find "${OUTDIR}" -name "*${DOCUMENT_TYPE}-*.log.gz")" + parallel "gunzip -c {} | jq '.error' | grep -q true && echo -e '${ORANGE}ERROR related to data found when indexing {}${NC}' >> ${TMP_FILE} ;" ::: ${OUTDIR}/*${DOCUMENT_TYPE}*-resources.log.gz + parallel "gunzip -c {} | jq '.error? | length == 0' | grep -q false && echo -e '${ORANGE}ERROR related to Elasticsearch API usage found when indexing {}${NC}' >> ${TMP_FILE} ;" ::: ${OUTDIR}/*${DOCUMENT_TYPE}*-resources.log.gz if [ -f "${TMP_FILE}" ] && [ -s "${TMP_FILE}" ]; then echo -e "${RED}ERROR: a problem occurred when trying to index data into ${ES_HOST}:${ES_PORT}/${INDEX_NAME} indice.${NC}" echo -e "${ORANGE}$(cat ${TMP_FILE})${NC}" @@ -177,28 +179,28 @@ for DOCUMENT_TYPE in ${DOCUMENT_TYPES}; do exit 1; fi - # Check indexed data - echo -e "* Check data indexed from ${DATA_DIR} into ${INDEX_NAME}..." - # skip some documents because they contain nested objects that distort the count - if [[ "${DOCUMENT_TYPE}" != "germplasmAttribute" && "${DOCUMENT_TYPE}" != "observationUnit" && "${DOCUMENT_TYPE}" != "datadiscovery" ]]; then - COUNT_EXTRACTED_DOCS=0 - for FILE in $(find ${DATA_DIR} -name "${DOCUMENT_TYPE}-*.json.gz"); do - COUNT_FILE_DOCS=$(zcat ${FILE} | grep "\"_id\"" | sort | uniq | wc -l) - COUNT_EXTRACTED_DOCS=$((COUNT_EXTRACTED_DOCS+COUNT_FILE_DOCS)) - done - curl -s -XGET "${ES_HOST}:${ES_PORT}/${INDEX_NAME}/_refresh" >/dev/null - COUNT_INDEXED_DOCS=$(curl -s -XGET "${ES_HOST}:${ES_PORT}/_cat/indices/${INDEX_NAME}?h=docs.count") - fi - if [ "$COUNT_INDEXED_DOCS" != "$COUNT_EXTRACTED_DOCS" ]; then - echo -e "${RED}ERROR: a problem occurred when indexing data from ${DATA_DIR} on FAIDARE ${ENV}.${NC}" - echo -e "${ORANGE}Expected ${COUNT_EXTRACTED_DOCS} documents but got ${COUNT_INDEXED_DOCS} indexed documents.${NC}" - exit 1; - fi - sleep 5 + # Check indexed data + echo -e "* Check data indexed from ${DATA_DIR} into ${INDEX_NAME}..." + # skip some documents because they contain nested objects that distort the count + if [[ "${DOCUMENT_TYPE}" != "germplasmAttribute" && "${DOCUMENT_TYPE}" != "trial" ]]; then + COUNT_EXTRACTED_DOCS=0 + for FILE in $(find ${DATA_DIR} -name "${DOCUMENT_TYPE}-*.json.gz"); do + COUNT_FILE_DOCS=$(zcat ${FILE} | grep -o "\"@id\"" | wc -l) + COUNT_EXTRACTED_DOCS=$((COUNT_EXTRACTED_DOCS+COUNT_FILE_DOCS)) + done + curl -s -XGET "${ES_HOST}:${ES_PORT}/${INDEX_NAME}/_refresh" >/dev/null + COUNT_INDEXED_DOCS=$(curl -s -XGET "${ES_HOST}:${ES_PORT}/_cat/indices/${INDEX_NAME}?h=docs.count") + fi + if [ "$COUNT_INDEXED_DOCS" != "$COUNT_EXTRACTED_DOCS" ]; then + echo -e "${RED}ERROR: a problem occurred when indexing data from ${DATA_DIR} on FAIDARE ${ENV}.${NC}" + echo -e "${ORANGE}Expected ${COUNT_EXTRACTED_DOCS} documents but got ${COUNT_INDEXED_DOCS} indexed documents.${NC}" + exit 1; + fi + sleep 5 # Add aliases ALIAS_PATTERN="${INDEX_PATTERN}-group*" - ALIAS_EXIST=$(curl -s -XGET "${ES_HOST}:${ES_PORT}/_alias/${ALIAS_PATTERN}" | jq '.status' | grep -q "404" && echo "false" || echo "true") + ALIAS_EXIST=$(curl -s -XGET "${ES_HOST}:${ES_PORT}/_alias/${ALIAS_PATTERN}" | jq '.status' | grep -q -e "404" -e 'null' && echo "false" || echo "true") if [ "${ALIAS_EXIST}" == "true" ]; then echo -e "* Delete aliases ${ALIAS_PATTERN}..." LOG=$(curl -s -XDELETE "${ES_HOST}:${ES_PORT}/*/_aliases/${ALIAS_PATTERN}") @@ -219,8 +221,8 @@ for DOCUMENT_TYPE in ${DOCUMENT_TYPES}; do } }' | jq -cr '.aggregations.uniq_group.buckets[].key') # Extract ES aggregation bucket keys [ -z "$GROUP_IDS" ] && { - echo -e "${RED}ERROR: could not list 'groupId' values from index.${NC}" - exit 1; + echo -e "${ORANGE}WARNING: could not list 'groupId' values from index. Defaulting to 'groupId' = 0. ${NC}" + GROUP_IDS="0" } echo -e "* Create aliases:" for GROUP_ID in ${GROUP_IDS}; do diff --git a/scripts/to_bulk.jq b/scripts/to_bulk.jq new file mode 100644 index 0000000000000000000000000000000000000000..cef91fc15cc5327b92ef390f0bda7c3eb5bfbcab --- /dev/null +++ b/scripts/to_bulk.jq @@ -0,0 +1,28 @@ +#!/usr/bin/env jq -Mf + +# Transforms a JSON array of documents in Elasticsearch compliant bulk file +# using value of 'ID_FIELD' variable if provided, or using concatenation of +# several fields, as the Elasticsearch documents identifier +# The input data must be of type 'JSON array'. +# Return codes: +# - 0 if process succeeded +# - 2 if the input is not a JSON array + +def to_string: + if ((. | type) == "array") then + .|join("|")|tostring + else + .|tostring + end + | if(. == "null" or . == null) then + "" + else + . + end +; + +def to_bulk: + .[] | . |= {"index": {"_type": "_doc", "_id": ."@id" }}, . +; + +to_bulk