pbcore 0.2.0
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/.gitignore +13 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +674 -0
- data/README.md +37 -0
- data/Rakefile +6 -0
- data/bin/console +11 -0
- data/bin/setup +8 -0
- data/lib/pbcore.rb +28 -0
- data/lib/pbcore/annotation.rb +12 -0
- data/lib/pbcore/asset_date.rb +12 -0
- data/lib/pbcore/asset_type.rb +11 -0
- data/lib/pbcore/attributes.rb +6 -0
- data/lib/pbcore/attributes/common.rb +13 -0
- data/lib/pbcore/attributes/time_interval.rb +12 -0
- data/lib/pbcore/audience_level.rb +11 -0
- data/lib/pbcore/audience_rating.rb +11 -0
- data/lib/pbcore/contributor.rb +19 -0
- data/lib/pbcore/contributor/contributor.rb +12 -0
- data/lib/pbcore/contributor/role.rb +12 -0
- data/lib/pbcore/coverage.rb +20 -0
- data/lib/pbcore/coverage/coverage.rb +11 -0
- data/lib/pbcore/coverage/type.rb +11 -0
- data/lib/pbcore/creator.rb +19 -0
- data/lib/pbcore/creator/creator.rb +16 -0
- data/lib/pbcore/creator/role.rb +11 -0
- data/lib/pbcore/description.rb +13 -0
- data/lib/pbcore/description_document.rb +60 -0
- data/lib/pbcore/element.rb +199 -0
- data/lib/pbcore/errors.rb +55 -0
- data/lib/pbcore/extension.rb +19 -0
- data/lib/pbcore/extension/embedded.rb +15 -0
- data/lib/pbcore/extension/wrap.rb +26 -0
- data/lib/pbcore/extension/wrap/authority_used.rb +11 -0
- data/lib/pbcore/extension/wrap/element.rb +11 -0
- data/lib/pbcore/extension/wrap/value.rb +11 -0
- data/lib/pbcore/factories.rb +6 -0
- data/lib/pbcore/genre.rb +11 -0
- data/lib/pbcore/identifier.rb +11 -0
- data/lib/pbcore/instantiation.rb +87 -0
- data/lib/pbcore/instantiation/alternative_modes.rb +11 -0
- data/lib/pbcore/instantiation/annotation.rb +12 -0
- data/lib/pbcore/instantiation/channel_configuration.rb +11 -0
- data/lib/pbcore/instantiation/colors.rb +11 -0
- data/lib/pbcore/instantiation/data_rate.rb +13 -0
- data/lib/pbcore/instantiation/date.rb +13 -0
- data/lib/pbcore/instantiation/digital.rb +11 -0
- data/lib/pbcore/instantiation/dimensions.rb +13 -0
- data/lib/pbcore/instantiation/duration.rb +11 -0
- data/lib/pbcore/instantiation/essence_track.rb +59 -0
- data/lib/pbcore/instantiation/essence_track/annotation.rb +11 -0
- data/lib/pbcore/instantiation/essence_track/aspect_ratio.rb +11 -0
- data/lib/pbcore/instantiation/essence_track/bit_depth.rb +11 -0
- data/lib/pbcore/instantiation/essence_track/data_rate.rb +11 -0
- data/lib/pbcore/instantiation/essence_track/duration.rb +9 -0
- data/lib/pbcore/instantiation/essence_track/encoding.rb +9 -0
- data/lib/pbcore/instantiation/essence_track/frame_rate.rb +11 -0
- data/lib/pbcore/instantiation/essence_track/frame_size.rb +11 -0
- data/lib/pbcore/instantiation/essence_track/identifier.rb +9 -0
- data/lib/pbcore/instantiation/essence_track/language.rb +9 -0
- data/lib/pbcore/instantiation/essence_track/playback_speed.rb +11 -0
- data/lib/pbcore/instantiation/essence_track/sampling_rate.rb +11 -0
- data/lib/pbcore/instantiation/essence_track/standard.rb +9 -0
- data/lib/pbcore/instantiation/essence_track/time_start.rb +9 -0
- data/lib/pbcore/instantiation/essence_track/type.rb +9 -0
- data/lib/pbcore/instantiation/extension.rb +22 -0
- data/lib/pbcore/instantiation/file_size.rb +13 -0
- data/lib/pbcore/instantiation/generations.rb +11 -0
- data/lib/pbcore/instantiation/identifier.rb +11 -0
- data/lib/pbcore/instantiation/language.rb +11 -0
- data/lib/pbcore/instantiation/location.rb +11 -0
- data/lib/pbcore/instantiation/media_type.rb +11 -0
- data/lib/pbcore/instantiation/physical.rb +11 -0
- data/lib/pbcore/instantiation/relation.rb +19 -0
- data/lib/pbcore/instantiation/relation/identifier.rb +9 -0
- data/lib/pbcore/instantiation/relation/type.rb +9 -0
- data/lib/pbcore/instantiation/rights.rb +22 -0
- data/lib/pbcore/instantiation/rights/link.rb +11 -0
- data/lib/pbcore/instantiation/rights/summary.rb +11 -0
- data/lib/pbcore/instantiation/standard.rb +13 -0
- data/lib/pbcore/instantiation/time_start.rb +11 -0
- data/lib/pbcore/instantiation/tracks.rb +11 -0
- data/lib/pbcore/instantiation_document.rb +97 -0
- data/lib/pbcore/publisher.rb +19 -0
- data/lib/pbcore/publisher/publisher.rb +17 -0
- data/lib/pbcore/publisher/role.rb +11 -0
- data/lib/pbcore/relation.rb +19 -0
- data/lib/pbcore/relation/identifier.rb +11 -0
- data/lib/pbcore/relation/type.rb +11 -0
- data/lib/pbcore/rights_summary.rb +22 -0
- data/lib/pbcore/rights_summary/link.rb +11 -0
- data/lib/pbcore/rights_summary/summary.rb +11 -0
- data/lib/pbcore/subject.rb +15 -0
- data/lib/pbcore/title.rb +15 -0
- data/lib/pbcore/version.rb +3 -0
- data/lib/pbcore/vocab.rb +15 -0
- data/pbcore.gemspec +40 -0
- metadata +297 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module PBCore
|
|
2
|
+
class Instantiation::EssenceTrack::Annotation < Element
|
|
3
|
+
element :essenceTrackAnnotation, as: :value
|
|
4
|
+
|
|
5
|
+
attribute :annotationType, as: :type
|
|
6
|
+
|
|
7
|
+
build_xml do |xml|
|
|
8
|
+
xml.essenceTrackAnnotation(value, xml_attributes.compact)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module PBCore
|
|
2
|
+
class Instantiation::EssenceTrack::AspectRatio < Element
|
|
3
|
+
element :essenceTrackAspectRatio, as: :value
|
|
4
|
+
|
|
5
|
+
attribute :unitsOfMeasure, as: :units_of_measure
|
|
6
|
+
|
|
7
|
+
build_xml do |xml|
|
|
8
|
+
xml.essenceTrackAspectRatio(value, xml_attributes.compact)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module PBCore
|
|
2
|
+
class Instantiation::EssenceTrack::BitDepth < Element
|
|
3
|
+
element :essenceTrackBitDepth, as: :value
|
|
4
|
+
|
|
5
|
+
attribute :unitsOfMeasure, as: :units_of_measure
|
|
6
|
+
|
|
7
|
+
build_xml do |xml|
|
|
8
|
+
xml.essenceTrackBitDepth(value, xml_attributes.compact)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module PBCore
|
|
2
|
+
class Instantiation::EssenceTrack::DataRate < Element
|
|
3
|
+
element :essenceTrackDataRate, as: :value
|
|
4
|
+
|
|
5
|
+
attribute :unitsOfMeasure, as: :units_of_measure
|
|
6
|
+
|
|
7
|
+
build_xml do |xml|
|
|
8
|
+
xml.essenceTrackDataRate(value, xml_attributes.compact)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module PBCore
|
|
2
|
+
class Instantiation::EssenceTrack::FrameRate < Element
|
|
3
|
+
element :essenceTrackFrameRate, as: :value
|
|
4
|
+
|
|
5
|
+
attribute :unitsOfMeasure, as: :units_of_measure
|
|
6
|
+
|
|
7
|
+
build_xml do |xml|
|
|
8
|
+
xml.essenceTrackFrameRate(value, xml_attributes.compact)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module PBCore
|
|
2
|
+
class Instantiation::EssenceTrack::FrameSize < Element
|
|
3
|
+
element :essenceTrackFrameSize, as: :value
|
|
4
|
+
|
|
5
|
+
attribute :unitsOfMeasure, as: :units_of_measure
|
|
6
|
+
|
|
7
|
+
build_xml do |xml|
|
|
8
|
+
xml.essenceTrackFrameSize(value, xml_attributes.compact)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module PBCore
|
|
2
|
+
class Instantiation::EssenceTrack::PlaybackSpeed < Element
|
|
3
|
+
element :essenceTrackPlaybackSpeed, as: :value
|
|
4
|
+
|
|
5
|
+
attribute :unitsOfMeasure, as: :units_of_measure
|
|
6
|
+
|
|
7
|
+
build_xml do |xml|
|
|
8
|
+
xml.essenceTrackPlaybackSpeed(value, xml_attributes.compact)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module PBCore
|
|
2
|
+
class Instantiation::EssenceTrack::SamplingRate < Element
|
|
3
|
+
element :essenceTrackSamplingRate, as: :value
|
|
4
|
+
|
|
5
|
+
attribute :unitsOfMeasure, as: :units_of_measure
|
|
6
|
+
|
|
7
|
+
build_xml do |xml|
|
|
8
|
+
xml.essenceTrackSamplingRate(value, xml_attributes.compact)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require 'pbcore/element'
|
|
2
|
+
|
|
3
|
+
module PBCore
|
|
4
|
+
class Instantiation::Extension < Element
|
|
5
|
+
autoload :Wrap, 'pbcore/instantiation/extension/wrap'
|
|
6
|
+
autoload :Embedded, 'pbcore/instantiation/extension/embedded'
|
|
7
|
+
|
|
8
|
+
element :instantiationExtension, as: :value
|
|
9
|
+
# NOTE: the classes used for extensionWrap and extensionEmbedded elements
|
|
10
|
+
# here are the same as those used for PBCore::Extension, since everything
|
|
11
|
+
# inside has the same schema.
|
|
12
|
+
element :extensionWrap, as: :wrap, class: PBCore::Extension::Wrap
|
|
13
|
+
element :extensionEmbedded, as: :embedded, class: PBCore::Extension::Embedded
|
|
14
|
+
|
|
15
|
+
build_xml do |xml|
|
|
16
|
+
xml.instantiationExtension(xml_attributes.compact) do |xml|
|
|
17
|
+
wrap.build(xml) if wrap
|
|
18
|
+
embedded.build(xml) if embedded
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'pbcore/element'
|
|
2
|
+
|
|
3
|
+
module PBCore
|
|
4
|
+
class Instantiation::FileSize < Element
|
|
5
|
+
element :instantiationFileSize, as: :value
|
|
6
|
+
|
|
7
|
+
attribute :unitsOfMeasure, as: :units_of_measure
|
|
8
|
+
|
|
9
|
+
build_xml do |xml|
|
|
10
|
+
xml.instantiationFileSize(value, xml_attributes.compact)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'pbcore/element'
|
|
2
|
+
|
|
3
|
+
module PBCore
|
|
4
|
+
class Instantiation::Relation < Element
|
|
5
|
+
autoload :Type, 'pbcore/instantiation/relation/type'
|
|
6
|
+
autoload :Identifier, 'pbcore/instantiation/relation/identifier'
|
|
7
|
+
|
|
8
|
+
element :instantiationRelation, as: :value
|
|
9
|
+
element :instantiationRelationType, as: :type, class: PBCore::Instantiation::Relation::Type
|
|
10
|
+
element :instantiationRelationIdentifier, as: :identifier, class: PBCore::Instantiation::Relation::Identifier
|
|
11
|
+
|
|
12
|
+
build_xml do |xml|
|
|
13
|
+
xml.instantiationRelation(xml_attributes.compact) do |xml|
|
|
14
|
+
type.build(xml)
|
|
15
|
+
identifier.build(xml)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require 'pbcore/element'
|
|
2
|
+
|
|
3
|
+
module PBCore
|
|
4
|
+
class Instantiation::Rights < Element
|
|
5
|
+
autoload :Summary, 'pbcore/instantiation/rights/summary'
|
|
6
|
+
autoload :Link, 'pbcore/instantiation/rights/link'
|
|
7
|
+
|
|
8
|
+
element :instantiationRights, as: :value
|
|
9
|
+
element :rightsSummary, as: :summary, class: PBCore::Instantiation::Rights::Summary
|
|
10
|
+
element :rightsLink, as: :link, class: PBCore::Instantiation::Rights::Link
|
|
11
|
+
|
|
12
|
+
# has_time_attributes_on :instantiationRights
|
|
13
|
+
include PBCore::Attributes::TimeInterval
|
|
14
|
+
|
|
15
|
+
build_xml do |xml|
|
|
16
|
+
xml.instantiationRights(xml_attributes.compact) do |xml|
|
|
17
|
+
summary.build(xml) if summary
|
|
18
|
+
link.build(xml) if link
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require 'pbcore/element'
|
|
2
|
+
|
|
3
|
+
module PBCore
|
|
4
|
+
class Instantiation::Standard < Element
|
|
5
|
+
element :instantiationStandard, as: :value
|
|
6
|
+
|
|
7
|
+
attribute :profile, as: :profile
|
|
8
|
+
|
|
9
|
+
build_xml do |xml|
|
|
10
|
+
xml.instantiationStandard(value, xml_attributes.compact)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
require 'pbcore/element'
|
|
2
|
+
|
|
3
|
+
module PBCore
|
|
4
|
+
class InstantiationDocument < Element
|
|
5
|
+
autoload :Identifier, 'pbcore/instantiation/identifier'
|
|
6
|
+
autoload :Date, 'pbcore/instantiation/date'
|
|
7
|
+
autoload :Dimensions, 'pbcore/instantiation/dimensions'
|
|
8
|
+
autoload :Physical, 'pbcore/instantiation/physical'
|
|
9
|
+
autoload :Digital, 'pbcore/instantiation/digital'
|
|
10
|
+
autoload :Standard, 'pbcore/instantiation/standard'
|
|
11
|
+
autoload :Location, 'pbcore/instantiation/location'
|
|
12
|
+
autoload :MediaType, 'pbcore/instantiation/media_type'
|
|
13
|
+
autoload :Generations, 'pbcore/instantiation/generations'
|
|
14
|
+
autoload :TimeStart, 'pbcore/instantiation/time_start'
|
|
15
|
+
autoload :FileSize, 'pbcore/instantiation/file_size'
|
|
16
|
+
autoload :Duration, 'pbcore/instantiation/duration'
|
|
17
|
+
autoload :DataRate, 'pbcore/instantiation/data_rate'
|
|
18
|
+
autoload :Colors, 'pbcore/instantiation/colors'
|
|
19
|
+
autoload :Tracks, 'pbcore/instantiation/tracks'
|
|
20
|
+
autoload :ChannelConfiguration, 'pbcore/instantiation/channel_configuration'
|
|
21
|
+
autoload :Language, 'pbcore/instantiation/language'
|
|
22
|
+
autoload :AlternativeModes, 'pbcore/instantiation/alternative_modes'
|
|
23
|
+
autoload :EssenceTrack, 'pbcore/instantiation/essence_track'
|
|
24
|
+
autoload :Extension, 'pbcore/instantiation/extension'
|
|
25
|
+
autoload :Relation, 'pbcore/instantiation/relation'
|
|
26
|
+
autoload :Rights, 'pbcore/instantiation/rights'
|
|
27
|
+
autoload :Annotation, 'pbcore/instantiation/annotation'
|
|
28
|
+
|
|
29
|
+
element :pbcoreInstantiationDocument, as: :value
|
|
30
|
+
elements :instantiationIdentifier, as: :identifiers, class: PBCore::Instantiation::Identifier
|
|
31
|
+
elements :instantiationDate, as: :dates, class: PBCore::Instantiation::Date
|
|
32
|
+
elements :instantiationDimensions, as: :dimensions, class: PBCore::Instantiation::Dimensions
|
|
33
|
+
element :instantiationPhysical, as: :physical, class: PBCore::Instantiation::Physical
|
|
34
|
+
element :instantiationDigital, as: :digital, class: PBCore::Instantiation::Digital
|
|
35
|
+
element :instantiationStandard, as: :standard, class: PBCore::Instantiation::Standard
|
|
36
|
+
element :instantiationLocation, as: :location, class: PBCore::Instantiation::Location
|
|
37
|
+
element :instantiationMediaType, as: :media_type, class: PBCore::Instantiation::MediaType
|
|
38
|
+
elements :instantiationGenerations, as: :generations, class: PBCore::Instantiation::Generations
|
|
39
|
+
elements :instantiationTimeStart, as: :time_starts, class: PBCore::Instantiation::TimeStart
|
|
40
|
+
element :instantiationFileSize, as: :file_size, class: PBCore::Instantiation::FileSize
|
|
41
|
+
element :instantiationDuration, as: :duration, class: PBCore::Instantiation::Duration
|
|
42
|
+
element :instantiationDataRate, as: :data_rate, class: PBCore::Instantiation::DataRate
|
|
43
|
+
element :instantiationColors, as: :colors, class: PBCore::Instantiation::Colors
|
|
44
|
+
element :instantiationTracks, as: :tracks, class: PBCore::Instantiation::Tracks
|
|
45
|
+
element :instantiationChannelConfiguration, as: :channel_configuration, class: PBCore::Instantiation::ChannelConfiguration
|
|
46
|
+
elements :instantiationLanguage, as: :languages, class: PBCore::Instantiation::Language
|
|
47
|
+
element :instantiationAlternativeModes, as: :alternative_modes, class: PBCore::Instantiation::AlternativeModes
|
|
48
|
+
elements :instantiationEssenceTrack, as: :essence_tracks, class: PBCore::Instantiation::EssenceTrack
|
|
49
|
+
elements :instantiationExtension, as: :extensions, class: PBCore::Instantiation::Extension
|
|
50
|
+
elements :instantiationRelation, as: :relations, class: PBCore::Instantiation::Relation
|
|
51
|
+
elements :instantiationRights, as: :rights, class: PBCore::Instantiation::Rights
|
|
52
|
+
elements :instantiationAnnotation, as: :annotations, class: PBCore::Instantiation::Annotation
|
|
53
|
+
|
|
54
|
+
include PBCore::Attributes::TimeInterval
|
|
55
|
+
|
|
56
|
+
build_xml do |xml|
|
|
57
|
+
attrs = xml_attributes.merge(namespace_attributes).compact
|
|
58
|
+
xml.pbcoreInstantiationDocument(attrs) do |xml|
|
|
59
|
+
identifiers.each { |identifier| identifier.build(xml) }
|
|
60
|
+
dates.each { |date| date.build(xml) }
|
|
61
|
+
dimensions.each { |dimensions_element| dimensions_element.build(xml) }
|
|
62
|
+
physical.build(xml) if physical
|
|
63
|
+
digital.build(xml) if digital
|
|
64
|
+
standard.build(xml) if standard
|
|
65
|
+
location.build(xml) if location
|
|
66
|
+
media_type.build(xml) if media_type
|
|
67
|
+
generations.each { |generations_element| generations_element.build(xml) }
|
|
68
|
+
time_starts.each { |time_start| time_start.build(xml) }
|
|
69
|
+
file_size.build(xml) if file_size
|
|
70
|
+
duration.build(xml) if duration
|
|
71
|
+
data_rate.build(xml) if data_rate
|
|
72
|
+
colors.build(xml) if colors
|
|
73
|
+
tracks.build(xml) if tracks
|
|
74
|
+
channel_configuration.build(xml) if channel_configuration
|
|
75
|
+
languages.each { |language| language.build(xml) }
|
|
76
|
+
alternative_modes.build(xml) if alternative_modes
|
|
77
|
+
essence_tracks.each { |essence_track| essence_track.build(xml) }
|
|
78
|
+
extensions.each { |extension| extension.build(xml) }
|
|
79
|
+
relations.each { |relation| relation.build(xml) }
|
|
80
|
+
rights.each { |rights_element| rights_element.build(xml) }
|
|
81
|
+
annotations.each { |annotation| annotation.build(xml) }
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
private
|
|
86
|
+
# NOTE: For some reason, these attributes will not parse with SAXMachine
|
|
87
|
+
# attributes.
|
|
88
|
+
# TODO: Is there a better way to set namespace attributes?
|
|
89
|
+
def namespace_attributes
|
|
90
|
+
{
|
|
91
|
+
'xmlns' => "http://www.pbcore.org/PBCore/PBCoreNamespace.html",
|
|
92
|
+
'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance",
|
|
93
|
+
'xsi:schemaLocation' => "http://www.pbcore.org/PBCore/PBCoreNamespace.html http://www.pbcore.org/xsd/pbcore-2.1.xsd"
|
|
94
|
+
}
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|