iiif / prezi-2-to-3 Goto Github PK
View Code? Open in Web Editor NEWLibraries to upgrade Presentation API v2 to v3 automatically
License: Apache License 2.0
Libraries to upgrade Presentation API v2 to v3 automatically
License: Apache License 2.0
@id
is renamed to id
Issue: IIIF/api#590
@type
is renamed to type
Issue: IIIF/api#590
Moving to Web Annotation with the default context means changing full to source
Issue:
viewingHint
is renamed to behavior
Issue: IIIF/api#1073
From pull request: GH-15
"Looks good.
Minor niggle about the flags for the online service allowing deref and crawl, as it could be used for denial of service ... but we can put it back if it becomes a problem in practice."
Our Manifests are not on an open-to-the-internet server so I can't share URLs.
I'm running the CLI on a v2 Manifest to generate a v3, but when I run the v3 Manifest output against the IIIF Manifest validator (running locally), it identifies an error: 'True is not of type 'string' - in the context of the requiredStatement label.
This is the section in the output v3 Manifest where the requiredStatement issue is found:
"requiredStatement": {
"label": {
"true": [
true
]
},
"value": {
"true": [
"BFI National Archive"
]
}
},
And this is the section in the input v2Manifest where the 'BFI National Archive' sits, in the 'attribution':
{
"@context": "http:/iiif.io/api/presentation/2/context.json",
"@type": "sc:Manifest",
"@id": "https://serverDNSname/collections_assets/40000852/manifest.json",
"label": "Title of film",
"attribution": "BFI National Archive",
So it seems that attribution is not being added as an 'Attribution' string in the requiredStatement label -instead an unquoted true is being added.
I can work around this with a post-conversion script, or I can dig into the prezi-2-to-3 Python, but wanted to document this.
Needs to be a string per Web Annotation context, but currently gets turned into a languageMap per IIIF context.
All structural containment properties were renamed to items
.
Issue: IIIF/api#1145
The move to Web Annotation with the default context changes resource back to body.
Issue:
Need to add IIIF favicon
license
is renamed to rights
Issue: IIIF/api#636
As the service returns a real manifest, there is no slot of non-fatal warnings.
Proposal: If debug
is turned on, add a _warnings
property to the top level resource and collect them all there.
Remove the context definition for oa:hasTarget and use target, per Web Annotation model.
Issue:
Web Annotation changed style to styleClass to be more explicit.
Issue:
Per discussion at the BL meeting there's some interest in a JavaScript version of this which could be used to recode version 2 manifests to 3 on the fly, such as in a v3 web viewer. (Or could be run in a server context via node.)
I can give this a try; it looks pretty straightforward, the main required difference being that URI dereferencing in fix_objects() needs to be done asynchronously.
Should I make a PR against this repo or make my own separate one?
otherContent
on everything other than a Canvas goes to annotations
. On a canvas it needs to be checked as to whether the annotations are painting or not.
Per IIIF/api#1417
Running prezi_2_to_3.py from the command line produces funky language maps with "true" as their default language key. Running:
python2 prezi2to3.py https://iiif.museum.colby.edu/presentation/portfolio/1334.json --output /tmp/1334.json
Results in a file with labels like:
"label": {
"true": [
"A View of Albany, New York"
]
}
My workaround thus far is just to adjust this line:
if FLAGS[key]['default'] is not str:
type=bool
to
if type is not str:
type=bool
But since this is the only stringy flag I'm using, not sure what other upgrader flags that might adversely affect.
startCanvas
is renamed to start
Issue: IIIF/api#1320
See remote test URIs
contentLayer
is renamed to includes
Issue: IIIF/api#1174
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.