From 33e40baa386a17ac3de1325ee8d3c603aab66821 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Mon, 18 Nov 2024 16:58:49 +0800 Subject: [PATCH 1/2] feat: support paneron glossarist attributes in localized concept, fixes #111 --- lib/glossarist/concept.rb | 13 +++++++-- lib/glossarist/localized_concept.rb | 15 +++++----- spec/features/v1_serialization_spec.rb | 2 +- spec/features/v2_serialization_spec.rb | 4 +-- .../9c15f53f-b4b1-5e29-b27b-e971fbe85740.yaml | 1 + .../9ea138b3-decf-5435-a067-2a581c5c663c.yaml | 1 + .../c8763b71-b695-5117-9309-c7d998f63ad7.yaml | 1 + .../cb3f57c3-f67f-56b8-a0d2-4d16349ed89b.yaml | 1 + .../cd5b9b55-4d46-5a17-840d-ac315074c909.yaml | 1 + .../d74f5f2e-40f2-5fd2-be7e-42af2891a882.yaml | 1 + .../081154c5-89d6-5192-8147-373bd6060eaa.yaml | 1 + .../27457e38-89b5-5694-8d19-0dd3973ec71d.yaml | 1 + .../527bd617-f471-5523-9b98-59bb181f3df8.yaml | 1 + .../becf3892-886d-5dab-8a7c-af303e576a8d.yaml | 1 + .../bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml | 1 + .../c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml | 1 + .../c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml | 1 + .../da24b782-1551-5128-a043-ba6135a25acf.yaml | 1 + .../e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml | 1 + .../eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml | 1 + .../081154c5-89d6-5192-8147-373bd6060eaa.yaml | 1 + .../27457e38-89b5-5694-8d19-0dd3973ec71d.yaml | 1 + .../527bd617-f471-5523-9b98-59bb181f3df8.yaml | 1 + .../becf3892-886d-5dab-8a7c-af303e576a8d.yaml | 1 + .../bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml | 1 + .../c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml | 1 + .../c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml | 1 + .../da24b782-1551-5128-a043-ba6135a25acf.yaml | 1 + .../e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml | 1 + .../eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml | 1 + spec/spec_helper.rb | 1 + spec/unit/concept_spec.rb | 28 ++++++++----------- 32 files changed, 58 insertions(+), 31 deletions(-) diff --git a/lib/glossarist/concept.rb b/lib/glossarist/concept.rb index f35289c..985e32a 100644 --- a/lib/glossarist/concept.rb +++ b/lib/glossarist/concept.rb @@ -69,12 +69,12 @@ def initialize(*args) def uuid @uuid ||= Glossarist::Utilities::UUID.uuid_v5( Glossarist::Utilities::UUID::OID_NAMESPACE, - to_h.to_yaml, + to_h_no_uuid.to_yaml, ) end def id=(id) - # Some of the glossaries that are not generated using glossarist, contains ids that are integers + # Some of the glossaries that are not generated using glossarist, contains ids that are integers # so adding a temporary check until every glossary is updated using glossarist. if !id.nil? && (id.is_a?(String) || id.is_a?(Integer)) @id = id @@ -82,6 +82,7 @@ def id=(id) raise(Glossarist::Error, "Expect id to be a String or Integer, Got #{id.class} (#{id})") end end + alias :termid= :id= alias :identifier= :id= @@ -119,6 +120,7 @@ def designations=(designations) def preferred_designations @designations.select(&:preferred?) end + alias :preferred_terms :preferred_designations def dates=(dates) @@ -141,7 +143,7 @@ def authoritative_source=(sources) end end - def to_h + def to_h_no_uuid { "data" => { "dates" => dates&.map(&:to_h), @@ -154,10 +156,15 @@ def to_h "sources" => sources.empty? ? nil : sources&.map(&:to_h), "terms" => (terms&.map(&:to_h) || []), "related" => related&.map(&:to_h), + "domain" => domain, }.compact, }.compact end + def to_h + to_h_no_uuid.merge("id" => uuid) + end + # @deprecated For legacy reasons only. # Implicit conversion (i.e. {#to_hash} alias) will be removed soon. alias :to_hash :to_h diff --git a/lib/glossarist/localized_concept.rb b/lib/glossarist/localized_concept.rb index c0b012a..2308724 100644 --- a/lib/glossarist/localized_concept.rb +++ b/lib/glossarist/localized_concept.rb @@ -27,11 +27,11 @@ class LocalizedConcept < Concept # Temporary fields # @todo Need to remove these once the isotc211-glossary is fixed attr_accessor *%i[ - review_date - review_decision_date - review_decision_event - review_type - ] + review_date + review_decision_date + review_decision_event + review_type + ] def language_code=(language_code) if language_code.is_a?(String) && language_code.length == 3 @@ -41,11 +41,10 @@ def language_code=(language_code) end end - def to_h # rubocop:disable Metrics/MethodLength, Metrics/AbcSize + def to_h_no_uuid # rubocop:disable Metrics/MethodLength, Metrics/AbcSize hash = super hash["data"].merge!({ - "domain" => domain, "language_code" => language_code, "entry_status" => entry_status, "sources" => sources.empty? ? nil : sources&.map(&:to_h), @@ -63,7 +62,7 @@ def self.from_h(hash) terms = hash["terms"]&.map { |h| Designation::Base.from_h(h) } || [] sources = hash["authoritative_source"]&.each { |source| source.merge({ "type" => "authoritative" }) } - super(hash.merge({"terms" => terms, "sources" => sources})) + super(hash.merge({ "terms" => terms, "sources" => sources })) end # @deprecated For legacy reasons only. diff --git a/spec/features/v1_serialization_spec.rb b/spec/features/v1_serialization_spec.rb index 46afd47..a72285a 100644 --- a/spec/features/v1_serialization_spec.rb +++ b/spec/features/v1_serialization_spec.rb @@ -17,7 +17,7 @@ localized_concept_path = File.join(localized_concepts_folder, "#{id}.yaml") localized_concept = load_yaml_file(localized_concept_path) - expect(localized_concept["data"]).to eq(concept.localizations[lang].to_h["data"]) + expect(localized_concept["data"]).to eq(concept.localizations[lang].to_h_no_uuid["data"]) end end diff --git a/spec/features/v2_serialization_spec.rb b/spec/features/v2_serialization_spec.rb index 81710be..7d30522 100644 --- a/spec/features/v2_serialization_spec.rb +++ b/spec/features/v2_serialization_spec.rb @@ -18,7 +18,7 @@ localized_concept_path = File.join(localized_concepts_folder, "#{id}.yaml") localized_concept = load_yaml_file(localized_concept_path) - expect(localized_concept["data"]).to eq(concept.localizations[lang].to_h["data"]) + expect(localized_concept["data"]).to eq(concept.localizations[lang].to_h_no_uuid["data"]) end end @@ -59,7 +59,7 @@ localized_concept_path = File.join(localized_concepts_folder, "#{id}.yaml") localized_concept = load_yaml_file(localized_concept_path) - expect(localized_concept["data"]).to eq(concept.localizations[lang].to_h["data"]) + expect(localized_concept["data"]).to eq(concept.localizations[lang].to_h_no_uuid["data"]) end end diff --git a/spec/fixtures/concept_collection_v1/output/localized_concept/9c15f53f-b4b1-5e29-b27b-e971fbe85740.yaml b/spec/fixtures/concept_collection_v1/output/localized_concept/9c15f53f-b4b1-5e29-b27b-e971fbe85740.yaml index 6ce5211..71b5cea 100644 --- a/spec/fixtures/concept_collection_v1/output/localized_concept/9c15f53f-b4b1-5e29-b27b-e971fbe85740.yaml +++ b/spec/fixtures/concept_collection_v1/output/localized_concept/9c15f53f-b4b1-5e29-b27b-e971fbe85740.yaml @@ -17,3 +17,4 @@ data: designation: person language_code: eng entry_status: valid +id: 9c15f53f-b4b1-5e29-b27b-e971fbe85740 diff --git a/spec/fixtures/concept_collection_v1/output/localized_concept/9ea138b3-decf-5435-a067-2a581c5c663c.yaml b/spec/fixtures/concept_collection_v1/output/localized_concept/9ea138b3-decf-5435-a067-2a581c5c663c.yaml index bb82f39..5cbc7e8 100644 --- a/spec/fixtures/concept_collection_v1/output/localized_concept/9ea138b3-decf-5435-a067-2a581c5c663c.yaml +++ b/spec/fixtures/concept_collection_v1/output/localized_concept/9ea138b3-decf-5435-a067-2a581c5c663c.yaml @@ -17,3 +17,4 @@ data: designation: biological_entity language_code: eng entry_status: valid +id: 9ea138b3-decf-5435-a067-2a581c5c663c diff --git a/spec/fixtures/concept_collection_v1/output/localized_concept/c8763b71-b695-5117-9309-c7d998f63ad7.yaml b/spec/fixtures/concept_collection_v1/output/localized_concept/c8763b71-b695-5117-9309-c7d998f63ad7.yaml index d737c6b..fb10446 100644 --- a/spec/fixtures/concept_collection_v1/output/localized_concept/c8763b71-b695-5117-9309-c7d998f63ad7.yaml +++ b/spec/fixtures/concept_collection_v1/output/localized_concept/c8763b71-b695-5117-9309-c7d998f63ad7.yaml @@ -19,3 +19,4 @@ data: designation: material entity language_code: eng entry_status: valid +id: c8763b71-b695-5117-9309-c7d998f63ad7 diff --git a/spec/fixtures/concept_collection_v1/output/localized_concept/cb3f57c3-f67f-56b8-a0d2-4d16349ed89b.yaml b/spec/fixtures/concept_collection_v1/output/localized_concept/cb3f57c3-f67f-56b8-a0d2-4d16349ed89b.yaml index 932d325..769719f 100644 --- a/spec/fixtures/concept_collection_v1/output/localized_concept/cb3f57c3-f67f-56b8-a0d2-4d16349ed89b.yaml +++ b/spec/fixtures/concept_collection_v1/output/localized_concept/cb3f57c3-f67f-56b8-a0d2-4d16349ed89b.yaml @@ -21,3 +21,4 @@ data: designation: entity language_code: eng entry_status: valid +id: cb3f57c3-f67f-56b8-a0d2-4d16349ed89b diff --git a/spec/fixtures/concept_collection_v1/output/localized_concept/cd5b9b55-4d46-5a17-840d-ac315074c909.yaml b/spec/fixtures/concept_collection_v1/output/localized_concept/cd5b9b55-4d46-5a17-840d-ac315074c909.yaml index e52aadc..db1b6f5 100644 --- a/spec/fixtures/concept_collection_v1/output/localized_concept/cd5b9b55-4d46-5a17-840d-ac315074c909.yaml +++ b/spec/fixtures/concept_collection_v1/output/localized_concept/cd5b9b55-4d46-5a17-840d-ac315074c909.yaml @@ -17,3 +17,4 @@ data: designation: non-biological entity language_code: eng entry_status: valid +id: cd5b9b55-4d46-5a17-840d-ac315074c909 diff --git a/spec/fixtures/concept_collection_v1/output/localized_concept/d74f5f2e-40f2-5fd2-be7e-42af2891a882.yaml b/spec/fixtures/concept_collection_v1/output/localized_concept/d74f5f2e-40f2-5fd2-be7e-42af2891a882.yaml index f0803d4..773e1f3 100644 --- a/spec/fixtures/concept_collection_v1/output/localized_concept/d74f5f2e-40f2-5fd2-be7e-42af2891a882.yaml +++ b/spec/fixtures/concept_collection_v1/output/localized_concept/d74f5f2e-40f2-5fd2-be7e-42af2891a882.yaml @@ -18,3 +18,4 @@ data: designation: immaterial_entity language_code: eng entry_status: valid +id: d74f5f2e-40f2-5fd2-be7e-42af2891a882 diff --git a/spec/fixtures/concept_collection_v2/localized_concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml b/spec/fixtures/concept_collection_v2/localized_concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml index 699f72a..e2c5632 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml @@ -24,3 +24,4 @@ data: normative_status: preferred designation: دلالة language_code: ara +id: '081154c5-89d6-5192-8147-373bd6060eaa' diff --git a/spec/fixtures/concept_collection_v2/localized_concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml b/spec/fixtures/concept_collection_v2/localized_concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml index bfa9260..da85b16 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml @@ -29,3 +29,4 @@ data: - type: expression designation: ellipsoidal latitude language_code: eng +id: 27457e38-89b5-5694-8d19-0dd3973ec71d diff --git a/spec/fixtures/concept_collection_v2/localized_concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml b/spec/fixtures/concept_collection_v2/localized_concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml index 6376ef7..6c73ee8 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml @@ -23,3 +23,4 @@ data: normative_status: preferred designation: Intension language_code: deu +id: 527bd617-f471-5523-9b98-59bb181f3df8 diff --git a/spec/fixtures/concept_collection_v2/localized_concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml b/spec/fixtures/concept_collection_v2/localized_concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml index 77641d8..523c1b6 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml @@ -23,3 +23,4 @@ data: - type: expression designation: Sistema de Coordenadas Cartesianas language_code: spa +id: becf3892-886d-5dab-8a7c-af303e576a8d diff --git a/spec/fixtures/concept_collection_v2/localized_concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml b/spec/fixtures/concept_collection_v2/localized_concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml index 4c0ccbf..cf2daec 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml @@ -24,3 +24,4 @@ data: normative_status: preferred designation: intension language_code: eng +id: bf1691ef-6b21-590a-aef1-9e67ad54378e diff --git a/spec/fixtures/concept_collection_v2/localized_concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml b/spec/fixtures/concept_collection_v2/localized_concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml index 62af633..22cf35e 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml @@ -29,3 +29,4 @@ data: - type: expression designation: ellipsoidal latitude language_code: deu +id: c2cc493d-bc21-50a5-96fc-6774f3d53496 diff --git a/spec/fixtures/concept_collection_v2/localized_concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml b/spec/fixtures/concept_collection_v2/localized_concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml index 22e97a9..7589ebd 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml @@ -23,3 +23,4 @@ data: - type: expression designation: Cartesian coordinate system language_code: eng +id: c87dfcd1-c38a-55f9-87bd-9da33bfede80 diff --git a/spec/fixtures/concept_collection_v2/localized_concept/da24b782-1551-5128-a043-ba6135a25acf.yaml b/spec/fixtures/concept_collection_v2/localized_concept/da24b782-1551-5128-a043-ba6135a25acf.yaml index b8745e0..53d51a2 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/da24b782-1551-5128-a043-ba6135a25acf.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/da24b782-1551-5128-a043-ba6135a25acf.yaml @@ -29,3 +29,4 @@ data: designation: postal address component domain: postal address language_code: eng +id: da24b782-1551-5128-a043-ba6135a25acf diff --git a/spec/fixtures/concept_collection_v2/localized_concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml b/spec/fixtures/concept_collection_v2/localized_concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml index 0d43406..624c50b 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml @@ -29,3 +29,4 @@ data: - type: expression designation: ellipsoidal latitude language_code: ara +id: e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b diff --git a/spec/fixtures/concept_collection_v2/localized_concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml b/spec/fixtures/concept_collection_v2/localized_concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml index 77e3a4e..c647974 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml @@ -26,3 +26,4 @@ data: - type: expression designation: geodætisk bredde language_code: dan +id: eaea6d0f-c655-59c9-98f7-9affbdce7612 diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml index 699f72a..e2c5632 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml @@ -24,3 +24,4 @@ data: normative_status: preferred designation: دلالة language_code: ara +id: '081154c5-89d6-5192-8147-373bd6060eaa' diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml index bfa9260..da85b16 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml @@ -29,3 +29,4 @@ data: - type: expression designation: ellipsoidal latitude language_code: eng +id: 27457e38-89b5-5694-8d19-0dd3973ec71d diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml index 6376ef7..6c73ee8 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml @@ -23,3 +23,4 @@ data: normative_status: preferred designation: Intension language_code: deu +id: 527bd617-f471-5523-9b98-59bb181f3df8 diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml index 77641d8..523c1b6 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml @@ -23,3 +23,4 @@ data: - type: expression designation: Sistema de Coordenadas Cartesianas language_code: spa +id: becf3892-886d-5dab-8a7c-af303e576a8d diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml index 4c0ccbf..cf2daec 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml @@ -24,3 +24,4 @@ data: normative_status: preferred designation: intension language_code: eng +id: bf1691ef-6b21-590a-aef1-9e67ad54378e diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml index 62af633..22cf35e 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml @@ -29,3 +29,4 @@ data: - type: expression designation: ellipsoidal latitude language_code: deu +id: c2cc493d-bc21-50a5-96fc-6774f3d53496 diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml index 22e97a9..7589ebd 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml @@ -23,3 +23,4 @@ data: - type: expression designation: Cartesian coordinate system language_code: eng +id: c87dfcd1-c38a-55f9-87bd-9da33bfede80 diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/da24b782-1551-5128-a043-ba6135a25acf.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/da24b782-1551-5128-a043-ba6135a25acf.yaml index b8745e0..53d51a2 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/da24b782-1551-5128-a043-ba6135a25acf.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/da24b782-1551-5128-a043-ba6135a25acf.yaml @@ -29,3 +29,4 @@ data: designation: postal address component domain: postal address language_code: eng +id: da24b782-1551-5128-a043-ba6135a25acf diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml index 0d43406..624c50b 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml @@ -29,3 +29,4 @@ data: - type: expression designation: ellipsoidal latitude language_code: ara +id: e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml index 77e3a4e..c647974 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml @@ -26,3 +26,4 @@ data: - type: expression designation: geodætisk bredde language_code: dan +id: eaea6d0f-c655-59c9-98f7-9affbdce7612 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fa155bd..be4ce27 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,6 +4,7 @@ # require "glossarist" +require "tmpdir" Bundler.require(:development) diff --git a/spec/unit/concept_spec.rb b/spec/unit/concept_spec.rb index d075a19..293c737 100644 --- a/spec/unit/concept_spec.rb +++ b/spec/unit/concept_spec.rb @@ -9,13 +9,11 @@ let(:attrs) { { id: "123" } } it "accepts strings as ids" do - expect { subject.id = "456" } - .to change { subject.id }.to("456") + expect { subject.id = "456" }.to change { subject.id }.to("456") end it "accepts integers as ids" do - expect { subject.id = 456 } - .to change { subject.id }.to(456) + expect { subject.id = 456 }.to change { subject.id }.to(456) end describe "#to_h" do @@ -27,27 +25,26 @@ content: "Test content", type: :supersedes, }, - ] + ], ) retval = object.to_h["data"] expect(retval).to be_kind_of(Hash) expect(retval["id"]).to eq("123") - expect(retval["related"]).to eq([{"content"=>"Test content", "type"=>"supersedes"}]) + expect(retval["related"]).to eq([{ "content" => "Test content", "type" => "supersedes" }]) end end describe "::new" do it "accepts a hash of attributes" do - expect { described_class.new(attrs) } - .not_to raise_error + expect { described_class.new(attrs) }.not_to raise_error end it "generates a uuid if not given" do concept = described_class.new(attrs) uuid = Glossarist::Utilities::UUID.uuid_v5( Glossarist::Utilities::UUID::OID_NAMESPACE, - concept.to_h.to_yaml + concept.to_h_no_uuid.to_yaml ) expect(concept.uuid).to eq(uuid) @@ -132,7 +129,7 @@ "type" => "authoritative", "status" => "identical", "origin" => { "text" => "url" }, - } + }, ], "related" => [ { @@ -191,8 +188,7 @@ end it "should return only authoritative_sources" do - expect(subject.authoritative_source.map(&:to_h)) - .to eq(authoritative_source) + expect(subject.authoritative_source.map(&:to_h)).to eq(authoritative_source) end end @@ -229,11 +225,9 @@ end it "should add to sources hash" do - - expect { subject.authoritative_source = [authoritative_source] } - .to change { subject.sources.map(&:to_h) } - .from(sources) - .to(sources + [authoritative_source.merge("type" => "authoritative")]) + expect { subject.authoritative_source = [authoritative_source] }.to change { subject.sources.map(&:to_h) } + .from(sources) + .to(sources + [authoritative_source.merge("type" => "authoritative")]) end end end From 52a89f6a0793920a96a267aace0eb5ba0c262728 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Tue, 19 Nov 2024 12:21:06 +0800 Subject: [PATCH 2/2] fix: provide registry information by default --- lib/glossarist/concept.rb | 18 ++++++++++++++++++ lib/glossarist/localized_concept.rb | 2 ++ .../09767627-efa4-5d13-9503-b06ba3f18cda.yaml | 6 ++++++ .../17d42136-6e1f-58ec-8b20-64ec244dfe4c.yaml | 6 ++++++ .../1c26b632-4bb6-50da-8935-796bdb5fa795.yaml | 6 ------ .../262414b2-bc5c-515e-9f49-824d7303dfc1.yaml | 6 ------ .../2be5e463-8e95-5a4d-9796-27fbd9eea33a.yaml | 9 +++++++++ .../3392b98d-4cca-5387-960d-18df47e3b3fb.yaml | 6 ------ .../4268ae1d-fbc6-5ce2-aec9-7b0065b9576d.yaml | 6 ++++++ .../49879506-7988-5a46-b11a-c0368cd820c5.yaml | 6 ------ .../8c365ead-4e63-5ff7-a709-5fd604ab4619.yaml | 6 ------ .../a7c18f14-095c-51a6-9c60-5219d2937e5a.yaml | 6 ++++++ .../a83fbbf6-da2a-53b6-877a-6c47cb460448.yaml | 9 --------- .../a9be0faa-aadc-5dbe-8128-f70708ee88cc.yaml | 6 ++++++ ... 285b90e7-2f7d-586a-bf5b-016dbfcdcf77.yaml} | 3 ++- ... 2d05fd15-6c65-501b-b1e2-77389a1efd3a.yaml} | 6 ++++-- ... 6660ed79-d78b-5940-887f-9c86597eed26.yaml} | 3 ++- ... b69609eb-0b27-50bf-86a0-634409e25872.yaml} | 3 ++- ... b90879f4-9627-5c09-a660-827b44f4fb24.yaml} | 3 ++- ... dca5c779-33de-5621-a824-b8054ea26316.yaml} | 3 ++- .../081154c5-89d6-5192-8147-373bd6060eaa.yaml | 1 + .../27457e38-89b5-5694-8d19-0dd3973ec71d.yaml | 1 + .../527bd617-f471-5523-9b98-59bb181f3df8.yaml | 1 + .../becf3892-886d-5dab-8a7c-af303e576a8d.yaml | 1 + .../bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml | 1 + .../c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml | 1 + .../c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml | 1 + .../da24b782-1551-5128-a043-ba6135a25acf.yaml | 1 + .../e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml | 1 + .../eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml | 1 + .../081154c5-89d6-5192-8147-373bd6060eaa.yaml | 1 + .../27457e38-89b5-5694-8d19-0dd3973ec71d.yaml | 1 + .../527bd617-f471-5523-9b98-59bb181f3df8.yaml | 1 + .../becf3892-886d-5dab-8a7c-af303e576a8d.yaml | 1 + .../bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml | 1 + .../c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml | 1 + .../c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml | 1 + .../da24b782-1551-5128-a043-ba6135a25acf.yaml | 1 + .../e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml | 1 + .../eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml | 1 + 40 files changed, 93 insertions(+), 46 deletions(-) create mode 100644 spec/fixtures/concept_collection_v1/output/concept/09767627-efa4-5d13-9503-b06ba3f18cda.yaml create mode 100644 spec/fixtures/concept_collection_v1/output/concept/17d42136-6e1f-58ec-8b20-64ec244dfe4c.yaml delete mode 100644 spec/fixtures/concept_collection_v1/output/concept/1c26b632-4bb6-50da-8935-796bdb5fa795.yaml delete mode 100644 spec/fixtures/concept_collection_v1/output/concept/262414b2-bc5c-515e-9f49-824d7303dfc1.yaml create mode 100644 spec/fixtures/concept_collection_v1/output/concept/2be5e463-8e95-5a4d-9796-27fbd9eea33a.yaml delete mode 100644 spec/fixtures/concept_collection_v1/output/concept/3392b98d-4cca-5387-960d-18df47e3b3fb.yaml create mode 100644 spec/fixtures/concept_collection_v1/output/concept/4268ae1d-fbc6-5ce2-aec9-7b0065b9576d.yaml delete mode 100644 spec/fixtures/concept_collection_v1/output/concept/49879506-7988-5a46-b11a-c0368cd820c5.yaml delete mode 100644 spec/fixtures/concept_collection_v1/output/concept/8c365ead-4e63-5ff7-a709-5fd604ab4619.yaml create mode 100644 spec/fixtures/concept_collection_v1/output/concept/a7c18f14-095c-51a6-9c60-5219d2937e5a.yaml delete mode 100644 spec/fixtures/concept_collection_v1/output/concept/a83fbbf6-da2a-53b6-877a-6c47cb460448.yaml create mode 100644 spec/fixtures/concept_collection_v1/output/concept/a9be0faa-aadc-5dbe-8128-f70708ee88cc.yaml rename spec/fixtures/concept_collection_v1/output/localized_concept/{9ea138b3-decf-5435-a067-2a581c5c663c.yaml => 285b90e7-2f7d-586a-bf5b-016dbfcdcf77.yaml} (88%) rename spec/fixtures/concept_collection_v1/output/localized_concept/{cb3f57c3-f67f-56b8-a0d2-4d16349ed89b.yaml => 2d05fd15-6c65-501b-b1e2-77389a1efd3a.yaml} (81%) rename spec/fixtures/concept_collection_v1/output/localized_concept/{d74f5f2e-40f2-5fd2-be7e-42af2891a882.yaml => 6660ed79-d78b-5940-887f-9c86597eed26.yaml} (89%) rename spec/fixtures/concept_collection_v1/output/localized_concept/{9c15f53f-b4b1-5e29-b27b-e971fbe85740.yaml => b69609eb-0b27-50bf-86a0-634409e25872.yaml} (87%) rename spec/fixtures/concept_collection_v1/output/localized_concept/{cd5b9b55-4d46-5a17-840d-ac315074c909.yaml => b90879f4-9627-5c09-a660-827b44f4fb24.yaml} (88%) rename spec/fixtures/concept_collection_v1/output/localized_concept/{c8763b71-b695-5117-9309-c7d998f63ad7.yaml => dca5c779-33de-5621-a824-b8054ea26316.yaml} (91%) diff --git a/lib/glossarist/concept.rb b/lib/glossarist/concept.rb index 985e32a..92d49b6 100644 --- a/lib/glossarist/concept.rb +++ b/lib/glossarist/concept.rb @@ -143,6 +143,21 @@ def authoritative_source=(sources) end end + def date_accepted=(date) + date_hash = { + "type" => "accepted", + "date" => date, + } + + @dates ||= [] + @dates << ConceptDate.new(date_hash) + end + + def date_accepted + return nil unless @dates + @dates.find { |date| date.accepted? } + end + def to_h_no_uuid { "data" => { @@ -158,6 +173,9 @@ def to_h_no_uuid "related" => related&.map(&:to_h), "domain" => domain, }.compact, + + "date_accepted" => date_accepted&.date, + }.compact end diff --git a/lib/glossarist/localized_concept.rb b/lib/glossarist/localized_concept.rb index 2308724..55a3843 100644 --- a/lib/glossarist/localized_concept.rb +++ b/lib/glossarist/localized_concept.rb @@ -55,6 +55,8 @@ def to_h_no_uuid # rubocop:disable Metrics/MethodLength, Metrics/AbcSize "review_decision_event" => review_decision_event, }.compact).merge!(@extension_attributes) + hash["status"] = entry_status if entry_status + hash end diff --git a/spec/fixtures/concept_collection_v1/output/concept/09767627-efa4-5d13-9503-b06ba3f18cda.yaml b/spec/fixtures/concept_collection_v1/output/concept/09767627-efa4-5d13-9503-b06ba3f18cda.yaml new file mode 100644 index 0000000..5a288de --- /dev/null +++ b/spec/fixtures/concept_collection_v1/output/concept/09767627-efa4-5d13-9503-b06ba3f18cda.yaml @@ -0,0 +1,6 @@ +--- +data: + identifier: 3.1.1.6 + localized_concepts: + eng: b69609eb-0b27-50bf-86a0-634409e25872 +id: '09767627-efa4-5d13-9503-b06ba3f18cda' diff --git a/spec/fixtures/concept_collection_v1/output/concept/17d42136-6e1f-58ec-8b20-64ec244dfe4c.yaml b/spec/fixtures/concept_collection_v1/output/concept/17d42136-6e1f-58ec-8b20-64ec244dfe4c.yaml new file mode 100644 index 0000000..52b9818 --- /dev/null +++ b/spec/fixtures/concept_collection_v1/output/concept/17d42136-6e1f-58ec-8b20-64ec244dfe4c.yaml @@ -0,0 +1,6 @@ +--- +data: + identifier: 3.1.1.5 + localized_concepts: + eng: 285b90e7-2f7d-586a-bf5b-016dbfcdcf77 +id: 17d42136-6e1f-58ec-8b20-64ec244dfe4c diff --git a/spec/fixtures/concept_collection_v1/output/concept/1c26b632-4bb6-50da-8935-796bdb5fa795.yaml b/spec/fixtures/concept_collection_v1/output/concept/1c26b632-4bb6-50da-8935-796bdb5fa795.yaml deleted file mode 100644 index 31a2d82..0000000 --- a/spec/fixtures/concept_collection_v1/output/concept/1c26b632-4bb6-50da-8935-796bdb5fa795.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -data: - identifier: 3.1.1.2 - localized_concepts: - eng: d74f5f2e-40f2-5fd2-be7e-42af2891a882 -id: 1c26b632-4bb6-50da-8935-796bdb5fa795 diff --git a/spec/fixtures/concept_collection_v1/output/concept/262414b2-bc5c-515e-9f49-824d7303dfc1.yaml b/spec/fixtures/concept_collection_v1/output/concept/262414b2-bc5c-515e-9f49-824d7303dfc1.yaml deleted file mode 100644 index fba999f..0000000 --- a/spec/fixtures/concept_collection_v1/output/concept/262414b2-bc5c-515e-9f49-824d7303dfc1.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -data: - identifier: 3.1.1.4 - localized_concepts: - eng: cd5b9b55-4d46-5a17-840d-ac315074c909 -id: 262414b2-bc5c-515e-9f49-824d7303dfc1 diff --git a/spec/fixtures/concept_collection_v1/output/concept/2be5e463-8e95-5a4d-9796-27fbd9eea33a.yaml b/spec/fixtures/concept_collection_v1/output/concept/2be5e463-8e95-5a4d-9796-27fbd9eea33a.yaml new file mode 100644 index 0000000..9ec56c9 --- /dev/null +++ b/spec/fixtures/concept_collection_v1/output/concept/2be5e463-8e95-5a4d-9796-27fbd9eea33a.yaml @@ -0,0 +1,9 @@ +--- +data: + identifier: 3.1.1.1 + localized_concepts: + eng: 2d05fd15-6c65-501b-b1e2-77389a1efd3a + groups: + - foo + - bar +id: 2be5e463-8e95-5a4d-9796-27fbd9eea33a diff --git a/spec/fixtures/concept_collection_v1/output/concept/3392b98d-4cca-5387-960d-18df47e3b3fb.yaml b/spec/fixtures/concept_collection_v1/output/concept/3392b98d-4cca-5387-960d-18df47e3b3fb.yaml deleted file mode 100644 index db03d11..0000000 --- a/spec/fixtures/concept_collection_v1/output/concept/3392b98d-4cca-5387-960d-18df47e3b3fb.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -data: - identifier: 3.1.1.5 - localized_concepts: - eng: 9ea138b3-decf-5435-a067-2a581c5c663c -id: 3392b98d-4cca-5387-960d-18df47e3b3fb diff --git a/spec/fixtures/concept_collection_v1/output/concept/4268ae1d-fbc6-5ce2-aec9-7b0065b9576d.yaml b/spec/fixtures/concept_collection_v1/output/concept/4268ae1d-fbc6-5ce2-aec9-7b0065b9576d.yaml new file mode 100644 index 0000000..2efabf4 --- /dev/null +++ b/spec/fixtures/concept_collection_v1/output/concept/4268ae1d-fbc6-5ce2-aec9-7b0065b9576d.yaml @@ -0,0 +1,6 @@ +--- +data: + identifier: 3.1.1.2 + localized_concepts: + eng: 6660ed79-d78b-5940-887f-9c86597eed26 +id: 4268ae1d-fbc6-5ce2-aec9-7b0065b9576d diff --git a/spec/fixtures/concept_collection_v1/output/concept/49879506-7988-5a46-b11a-c0368cd820c5.yaml b/spec/fixtures/concept_collection_v1/output/concept/49879506-7988-5a46-b11a-c0368cd820c5.yaml deleted file mode 100644 index 910099e..0000000 --- a/spec/fixtures/concept_collection_v1/output/concept/49879506-7988-5a46-b11a-c0368cd820c5.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -data: - identifier: 3.1.1.3 - localized_concepts: - eng: c8763b71-b695-5117-9309-c7d998f63ad7 -id: 49879506-7988-5a46-b11a-c0368cd820c5 diff --git a/spec/fixtures/concept_collection_v1/output/concept/8c365ead-4e63-5ff7-a709-5fd604ab4619.yaml b/spec/fixtures/concept_collection_v1/output/concept/8c365ead-4e63-5ff7-a709-5fd604ab4619.yaml deleted file mode 100644 index 724c80f..0000000 --- a/spec/fixtures/concept_collection_v1/output/concept/8c365ead-4e63-5ff7-a709-5fd604ab4619.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -data: - identifier: 3.1.1.6 - localized_concepts: - eng: 9c15f53f-b4b1-5e29-b27b-e971fbe85740 -id: 8c365ead-4e63-5ff7-a709-5fd604ab4619 diff --git a/spec/fixtures/concept_collection_v1/output/concept/a7c18f14-095c-51a6-9c60-5219d2937e5a.yaml b/spec/fixtures/concept_collection_v1/output/concept/a7c18f14-095c-51a6-9c60-5219d2937e5a.yaml new file mode 100644 index 0000000..7f76dba --- /dev/null +++ b/spec/fixtures/concept_collection_v1/output/concept/a7c18f14-095c-51a6-9c60-5219d2937e5a.yaml @@ -0,0 +1,6 @@ +--- +data: + identifier: 3.1.1.4 + localized_concepts: + eng: b90879f4-9627-5c09-a660-827b44f4fb24 +id: a7c18f14-095c-51a6-9c60-5219d2937e5a diff --git a/spec/fixtures/concept_collection_v1/output/concept/a83fbbf6-da2a-53b6-877a-6c47cb460448.yaml b/spec/fixtures/concept_collection_v1/output/concept/a83fbbf6-da2a-53b6-877a-6c47cb460448.yaml deleted file mode 100644 index f305622..0000000 --- a/spec/fixtures/concept_collection_v1/output/concept/a83fbbf6-da2a-53b6-877a-6c47cb460448.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -data: - identifier: 3.1.1.1 - localized_concepts: - eng: cb3f57c3-f67f-56b8-a0d2-4d16349ed89b - groups: - - foo - - bar -id: a83fbbf6-da2a-53b6-877a-6c47cb460448 diff --git a/spec/fixtures/concept_collection_v1/output/concept/a9be0faa-aadc-5dbe-8128-f70708ee88cc.yaml b/spec/fixtures/concept_collection_v1/output/concept/a9be0faa-aadc-5dbe-8128-f70708ee88cc.yaml new file mode 100644 index 0000000..324650d --- /dev/null +++ b/spec/fixtures/concept_collection_v1/output/concept/a9be0faa-aadc-5dbe-8128-f70708ee88cc.yaml @@ -0,0 +1,6 @@ +--- +data: + identifier: 3.1.1.3 + localized_concepts: + eng: dca5c779-33de-5621-a824-b8054ea26316 +id: a9be0faa-aadc-5dbe-8128-f70708ee88cc diff --git a/spec/fixtures/concept_collection_v1/output/localized_concept/9ea138b3-decf-5435-a067-2a581c5c663c.yaml b/spec/fixtures/concept_collection_v1/output/localized_concept/285b90e7-2f7d-586a-bf5b-016dbfcdcf77.yaml similarity index 88% rename from spec/fixtures/concept_collection_v1/output/localized_concept/9ea138b3-decf-5435-a067-2a581c5c663c.yaml rename to spec/fixtures/concept_collection_v1/output/localized_concept/285b90e7-2f7d-586a-bf5b-016dbfcdcf77.yaml index 5cbc7e8..de10c40 100644 --- a/spec/fixtures/concept_collection_v1/output/localized_concept/9ea138b3-decf-5435-a067-2a581c5c663c.yaml +++ b/spec/fixtures/concept_collection_v1/output/localized_concept/285b90e7-2f7d-586a-bf5b-016dbfcdcf77.yaml @@ -17,4 +17,5 @@ data: designation: biological_entity language_code: eng entry_status: valid -id: 9ea138b3-decf-5435-a067-2a581c5c663c +status: valid +id: 285b90e7-2f7d-586a-bf5b-016dbfcdcf77 diff --git a/spec/fixtures/concept_collection_v1/output/localized_concept/cb3f57c3-f67f-56b8-a0d2-4d16349ed89b.yaml b/spec/fixtures/concept_collection_v1/output/localized_concept/2d05fd15-6c65-501b-b1e2-77389a1efd3a.yaml similarity index 81% rename from spec/fixtures/concept_collection_v1/output/localized_concept/cb3f57c3-f67f-56b8-a0d2-4d16349ed89b.yaml rename to spec/fixtures/concept_collection_v1/output/localized_concept/2d05fd15-6c65-501b-b1e2-77389a1efd3a.yaml index 769719f..f8c463f 100644 --- a/spec/fixtures/concept_collection_v1/output/localized_concept/cb3f57c3-f67f-56b8-a0d2-4d16349ed89b.yaml +++ b/spec/fixtures/concept_collection_v1/output/localized_concept/2d05fd15-6c65-501b-b1e2-77389a1efd3a.yaml @@ -1,7 +1,7 @@ --- data: dates: - - date: 2008-11-15 00:00:00.000000000 +08:00 + - date: &1 2008-11-15 00:00:00.000000000 +08:00 type: accepted definition: - content: concrete or abstract thing that exists, did exist, or can possibly exist, @@ -21,4 +21,6 @@ data: designation: entity language_code: eng entry_status: valid -id: cb3f57c3-f67f-56b8-a0d2-4d16349ed89b +date_accepted: *1 +status: valid +id: 2d05fd15-6c65-501b-b1e2-77389a1efd3a diff --git a/spec/fixtures/concept_collection_v1/output/localized_concept/d74f5f2e-40f2-5fd2-be7e-42af2891a882.yaml b/spec/fixtures/concept_collection_v1/output/localized_concept/6660ed79-d78b-5940-887f-9c86597eed26.yaml similarity index 89% rename from spec/fixtures/concept_collection_v1/output/localized_concept/d74f5f2e-40f2-5fd2-be7e-42af2891a882.yaml rename to spec/fixtures/concept_collection_v1/output/localized_concept/6660ed79-d78b-5940-887f-9c86597eed26.yaml index 773e1f3..41b92a8 100644 --- a/spec/fixtures/concept_collection_v1/output/localized_concept/d74f5f2e-40f2-5fd2-be7e-42af2891a882.yaml +++ b/spec/fixtures/concept_collection_v1/output/localized_concept/6660ed79-d78b-5940-887f-9c86597eed26.yaml @@ -18,4 +18,5 @@ data: designation: immaterial_entity language_code: eng entry_status: valid -id: d74f5f2e-40f2-5fd2-be7e-42af2891a882 +status: valid +id: 6660ed79-d78b-5940-887f-9c86597eed26 diff --git a/spec/fixtures/concept_collection_v1/output/localized_concept/9c15f53f-b4b1-5e29-b27b-e971fbe85740.yaml b/spec/fixtures/concept_collection_v1/output/localized_concept/b69609eb-0b27-50bf-86a0-634409e25872.yaml similarity index 87% rename from spec/fixtures/concept_collection_v1/output/localized_concept/9c15f53f-b4b1-5e29-b27b-e971fbe85740.yaml rename to spec/fixtures/concept_collection_v1/output/localized_concept/b69609eb-0b27-50bf-86a0-634409e25872.yaml index 71b5cea..e7ac1ad 100644 --- a/spec/fixtures/concept_collection_v1/output/localized_concept/9c15f53f-b4b1-5e29-b27b-e971fbe85740.yaml +++ b/spec/fixtures/concept_collection_v1/output/localized_concept/b69609eb-0b27-50bf-86a0-634409e25872.yaml @@ -17,4 +17,5 @@ data: designation: person language_code: eng entry_status: valid -id: 9c15f53f-b4b1-5e29-b27b-e971fbe85740 +status: valid +id: b69609eb-0b27-50bf-86a0-634409e25872 diff --git a/spec/fixtures/concept_collection_v1/output/localized_concept/cd5b9b55-4d46-5a17-840d-ac315074c909.yaml b/spec/fixtures/concept_collection_v1/output/localized_concept/b90879f4-9627-5c09-a660-827b44f4fb24.yaml similarity index 88% rename from spec/fixtures/concept_collection_v1/output/localized_concept/cd5b9b55-4d46-5a17-840d-ac315074c909.yaml rename to spec/fixtures/concept_collection_v1/output/localized_concept/b90879f4-9627-5c09-a660-827b44f4fb24.yaml index db1b6f5..effb1c3 100644 --- a/spec/fixtures/concept_collection_v1/output/localized_concept/cd5b9b55-4d46-5a17-840d-ac315074c909.yaml +++ b/spec/fixtures/concept_collection_v1/output/localized_concept/b90879f4-9627-5c09-a660-827b44f4fb24.yaml @@ -17,4 +17,5 @@ data: designation: non-biological entity language_code: eng entry_status: valid -id: cd5b9b55-4d46-5a17-840d-ac315074c909 +status: valid +id: b90879f4-9627-5c09-a660-827b44f4fb24 diff --git a/spec/fixtures/concept_collection_v1/output/localized_concept/c8763b71-b695-5117-9309-c7d998f63ad7.yaml b/spec/fixtures/concept_collection_v1/output/localized_concept/dca5c779-33de-5621-a824-b8054ea26316.yaml similarity index 91% rename from spec/fixtures/concept_collection_v1/output/localized_concept/c8763b71-b695-5117-9309-c7d998f63ad7.yaml rename to spec/fixtures/concept_collection_v1/output/localized_concept/dca5c779-33de-5621-a824-b8054ea26316.yaml index fb10446..3f35d3e 100644 --- a/spec/fixtures/concept_collection_v1/output/localized_concept/c8763b71-b695-5117-9309-c7d998f63ad7.yaml +++ b/spec/fixtures/concept_collection_v1/output/localized_concept/dca5c779-33de-5621-a824-b8054ea26316.yaml @@ -19,4 +19,5 @@ data: designation: material entity language_code: eng entry_status: valid -id: c8763b71-b695-5117-9309-c7d998f63ad7 +status: valid +id: dca5c779-33de-5621-a824-b8054ea26316 diff --git a/spec/fixtures/concept_collection_v2/localized_concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml b/spec/fixtures/concept_collection_v2/localized_concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml index e2c5632..a1ee041 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml @@ -24,4 +24,5 @@ data: normative_status: preferred designation: دلالة language_code: ara +date_accepted: '2010-11-01T00:00:00.000Z' id: '081154c5-89d6-5192-8147-373bd6060eaa' diff --git a/spec/fixtures/concept_collection_v2/localized_concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml b/spec/fixtures/concept_collection_v2/localized_concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml index da85b16..1732b4c 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml @@ -29,4 +29,5 @@ data: - type: expression designation: ellipsoidal latitude language_code: eng +date_accepted: '2003-02-15T00:00:00.000Z' id: 27457e38-89b5-5694-8d19-0dd3973ec71d diff --git a/spec/fixtures/concept_collection_v2/localized_concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml b/spec/fixtures/concept_collection_v2/localized_concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml index 6c73ee8..d6bf5ac 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml @@ -23,4 +23,5 @@ data: normative_status: preferred designation: Intension language_code: deu +date_accepted: '2010-11-01T00:00:00.000Z' id: 527bd617-f471-5523-9b98-59bb181f3df8 diff --git a/spec/fixtures/concept_collection_v2/localized_concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml b/spec/fixtures/concept_collection_v2/localized_concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml index 523c1b6..6522f05 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml @@ -23,4 +23,5 @@ data: - type: expression designation: Sistema de Coordenadas Cartesianas language_code: spa +date_accepted: '2015-08-15T00:00:00.000Z' id: becf3892-886d-5dab-8a7c-af303e576a8d diff --git a/spec/fixtures/concept_collection_v2/localized_concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml b/spec/fixtures/concept_collection_v2/localized_concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml index cf2daec..ed8d7f0 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml @@ -24,4 +24,5 @@ data: normative_status: preferred designation: intension language_code: eng +date_accepted: '2010-11-01T00:00:00.000Z' id: bf1691ef-6b21-590a-aef1-9e67ad54378e diff --git a/spec/fixtures/concept_collection_v2/localized_concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml b/spec/fixtures/concept_collection_v2/localized_concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml index 22cf35e..000b5e7 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml @@ -29,4 +29,5 @@ data: - type: expression designation: ellipsoidal latitude language_code: deu +date_accepted: '2003-02-15T00:00:00.000Z' id: c2cc493d-bc21-50a5-96fc-6774f3d53496 diff --git a/spec/fixtures/concept_collection_v2/localized_concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml b/spec/fixtures/concept_collection_v2/localized_concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml index 7589ebd..50cf482 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml @@ -23,4 +23,5 @@ data: - type: expression designation: Cartesian coordinate system language_code: eng +date_accepted: '2015-08-15T00:00:00.000Z' id: c87dfcd1-c38a-55f9-87bd-9da33bfede80 diff --git a/spec/fixtures/concept_collection_v2/localized_concept/da24b782-1551-5128-a043-ba6135a25acf.yaml b/spec/fixtures/concept_collection_v2/localized_concept/da24b782-1551-5128-a043-ba6135a25acf.yaml index 53d51a2..5a2b03a 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/da24b782-1551-5128-a043-ba6135a25acf.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/da24b782-1551-5128-a043-ba6135a25acf.yaml @@ -29,4 +29,5 @@ data: designation: postal address component domain: postal address language_code: eng +date_accepted: '2017-11-15T00:00:00.000Z' id: da24b782-1551-5128-a043-ba6135a25acf diff --git a/spec/fixtures/concept_collection_v2/localized_concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml b/spec/fixtures/concept_collection_v2/localized_concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml index 624c50b..520cdb9 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml @@ -29,4 +29,5 @@ data: - type: expression designation: ellipsoidal latitude language_code: ara +date_accepted: '2003-02-15T00:00:00.000Z' id: e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b diff --git a/spec/fixtures/concept_collection_v2/localized_concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml b/spec/fixtures/concept_collection_v2/localized_concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml index c647974..2721bba 100644 --- a/spec/fixtures/concept_collection_v2/localized_concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml +++ b/spec/fixtures/concept_collection_v2/localized_concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml @@ -26,4 +26,5 @@ data: - type: expression designation: geodætisk bredde language_code: dan +date_accepted: '2003-02-15T00:00:00.000Z' id: eaea6d0f-c655-59c9-98f7-9affbdce7612 diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml index e2c5632..a1ee041 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/081154c5-89d6-5192-8147-373bd6060eaa.yaml @@ -24,4 +24,5 @@ data: normative_status: preferred designation: دلالة language_code: ara +date_accepted: '2010-11-01T00:00:00.000Z' id: '081154c5-89d6-5192-8147-373bd6060eaa' diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml index da85b16..1732b4c 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/27457e38-89b5-5694-8d19-0dd3973ec71d.yaml @@ -29,4 +29,5 @@ data: - type: expression designation: ellipsoidal latitude language_code: eng +date_accepted: '2003-02-15T00:00:00.000Z' id: 27457e38-89b5-5694-8d19-0dd3973ec71d diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml index 6c73ee8..d6bf5ac 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/527bd617-f471-5523-9b98-59bb181f3df8.yaml @@ -23,4 +23,5 @@ data: normative_status: preferred designation: Intension language_code: deu +date_accepted: '2010-11-01T00:00:00.000Z' id: 527bd617-f471-5523-9b98-59bb181f3df8 diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml index 523c1b6..6522f05 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/becf3892-886d-5dab-8a7c-af303e576a8d.yaml @@ -23,4 +23,5 @@ data: - type: expression designation: Sistema de Coordenadas Cartesianas language_code: spa +date_accepted: '2015-08-15T00:00:00.000Z' id: becf3892-886d-5dab-8a7c-af303e576a8d diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml index cf2daec..ed8d7f0 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/bf1691ef-6b21-590a-aef1-9e67ad54378e.yaml @@ -24,4 +24,5 @@ data: normative_status: preferred designation: intension language_code: eng +date_accepted: '2010-11-01T00:00:00.000Z' id: bf1691ef-6b21-590a-aef1-9e67ad54378e diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml index 22cf35e..000b5e7 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/c2cc493d-bc21-50a5-96fc-6774f3d53496.yaml @@ -29,4 +29,5 @@ data: - type: expression designation: ellipsoidal latitude language_code: deu +date_accepted: '2003-02-15T00:00:00.000Z' id: c2cc493d-bc21-50a5-96fc-6774f3d53496 diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml index 7589ebd..50cf482 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/c87dfcd1-c38a-55f9-87bd-9da33bfede80.yaml @@ -23,4 +23,5 @@ data: - type: expression designation: Cartesian coordinate system language_code: eng +date_accepted: '2015-08-15T00:00:00.000Z' id: c87dfcd1-c38a-55f9-87bd-9da33bfede80 diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/da24b782-1551-5128-a043-ba6135a25acf.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/da24b782-1551-5128-a043-ba6135a25acf.yaml index 53d51a2..5a2b03a 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/da24b782-1551-5128-a043-ba6135a25acf.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/da24b782-1551-5128-a043-ba6135a25acf.yaml @@ -29,4 +29,5 @@ data: designation: postal address component domain: postal address language_code: eng +date_accepted: '2017-11-15T00:00:00.000Z' id: da24b782-1551-5128-a043-ba6135a25acf diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml index 624c50b..520cdb9 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b.yaml @@ -29,4 +29,5 @@ data: - type: expression designation: ellipsoidal latitude language_code: ara +date_accepted: '2003-02-15T00:00:00.000Z' id: e4ee4f5c-07b0-577e-8bc0-37e0f98d7a2b diff --git a/spec/fixtures/concept_collection_v2_dashed/localized-concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml b/spec/fixtures/concept_collection_v2_dashed/localized-concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml index c647974..2721bba 100644 --- a/spec/fixtures/concept_collection_v2_dashed/localized-concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml +++ b/spec/fixtures/concept_collection_v2_dashed/localized-concept/eaea6d0f-c655-59c9-98f7-9affbdce7612.yaml @@ -26,4 +26,5 @@ data: - type: expression designation: geodætisk bredde language_code: dan +date_accepted: '2003-02-15T00:00:00.000Z' id: eaea6d0f-c655-59c9-98f7-9affbdce7612