[x3d-public] JSON Encoding

John Carlson yottzumm at gmail.com
Tue Dec 22 08:03:08 PST 2015


I think we want to use something like rapidjson for c++ JSON parsing.   I
was looking at it in assimp where they use it for parsing glTF.  I believe
it uses both SAX (streaming) and DOM style parsing.  Whether we access JSON
as Cecile suggests is to be seen.  I'd like to see a real application
written in both styles to determine whether it makes a difference which
style we use.  Perhaps we should consider accepting both styles of JSON?
Really it's up to the application writer to determine whether any
preprocessing needs to be done.  We can probably convert from X3D JSON to
JSON5  and back.
On Dec 22, 2015 9:12 AM, "Roy Walmsley" <roy.walmsley at ntlworld.com> wrote:

> Hi again, Don and Cecile.
>
>
>
> Having looked at Cecile’s examples on GitHub I hope I am  beginning to
> understand the issues better. Although one thing I don’t understand is the
> significance of the “$” in the JSON5 encoding. For example,
> “appearance”:{“$”:”Appearance”,”material”:{“$”:”Material”, etc. Where is
> this usage defined/explained, please?
>
>
>
> So, we take a JSON encoding (of one sort or another) and parse it. This
> produces some sort of internal representation, which you can reference with
> the appropriate string/path.
>
>
>
> But, we also need to generate internal structures that actually manage the
> 3D graphics work. Then any access references relative to the internal
> representation have to be converted to be relative to the internal
> structures.
>
>
>
> Cecile’s paths make me assume that everything is loaded “as is”, i.e.
> comments, structures such as children (or content), into the external
> representation on parsing. Even though they are going to be removed for
> generation of the 3D structures needed.
>
>
>
> So, it seems to me some of the things we have to decide are:
>
>
>
> 1)      What format of JSON do we want to use?
>
> 2)      Do we want to achieve lossless round tripping between encodings?
>
> 3)      What are the priorities for minimization, e.g. file
> size/complexity, access paths, etc.
>
> 4)      Do we want a parser/loader to convert everything as is, or to
> perform some optimizations along the way to eliminate comments and
> structures such as content/children, so that the internal representation is
> much closer to the 3D structures required? Or put it another way, use a
> standard JSON parser or a specific X3D JSON parser?
>
>
>
> Regards,
>
>
>
> Roy
>
>
>
> *From:* x3d-public [mailto:x3d-public-bounces at web3d.org] *On Behalf Of *Cecile
> Muller
> *Sent:* 22 December 2015 01:00
> *To:* X3D Graphics public mailing list
> *Subject:* Re: [x3d-public] JSON Encoding
>
>
>
> Hi again Don,
>
>
>
>
>
> > Wondering, does JSON5 provide an alternative syntax for referencing the
> same JSON structure?
>
>
>
> No it doesn't have one afaik.
>
>
>
>
>
> See you,
>
> Cecile
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20151222/f988ebb6/attachment.html>


More information about the x3d-public mailing list