diff --git a/README.md b/README.md index 50adbdd..ddfaaaa 100644 --- a/README.md +++ b/README.md @@ -82,11 +82,11 @@ const { MusicRecording } = require('./src/music') -// 'member' expects an array of Parties +// 'members' expects an array of Parties const group = new MusicGroup() group.setDescription('descriptive') group.setName('Beatles') -group.addMember(man) +group.addMembers(man) group.path = '' const composition = new MusicComposition() @@ -102,17 +102,17 @@ recording.setRecordingOf(comp) console.log(recording.data()) -// { +// { // "@context": "http://coalaip.org", // "@type": "MusicRecording", -// "byArtist": [ -// { +// "byArtist": [ +// { // "@context": "http://schema.org", // "@type": "MusicGroup", // "name": "Beatles", // "description": "descriptive", -// "member": [ -// { +// "members": [ +// { // "@context": "http://schema.org", // "@type": "Person", // "givenName": "John", @@ -122,11 +122,11 @@ console.log(recording.data()) // ] // } // ], -// "recordingOf": { +// "recordingOf": { // "@context": "http://coalaip.org", // "@type": "MusicComposition", -// "composer": [ -// { +// "composer": [ +// { // "@context": "http://schema.org", // "@type": "Person", // "givenName": "John", @@ -141,15 +141,15 @@ console.log(recording.data()) console.log(recording.ipld()) -// { +// { // "@context": "http://coalaip.org", // "@type": "MusicRecording", -// "byArtist": [ -// { +// "byArtist": [ +// { // "/": "" // } // ], -// "recordingOf": { +// "recordingOf": { // "/": "" // } // } diff --git a/src/core.js b/src/core.js index a8b4360..ad1901e 100644 --- a/src/core.js +++ b/src/core.js @@ -40,6 +40,7 @@ inherit(CreativeWork, Thing) propArray(CreativeWork, String(), 'genre') propArray(CreativeWork, new Party(), 'producer') propArray(CreativeWork, new Party(), 'publisher') +propArray(CreativeWork, new MediaObject(), 'associatedMedia') // Intangible @@ -121,7 +122,7 @@ function Organization (type = 'Organization') { inherit(Organization, Party) -propArray(Organization, new Party(), 'member') +propArray(Organization, new Party(), 'members') // Person diff --git a/src/music.js b/src/music.js index b221238..9d11d50 100644 --- a/src/music.js +++ b/src/music.js @@ -42,7 +42,7 @@ function MusicPlaylist (type = 'MusicPlaylist') { } inherit(MusicPlaylist, CreativeWork) -propArray(MusicPlaylist, new MusicRecording(), 'track') +propArray(MusicPlaylist, new MusicRecording(), 'tracks') // MusicRecording diff --git a/test/fixtures/core.js b/test/fixtures/core.js index e694086..c4c5192 100644 --- a/test/fixtures/core.js +++ b/test/fixtures/core.js @@ -113,7 +113,8 @@ exports.CreativeWork = { add: { genre: 'slimecore', producer: party, - publisher: party + publisher: party, + associatedMedia: [imageObject, imageObject] }, set: { name: 'creativeWork' @@ -258,7 +259,7 @@ exports.Organization = { core.Party ], add: { - member: party + members: [party, party] }, set: { email: 'me@example.org', diff --git a/test/fixtures/music.js b/test/fixtures/music.js index 055e82d..f1a0133 100644 --- a/test/fixtures/music.js +++ b/test/fixtures/music.js @@ -73,7 +73,7 @@ exports.MusicGroup = { ], add: { genre: 'ska', - member: party + members: [party, party] }, set: { email: 'me@example.org', @@ -117,7 +117,7 @@ exports.MusicPlaylist = { genre: 'slimecore', producer: party, publisher: party, - track: musicRecording + tracks: [musicRecording, musicRecording] }, set: { name: 'musicPlaylist' @@ -139,7 +139,7 @@ exports.MusicAlbum = { genre: 'slimecore', producer: party, publisher: party, - track: musicRecording + tracks: [musicRecording, musicRecording] }, set: { albumProductionType: 'DemoAlbum', @@ -162,7 +162,7 @@ exports.MusicRelease = { producer: party, publisher: party, recordLabel: party, - track: musicRecording + tracks: [musicRecording, musicRecording] }, set: { catalogNumber: '12345',