From 6929f10ba76da16d08a2c948cb42703cf66c0651 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Mon, 29 Jul 2024 21:50:13 +0100 Subject: [PATCH] Fix formatting and add note about provider fields --- optimade.rst | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/optimade.rst b/optimade.rst index 87d72501..6e24b2cc 100644 --- a/optimade.rst +++ b/optimade.rst @@ -4521,30 +4521,36 @@ The OPTIMADE JSON Lines format then extends these rules with the following conve - First the base info response MUST be provided, following the description at `Base Info Endpoint`_. - The next lines MUST contain the entry info endpoint responses for the all entry types present later in the file, as described in `Entry Listing Info Endpoints`_. These MUST appear in alphabetical order by entry type name. -- The remaining lines of the file contain data entries themselves, described in `Entry Listng JSON Response Schema`_. +- The remaining lines of the file contain data entries themselves, described in `Entry Listing JSON Response Schema`_. Again, these MUST appear in block alphabetical order by entry type name, but can appear in any order within those blocks. - Finally, any custom extension endpoints (see `Custom Extension Endpoints`_), if present and desirable, MUST appear at the end of the file. This leaves the following overall file structure: -.. code :: text +.. code :: txt +
+ -- Information about prefixes and provider fields +This JSONL format can also be used to share provider-specific properties. +These should be consistent with any external definitions, and where appropriate, prefixes tied to the tools used to generate the file should be used. +It is RECOMMENDED that custom properties are defined in full within the JSONL file, or pointed to a specific versioned property definition. Example OPTIMADE JSON Lines File ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code :: json +.. code :: jsonc + {"x-optimade": {"api_version": "1.2.0"}} {"meta": {"time_stamp": "2024-07-19T11:47:10Z", "data_returned": 6, "provider": {"name": "Example JSONL", "description": "An example JSONL file.", "prefix": "_exmpl"}}} - {"type": "info", "id": "/", "attributes": {"api_version": "1.2.0", "available_api_versions": ["1.2.0"], "formats": ["json"], "entry_types_by_format": {"json": ["references", "structures"]}, "license": "https://example.com/licenses/example_license.html"} "homepage": "https://example.com", "name": "Example API", "provider": {"description": "A simple example provider", "name": "Example Provider"}}} + {"type": "info", "id": "/", "attributes": {"api_version": "1.2.0", "available_api_versions": ["1.2.0"], "formats": ["json"], "entry_types_by_format": {"json": ["references", "structures"]}, "license": "https://example.com/licenses/example_license.html"}, "homepage": "https://example.com", "name": "Example API", "provider": {"description": "A simple example provider", "name": "Example Provider"}}} {"type": "info", "id": "references", ...} {"type": "info", "id": "structures", ...} - {"type": "structures", "id": "1", "attributes": {...} + {"type": "structures", "id": "1", "attributes": {...}} + {"type": "references", "id": "2", "attributes": {...}}