How you want to format it is up to you. You can take some inspiration from the .schem file format, which you can see here, or just write your own format based on what data you want to save. I believe if you actually run the //schematic command (or whatever it's called) and create a .schem file, you can open it with Notepad++ and see how they lay out the information. It may be in JSON. I'm not quite sure EDIT: They're in NBT format, which is similar to a loose-JSON format with various other features.