Skip to content

Commit

Permalink
Fix formatting and add note about provider fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Jul 29, 2024
1 parent 02879bf commit 6929f10
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions optimade.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
<header>
<optional metadata>
<base info response>
<entry info responses>
<entries block ordered by entry type>
<optional custom extension endpoints>
- 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": {...}}

0 comments on commit 6929f10

Please sign in to comment.