Skip to content

Commit

Permalink
fix: provide registry information by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldtse committed Nov 19, 2024
1 parent e982bdd commit 65e740a
Show file tree
Hide file tree
Showing 40 changed files with 93 additions and 46 deletions.
18 changes: 18 additions & 0 deletions lib/glossarist/concept.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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" => {
Expand All @@ -158,6 +173,9 @@ def to_h_no_uuid
"related" => related&.map(&:to_h),
"domain" => domain,
}.compact,

"date_accepted" => date_accepted&.date,

}.compact
end

Expand Down
2 changes: 2 additions & 0 deletions lib/glossarist/localized_concept.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
data:
identifier: 3.1.1.6
localized_concepts:
eng: b69609eb-0b27-50bf-86a0-634409e25872
id: '09767627-efa4-5d13-9503-b06ba3f18cda'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
data:
identifier: 3.1.1.5
localized_concepts:
eng: 285b90e7-2f7d-586a-bf5b-016dbfcdcf77
id: 17d42136-6e1f-58ec-8b20-64ec244dfe4c

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
data:
identifier: 3.1.1.2
localized_concepts:
eng: 6660ed79-d78b-5940-887f-9c86597eed26
id: 4268ae1d-fbc6-5ce2-aec9-7b0065b9576d

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
data:
identifier: 3.1.1.4
localized_concepts:
eng: b90879f4-9627-5c09-a660-827b44f4fb24
id: a7c18f14-095c-51a6-9c60-5219d2937e5a

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
data:
identifier: 3.1.1.3
localized_concepts:
eng: dca5c779-33de-5621-a824-b8054ea26316
id: a9be0faa-aadc-5dbe-8128-f70708ee88cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 65e740a

Please sign in to comment.