Merge @type and @datatype

Sorry for spamming the mailing list today, but as it was quite silent here
recently I would like to use the opportunity to discuss a number of things I
came up with while I reviewed the spec. So there may be more mails coming
:-)

This one is about merging @type and @datatype.

@type is used to set the type of the active subject.
@datatype is used to specify the datatype for a literal.

Since @datatype has always to be used with @literal in an object it is kind
of redundant. E.g. consider the following:

...
{ "@literal": "4.8", "@datatype": "xsd:decimal" }
...

It would be invalid to create something like

{ "@literal": "Markus", "@type": "foaf:Person" }


I understand that in a RDF world the distinction is necessary, but in
JSON-LD we do not need to distinguish the two keywords as they can't be
misinterpreted.

So I would like to propose to merge @datatype and @type to @type (ISSUE-31).
I think this won't cause any problems in the already implemented algorithms
and just require a change from @datatype to @type. The reason behind this is
that both, @type and @datatype, specify the "data type" of a construct, the
only difference is that the one addresses subjects while the other addresses
objects.
Since simplicity is one of the design goals of JSON-LD, the reduction of
keywords is desirable.



--
Markus Lanthaler
@markuslanthaler

Received on Wednesday, 28 September 2011 12:26:13 UTC