newsmlg2 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/docs.yml +63 -0
  3. data/.github/workflows/links.yml +99 -0
  4. data/.github/workflows/performance.yml +25 -0
  5. data/.github/workflows/rake.yml +19 -0
  6. data/.github/workflows/release.yml +34 -0
  7. data/.gitignore +17 -0
  8. data/.rubocop.yml +51 -0
  9. data/CHANGELOG.md +31 -0
  10. data/CLAUDE.md +77 -0
  11. data/Gemfile +15 -0
  12. data/LICENSE +24 -0
  13. data/README.adoc +135 -0
  14. data/Rakefile +15 -0
  15. data/docs/Gemfile +6 -0
  16. data/docs/_config.yml +4 -0
  17. data/docs/index.md +15 -0
  18. data/docs/lychee.toml +4 -0
  19. data/docs/usage.md +36 -0
  20. data/lib/newsmlg2/base/administrative_metadata_group.rb +40 -0
  21. data/lib/newsmlg2/base/arbitrary_value_attributes.rb +13 -0
  22. data/lib/newsmlg2/base/authority_attributes.rb +14 -0
  23. data/lib/newsmlg2/base/common_power_attributes.rb +17 -0
  24. data/lib/newsmlg2/base/concept_definition_group.rb +25 -0
  25. data/lib/newsmlg2/base/concept_relationships_group.rb +22 -0
  26. data/lib/newsmlg2/base/confirmation_status_attributes.rb +13 -0
  27. data/lib/newsmlg2/base/deprecated_link_attributes.rb +14 -0
  28. data/lib/newsmlg2/base/descriptive_metadata_group.rb +54 -0
  29. data/lib/newsmlg2/base/entity_details_group.rb +28 -0
  30. data/lib/newsmlg2/base/flex_attributes.rb +13 -0
  31. data/lib/newsmlg2/base/i18n_attributes.rb +14 -0
  32. data/lib/newsmlg2/base/item_management_group.rb +59 -0
  33. data/lib/newsmlg2/base/media_content_characteristics1.rb +22 -0
  34. data/lib/newsmlg2/base/news_content_attributes.rb +18 -0
  35. data/lib/newsmlg2/base/news_content_characteristics.rb +30 -0
  36. data/lib/newsmlg2/base/news_content_type_attributes.rb +17 -0
  37. data/lib/newsmlg2/base/persistent_edit_attributes.rb +13 -0
  38. data/lib/newsmlg2/base/qualifying_attributes.rb +13 -0
  39. data/lib/newsmlg2/base/quantify_attributes.rb +13 -0
  40. data/lib/newsmlg2/base/ranking_attributes.rb +13 -0
  41. data/lib/newsmlg2/base/recurrence_rule_attributes.rb +18 -0
  42. data/lib/newsmlg2/base/target_resource_attributes.rb +20 -0
  43. data/lib/newsmlg2/base/time_validity_attributes.rb +13 -0
  44. data/lib/newsmlg2/base.rb +35 -0
  45. data/lib/newsmlg2/builder/node.rb +125 -0
  46. data/lib/newsmlg2/builder.rb +69 -0
  47. data/lib/newsmlg2/catalog.rb +38 -0
  48. data/lib/newsmlg2/catalog_cache.rb +49 -0
  49. data/lib/newsmlg2/catalog_ref.rb +13 -0
  50. data/lib/newsmlg2/catalog_store.rb +66 -0
  51. data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_32.xml +620 -0
  52. data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_33.xml +625 -0
  53. data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_34.xml +626 -0
  54. data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_35.xml +635 -0
  55. data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_36.xml +644 -0
  56. data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_37.xml +661 -0
  57. data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_38.xml +674 -0
  58. data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_39.xml +682 -0
  59. data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_40.xml +724 -0
  60. data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_41.xml +729 -0
  61. data/lib/newsmlg2/configuration.rb +61 -0
  62. data/lib/newsmlg2/document.rb +123 -0
  63. data/lib/newsmlg2/errors.rb +18 -0
  64. data/lib/newsmlg2/i18n.rb +20 -0
  65. data/lib/newsmlg2/items/any_item.rb +180 -0
  66. data/lib/newsmlg2/items/catalog_item.rb +24 -0
  67. data/lib/newsmlg2/items/concept_item.rb +23 -0
  68. data/lib/newsmlg2/items/content_meta.rb +73 -0
  69. data/lib/newsmlg2/items/item_ref.rb +13 -0
  70. data/lib/newsmlg2/items/knowledge_item.rb +68 -0
  71. data/lib/newsmlg2/items/news_item.rb +130 -0
  72. data/lib/newsmlg2/items/news_message.rb +142 -0
  73. data/lib/newsmlg2/items/package_item.rb +82 -0
  74. data/lib/newsmlg2/items/part_meta.rb +68 -0
  75. data/lib/newsmlg2/items/planning_item.rb +160 -0
  76. data/lib/newsmlg2/nar_model.rb +76 -0
  77. data/lib/newsmlg2/nar_namespace.rb +10 -0
  78. data/lib/newsmlg2/nitf_namespace.rb +9 -0
  79. data/lib/newsmlg2/same_as_scheme.rb +15 -0
  80. data/lib/newsmlg2/scheme.rb +30 -0
  81. data/lib/newsmlg2/types/approximate_date_time_prop_type.rb +14 -0
  82. data/lib/newsmlg2/types/bag.rb +16 -0
  83. data/lib/newsmlg2/types/block_types.rb +62 -0
  84. data/lib/newsmlg2/types/concept.rb +36 -0
  85. data/lib/newsmlg2/types/concept_id.rb +17 -0
  86. data/lib/newsmlg2/types/concept_name_type.rb +17 -0
  87. data/lib/newsmlg2/types/content_meta_types.rb +152 -0
  88. data/lib/newsmlg2/types/date_opt_time_prop_type.rb +12 -0
  89. data/lib/newsmlg2/types/date_time_or_null_prop_type.rb +12 -0
  90. data/lib/newsmlg2/types/date_time_prop_type.rb +12 -0
  91. data/lib/newsmlg2/types/event_details.rb +213 -0
  92. data/lib/newsmlg2/types/ext_property.rb +21 -0
  93. data/lib/newsmlg2/types/facet.rb +17 -0
  94. data/lib/newsmlg2/types/flex1_prop_type.rb +32 -0
  95. data/lib/newsmlg2/types/flex_location_prop_type.rb +43 -0
  96. data/lib/newsmlg2/types/flex_party_prop_type.rb +49 -0
  97. data/lib/newsmlg2/types/flex_prop2_type.rb +26 -0
  98. data/lib/newsmlg2/types/flex_prop_type.rb +17 -0
  99. data/lib/newsmlg2/types/geo.rb +92 -0
  100. data/lib/newsmlg2/types/hierarchy_info.rb +17 -0
  101. data/lib/newsmlg2/types/ids.rb +28 -0
  102. data/lib/newsmlg2/types/inline_types.rb +56 -0
  103. data/lib/newsmlg2/types/intl_string_type.rb +17 -0
  104. data/lib/newsmlg2/types/intl_string_type2.rb +14 -0
  105. data/lib/newsmlg2/types/item_management.rb +74 -0
  106. data/lib/newsmlg2/types/link.rb +40 -0
  107. data/lib/newsmlg2/types/object_details.rb +40 -0
  108. data/lib/newsmlg2/types/party_details.rb +258 -0
  109. data/lib/newsmlg2/types/poi.rb +79 -0
  110. data/lib/newsmlg2/types/qcode_prop_type.rb +12 -0
  111. data/lib/newsmlg2/types/qual_prop_type.rb +23 -0
  112. data/lib/newsmlg2/types/qual_rel_prop_type.rb +18 -0
  113. data/lib/newsmlg2/types/related_concept.rb +71 -0
  114. data/lib/newsmlg2/types/rights.rb +84 -0
  115. data/lib/newsmlg2/types/ruby_annotation.rb +55 -0
  116. data/lib/newsmlg2/types/same_as.rb +17 -0
  117. data/lib/newsmlg2/types/truncated_date_time_prop_type.rb +13 -0
  118. data/lib/newsmlg2/types/versioned_string_type.rb +10 -0
  119. data/lib/newsmlg2/types/xml_base.rb +12 -0
  120. data/lib/newsmlg2/types/xml_lang.rb +12 -0
  121. data/lib/newsmlg2/types.rb +166 -0
  122. data/lib/newsmlg2/utils.rb +42 -0
  123. data/lib/newsmlg2/version.rb +5 -0
  124. data/lib/newsmlg2.rb +181 -0
  125. data/lib/tasks/performance.rake +72 -0
  126. data/newsmlg2.gemspec +34 -0
  127. metadata +185 -0
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ # A scheme alias-to-URI mapping, as declared inside a catalog.
5
+ class Scheme < Newsmlg2::NarModel
6
+ include Newsmlg2::Base::CommonPowerAttributes
7
+ include Newsmlg2::Base::AuthorityAttributes
8
+
9
+ xml_attributes :schemecreated, :schememodified, :schemeretired,
10
+ alias_attr: 'alias', uri: 'uri'
11
+ xml_element :same_as_schemes, xml: 'sameAsScheme',
12
+ type: Newsmlg2::SameAsScheme, collection: true
13
+ xml_element :names, xml: 'name',
14
+ type: Newsmlg2::Types::ConceptNameType, collection: true
15
+ xml_element :definitions, xml: 'definition',
16
+ type: Newsmlg2::Types::Definition, collection: true
17
+ xml_element :notes, xml: 'note',
18
+ type: Newsmlg2::Types::Note, collection: true
19
+ xml_element :same_as, xml: 'sameAs',
20
+ type: Newsmlg2::Types::SameAs, collection: true
21
+
22
+ xml do
23
+ element 'scheme'
24
+ end
25
+
26
+ def to_s
27
+ "#{names.first} (#{alias_attr}, #{uri})"
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Types
5
+ # Property carrying an approximate date-time as content, with an optional
6
+ # approximation range.
7
+ class ApproximateDateTimePropType < Newsmlg2::NarModel
8
+ include Newsmlg2::Base::CommonPowerAttributes
9
+
10
+ xml_attributes :approxstart, :approxend
11
+ xml_content
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Types
5
+ # A group of existing concepts which express a new concept.
6
+ class Bag < QCodePropType
7
+ include Newsmlg2::Base::QuantifyAttributes
8
+
9
+ xml_attributes :type, :typeuri, :significance
10
+
11
+ xml do
12
+ element 'bag'
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Types
5
+ # The PCL-type for information about the content as a natural language
6
+ # string with minimal markup. Mixed content.
7
+ class Label1Type < Newsmlg2::NarModel
8
+ include Newsmlg2::Base::CommonPowerAttributes
9
+ include Newsmlg2::Base::I18NAttributes
10
+
11
+ xml_attributes :role, :roleuri, :media
12
+ xml_element :anchors, xml: 'a', type: Newsmlg2::Types::A, collection: true
13
+ xml_element :spans, xml: 'span', type: Newsmlg2::Types::Span, collection: true
14
+ xml_element :rubies, xml: 'ruby', type: Newsmlg2::Types::Ruby, collection: true
15
+ xml_element :inlines, xml: 'inline', type: Newsmlg2::Types::Inline, collection: true
16
+
17
+ xml_content(collection: true)
18
+
19
+ def to_s
20
+ Array(text).join.strip
21
+ end
22
+ end
23
+
24
+ # Natural-language content with minimal markup and line breaks.
25
+ # Mixed content.
26
+ class BlockType < Newsmlg2::NarModel
27
+ include Newsmlg2::Base::CommonPowerAttributes
28
+ include Newsmlg2::Base::I18NAttributes
29
+
30
+ xml_attributes :media, :role, :roleuri
31
+ xml_element :anchors, xml: 'a', type: Newsmlg2::Types::A, collection: true
32
+ xml_element :spans, xml: 'span', type: Newsmlg2::Types::Span, collection: true
33
+ xml_element :rubies, xml: 'ruby', type: Newsmlg2::Types::Ruby, collection: true
34
+ xml_element :brs, xml: 'br', type: Newsmlg2::Types::Br, collection: true
35
+ xml_element :inlines, xml: 'inline', type: Newsmlg2::Types::Inline, collection: true
36
+
37
+ xml_content(collection: true)
38
+
39
+ def to_s
40
+ Array(text).join.strip
41
+ end
42
+ end
43
+
44
+ # A natural language definition of the semantics of a concept.
45
+ class Definition < BlockType
46
+ include Newsmlg2::Base::TimeValidityAttributes
47
+
48
+ xml do
49
+ element 'definition'
50
+ end
51
+ end
52
+
53
+ # Additional natural language information about a concept.
54
+ class Note < BlockType
55
+ include Newsmlg2::Base::TimeValidityAttributes
56
+
57
+ xml do
58
+ element 'note'
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Types
5
+ # A set of properties defining a concept.
6
+ class Concept < Newsmlg2::NarModel
7
+ include Newsmlg2::Base::CommonPowerAttributes
8
+ include Newsmlg2::Base::I18NAttributes
9
+
10
+ xml_element :concept_id, xml: 'conceptId',
11
+ type: Newsmlg2::Types::ConceptId
12
+ xml_element :type, xml: 'type', type: Newsmlg2::Types::ConceptType
13
+ xml_element :names, xml: 'name',
14
+ type: Newsmlg2::Types::ConceptNameType, collection: true
15
+ xml_element :definitions, xml: 'definition',
16
+ type: Newsmlg2::Types::Definition, collection: true
17
+ xml_element :notes, xml: 'note',
18
+ type: Newsmlg2::Types::Note, collection: true
19
+ xml_element :facets, xml: 'facet',
20
+ type: Newsmlg2::Types::Facet, collection: true
21
+ xml_element :remote_infos, xml: 'remoteInfo',
22
+ type: Newsmlg2::Types::RemoteInfo, collection: true
23
+ xml_element :hierarchy_infos, xml: 'hierarchyInfo',
24
+ type: Newsmlg2::Types::HierarchyInfo, collection: true
25
+ include Newsmlg2::Base::ConceptRelationshipsGroup
26
+ include Newsmlg2::Base::EntityDetailsGroup
27
+
28
+ xml_element :concept_ext_property, xml: 'conceptExtProperty',
29
+ type: Newsmlg2::Types::Flex2ExtPropType
30
+
31
+ xml do
32
+ element 'concept'
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Types
5
+ # The preferred unambiguous identifier for a concept.
6
+ class ConceptIdType < QCodePropType
7
+ xml_attributes :created, :retired
8
+ end
9
+
10
+ # Serialized as the "conceptId" element.
11
+ class ConceptId < ConceptIdType
12
+ xml do
13
+ element 'conceptId'
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Types
5
+ # A natural-language name of a concept, with validity period and
6
+ # role/part refinements. Serialized as the "name" element.
7
+ class ConceptNameType < IntlStringType
8
+ include Newsmlg2::Base::TimeValidityAttributes
9
+
10
+ xml_attributes :role, :roleuri, :part, :parturi
11
+
12
+ xml do
13
+ element 'name'
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,152 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Types
5
+ # The editorial urgency of the content (1-9), as scoped by the parent
6
+ # element.
7
+ class Urgency < Newsmlg2::NarModel
8
+ include Newsmlg2::Base::CommonPowerAttributes
9
+
10
+ xml_content
11
+
12
+ xml do
13
+ element 'urgency'
14
+ end
15
+ end
16
+
17
+ # Indicates the source type from which the content was created.
18
+ class DigitalSourceType < FlexPropType
19
+ end
20
+
21
+ # An iconic visual identification of the content.
22
+ class Icon < Newsmlg2::NarModel
23
+ include Newsmlg2::Base::CommonPowerAttributes
24
+ include Newsmlg2::Base::TargetResourceAttributes
25
+ include Newsmlg2::Base::MediaContentCharacteristics1
26
+
27
+ xml_attributes :rendition, :renditionuri
28
+
29
+ xml do
30
+ element 'icon'
31
+ end
32
+ end
33
+
34
+ # The type covering all qualifiers for an audience property.
35
+ class AudienceType < Flex1PropType
36
+ include Newsmlg2::Base::QuantifyAttributes
37
+
38
+ xml_attributes :significance
39
+ end
40
+
41
+ # An intended audience for the content.
42
+ class Audience < AudienceType
43
+ end
44
+
45
+ # An excluded audience for the content.
46
+ class ExclAudience < AudienceType
47
+ end
48
+
49
+ # Expresses the rating of the content of this item by a party.
50
+ class Rating < Newsmlg2::NarModel
51
+ include Newsmlg2::Base::CommonPowerAttributes
52
+
53
+ xml_attributes(
54
+ :value, :valcalctype, :valcalctypeuri,
55
+ :scalemin, :scalemax, :scaleunit, :scaleunituri,
56
+ :raters, :ratertype, :ratertypeuri, :ratingtype, :ratingtypeuri
57
+ )
58
+ end
59
+
60
+ # Reflects a specific kind of user interaction with the content.
61
+ class UserInteraction < Newsmlg2::NarModel
62
+ include Newsmlg2::Base::CommonPowerAttributes
63
+
64
+ xml_attributes :interactions, :interactiontype, :interactiontypeuri
65
+ end
66
+
67
+ # A name for a concept assigned as property value of a language.
68
+ class LanguageName < IntlStringType
69
+ end
70
+
71
+ # A language used by the news content.
72
+ class Language < Newsmlg2::NarModel
73
+ include Newsmlg2::Base::CommonPowerAttributes
74
+ include Newsmlg2::Base::RankingAttributes
75
+
76
+ xml_attributes :tag, :role, :roleuri
77
+
78
+ xml_element :names, xml: 'name',
79
+ type: Newsmlg2::Types::LanguageName, collection: true
80
+
81
+ xml do
82
+ element 'language'
83
+ end
84
+ end
85
+
86
+ # A nature, intellectual or journalistic form of the content.
87
+ class Genre < Flex1ConceptPropType
88
+ include Newsmlg2::Base::RankingAttributes
89
+ end
90
+
91
+ # Free-text term for indexing or finding the content.
92
+ class Keyword < IntlStringType
93
+ include Newsmlg2::Base::RankingAttributes
94
+
95
+ xml_attributes :role, :roleuri, :confidence, :relevance
96
+
97
+ xml do
98
+ element 'keyword'
99
+ end
100
+ end
101
+
102
+ # An important topic of the content; what the content is about.
103
+ class Subject < Flex1ConceptPropType
104
+ include Newsmlg2::Base::RankingAttributes
105
+ end
106
+
107
+ # A sequence of tokens associated with the content.
108
+ class Slugline < IntlStringType
109
+ include Newsmlg2::Base::RankingAttributes
110
+
111
+ xml_attributes :separator, :role, :roleuri, :confidence, :relevance
112
+
113
+ xml do
114
+ element 'slugline'
115
+ end
116
+ end
117
+
118
+ # A brief and snappy introduction to the content.
119
+ class Headline < Label1Type
120
+ include Newsmlg2::Base::RankingAttributes
121
+
122
+ xml_attributes :confidence, :relevance
123
+
124
+ xml do
125
+ element 'headline'
126
+ end
127
+ end
128
+
129
+ # A natural-language statement of the date and/or place of creation of
130
+ # the content.
131
+ class Dateline < Label1Type
132
+ include Newsmlg2::Base::RankingAttributes
133
+ end
134
+
135
+ # A natural-language statement about the creator of the content.
136
+ class By < Label1Type
137
+ include Newsmlg2::Base::RankingAttributes
138
+ end
139
+
140
+ # A free-form expression of the credit(s) for the content.
141
+ class Creditline < IntlStringType
142
+ include Newsmlg2::Base::RankingAttributes
143
+ end
144
+
145
+ # A free-form textual description of the content of the item.
146
+ class ContentDescription < BlockType
147
+ include Newsmlg2::Base::RankingAttributes
148
+
149
+ xml_attributes :confidence, :relevance
150
+ end
151
+ end
152
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Types
5
+ # Property carrying a date with an optional time part as content.
6
+ class DateOptTimePropType < Newsmlg2::NarModel
7
+ include Newsmlg2::Base::CommonPowerAttributes
8
+
9
+ xml_content
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Types
5
+ # Property carrying a date-time or an empty string as content.
6
+ class DateTimeOrNullPropType < Newsmlg2::NarModel
7
+ include Newsmlg2::Base::CommonPowerAttributes
8
+
9
+ xml_content
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Types
5
+ # Property carrying an xsd:dateTime as element content.
6
+ class DateTimePropType < Newsmlg2::NarModel
7
+ include Newsmlg2::Base::CommonPowerAttributes
8
+
9
+ xml_content
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,213 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Types
5
+ # Explicit dates of recurrence.
6
+ class RDate < DateOptTimePropType
7
+ xml do
8
+ element 'rDate'
9
+ end
10
+ end
11
+
12
+ # Rule for recurrence.
13
+ class RRule < Newsmlg2::NarModel
14
+ include Newsmlg2::Base::CommonPowerAttributes
15
+ include Newsmlg2::Base::RecurrenceRuleAttributes
16
+
17
+ xml do
18
+ element 'rRule'
19
+ end
20
+ end
21
+
22
+ # Explicit dates to be excluded from any recurrence.
23
+ class ExDate < DateOptTimePropType
24
+ xml do
25
+ element 'exDate'
26
+ end
27
+ end
28
+
29
+ # Rule for dates to be excluded from recurrence.
30
+ class ExRule < Newsmlg2::NarModel
31
+ include Newsmlg2::Base::CommonPowerAttributes
32
+ include Newsmlg2::Base::RecurrenceRuleAttributes
33
+
34
+ xml do
35
+ element 'exRule'
36
+ end
37
+ end
38
+
39
+ # The date the event commences.
40
+ class Start < ApproximateDateTimePropType
41
+ include Newsmlg2::Base::ConfirmationStatusAttributes
42
+ end
43
+
44
+ # The date the event ends.
45
+ class End < ApproximateDateTimePropType
46
+ include Newsmlg2::Base::ConfirmationStatusAttributes
47
+ end
48
+
49
+ # The period the event will last (xsd:duration value as content).
50
+ class EventDuration < Newsmlg2::NarModel
51
+ include Newsmlg2::Base::CommonPowerAttributes
52
+ include Newsmlg2::Base::ConfirmationStatusAttributes
53
+
54
+ xml_content
55
+ end
56
+
57
+ # DEPRECATED since 2.24: use confirmationstatus attributes instead.
58
+ class Confirmation < QCodePropType
59
+ end
60
+
61
+ # All dates pertaining to the event.
62
+ class Dates < Newsmlg2::NarModel
63
+ include Newsmlg2::Base::CommonPowerAttributes
64
+
65
+ xml_element :start, xml: 'start', type: Newsmlg2::Types::Start
66
+ xml_element :end, xml: 'end', type: Newsmlg2::Types::End
67
+ xml_element :duration, xml: 'duration', type: Newsmlg2::Types::EventDuration
68
+ xml_element :rdates, xml: 'rDate', type: Newsmlg2::Types::RDate, collection: true
69
+ xml_element :rrules, xml: 'rRule', type: Newsmlg2::Types::RRule, collection: true
70
+ xml_element :exdates, xml: 'exDate', type: Newsmlg2::Types::ExDate, collection: true
71
+ xml_element :exrules, xml: 'exRule', type: Newsmlg2::Types::ExRule, collection: true
72
+ xml_element :confirmation, xml: 'confirmation',
73
+ type: Newsmlg2::Types::Confirmation
74
+
75
+ xml do
76
+ element 'dates'
77
+ end
78
+ end
79
+
80
+ # Indicates the certainty of the occurrence of the event.
81
+ class OccurStatus < QualPropType
82
+ end
83
+
84
+ # The planning of the news coverage of the event.
85
+ class NewsCoverageStatus < QualPropType
86
+ end
87
+
88
+ # How and when to register for the event.
89
+ class Registration < BlockType
90
+ end
91
+
92
+ # Indication of the accessibility of the event.
93
+ class AccessStatus < QualPropType
94
+ end
95
+
96
+ # A requirement for participating in the event.
97
+ class ParticipationRequirement < Flex1PropType
98
+ xml_attributes :role, :roleuri
99
+ end
100
+
101
+ # A subject covered by the event.
102
+ class EventDetailsSubject < Flex1ConceptPropType
103
+ end
104
+
105
+ # A location (geographical area or point of interest) where the event
106
+ # takes place.
107
+ class EventDetailsLocation < FlexLocationPropType
108
+ xml_attributes :role, :roleuri
109
+ end
110
+
111
+ # A person or organisation participating in the event.
112
+ class Participant < Flex1PartyPropType
113
+ end
114
+
115
+ # A person or organisation organising the event.
116
+ class Organiser < Flex1PartyPropType
117
+ end
118
+
119
+ # Legacy structured information about intended coverage, scoped to an
120
+ # event (the planning-item NewsCoverage is the modern form).
121
+ class EventNewsCoverage < Newsmlg2::NarModel
122
+ include Newsmlg2::Base::CommonPowerAttributes
123
+
124
+ xml_element :g2content_type, xml: 'g2contentType',
125
+ type: Newsmlg2::G2ContentType
126
+ xml_element :item_class, xml: 'itemClass',
127
+ type: Newsmlg2::Types::QualRelPropType
128
+ xml_element :assigned_to, xml: 'assignedTo',
129
+ type: Newsmlg2::AssignedTo, collection: true
130
+ xml_element :scheduled, xml: 'scheduled',
131
+ type: Newsmlg2::Scheduled
132
+ xml_element :services, xml: 'service',
133
+ type: Newsmlg2::Types::QualPropType, collection: true
134
+ xml_element :ed_notes, xml: 'edNote',
135
+ type: Newsmlg2::Types::BlockType, collection: true
136
+ include Newsmlg2::Base::DescriptiveMetadataGroup
137
+
138
+ xml_attributes :role, :roleuri
139
+ end
140
+
141
+ # A set of properties with details about an event.
142
+ class EventDetails < Newsmlg2::NarModel
143
+ include Newsmlg2::Base::CommonPowerAttributes
144
+
145
+ xml_element :dates, xml: 'dates', type: Newsmlg2::Types::Dates
146
+ xml_element :occur_status, xml: 'occurStatus',
147
+ type: Newsmlg2::Types::OccurStatus
148
+ xml_element :news_coverage_status, xml: 'newsCoverageStatus',
149
+ type: Newsmlg2::Types::NewsCoverageStatus
150
+ xml_element :registrations, xml: 'registration',
151
+ type: Newsmlg2::Types::Registration, collection: true
152
+ xml_element :keywords, xml: 'keyword',
153
+ type: Newsmlg2::Types::Keyword, collection: true
154
+ xml_element :access_statuses, xml: 'accessStatus',
155
+ type: Newsmlg2::Types::AccessStatus, collection: true
156
+ xml_element :participation_requirements, xml: 'participationRequirement',
157
+ type: Newsmlg2::Types::ParticipationRequirement, collection: true
158
+ xml_element :subjects, xml: 'subject',
159
+ type: Newsmlg2::Types::EventDetailsSubject, collection: true
160
+ xml_element :locations, xml: 'location',
161
+ type: Newsmlg2::Types::EventDetailsLocation, collection: true
162
+ xml_element :participants, xml: 'participant',
163
+ type: Newsmlg2::Types::Participant, collection: true
164
+ xml_element :organisers, xml: 'organiser',
165
+ type: Newsmlg2::Types::Organiser, collection: true
166
+ xml_element :contact_infos, xml: 'contactInfo',
167
+ type: Newsmlg2::Types::ContactInfoType, collection: true
168
+ xml_element :languages, xml: 'language',
169
+ type: Newsmlg2::Types::Language, collection: true
170
+ xml_element :news_coverages, xml: 'newsCoverage',
171
+ type: Newsmlg2::Types::EventNewsCoverage, collection: true
172
+
173
+ xml do
174
+ element 'eventDetails'
175
+ end
176
+ end
177
+
178
+ # Structured information about an event without a concept identifier,
179
+ # used only with News Items.
180
+ class Event < Newsmlg2::NarModel
181
+ include Newsmlg2::Base::CommonPowerAttributes
182
+
183
+ xml_element :names, xml: 'name',
184
+ type: Newsmlg2::Types::ConceptNameType, collection: true
185
+ xml_element :definitions, xml: 'definition',
186
+ type: Newsmlg2::Types::Definition, collection: true
187
+ xml_element :notes, xml: 'note',
188
+ type: Newsmlg2::Types::Note, collection: true
189
+ xml_element :facets, xml: 'facet',
190
+ type: Newsmlg2::Types::Facet, collection: true
191
+ include Newsmlg2::Base::ConceptRelationshipsGroup
192
+
193
+ xml_element :event_details, xml: 'eventDetails',
194
+ type: Newsmlg2::Types::EventDetails
195
+
196
+ xml do
197
+ element 'event'
198
+ end
199
+ end
200
+
201
+ # A wrapper for events in a News Item.
202
+ class Events < Newsmlg2::NarModel
203
+ include Newsmlg2::Base::CommonPowerAttributes
204
+
205
+ xml_element :events, xml: 'event',
206
+ type: Newsmlg2::Types::Event, collection: true
207
+
208
+ xml do
209
+ element 'events'
210
+ end
211
+ end
212
+ end
213
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Types
5
+ # Flexible generic PCL-type for controlled, uncontrolled and arbitrary
6
+ # values (extension property base).
7
+ class Flex1ExtPropType < Flex1PropType
8
+ include Newsmlg2::Base::ArbitraryValueAttributes
9
+ end
10
+
11
+ # Flexible generic PCL-type for controlled, uncontrolled and arbitrary
12
+ # values, with a mandatory relationship. All per-parent "ext property"
13
+ # elements (itemMetaExtProperty, rightsInfoExtProperty, …) use this type;
14
+ # their element names are declared at the usage site.
15
+ class Flex2ExtPropType < Flex1ExtPropType
16
+ include Newsmlg2::Base::TimeValidityAttributes
17
+
18
+ xml_attributes :rel, :reluri
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Types
5
+ # An intrinsic property of a concept (deprecated since NAR 1.8; use
6
+ # "related" instead).
7
+ class Facet < FlexPropType
8
+ include Newsmlg2::Base::TimeValidityAttributes
9
+
10
+ xml_attributes :rel, :reluri, :g2flag
11
+
12
+ xml do
13
+ element 'facet'
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Types
5
+ # Flexible generic PCL-type for both controlled and uncontrolled values,
6
+ # carrying a full concept definition and concept relationships.
7
+ class Flex1PropType < Newsmlg2::NarModel
8
+ include Newsmlg2::Base::CommonPowerAttributes
9
+ include Newsmlg2::Base::FlexAttributes
10
+ include Newsmlg2::Base::I18NAttributes
11
+ include Newsmlg2::Base::ConceptDefinitionGroup
12
+ include Newsmlg2::Base::ConceptRelationshipsGroup
13
+ end
14
+
15
+ # Flex1PropType with a role refinement.
16
+ class Flex1RolePropType < Flex1PropType
17
+ xml_attributes :role, :roleuri
18
+ end
19
+
20
+ # Flexible generic PCL-type for controlled and uncontrolled values, with
21
+ # optional quantifiers and faceted-concept children.
22
+ class Flex1ConceptPropType < Flex1PropType
23
+ include Newsmlg2::Base::QuantifyAttributes
24
+
25
+ xml_element :bag, type: Newsmlg2::Types::Bag
26
+ xml_element :main_concept, xml: 'mainConcept',
27
+ type: Newsmlg2::Types::MainConcept
28
+ xml_element :facet_concepts, xml: 'facetConcept',
29
+ type: Newsmlg2::Types::FacetConcept, collection: true
30
+ end
31
+ end
32
+ end