JSON-LD configuration
[jsonld]
@context documents are resolved.[[jsonld.preloaded_contexts]]
[[jsonld.preloaded_contexts]] table each with its url and path. Set in the file only. Left out, no context is preloaded.# [[jsonld.preloaded_contexts]]
# url = "https://example.org/ngsi-ld/context.jsonld"
# path = "contexts/example.jsonld"
The URL the context is known by. A preloaded URL is never downloaded.
The file the context is read from, which must exist and hold a valid @context document. A relative path that does not resolve from the working directory is read relative to the configuration file's directory.
[jsonld.fetch]
@context is downloaded.[jsonld.fetch]
mode = "enabled"
timeout = "10s"
max_redirects = 5
max_size = "2 MiB"
private_addresses = "allowed"
allowed_addresses = []
denied_addresses = []
Whether a context that is neither embedded, preloaded, stored nor cached may be downloaded. With "disabled" nothing is downloaded: only the core @context and the W3C Data Integrity context it names, preloaded documents, stored @contexts and what is already cached are used.
How long one download may take, its redirects included. A download that times out is not retried and is answered 504 LdContextNotAvailable. A JSON-LD alternate is a download of its own, and a request naming several remote @contexts waits for each, so keep it well below request_limits.timeout.
How many redirects one download may follow. Every redirect target is held to jsonld.fetch.private_addresses, jsonld.fetch.allowed_addresses and jsonld.fetch.denied_addresses as the first URL is.
The largest @context document the broker downloads. A larger one is refused with 504 LdContextNotAvailable.
Whether a @context URL resolving into private or reserved address space is downloaded, and so every redirect and JSON-LD alternate the download follows. Checked against the address actually resolved, not the host name. jsonld.fetch.allowed_addresses exempts addresses from "refused", and jsonld.fetch.denied_addresses refuses addresses whatever this is set to. A refused download is answered 504 LdContextNotAvailable. Set "refused" when clients you do not trust can name a @context.
IP addresses and subnets ("10.2.0.0/24", "10.3.0.17", "fd00:1234::/48") that a @context download may resolve into even though jsonld.fetch.private_addresses is "refused", such as a server in the broker's own network that hosts the contexts its clients use. Empty by default. An entry in jsonld.fetch.denied_addresses takes precedence.
IP addresses and subnets ("203.0.113.0/24", "198.51.100.9") that a @context download must not resolve into, public ones included and whatever jsonld.fetch.private_addresses is set to. Empty by default. Takes precedence over jsonld.fetch.allowed_addresses.
[jsonld.cache]
[jsonld.cache]
max_entries = 1024
default_lifetime = "1h"
hosted_revalidation_interval = "1m"
hit_flush_interval = "5s"
The most entries each in-process context cache holds.
How long a downloaded @context is kept when its response sets no Expires and no Cache-Control max-age or s-maxage, and how long a term-cache entry lives. A response that sets one of those keeps its own lifetime.
How long a broker process uses its in-memory copy of a @context the broker stores itself before reading it from the database again, since another process sharing the database may have deleted it. It is also the max-age sent when such a @context is served, in whole seconds.
How often the numberOfHits counters of stored @contexts are written to the database.