W3C home > Mailing lists > Public > public-vocabs@w3.org > November 2013

JSON-LD in examples invalid due to comments

From: Markus Lanthaler <markus.lanthaler@gmx.net>
Date: Thu, 28 Nov 2013 11:45:52 +0100
To: "'W3C Web Schemas Task Force'" <public-vocabs@w3.org>
Message-ID: <014001ceec27$02e058e0$08a10aa0$@lanthaler@gmx.net>
Hi,

I've just realized that all (?) JSON-LD examples in schema.org are invalid
since they include comments. Just as JSON, JSON-LD doesn't support comments.

Example 1 of http://schema.org/Action for instance begins as follows:

  <script type="application/ld+json">
    // John listened to Pink with Steve at Anna's appartment on his iPod.
  {
    "@context": "http://schema.org",
    "@type": "ListenAction",
    ...

The second line turns this into invalid JSON(-LD). It should thus be
rewritten to

  <script type="application/ld+json">
  {
    "@context": "http://schema.org",
    "@type": "ListenAction",
    ...


Would it be possible to remove those comments at the beginning of all
examples? I fear that otherwise a lot of people will adapt this style which
will lead to severe interoperability problems.


Thanks,
Markus


--
Markus Lanthaler
@markuslanthaler
Received on Thursday, 28 November 2013 10:46:25 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:29:35 UTC