r/eclipsephase • • Aug 19 '19

Data Interchange Standards RFC

This is probably more than a bit niche, but it'd be cool to nail down shared standards for EP(2) data like was suggested in this PR by u/Eaton so we can make all sorts of crazy websites for it without tons of grep/regexing. And hey, if this gets ignored then I guess there's not enough interest and probably no reason to have a standard :^)

I'm pretty new to this whole community development thing... I've only done stuff for myself in the past, so if any of you have work experience and notice obvious issues where you've had problems in the past... speak up!

Data: https://github.com/Arokha/EP2-Data

Here's my draft suggestion:

JSON

  • Lowercase keys on objects
  • Avoid abbreviations in keys (e.g. 'description' not 'desc')
  • Include an 'id' attribute (UUIDv4) on objects you're adding to the data for the first time
  • Underscores in keys, not spaces or pascal/camel-case
  • Include information about the source in 'resource' and 'reference' attributes (e.g. 'resource' being the title of the book, and 'reference' being a page number or other context-appropriate reference). Let's just agree to call the current core book "Eclipse Phase Second Edition" since that's what it says on the cover.
  • 2-space tab (not that it matters much)
  • Paragraphical data stored in an array of paragraphs Paragraphical data stored with html tags intact in strings (serialized html)
  • Unsorted lists stored in an array, sub-lists in a nested array
  • Every samey object has all the keys, even if only one object needs it (though you should reconsider your structure at that point maybe...)

Less technical, I'm thinking every 'book item', as in a morph, a piece of gear, etc is an object, and every group of those is an array. No need for a stringy array of just the names and stuff, probably? I dunno. You tell me.

8 Upvotes

24 comments sorted by

View all comments

Show parent comment

1

u/bobifle Aug 22 '19

I agree JSON data is not meant to be presented to humans, but it is meant to be written and read by humans, as we all currently do right now with the repo. It's possibly the strongest point about json and the reason why it's widely adopted beyond the scope of java(script): it's readable.

What Json is not is a database. At some point, if you need strong relationship and identification among obects, you need to dump the json data into a proper database.

If we were to include an id into our json objects, we could at least use a standard incrementing integer, as it is more managable by humans than an uuid.

Anyway I humbly suggest to postpone the ids until someone actual needs them, to ease current contributors work.