-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from IIIF-Commons/support-multiple-language-ma…
…p-values Add support to enable multiple metadata value retreival
- Loading branch information
Showing
8 changed files
with
134 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"@context": "http://iiif.io/api/presentation/2/context.json", | ||
"@id": "http://iiif.io/api/presentation/2.1/example/fixtures/4/manifest.json", | ||
"@type": "sc:Manifest", | ||
"label": "Test 4 Manifest: Metadata Pairs with Multiple Values in same Language", | ||
"metadata": [ | ||
{ | ||
"label": "date", | ||
"value": [ | ||
"some date", | ||
"some other date" | ||
] | ||
} | ||
], | ||
"within": "http://iiif.io/api/presentation/2.1/example/fixtures/collection.json", | ||
"sequences": [ | ||
{ | ||
"@type": "sc:Sequence", | ||
"label": "Test 4 Sequence 1", | ||
"canvases": [ | ||
{ | ||
"@id": "http://iiif.io/api/presentation/2.1/example/fixtures/canvas/4/c1.json", | ||
"@type": "sc:Canvas", | ||
"label": "Test 4 Canvas: 1", | ||
"height": 1800, | ||
"width": 1200, | ||
"images": [ | ||
{ | ||
"@type": "oa:Annotation", | ||
"motivation": "sc:painting", | ||
"resource": { | ||
"@id": "http://iiif.io/api/presentation/2.1/example/fixtures/resources/page1-full.png", | ||
"@type": "dctypes:Image", | ||
"height": 1800, | ||
"width": 1200 | ||
}, | ||
"on": "http://iiif.io/api/presentation/2.1/example/fixtures/canvas/4/c1.json" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
var expect = require('chai').expect; | ||
var should = require('chai').should(); | ||
var manifesto = require('../../dist-commonjs/'); | ||
var manifests = require('../fixtures/manifests'); | ||
var ServiceProfile = require('@iiif/vocabulary/dist-commonjs/').ServiceProfile; | ||
|
||
var manifest; | ||
|
||
describe('LabelValuePair', function() { | ||
beforeEach(function(done) { | ||
manifesto.loadManifest(manifests['4']).then(function(data) { | ||
manifest = manifesto.parseManifest(data); | ||
done(); | ||
}); | ||
}) | ||
describe('#getValues', function() { | ||
it('returns an array of language values', function() { | ||
var metadata = manifest.getMetadata().map(m => m.getValues()); | ||
expect(metadata[0]).to.eql(['some date', 'some other date']); | ||
}); | ||
}); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
var expect = require('chai').expect; | ||
var should = require('chai').should(); | ||
var manifesto = require('../../dist-commonjs/'); | ||
var manifests = require('../fixtures/manifests'); | ||
var ServiceProfile = require('@iiif/vocabulary/dist-commonjs/').ServiceProfile; | ||
|
||
var manifest; | ||
|
||
describe('LanguageMap', function() { | ||
beforeEach(function(done) { | ||
manifesto.loadManifest(manifests['4']).then(function(data) { | ||
manifest = manifesto.parseManifest(data); | ||
done(); | ||
}); | ||
}) | ||
describe('#getValues', function() { | ||
it('returns an array of language values', function() { | ||
var metadata = manifesto.LanguageMap.getValues(manifest.getMetadata())[0].map(v => v.value); | ||
expect(metadata).to.eql(['some date', 'some other date']); | ||
}); | ||
}); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters