-
Notifications
You must be signed in to change notification settings - Fork 164
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
I just can't understand IRI, any expainations? #8
Comments
An IRI is an International Resource Identifier. It's basically a URI which is composed of Unicode characters (rather than sticking to URI's strict ASCII charset). Each metadata item is identified by a name and a prefix. The prefix may be empty, meaning that it's part of the base vocabulary. Now, for matching purposes, each prefix maps to an IRI. This is similar to the way XML namespaces operate: you assign a prefix to a URI, and then you use the prefix to qualify stuff. The parser then uses the prefix to expand to the full URI for matching purposes. This way if one document fragment defines It's the same for properties (all properties, not just metadata) in EPUB 3. Some prefixes are implicitly mapped by the standard, and you can define your own (as the EPUB FXL standard does, in fact). For matching purposes, the prefix is resolved to an IRI and the name is appended to that IRI to create the identifier for that particular property. Any new prefixes must be declared in the root So, if your package contains: <package ... prefix="rendition: http://www.idpf.org/vocab/rendition/#">
...
<spine toc="ncx">
<item idref="cover" properties="rendition:page-spread-center"/>
...
</spine>
...
</package> …the parser will take the <package ... prefix="r: http://www.idpf.org/vocab/rendition/#">
...
<spine toc="ncx">
<item idref="cover" properties="r:page-spread-center"/>
...
</spine>
...
</package> …and the parser would still map the property to the same IRI: Also note that all this has been overhauled to be much more flexible and obvious in the develop branch, which should be hitting master quite soon. |
Hi guys,
I've studied Readium SDK's code for a while, and I still don't quite understand what IRI used for. I know that IRI is something like URN + URL.
It seems IRI is used in many places across the src. For example, in metadata.h(https://github.com/readium/readium-sdk/blob/master/ePub3/ePub/metadata.h), line 231 is as following:
@param owner The Package to which the metadata belongs; used for property IRI
resolution.
/
void AddExtension(xmlNodePtr node, const Package owner);
why should metadata contain its package's reference? what does it mean here by "used for property IRI resoluation"?
Thx in advance :)
The text was updated successfully, but these errors were encountered: