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
data/docs/usage.md ADDED
@@ -0,0 +1,36 @@
1
+ # Usage
2
+
3
+ ## Parsing
4
+
5
+ ```ruby
6
+ require "newsmlg2"
7
+
8
+ doc = Newsmlg2.parse_file("newsitem.xml")
9
+ doc.item # typed item, e.g. Newsmlg2::NewsItem
10
+ doc.item.item_meta.item_class.qcode
11
+ ```
12
+
13
+ ## Catalogs and qcodes
14
+
15
+ ```ruby
16
+ doc.catalog_store.get_scheme_for_alias("ninat").uri
17
+ Newsmlg2.qcode_to_uri("ninat:text", doc)
18
+ Newsmlg2.uri_to_qcode("http://cv.iptc.org/newscodes/ninature/text", doc)
19
+ ```
20
+
21
+ ## Builder DSL
22
+
23
+ ```ruby
24
+ Newsmlg2.build_news_item(guid: "...", lang: "en-GB") do |item|
25
+ item.item_meta do |meta|
26
+ meta.item_class qcode: "ninat:text"
27
+ meta.version_created "2026-08-30T12:00:00+00:00"
28
+ end
29
+ end.to_xml
30
+ ```
31
+
32
+ ## Serialization
33
+
34
+ ```ruby
35
+ doc.to_xml # XML declaration + canonical output
36
+ ```
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ # A group of properties associated with the administrative facet of
6
+ # content (contentmeta.py).
7
+ module AdministrativeMetadataGroup
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ xml_element :urgency, xml: 'urgency',
11
+ type: Newsmlg2::Types::Urgency
12
+ xml_element :content_created, xml: 'contentCreated',
13
+ type: Newsmlg2::Types::TruncatedDateTimePropType
14
+ xml_element :content_modified, xml: 'contentModified',
15
+ type: Newsmlg2::Types::TruncatedDateTimePropType
16
+ xml_element :digital_source_type, xml: 'digitalSourceType',
17
+ type: Newsmlg2::Types::DigitalSourceType
18
+ xml_element :located, xml: 'located',
19
+ type: Newsmlg2::Types::FlexLocationPropType, collection: true
20
+ xml_element :info_sources, xml: 'infoSource',
21
+ type: Newsmlg2::Types::Flex1PartyPropType, collection: true
22
+ xml_element :creators, xml: 'creator',
23
+ type: Newsmlg2::Types::FlexAuthorPropType, collection: true
24
+ xml_element :contributors, xml: 'contributor',
25
+ type: Newsmlg2::Types::FlexAuthorPropType, collection: true
26
+ xml_element :audiences, xml: 'audience',
27
+ type: Newsmlg2::Types::Audience, collection: true
28
+ xml_element :excl_audiences, xml: 'exclaudience',
29
+ type: Newsmlg2::Types::ExclAudience, collection: true
30
+ xml_element :alt_ids, xml: 'altId',
31
+ type: Newsmlg2::Types::AltId, collection: true
32
+ xml_element :ratings, xml: 'rating',
33
+ type: Newsmlg2::Types::Rating, collection: true
34
+ xml_element :user_interactions, xml: 'userInteraction',
35
+ type: Newsmlg2::Types::UserInteraction, collection: true
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ module ArbitraryValueAttributes
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ xml_attributes :value, :valuedatatype, :valueunit, :valueunituri
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ # Added in NewsML-G2 2.32.
6
+ module AuthorityAttributes
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ xml_attributes :authority, :authoritystatus, :authoritystatusuri
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ module CommonPowerAttributes
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ xml_attributes(
9
+ :id, :creator, :creatoruri, :modified, :custom,
10
+ :how, :howuri, :why, :whyuri,
11
+ :pubconstraint, :pubconstrainturi
12
+ )
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ # A group of properties required to define a concept (concepts.py).
6
+ module ConceptDefinitionGroup
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ xml_element :names, xml: 'name',
10
+ type: Newsmlg2::Types::ConceptNameType, collection: true
11
+ xml_element :definitions, xml: 'definition',
12
+ type: Newsmlg2::Types::Definition, collection: true
13
+ xml_element :notes, xml: 'note',
14
+ type: Newsmlg2::Types::Note, collection: true
15
+ xml_element :facets, xml: 'facet',
16
+ type: Newsmlg2::Types::Facet, collection: true
17
+ xml_element :remote_infos, xml: 'remoteInfo',
18
+ type: Newsmlg2::Types::RemoteInfo, collection: true
19
+ xml_element :hierarchy_infos, xml: 'hierarchyInfo',
20
+ type: Newsmlg2::Types::HierarchyInfo, collection: true
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ # A group of properties expressing relationships between concepts
6
+ # (conceptrelationships.py).
7
+ module ConceptRelationshipsGroup
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ xml_element :same_as, xml: 'sameAs',
11
+ type: Newsmlg2::Types::SameAs, collection: true
12
+ xml_element :broader, xml: 'broader',
13
+ type: Newsmlg2::Types::Broader, collection: true
14
+ xml_element :narrower, xml: 'narrower',
15
+ type: Newsmlg2::Types::Narrower, collection: true
16
+ xml_element :related, xml: 'related',
17
+ type: Newsmlg2::Types::Related, collection: true
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ module ConfirmationStatusAttributes
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ xml_attributes :confirmationstatus, :confirmationstatusuri
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ # Deprecated attributes once used for target identifiers (link.py).
6
+ module DeprecatedLinkAttributes
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ xml_attributes :guidref, :hreftype
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ # A group of properties associated with the full descriptive facet of
6
+ # news-related content (contentmeta.py).
7
+ module DescriptiveMetadataGroup
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ xml_element :languages, xml: 'language',
11
+ type: Newsmlg2::Types::Language, collection: true
12
+ xml_element :genres, xml: 'genre',
13
+ type: Newsmlg2::Types::Genre, collection: true
14
+ xml_element :keywords, xml: 'keyword',
15
+ type: Newsmlg2::Types::Keyword, collection: true
16
+ xml_element :subjects, xml: 'subject',
17
+ type: Newsmlg2::Types::Subject, collection: true
18
+ xml_element :sluglines, xml: 'slugline',
19
+ type: Newsmlg2::Types::Slugline, collection: true
20
+ xml_element :headlines, xml: 'headline',
21
+ type: Newsmlg2::Types::Headline, collection: true
22
+ xml_element :datelines, xml: 'dateline',
23
+ type: Newsmlg2::Types::Dateline, collection: true
24
+ xml_element :by, xml: 'by', type: Newsmlg2::Types::By, collection: true
25
+ xml_element :creditlines, xml: 'creditline',
26
+ type: Newsmlg2::Types::Creditline, collection: true
27
+ xml_element :descriptions, xml: 'description',
28
+ type: Newsmlg2::Types::ContentDescription, collection: true
29
+ end
30
+ end
31
+ end
32
+
33
+ # The core subset of the descriptive facet (no genre, dateline, by,
34
+ # creditline) — used by concept, knowledge, planning and catalog items.
35
+ module DescriptiveMetadataCoreGroup
36
+ def self.included(klass)
37
+ klass.class_eval do
38
+ xml_element :languages, xml: 'language',
39
+ type: Newsmlg2::Types::Language, collection: true
40
+ xml_element :keywords, xml: 'keyword',
41
+ type: Newsmlg2::Types::Keyword, collection: true
42
+ xml_element :subjects, xml: 'subject',
43
+ type: Newsmlg2::Types::Subject, collection: true
44
+ xml_element :sluglines, xml: 'slugline',
45
+ type: Newsmlg2::Types::Slugline, collection: true
46
+ xml_element :headlines, xml: 'headline',
47
+ type: Newsmlg2::Types::Headline, collection: true
48
+ xml_element :descriptions, xml: 'description',
49
+ type: Newsmlg2::Types::ContentDescription, collection: true
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ # A group of properties defining the details of specific entities
6
+ # (concepts.py EntityDetailsGroup).
7
+ module EntityDetailsGroup
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ xml_element :has_instruments, xml: 'hasInstrument',
11
+ type: Newsmlg2::Types::HasInstrument, collection: true
12
+ xml_element :person_details, xml: 'personDetails',
13
+ type: Newsmlg2::Types::PersonDetails
14
+ xml_element :organisation_details, xml: 'organisationDetails',
15
+ type: Newsmlg2::Types::OrganisationDetails
16
+ xml_element :geo_area_details, xml: 'geoAreaDetails',
17
+ type: Newsmlg2::Types::GeoAreaDetails
18
+ xml_element :poi_details, xml: 'POIDetails',
19
+ type: Newsmlg2::Types::POIDetails
20
+ xml_element :object_details, xml: 'objectDetails',
21
+ type: Newsmlg2::Types::ObjectDetails
22
+ xml_element :event_details, xml: 'eventDetails',
23
+ type: Newsmlg2::Types::EventDetails
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ module FlexAttributes
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ xml_attributes :qcode, :uri, :literal, :type, :typeuri
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ module I18NAttributes
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ xml_lang_attribute
9
+ xml_attributes :dir
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ # A group of properties for the management of the item
6
+ # (itemmanagement.py / XSD ItemManagementGroup). Element order follows the
7
+ # XSD sequence.
8
+ module ItemManagementGroup
9
+ def self.included(klass)
10
+ klass.class_eval do
11
+ xml_element :item_class, xml: 'itemClass',
12
+ type: Newsmlg2::Types::QualRelPropType
13
+ xml_element :provider, xml: 'provider',
14
+ type: Newsmlg2::Types::FlexPartyPropType
15
+ xml_element :version_created, xml: 'versionCreated',
16
+ type: Newsmlg2::Types::DateTimePropType
17
+ xml_element :first_created, xml: 'firstCreated',
18
+ type: Newsmlg2::Types::DateTimePropType
19
+ xml_element :embargoed, xml: 'embargoed',
20
+ type: Newsmlg2::Types::DateTimeOrNullPropType
21
+ xml_element :pub_status, xml: 'pubStatus',
22
+ type: Newsmlg2::Types::QualPropType
23
+ xml_element :role, xml: 'role', type: Newsmlg2::Types::QualPropType
24
+ xml_element :file_name, xml: 'fileName', type: Newsmlg2::Types::FileName
25
+ xml_element :generators, xml: 'generator',
26
+ type: Newsmlg2::Types::Generator, collection: true
27
+ xml_element :profile, xml: 'profile',
28
+ type: Newsmlg2::Types::VersionedStringType
29
+ xml_element :services, xml: 'service',
30
+ type: Newsmlg2::Types::QualPropType, collection: true
31
+ xml_element :titles, xml: 'title',
32
+ type: Newsmlg2::Types::Label1Type, collection: true
33
+ xml_element :ed_notes, xml: 'edNote',
34
+ type: Newsmlg2::Types::BlockType, collection: true
35
+ xml_element :member_of, xml: 'memberOf',
36
+ type: Newsmlg2::Types::Flex1PropType, collection: true
37
+ xml_element :instance_of, xml: 'instanceOf',
38
+ type: Newsmlg2::Types::Flex1PropType, collection: true
39
+ xml_element :signals, xml: 'signal',
40
+ type: Newsmlg2::Types::Signal, collection: true
41
+ xml_element :alt_reps, xml: 'altRep',
42
+ type: Newsmlg2::Types::AltRep, collection: true
43
+ xml_element :deliverable_of, xml: 'deliverableOf',
44
+ type: Newsmlg2::Types::Link1Type, collection: true
45
+ xml_element :hashes, xml: 'hash',
46
+ type: Newsmlg2::Types::Hash, collection: true
47
+ xml_element :expires, xml: 'expires',
48
+ type: Newsmlg2::Types::DateOptTimePropType, collection: true
49
+ xml_element :orig_reps, xml: 'origRep',
50
+ type: Newsmlg2::Types::OrigRep, collection: true
51
+ xml_element :incoming_feed_ids, xml: 'incomingFeedId',
52
+ type: Newsmlg2::Types::IncomingFeedId, collection: true
53
+ xml_element :metadata_creator, xml: 'metadataCreator',
54
+ type: Newsmlg2::Types::FlexAuthorPropType
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ module MediaContentCharacteristics1
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ xml_attributes(
9
+ :width, :widthunit, :widthunituri,
10
+ :height, :heightunit, :heightunituri,
11
+ :orientation,
12
+ :layoutorientation, :layoutorientationuri,
13
+ :colourspace, :colourspaceuri,
14
+ :colourindicator, :colourindicatoruri,
15
+ :videocodec, :videocodecuri,
16
+ :colourdepth
17
+ )
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ module NewsContentAttributes
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ xml_attributes(
9
+ :id, :creator, :creatoruri, :modified, :custom,
10
+ :how, :howuri, :why, :whyuri,
11
+ :rendition, :renditionuri,
12
+ :generator, :generated, :hascontent
13
+ )
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ module NewsContentCharacteristics
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ xml_attributes(
9
+ :charcount, :wordcount, :linecount, :pagecount,
10
+ :width, :widthunit, :widthunituri,
11
+ :height, :heightunit, :heightunituri,
12
+ :orientation,
13
+ :layoutorientation, :layoutorientationuri,
14
+ :colourspace, :colourspaceuri,
15
+ :colourindicator, :colourindicatoruri,
16
+ :colourdepth, :resolution,
17
+ :duration, :durationunit, :durationunituri,
18
+ :audiocodec, :audiocodecuri, :audiobitrate, :audiovbr,
19
+ :audiosamplesize, :audiosamplerate,
20
+ :audiochannels, :audiochannelsuri,
21
+ :videocodec, :videocodecuri, :videoavgbitrate, :videovbr,
22
+ :videoframerate, :videoscan, :videoaspectratio, :videosampling,
23
+ :videoscaling, :videoscalinguri,
24
+ :videodefinition, :videodefinitionuri
25
+ )
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ module NewsContentTypeAttributes
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ xml_attributes(
9
+ :contenttype, :contenttypestandardversion,
10
+ :contenttypevariant, :contenttypevariantstandardversion,
11
+ :format, :formaturi, :formatstandardversion
12
+ )
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ module PersistentEditAttributes
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ xml_attributes :id, :creator, :creatoruri, :modified
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ module QualifyingAttributes
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ xml_attributes :qcode, :uri, :literal, :type, :typeuri, :role, :roleuri
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ module QuantifyAttributes
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ xml_attributes :confidence, :relevance, :derivedfrom
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ module RankingAttributes
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ xml_attributes :rank
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ # iCalendar RECUR-aligned attributes (events.py).
6
+ module RecurrenceRuleAttributes
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ xml_attributes(
10
+ :freq, :interval, :until, :count,
11
+ :bysecond, :byminute, :byhour, :byday,
12
+ :bymonthday, :bymonth, :byyearday, :byweekno, :bysetpos, :wkst
13
+ )
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ # A group of attributes pertaining to any kind of link (link.py).
6
+ module TargetResourceAttributes
7
+ def self.included(klass)
8
+ klass.class_eval do
9
+ xml_attributes(
10
+ :href, :residref, :version, :persistidref,
11
+ :contenttype, :contenttypestandardversion,
12
+ :contenttypevariant, :contenttypevariantstandardversion,
13
+ :format, :formaturi, :formatstandardversion,
14
+ :size, :title
15
+ )
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ module Base
5
+ module TimeValidityAttributes
6
+ def self.included(klass)
7
+ klass.class_eval do
8
+ xml_attributes :validfrom, :validto
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Newsmlg2
4
+ # Shared XSD attribute groups and element groups, ported module-by-module
5
+ # from python-newsmlg2's attributegroups.py and the *Group element lists.
6
+ # Each mixin contributes attributes and mapping rules to the including
7
+ # NarModel subclass, in include order.
8
+ module Base
9
+ autoload :AdministrativeMetadataGroup, 'newsmlg2/base/administrative_metadata_group'
10
+ autoload :ArbitraryValueAttributes, 'newsmlg2/base/arbitrary_value_attributes'
11
+ autoload :AuthorityAttributes, 'newsmlg2/base/authority_attributes'
12
+ autoload :CommonPowerAttributes, 'newsmlg2/base/common_power_attributes'
13
+ autoload :ConceptDefinitionGroup, 'newsmlg2/base/concept_definition_group'
14
+ autoload :ConceptRelationshipsGroup, 'newsmlg2/base/concept_relationships_group'
15
+ autoload :ConfirmationStatusAttributes, 'newsmlg2/base/confirmation_status_attributes'
16
+ autoload :DeprecatedLinkAttributes, 'newsmlg2/base/deprecated_link_attributes'
17
+ autoload :DescriptiveMetadataCoreGroup, 'newsmlg2/base/descriptive_metadata_group'
18
+ autoload :DescriptiveMetadataGroup, 'newsmlg2/base/descriptive_metadata_group'
19
+ autoload :EntityDetailsGroup, 'newsmlg2/base/entity_details_group'
20
+ autoload :FlexAttributes, 'newsmlg2/base/flex_attributes'
21
+ autoload :I18NAttributes, 'newsmlg2/base/i18n_attributes'
22
+ autoload :ItemManagementGroup, 'newsmlg2/base/item_management_group'
23
+ autoload :MediaContentCharacteristics1, 'newsmlg2/base/media_content_characteristics1'
24
+ autoload :NewsContentAttributes, 'newsmlg2/base/news_content_attributes'
25
+ autoload :NewsContentCharacteristics, 'newsmlg2/base/news_content_characteristics'
26
+ autoload :NewsContentTypeAttributes, 'newsmlg2/base/news_content_type_attributes'
27
+ autoload :PersistentEditAttributes, 'newsmlg2/base/persistent_edit_attributes'
28
+ autoload :QualifyingAttributes, 'newsmlg2/base/qualifying_attributes'
29
+ autoload :QuantifyAttributes, 'newsmlg2/base/quantify_attributes'
30
+ autoload :RankingAttributes, 'newsmlg2/base/ranking_attributes'
31
+ autoload :RecurrenceRuleAttributes, 'newsmlg2/base/recurrence_rule_attributes'
32
+ autoload :TargetResourceAttributes, 'newsmlg2/base/target_resource_attributes'
33
+ autoload :TimeValidityAttributes, 'newsmlg2/base/time_validity_attributes'
34
+ end
35
+ end