HTTP Format

DataAxesFormats.HttpFormat Module

Read-only access to a FilesDaf directory served over HTTP.

The server is assumed to expose the FilesDaf directory tree verbatim, with GET {url}/{relative_path} returning the byte contents of the file. Any static web server (e.g. python -m http.server , nginx , S3 with HTTP access) pointed at the root directory will do.

The client downloads metadata.zip once at open time and keeps it in memory for the lifetime of the HttpDaf . Every .json file in the tree (plus the axes/metadata.json sidecar) is served from this in-memory archive, so enumerating scalars/axes/vectors/matrices and reading all their JSON metadata completes without further HTTP traffic.

Non-JSON payloads (axis entry .txt files, per-property .data / .nzind / .nzval / .colptr / .rowval / .nztxt ) are fetched lazily on first use via one GET each. Dense and sparse numeric vectors/matrices are returned zero-copy by unsafe_wrap 'ing the downloaded Vector{UInt8} buffer; the buffer is held alive by the same cache entry that holds the returned array. Matching the Zarr HTTP backend, the server data is assumed stable while an HttpDaf is open; reopening is the only way to pick up server-side changes.

Warning

Because returned vectors/matrices alias the cache entry's Vector{UInt8} backing, calling empty_cache! releases the memory that those arrays read from. Any vector/matrix reference previously returned by this format becomes dangling after the cache is emptied. Only call empty_cache! once you have dropped all references returned by prior queries.

Only a read-only interface is exposed; mutations are not supported.

DataAxesFormats.HttpFormat.HttpDaf Type
struct HttpDaf <: DafReader ... end

HttpDaf(
    url::AbstractString;
    [name::Maybe{AbstractString} = nothing]
)::HttpDaf

Open a read-only view of a remote FilesDaf served over http:// or https:// . url points at the root directory; the server must expose metadata.zip alongside the usual FilesDaf tree.

If name is not specified and the remote data set defines a name scalar property, it is used as the name; otherwise, the url itself is used.

Warning

Vectors and matrices returned by this format alias Vector{UInt8} buffers that are held alive by the Daf cache. Calling empty_cache! on this HttpDaf releases those buffers, so any previously returned array reference becomes dangling. Drop all such references before emptying the cache.

Index