Sha256: e0723ae1963950e40fab9271fc9d4db275e1bb58c3f0ba960f347a33a2381038

Contents?: true

Size: 1.52 KB

Versions: 4

Compression:

Stored size: 1.52 KB

Contents

require 'mida_vocabulary/vocabulary'

module Mida
  module SchemaOrg

    autoload :Thing, 'mida_vocabulary/vocabularies/schemaorg/thing'
    autoload :CreativeWork, 'mida_vocabulary/vocabularies/schemaorg/creativework'
    autoload :MusicGroup, 'mida_vocabulary/vocabularies/schemaorg/musicgroup'
    autoload :Duration, 'mida_vocabulary/vocabularies/schemaorg/duration'
    autoload :MusicAlbum, 'mida_vocabulary/vocabularies/schemaorg/musicalbum'
    autoload :MusicPlaylist, 'mida_vocabulary/vocabularies/schemaorg/musicplaylist'

    # A music recording (track), usually a single song.
    class MusicRecording < Mida::Vocabulary
      itemtype %r{http://schema.org/MusicRecording}i
      include_vocabulary Mida::SchemaOrg::Thing
      include_vocabulary Mida::SchemaOrg::CreativeWork

      # The artist that performed this album or recording.
      has_many 'byArtist' do
        extract Mida::SchemaOrg::MusicGroup
        extract Mida::DataType::Text
      end

      # The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.
      has_many 'duration' do
        extract Mida::SchemaOrg::Duration
        extract Mida::DataType::Text
      end

      # The album to which this recording belongs.
      has_many 'inAlbum' do
        extract Mida::SchemaOrg::MusicAlbum
        extract Mida::DataType::Text
      end

      # The playlist to which this recording belongs.
      has_many 'inPlaylist' do
        extract Mida::SchemaOrg::MusicPlaylist
        extract Mida::DataType::Text
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mida_vocabulary-0.1.3 lib/mida_vocabulary/vocabularies/schemaorg/musicrecording.rb
mida_vocabulary-0.1.2 lib/mida_vocabulary/vocabularies/schemaorg/musicrecording.rb
mida_vocabulary-0.1.1 lib/mida_vocabulary/vocabularies/schemaorg/musicrecording.rb
mida_vocabulary-0.1 lib/mida_vocabulary/vocabularies/schemaorg/musicrecording.rb