Skip to content
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

Use of "alternate" to reference an item in the resources list #27

Closed
marisademeglio opened this issue Oct 10, 2019 · 4 comments
Closed

Comments

@marisademeglio
Copy link
Contributor

I have a question about the use of alternate - in this thread, @mattgarrish mentioned avoiding IDREF-style constructs.

So we defined alternate as a (list of) URL(s) or LinkedResource instance(s).

In the audiobooks spec’s sync media example, I see that alternate references a URL which can be resolved using the resources list.

I don't see that pub-manifest prohibits this but I also don't see any examples of the resource list being referenced by the reading order in this way.

So my question is if we should rewrite this example to show alternate directly containing a LinkedResource object.

@wareid
Copy link
Contributor

wareid commented Oct 11, 2019

That makes sense to me, saves referencing something twice in the manifest, but I would love feedback from @mattgarrish on his perspective on this.

@mattgarrish
Copy link
Member

mattgarrish commented Oct 11, 2019

So my question is if we should rewrite this example to show alternate directly containing a LinkedResource object.

Yes, the example is invalid because the processing rules for the manifest will turn strings in alternate into LinkedResources (we don't do ID/IDREF referencing):

"alternate" : [
    {
        "type": ["LinkedResource"],
        "url": "sync-media/part001-1.json"
    }
]

But if this happens, the required encodingFormat will be missing.

The processing algorithm also needs revising. If a bare string is used in alternate, the URL should be removed, unless we want to let user agents guess at the media type.

@mattgarrish
Copy link
Member

And to correct myself here, the example is invalid, but for the different reason that you're not supposed to repeat resource in both lists.

It would still be better to update the example to show proper linkedresource objects than use strings:

{
	"@context" : ["https://schema.org", "https://www.w3.org/ns/pub-context"],
	"type"		 : "Audiobook",
	"url"      : "https://publisher.example.org/janeeyre",
	"name"     : "Jane Eyre",
	"readingOrder" : [{
		"type"	: "LinkedResource",
		"url"   : "audio/part001.wav#0",
		"encodingFormat" : "audio/vnd-wav",
		"name"  : "Chapter 1",
		"duration" : "457.931",
		"alternate" : {
                    "type": "LinkedResource",
                    "url": "sync-media/part001-1.json",
                    "encodingFormat" : "application/vnd.wp-sync-media+json"
                }
	}, {
		"type"  : "LinkedResource",
		"url"   : "audio/part001.wav#457.932",
		"encodingFormat" : "audio/vnd-wav",
		"name"  : "Chapter 2",
		"duration" : "234.245",
		"alternate" : {
		    "type": "LinkedResource",
		    "url" : "sync-media/part001-2.json",
		    "encodingFormat" : "application/vnd.wp-sync-media+json"
	        }
	}]
}

@marisademeglio
Copy link
Contributor Author

And in example 12, which shows an HTML alternate for an mp3 file - I would think the same correction applies.

@wareid wareid closed this as completed Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants