-
Notifications
You must be signed in to change notification settings - Fork 19
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
Processing our manifest into WebIDL #268
Comments
Overall this will be fairly "heavy", but this is the price we have to pay for the flexibility when authoring JSON-LD + schema.org. |
@HadrienGardeur yes, the IDL and, mainly, the processing has to be updated along the lines of what you describe. I would, however, propose not to do it right now. I would think that the draft should be published by adding an editorial note into the document making it clear that the IDL + processing is out of date and this is one of the next steps to do. Once published, and giving the schema.org part some rest (and expect external comments) we can do the changes. @mattgarrish wdyt? |
@HadrienGardeur on the technical aspect of your comments: I wonder whether, in the processing description (and, actually, the implementation), we should rely on the expansion API of the JSON-LD standard. In other words, the first step (after getting hold of the manifest) is to run the JSON-LD through the expansion and pick up after that. As the standard says, the expansion will make the context files disappear... I am not saying it will solve all our issues, but:
WDYT? |
As an example, this is the expanded form of one of the examples in the document:
|
@iherman purely from a specification perspective, this would make things easier when writing our section about processing (except for From a real implementation point of view though, I doubt that most of our UAs will be JSON-LD aware at all, which might actually make things even more complex for them to implement. |
@HadrienGardeur I am not sure. UA-s may ignore JSON-LD, in some sense, just use (available) JS libraries to perform expansion. I would certainly not implement expansion myself. |
@iherman I'm worried about the overhead. It's not ideal to implement the processing manually, but there might be a real overhead (and/or a lack of libraries available in a given language) with the JSON-LD expansion API. |
I understand... let us see what other implementers may say! |
As a developer, looking at parsing a JSON structure to create an in-memory model, I would only expand the JSON-LD serialization if to do that I can find a great/well-maintained OSS lib for my favorite language (and here we could list more than 20 languages). It would be great but I doubt it will be the case. And after that, I would still have to map this structure to my in-memory model. Currently, we parse "by hand" the structure, as the simple JSON decoding feature or our favorite languages don't work with the polymorphic structure of the Webpub manifest. It's boring but direct. And the native JSON decoding feature of my language would not make a clean object from the expanded JSON-LD structure neither, so this unmarshalling would still be boring. |
Yeah... I have to accept all these arguments, it is still a pity, though. Relying on the compaction would make the manifest more future proof, too. For example, as of today, we cannot use the handy language map feature, because (afaik) no schema.org processor recognizes it. However, if they do tomorrow, we should then explicitly expand the processing of the manifest to include language maps to make it (standard wise) usable, whereas the expansion algorithm would handle that feature automatically, too. Anyway... it sounded like a good idea:-) |
I believe that the specific questions raised in this have been covered by the latest draft, the updates on the JSON-Schema, the conversion p.o.c implementation and some explicit issues. @HadrienGardeur @llemeurfr would it be o.k. to close this issue and, if I missed any open problem, raise it as a specific issue? (Knowing that Section 5 of the draft on the Lifecyle still needs update of course.) |
Good for me
…. @HadrienGardeur @llemeurfr would it be o.k. to close this issue and, if I missed any open problem, raise it as a specific issue?
|
I don't think that this issue has been truly covered. We need to take a decision between:
|
@HadrienGardeur (admin) I would prefer to push this into a separate issue, it is hard to handle an issue that has, in fact, several topics. Could you open this separately and then close the present issue? |
... but this is exactly what this issue is all about, why should we open the same one elsewhere? |
As you said: there is the high level question ( |
As for the question in #268 (comment): in my view, a refresh of the lifecycle session is the best option. The details of the algorithms may not be 100% detailed, ie, it is not a code reengineering into English; we will have to find the right style. I was considering giving a go at it based on the p.o.c. work I did, unless somebody beats me into it... |
Processing JSON into WebIDL seems to be an open question others are facing, too: whatwg/infra#159 and w3c/manifest#611 |
Yep... it is indeed not that simple. I was a bit too fast:-( The problem is how to describe things in a language independent manner. If it was a matter of describing things in, say, JavaScript, than the p.o.c. implementation works and takes care of many things behind the screens. My current thoughts are (comments welcome...)
How does that sound? |
I think this sounds good: it's a canonical version of our manifest. We'll need to be careful though about how everything is named in our WebIDL (including |
@HadrienGardeur @mattgarrish I have created #306 that contains now a section on a canonical manifest (thanks for the term, @HadrienGardeur, it is perfect!) I would propose to follow the discussion on the PR, we can make use of the PR facilities of direct comment and automatically generated diffs (that is why I already created a PR, although much work is still to be done). |
@HadrienGardeur @mattgarrish @iherman OK to close? |
The canonicalization is now inherent part of the draft. Closing... |
There's a pretty large gap in our current draft: we don't describe at all how the manifest should be parsed and processed.
url
,dateModified
,datePublished
andreadingProgression
) this is a straightforward conversion from JSONid
/@id
we need to define which term has the priority and what happens when both are presentname
, we need to check whether a string or an object (@value
+@language
) is used and parse it accordingly inLocalizableString
name
) formsname
as well (string or@value
+@language
)readingOrder
,resources
andlinks
):encodingFormat
when using a string? (TBD)rel
@name
+@language
) form forname
anddescription
contents
inreadingOrder
andresources
We also need to decide how this will be organized in the spec. Do we express processing requirements along the manifest expression? Under the lifecycle section? In the appendix for the WebIDL?
The text was updated successfully, but these errors were encountered: