On 03/26/2012 10:56 PM, Daniel Kinzler wrote:
On 26.03.2012 22:28, Amgine wrote:
Are we talking about mime types for articles?
Yes, pretty much. Though technically, the mime type would only describe the
serialization format (e.g. "application/json"), not the data model (e.g.
"wikidata entity record") - both bits of information are needed. But
essentially, yes: pages will have types, and types have handlers for displaying,
editing, etc.
+1 for making serialization / data model information explicit. Parsoid
is also structured around per-input mime types, although currently only
a generic 'text/wiki' placeholder type is implemented. Each input type
has a specific parser pipeline associated with it, which eventually
produces tokens (at this stage mostly synonymous with HTML tags)
independent of input type for the last, shared token transformation phase.
There is no distinction between processing for displaying vs. editing
currently, as we try to preserve all relevant information for editing
using structured data (leaning towards RDFa) and attribute annotations
in a displayable DOM. We try to support schema-like information for
template editing. There might be a way to accommodate schema-like
information for Wikidata information using the same setup.
Mime types similar to those described for XML in RFC 3023 could be used
for JSON-serialized data. Maybe something like
application/wikidata+json? The syntax looks a bit backwards to me, but
at least there is the XML precedent, and anything with +json suffix can
be handled as generic JSON when the specific data model is not known.
Gabriel