-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON Schema - metadata.source? #14
Comments
Seems to be missing from https://github.com/readium/webpub-manifest/blob/master/schema/metadata.schema.json |
Related issue: #8 |
I have mixed feelings about this one. While we declare it in the JSON-LD context document, we don't really talk about it elsewhere. It's currently mapped to http://schema.org/isBasedOn but given the rather "flexible" nature of |
My advice would be to map this to schema.org and use the inherent extensibility of the model in various implementations. This could be covered in the parsing doc in the future cc @JayPanoz |
Same with
|
I see two potential way of dealing with this:
I would only follow the first approach for metadata that we consider important enough, everything else should simply use our extensibility. |
I'm trying to add the remaining I didn't find any way to get the namespace URL for a given prefix in our Swift XML lib (or access the Edit: This is wrong, see #14 (comment) |
Expanding them to a full URL is probably the right way to handle this for now. |
Okay, I think I found something in |
I have three related questions:
|
I just found out that the prefixes used in
|
Ah yeah, just to reinstate that you should feel free to complete the parsing doc. For starters, it’s not complete by any means, so having at least a documented reference will help discuss it and fine-tune handling. Then there is metadata I’m honestly not familiar with, and don’t know how to handle – I legit don’t know what authors expect for some metadata for instance, but having a written reference makes it (more) easily sharable/reviewable by others. Finally I’m confident others are more knowledgeable than me when it comes to some metadata I’ve never used as an author. |
For reference, I came up with this solution on Swift: This generates the (@HadrienGardeur My three questions are still relevant though: #14 (comment)) To author the additional // List of properties that should not be added to `otherMetadata` because they
// are already consumed by the RWPM model.
private let rwpmProperties: [OPFVocabulary: [String]] = [
.defaultMetadata: ["cover"],
.dc: ["contributor", "creator", "publisher"],
.dcterms: ["contributor", "creator", "modified", "publisher"],
.media: ["duration"],
.rendition: ["flow", "layout", "orientation", "spread"]
] Finally, here's an example of JSON produced for "metadata": {
"http://www.idpf.org/epub/vocab/package/a11y/#certifiedBy": "EDRLab",
"http://purl.org/dc/elements/1.1/source": ["Feedbooks", "Web", "Internet"],
"http://purl.org/dc/elements/1.1/rights": "Public Domain",
"http://idpf.org/epub/vocab/package/#type": "article",
"http://my.url/#customProperty": "Custom property",
"rendition": {
"spread": "both",
"overflow": "scrolled",
"orientation": "landscape",
"layout": "fixed"
}
} from <package prefix="
rend-alias: http://www.idpf.org/vocab/rendition/#
myPrefix: http://my.url/#">
<metadata>
<dc:source>Feedbooks</dc:source>
<meta property="dc:source">Web</meta>
<meta name="dc:source" content="Internet"/>
<dc:rights>Public Domain</dc:rights>
<meta property="rendition:layout">pre-paginated</meta>
<meta property="rend-alias:orientation">landscape</meta>
<meta property="rendition:flow">scrolled-doc</meta>
<meta property="rendition:spread">both</meta>
<meta property="og:type">article</meta>
<meta property="a11y:certifiedBy">EDRLab</meta>
<meta property="myPrefix:customProperty">Custom property</meta>
</metadata>
</package> |
EPUB "reserved" prefixes: in practice they are probably never overridden (why would content creators want to take that risk) ... but they can! (even though they are "reserved")
...so strictly-speaking, Mickael's approach makes sense :) |
I think they could be either:
This is the use case where we could use an object:
You've covered this properly in your examples IMO. |
Related issue: #66 |
metadata.source
Currently parsed from EPUB (OPF XML):
metadata.source
= OPF/package/metadata/dc:source/text()
The text was updated successfully, but these errors were encountered: