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.
- checksums.yaml +7 -0
- data/.github/workflows/docs.yml +63 -0
- data/.github/workflows/links.yml +99 -0
- data/.github/workflows/performance.yml +25 -0
- data/.github/workflows/rake.yml +19 -0
- data/.github/workflows/release.yml +34 -0
- data/.gitignore +17 -0
- data/.rubocop.yml +51 -0
- data/CHANGELOG.md +31 -0
- data/CLAUDE.md +77 -0
- data/Gemfile +15 -0
- data/LICENSE +24 -0
- data/README.adoc +135 -0
- data/Rakefile +15 -0
- data/docs/Gemfile +6 -0
- data/docs/_config.yml +4 -0
- data/docs/index.md +15 -0
- data/docs/lychee.toml +4 -0
- data/docs/usage.md +36 -0
- data/lib/newsmlg2/base/administrative_metadata_group.rb +40 -0
- data/lib/newsmlg2/base/arbitrary_value_attributes.rb +13 -0
- data/lib/newsmlg2/base/authority_attributes.rb +14 -0
- data/lib/newsmlg2/base/common_power_attributes.rb +17 -0
- data/lib/newsmlg2/base/concept_definition_group.rb +25 -0
- data/lib/newsmlg2/base/concept_relationships_group.rb +22 -0
- data/lib/newsmlg2/base/confirmation_status_attributes.rb +13 -0
- data/lib/newsmlg2/base/deprecated_link_attributes.rb +14 -0
- data/lib/newsmlg2/base/descriptive_metadata_group.rb +54 -0
- data/lib/newsmlg2/base/entity_details_group.rb +28 -0
- data/lib/newsmlg2/base/flex_attributes.rb +13 -0
- data/lib/newsmlg2/base/i18n_attributes.rb +14 -0
- data/lib/newsmlg2/base/item_management_group.rb +59 -0
- data/lib/newsmlg2/base/media_content_characteristics1.rb +22 -0
- data/lib/newsmlg2/base/news_content_attributes.rb +18 -0
- data/lib/newsmlg2/base/news_content_characteristics.rb +30 -0
- data/lib/newsmlg2/base/news_content_type_attributes.rb +17 -0
- data/lib/newsmlg2/base/persistent_edit_attributes.rb +13 -0
- data/lib/newsmlg2/base/qualifying_attributes.rb +13 -0
- data/lib/newsmlg2/base/quantify_attributes.rb +13 -0
- data/lib/newsmlg2/base/ranking_attributes.rb +13 -0
- data/lib/newsmlg2/base/recurrence_rule_attributes.rb +18 -0
- data/lib/newsmlg2/base/target_resource_attributes.rb +20 -0
- data/lib/newsmlg2/base/time_validity_attributes.rb +13 -0
- data/lib/newsmlg2/base.rb +35 -0
- data/lib/newsmlg2/builder/node.rb +125 -0
- data/lib/newsmlg2/builder.rb +69 -0
- data/lib/newsmlg2/catalog.rb +38 -0
- data/lib/newsmlg2/catalog_cache.rb +49 -0
- data/lib/newsmlg2/catalog_ref.rb +13 -0
- data/lib/newsmlg2/catalog_store.rb +66 -0
- data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_32.xml +620 -0
- data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_33.xml +625 -0
- data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_34.xml +626 -0
- data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_35.xml +635 -0
- data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_36.xml +644 -0
- data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_37.xml +661 -0
- data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_38.xml +674 -0
- data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_39.xml +682 -0
- data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_40.xml +724 -0
- data/lib/newsmlg2/catalogs/catalog.IPTC-G2-Standards_41.xml +729 -0
- data/lib/newsmlg2/configuration.rb +61 -0
- data/lib/newsmlg2/document.rb +123 -0
- data/lib/newsmlg2/errors.rb +18 -0
- data/lib/newsmlg2/i18n.rb +20 -0
- data/lib/newsmlg2/items/any_item.rb +180 -0
- data/lib/newsmlg2/items/catalog_item.rb +24 -0
- data/lib/newsmlg2/items/concept_item.rb +23 -0
- data/lib/newsmlg2/items/content_meta.rb +73 -0
- data/lib/newsmlg2/items/item_ref.rb +13 -0
- data/lib/newsmlg2/items/knowledge_item.rb +68 -0
- data/lib/newsmlg2/items/news_item.rb +130 -0
- data/lib/newsmlg2/items/news_message.rb +142 -0
- data/lib/newsmlg2/items/package_item.rb +82 -0
- data/lib/newsmlg2/items/part_meta.rb +68 -0
- data/lib/newsmlg2/items/planning_item.rb +160 -0
- data/lib/newsmlg2/nar_model.rb +76 -0
- data/lib/newsmlg2/nar_namespace.rb +10 -0
- data/lib/newsmlg2/nitf_namespace.rb +9 -0
- data/lib/newsmlg2/same_as_scheme.rb +15 -0
- data/lib/newsmlg2/scheme.rb +30 -0
- data/lib/newsmlg2/types/approximate_date_time_prop_type.rb +14 -0
- data/lib/newsmlg2/types/bag.rb +16 -0
- data/lib/newsmlg2/types/block_types.rb +62 -0
- data/lib/newsmlg2/types/concept.rb +36 -0
- data/lib/newsmlg2/types/concept_id.rb +17 -0
- data/lib/newsmlg2/types/concept_name_type.rb +17 -0
- data/lib/newsmlg2/types/content_meta_types.rb +152 -0
- data/lib/newsmlg2/types/date_opt_time_prop_type.rb +12 -0
- data/lib/newsmlg2/types/date_time_or_null_prop_type.rb +12 -0
- data/lib/newsmlg2/types/date_time_prop_type.rb +12 -0
- data/lib/newsmlg2/types/event_details.rb +213 -0
- data/lib/newsmlg2/types/ext_property.rb +21 -0
- data/lib/newsmlg2/types/facet.rb +17 -0
- data/lib/newsmlg2/types/flex1_prop_type.rb +32 -0
- data/lib/newsmlg2/types/flex_location_prop_type.rb +43 -0
- data/lib/newsmlg2/types/flex_party_prop_type.rb +49 -0
- data/lib/newsmlg2/types/flex_prop2_type.rb +26 -0
- data/lib/newsmlg2/types/flex_prop_type.rb +17 -0
- data/lib/newsmlg2/types/geo.rb +92 -0
- data/lib/newsmlg2/types/hierarchy_info.rb +17 -0
- data/lib/newsmlg2/types/ids.rb +28 -0
- data/lib/newsmlg2/types/inline_types.rb +56 -0
- data/lib/newsmlg2/types/intl_string_type.rb +17 -0
- data/lib/newsmlg2/types/intl_string_type2.rb +14 -0
- data/lib/newsmlg2/types/item_management.rb +74 -0
- data/lib/newsmlg2/types/link.rb +40 -0
- data/lib/newsmlg2/types/object_details.rb +40 -0
- data/lib/newsmlg2/types/party_details.rb +258 -0
- data/lib/newsmlg2/types/poi.rb +79 -0
- data/lib/newsmlg2/types/qcode_prop_type.rb +12 -0
- data/lib/newsmlg2/types/qual_prop_type.rb +23 -0
- data/lib/newsmlg2/types/qual_rel_prop_type.rb +18 -0
- data/lib/newsmlg2/types/related_concept.rb +71 -0
- data/lib/newsmlg2/types/rights.rb +84 -0
- data/lib/newsmlg2/types/ruby_annotation.rb +55 -0
- data/lib/newsmlg2/types/same_as.rb +17 -0
- data/lib/newsmlg2/types/truncated_date_time_prop_type.rb +13 -0
- data/lib/newsmlg2/types/versioned_string_type.rb +10 -0
- data/lib/newsmlg2/types/xml_base.rb +12 -0
- data/lib/newsmlg2/types/xml_lang.rb +12 -0
- data/lib/newsmlg2/types.rb +166 -0
- data/lib/newsmlg2/utils.rb +42 -0
- data/lib/newsmlg2/version.rb +5 -0
- data/lib/newsmlg2.rb +181 -0
- data/lib/tasks/performance.rake +72 -0
- data/newsmlg2.gemspec +34 -0
- metadata +185 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Newsmlg2
|
|
4
|
+
module Types
|
|
5
|
+
# Flexible location (geopolitical area or point-of-interest) data type.
|
|
6
|
+
class FlexLocationPropType < Newsmlg2::NarModel
|
|
7
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
8
|
+
include Newsmlg2::Base::FlexAttributes
|
|
9
|
+
include Newsmlg2::Base::I18NAttributes
|
|
10
|
+
include Newsmlg2::Base::ConceptDefinitionGroup
|
|
11
|
+
include Newsmlg2::Base::ConceptRelationshipsGroup
|
|
12
|
+
|
|
13
|
+
xml_element :geo_area_details, xml: 'geoAreaDetails',
|
|
14
|
+
type: Newsmlg2::Types::GeoAreaDetails
|
|
15
|
+
xml_element :poi_details, xml: 'POIDetails',
|
|
16
|
+
type: Newsmlg2::Types::POIDetails
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Flexible point-of-interest data type.
|
|
20
|
+
class FlexPOIPropType < Newsmlg2::NarModel
|
|
21
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
22
|
+
include Newsmlg2::Base::FlexAttributes
|
|
23
|
+
include Newsmlg2::Base::I18NAttributes
|
|
24
|
+
include Newsmlg2::Base::ConceptDefinitionGroup
|
|
25
|
+
include Newsmlg2::Base::ConceptRelationshipsGroup
|
|
26
|
+
|
|
27
|
+
xml_element :poi_details, xml: 'POIDetails',
|
|
28
|
+
type: Newsmlg2::Types::POIDetails
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Flexible geopolitical area data type.
|
|
32
|
+
class FlexGeoAreaPropType < Newsmlg2::NarModel
|
|
33
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
34
|
+
include Newsmlg2::Base::FlexAttributes
|
|
35
|
+
include Newsmlg2::Base::I18NAttributes
|
|
36
|
+
include Newsmlg2::Base::ConceptDefinitionGroup
|
|
37
|
+
include Newsmlg2::Base::ConceptRelationshipsGroup
|
|
38
|
+
|
|
39
|
+
xml_element :geo_area_details, xml: 'geoAreaDetails',
|
|
40
|
+
type: Newsmlg2::Types::GeoAreaDetails
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Newsmlg2
|
|
4
|
+
module Types
|
|
5
|
+
# Flexible person data type for both controlled and uncontrolled values.
|
|
6
|
+
class FlexPersonPropType < Newsmlg2::NarModel
|
|
7
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
8
|
+
include Newsmlg2::Base::FlexAttributes
|
|
9
|
+
include Newsmlg2::Base::I18NAttributes
|
|
10
|
+
include Newsmlg2::Base::ConceptDefinitionGroup
|
|
11
|
+
include Newsmlg2::Base::ConceptRelationshipsGroup
|
|
12
|
+
|
|
13
|
+
xml_element :person_details, xml: 'personDetails',
|
|
14
|
+
type: Newsmlg2::Types::PersonDetails
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Flexible party (person or organisation) PCL-type for both controlled
|
|
18
|
+
# and uncontrolled values.
|
|
19
|
+
class FlexPartyPropType < Newsmlg2::NarModel
|
|
20
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
21
|
+
include Newsmlg2::Base::FlexAttributes
|
|
22
|
+
include Newsmlg2::Base::I18NAttributes
|
|
23
|
+
include Newsmlg2::Base::ConceptDefinitionGroup
|
|
24
|
+
include Newsmlg2::Base::ConceptRelationshipsGroup
|
|
25
|
+
|
|
26
|
+
xml_element :person_details, xml: 'personDetails',
|
|
27
|
+
type: Newsmlg2::Types::PersonDetails
|
|
28
|
+
xml_element :organisation_details, xml: 'organisationDetails',
|
|
29
|
+
type: Newsmlg2::Types::OrganisationDetails
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# A party involved in a hop of the Hop History.
|
|
33
|
+
class Party < FlexPartyPropType
|
|
34
|
+
xml do
|
|
35
|
+
element 'party'
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# FlexPartyPropType with a role refinement.
|
|
40
|
+
class Flex1PartyPropType < FlexPartyPropType
|
|
41
|
+
xml_attributes :role, :roleuri
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Flexible author (creator or contributor) PCL-type.
|
|
45
|
+
class FlexAuthorPropType < FlexPartyPropType
|
|
46
|
+
xml_attributes :role, :roleuri, :jobtitle, :jobtitleuri
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Newsmlg2
|
|
4
|
+
module Types
|
|
5
|
+
# Flexible type for related concepts for both controlled and
|
|
6
|
+
# uncontrolled values.
|
|
7
|
+
class FlexProp2Type < Newsmlg2::NarModel
|
|
8
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
9
|
+
include Newsmlg2::Base::FlexAttributes
|
|
10
|
+
include Newsmlg2::Base::I18NAttributes
|
|
11
|
+
|
|
12
|
+
xml_element :names, xml: 'name',
|
|
13
|
+
type: Newsmlg2::Types::ConceptNameType, collection: true
|
|
14
|
+
xml_element :hierarchy_infos, xml: 'hierarchyInfo',
|
|
15
|
+
type: Newsmlg2::Types::HierarchyInfo, collection: true
|
|
16
|
+
xml_element :same_as, xml: 'sameAs',
|
|
17
|
+
type: Newsmlg2::Types::SameAs, collection: true
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Flexible generic type for controlled and uncontrolled values of a
|
|
21
|
+
# related concept.
|
|
22
|
+
class FlexRelatedPropType < FlexProp2Type
|
|
23
|
+
xml_attributes :rel, :reluri
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Newsmlg2
|
|
4
|
+
module Types
|
|
5
|
+
# Flexible generic type for both controlled and uncontrolled values.
|
|
6
|
+
class FlexPropType < Newsmlg2::NarModel
|
|
7
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
8
|
+
include Newsmlg2::Base::FlexAttributes
|
|
9
|
+
include Newsmlg2::Base::I18NAttributes
|
|
10
|
+
|
|
11
|
+
xml_element :names, xml: 'name',
|
|
12
|
+
type: Newsmlg2::Types::ConceptNameType, collection: true
|
|
13
|
+
xml_element :hierarchy_info, xml: 'hierarchyInfo',
|
|
14
|
+
type: Newsmlg2::Types::HierarchyInfo, collection: true
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Newsmlg2
|
|
4
|
+
module Types
|
|
5
|
+
# Geographic coordinates.
|
|
6
|
+
class GeoCoordinatesType < Newsmlg2::NarModel
|
|
7
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
8
|
+
|
|
9
|
+
xml_attributes :latitude, :longitude, :altitude, :gpsdatum
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# The coordinates of a location.
|
|
13
|
+
class Position < GeoCoordinatesType
|
|
14
|
+
xml do
|
|
15
|
+
element 'position'
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# The date the geopolitical area was founded/established.
|
|
20
|
+
class GeoAreaFounded < TruncatedDateTimePropType
|
|
21
|
+
xml do
|
|
22
|
+
element 'founded'
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# The date the geopolitical area was dissolved.
|
|
27
|
+
class GeoAreaDissolved < TruncatedDateTimePropType
|
|
28
|
+
xml do
|
|
29
|
+
element 'dissolved'
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# A line as a geographic area.
|
|
34
|
+
class GeoAreaLine < Newsmlg2::NarModel
|
|
35
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
36
|
+
|
|
37
|
+
xml_element :positions, xml: 'position',
|
|
38
|
+
type: Newsmlg2::Types::Position, collection: true
|
|
39
|
+
|
|
40
|
+
xml do
|
|
41
|
+
element 'line'
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# A circle as a geographic area.
|
|
46
|
+
class GeoAreaCircle < Newsmlg2::NarModel
|
|
47
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
48
|
+
|
|
49
|
+
xml_attributes :radius, :radunit, :radunituri
|
|
50
|
+
xml_element :positions, xml: 'position',
|
|
51
|
+
type: Newsmlg2::Types::Position, collection: true
|
|
52
|
+
|
|
53
|
+
xml do
|
|
54
|
+
element 'circle'
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# A polygon as a geographic area.
|
|
59
|
+
class GeoAreaPolygon < Newsmlg2::NarModel
|
|
60
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
61
|
+
|
|
62
|
+
xml_element :positions, xml: 'position',
|
|
63
|
+
type: Newsmlg2::Types::Position, collection: true
|
|
64
|
+
|
|
65
|
+
xml do
|
|
66
|
+
element 'polygon'
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# A group of properties specific to a geopolitical area.
|
|
71
|
+
class GeoAreaDetails < Newsmlg2::NarModel
|
|
72
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
73
|
+
|
|
74
|
+
xml_element :position, xml: 'position',
|
|
75
|
+
type: Newsmlg2::Types::Position
|
|
76
|
+
xml_element :founded, xml: 'founded',
|
|
77
|
+
type: Newsmlg2::Types::GeoAreaFounded
|
|
78
|
+
xml_element :dissolved, xml: 'dissolved',
|
|
79
|
+
type: Newsmlg2::Types::GeoAreaDissolved
|
|
80
|
+
xml_element :lines, xml: 'line',
|
|
81
|
+
type: Newsmlg2::Types::GeoAreaLine, collection: true
|
|
82
|
+
xml_element :circles, xml: 'circle',
|
|
83
|
+
type: Newsmlg2::Types::GeoAreaCircle, collection: true
|
|
84
|
+
xml_element :polygons, xml: 'polygon',
|
|
85
|
+
type: Newsmlg2::Types::GeoAreaPolygon, collection: true
|
|
86
|
+
|
|
87
|
+
xml do
|
|
88
|
+
element 'geoAreaDetails'
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Newsmlg2
|
|
4
|
+
module Types
|
|
5
|
+
# Position of a concept in a hierarchical taxonomy tree, expressed by a
|
|
6
|
+
# sequence of QCode tokens as element content.
|
|
7
|
+
class HierarchyInfo < Newsmlg2::NarModel
|
|
8
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
9
|
+
|
|
10
|
+
xml_content
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
element 'hierarchyInfo'
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Newsmlg2
|
|
4
|
+
module Types
|
|
5
|
+
# An alternative identifier assigned to the content.
|
|
6
|
+
class AltId < IntlStringType2
|
|
7
|
+
xml_attributes(
|
|
8
|
+
:type, :typeuri, :environment, :environmenturi,
|
|
9
|
+
:idformat, :idformaturi, :role, :roleuri, :version
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
element 'altId'
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Hash value of parts of an item as defined by the hashscope attribute.
|
|
18
|
+
class Hash < Newsmlg2::NarModel
|
|
19
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
20
|
+
|
|
21
|
+
xml_attributes :hashtype, :hashtypeuri, :scope, :scopeuri
|
|
22
|
+
|
|
23
|
+
xml do
|
|
24
|
+
element 'hash'
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Newsmlg2
|
|
4
|
+
module Types
|
|
5
|
+
# A generic mechanism for adding inline information to parts of textual
|
|
6
|
+
# content. Mixed content.
|
|
7
|
+
class Span < Newsmlg2::NarModel
|
|
8
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
9
|
+
include Newsmlg2::Base::I18NAttributes
|
|
10
|
+
|
|
11
|
+
xml_attributes class_attr: 'class'
|
|
12
|
+
xml_element :rubies, xml: 'ruby', type: Newsmlg2::Types::Ruby, collection: true
|
|
13
|
+
|
|
14
|
+
xml_content(collection: true)
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
element 'span'
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# An inline markup tag usable with any concept. Mixed content.
|
|
22
|
+
class Inline < Newsmlg2::NarModel
|
|
23
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
24
|
+
include Newsmlg2::Base::FlexAttributes
|
|
25
|
+
include Newsmlg2::Base::I18NAttributes
|
|
26
|
+
include Newsmlg2::Base::QuantifyAttributes
|
|
27
|
+
|
|
28
|
+
xml_attributes class_attr: 'class'
|
|
29
|
+
xml_element :spans, xml: 'span', type: Newsmlg2::Types::Span, collection: true
|
|
30
|
+
xml_element :rubies, xml: 'ruby', type: Newsmlg2::Types::Ruby, collection: true
|
|
31
|
+
|
|
32
|
+
xml_content(collection: true)
|
|
33
|
+
|
|
34
|
+
xml do
|
|
35
|
+
element 'inline'
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# An anchor for inline linking, like the HTML a element. Mixed content.
|
|
40
|
+
class A < Newsmlg2::NarModel
|
|
41
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
42
|
+
include Newsmlg2::Base::I18NAttributes
|
|
43
|
+
|
|
44
|
+
xml_attributes :href, :hreflang, :rel, :rev, class_attr: 'class'
|
|
45
|
+
xml_element :inlines, xml: 'inline', type: Newsmlg2::Types::Inline, collection: true
|
|
46
|
+
xml_element :spans, xml: 'span', type: Newsmlg2::Types::Span, collection: true
|
|
47
|
+
xml_element :rubies, xml: 'ruby', type: Newsmlg2::Types::Ruby, collection: true
|
|
48
|
+
|
|
49
|
+
xml_content(collection: true)
|
|
50
|
+
|
|
51
|
+
xml do
|
|
52
|
+
element 'a'
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Newsmlg2
|
|
4
|
+
module Types
|
|
5
|
+
# Internationalized normalized string: content plus language/directionality.
|
|
6
|
+
class IntlStringType < Newsmlg2::NarModel
|
|
7
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
8
|
+
include Newsmlg2::Base::I18NAttributes
|
|
9
|
+
|
|
10
|
+
xml_content
|
|
11
|
+
|
|
12
|
+
def to_s
|
|
13
|
+
text.to_s.strip
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Newsmlg2
|
|
4
|
+
module Types
|
|
5
|
+
# Internationalized unrestricted string: content plus
|
|
6
|
+
# language/directionality.
|
|
7
|
+
class IntlStringType2 < Newsmlg2::NarModel
|
|
8
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
9
|
+
include Newsmlg2::Base::I18NAttributes
|
|
10
|
+
|
|
11
|
+
xml_content
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Newsmlg2
|
|
4
|
+
module Types
|
|
5
|
+
# The recommended file name for this Item.
|
|
6
|
+
class FileName < Newsmlg2::NarModel
|
|
7
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
8
|
+
|
|
9
|
+
xml_content
|
|
10
|
+
|
|
11
|
+
xml do
|
|
12
|
+
element 'fileName'
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# The name and version of the software tool used to generate the Item.
|
|
17
|
+
class Generator < VersionedStringType
|
|
18
|
+
xml_attributes :role, :roleuri
|
|
19
|
+
|
|
20
|
+
xml do
|
|
21
|
+
element 'generator'
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# An instruction to the processor that the content requires special
|
|
26
|
+
# handling.
|
|
27
|
+
class Signal < Flex1PropType
|
|
28
|
+
xml_attributes :severity, :severityuri
|
|
29
|
+
|
|
30
|
+
xml do
|
|
31
|
+
element 'signal'
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# An IRI which, upon dereferencing, provides an alternative
|
|
36
|
+
# representation of the Item.
|
|
37
|
+
class AltRep < Newsmlg2::NarModel
|
|
38
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
39
|
+
include Newsmlg2::Base::TimeValidityAttributes
|
|
40
|
+
include Newsmlg2::Base::NewsContentTypeAttributes
|
|
41
|
+
|
|
42
|
+
xml_content
|
|
43
|
+
|
|
44
|
+
xml_attributes :representation, :representationuri, :size
|
|
45
|
+
|
|
46
|
+
xml do
|
|
47
|
+
element 'altRep'
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# An IRI which, upon dereferencing, provides the original representation
|
|
52
|
+
# of the Item.
|
|
53
|
+
class OrigRep < Newsmlg2::NarModel
|
|
54
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
55
|
+
|
|
56
|
+
xml_content
|
|
57
|
+
|
|
58
|
+
xml_attributes :accesstype, :accesstypeuri, :reposrole, :reposroleuri
|
|
59
|
+
|
|
60
|
+
xml do
|
|
61
|
+
element 'origRep'
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# The identifier of an incoming feed.
|
|
66
|
+
class IncomingFeedId < QCodePropType
|
|
67
|
+
xml_attributes :role, :roleuri
|
|
68
|
+
|
|
69
|
+
xml do
|
|
70
|
+
element 'incomingFeedId'
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Newsmlg2
|
|
4
|
+
module Types
|
|
5
|
+
# The PCL-type of a link from the current Item to a target Item or Web
|
|
6
|
+
# resource.
|
|
7
|
+
class Link1Type < Newsmlg2::NarModel
|
|
8
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
9
|
+
include Newsmlg2::Base::TargetResourceAttributes
|
|
10
|
+
include Newsmlg2::Base::TimeValidityAttributes
|
|
11
|
+
include Newsmlg2::Base::I18NAttributes
|
|
12
|
+
include Newsmlg2::Base::DeprecatedLinkAttributes
|
|
13
|
+
|
|
14
|
+
xml_attributes :rel, :reluri, :rank
|
|
15
|
+
|
|
16
|
+
# Link1Type permits arbitrary inline content (xs:any) — e.g. the
|
|
17
|
+
# referenced item's metadata preview inside package itemRef.
|
|
18
|
+
attribute :content, :string
|
|
19
|
+
|
|
20
|
+
xml do
|
|
21
|
+
map_all to: :content
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# A link from the current Item to a target Item or Web resource.
|
|
26
|
+
class Link < Link1Type
|
|
27
|
+
xml do
|
|
28
|
+
element 'link'
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# A link to an item or a web resource which provides information about
|
|
33
|
+
# the concept.
|
|
34
|
+
class RemoteInfo < Link1Type
|
|
35
|
+
xml do
|
|
36
|
+
element 'remoteInfo'
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Newsmlg2
|
|
4
|
+
module Types
|
|
5
|
+
# The date (and optionally the time) on which this object was created.
|
|
6
|
+
class ObjectCreated < TruncatedDateTimePropType
|
|
7
|
+
xml do
|
|
8
|
+
element 'created'
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# The date (and optionally the time) on which this object ceased to
|
|
13
|
+
# exist.
|
|
14
|
+
class ObjectCeasedToExist < TruncatedDateTimePropType
|
|
15
|
+
xml do
|
|
16
|
+
element 'ceasedToExist'
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# A group of properties specific to an object. Kept in its own file so
|
|
21
|
+
# the party detail types and the rights types never load each other
|
|
22
|
+
# mid-flight.
|
|
23
|
+
class ObjectDetails < Newsmlg2::NarModel
|
|
24
|
+
include Newsmlg2::Base::CommonPowerAttributes
|
|
25
|
+
|
|
26
|
+
xml_element :created, xml: 'created',
|
|
27
|
+
type: Newsmlg2::Types::ObjectCreated
|
|
28
|
+
xml_element :copyright_notices, xml: 'copyrightNotice',
|
|
29
|
+
type: Newsmlg2::Types::CopyrightNotice, collection: true
|
|
30
|
+
xml_element :creators, xml: 'creator',
|
|
31
|
+
type: Newsmlg2::Types::FlexAuthorPropType, collection: true
|
|
32
|
+
xml_element :ceased_to_exist, xml: 'ceasedToExist',
|
|
33
|
+
type: Newsmlg2::Types::ObjectCeasedToExist
|
|
34
|
+
|
|
35
|
+
xml do
|
|
36
|
+
element 'objectDetails'
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|