References specification ======================== The content of a reference set should match the given description here. ``fsspec``'s ``ReferenceFileSystem`` expects this kind of input. Version 0 --------- Prototype spec for the structure required by ReferenceFileSystem: .. code-block:: json { "key0": "data", "key1": ["protocol://target_url", 10000, 100] } where: * ``key0`` includes data as-is (stored as text) * ``key1`` refers to a data file URL, the offset within the file (in bytes), and the length of the data item (in bytes). For example, Zarr data in this proposed spec might be represented as: .. code-block:: json { ".zgroup": "{\n \"zarr_format\": 2\n}", ".zattrs": "{\n \"Conventions\": \"UGRID-0.9.0\n\"}", "x/.zattrs": "{\n \"_ARRAY_DIMENSIONS\": [\n \"node\"\n ...", "x/.zarray": "{\n \"chunks\": [\n 9228245\n ],\n \"compressor\": null,\n \"dtype\": \"10000,<=20000 would be in "./name/refs.2.parquet". Each file is (for now) padded to record_size, but they compress really well. Each row of the parquet data contains fields .. code-block:: path: optional str/categorical, remote location URL offset: int, start location of block size: int, number of bytes in block raw: optional bytes, binary data If ``raw`` is populated, this is the data of the key. If ``path`` is populated but size is 0, it is the whole file indicated (like a JSON [url] reference). Otherwise, it is a byte block in the indicated file (like a JSON [url, offset, size] reference). If both ``raw`` and ``path`` are NULL, the key does not exist. We reserve the possibility to store small array data in .zmetadata instead of creating a small/mostly empty parquet file for each.