revela.json (pronounced: revelation) is a JSON configuration file in which all "!!!" key values (spreads) are evaluated and their results then spread and merged on top of the surrounding object.
The evaluation allows for VPath operations, most notably importing relative config files and accessing their subsections. Together the evaluation, spread and merge allow for fine-grained DRY for various valos fabric config files.
This document is part of the library workspace @valos/inspire (of domain @valos/kernel) which has the description: `ValOS Inspire application gateway`.
trivial revelation patch
we expect
toEquallazyPatchRevelations(gatewayMock, { a: [1] }, { a: [2] })
({ a: [1, 2] })
spread of a simple relative import
we expect
toMatchObjectlazyPatchRevelations(gatewayMock, {}, { "!!!": "./path" })
({ revealOrigin: "/site/revelation/path", someField: 1 })
spread of an explicit site root import followed by field access
we expect
toEquallazyPatchRevelations(gatewayMock, "", { "!!!": ["/path", "revealOrigin"] })
"/site/path"
spread of a URI import followed by pick-array append
we expect
toEquallazyPatchRevelations(gatewayMock, [0], { "!!!": [ ["@$https.foobar.com%2Fpath"], [["@.:fetchedField"], ["@.:options@.:revealOrigin@@"]], ] }, undefined, ["last"])
[0, 1, "https://foobar.com/path", "last"]
non-evaluated spreader contents to be segmented but non-cemented
we expect
toEquallazyPatchRevelations(gatewayMock, {}, { "!!!": ["@@", [{ value: ["@$expanded.but-unbound"] }]] })
({ value: ["@$expanded", "but-unbound"] })
nested import & invoke spread to resolve all spreads
we expect
toEqualexpose(lazyPatchRevelations(gatewayMock, {}, { out: { "!!!": { prefixes: { "/test/v0": { name: "test", "test-lib": { preset: 10, overridden: 10, sessionDuration: 0, view: { focus: "focus to be overwritten", nulled: "nulled to be overwritten" }, unboundAndUnsegmented: ["@$un.bound"], }, }, }, }, prefixes: { "/test/v0": { "!!!": ["@@", ["@!:test-lib"], ["@!invoke:callMe", [{ view: { focus: "valaa-aws://example.org/deployment?id=@$~raw.f0c5-f0c5@@", nulled: null, }, identity: { "!!!": ["./config", "revealOrigin"] }, sessionDuration: 86400, unboundButSectioned: ["@$also.unbound"], }]]], "test-lib": { overridden: 20 }, }, } } }))
({ out: { prefixes: { "/test/v0": { name: "test", "test-lib": { preset: 10, overridden: 20, sessionDuration: 86400, view: { focus: "valaa-aws://example.org/deployment?id=@$~raw.f0c5-f0c5@@", nulled: null }, identity: "/site/revelation/config", unboundAndUnsegmented: ["@$un.bound"], unboundButSectioned: ["@$also", "unbound"], } } } } })
revela ontology specifies the verbs specific to revela.json files.
Prefix | IRI |
---|---|
rdf | http://www.w3.org/1999/02/22-rdf-syntax-ns# |
rdfs | http://www.w3.org/2000/01/rdf-schema# |
xsd | http://www.w3.org/2001/XMLSchema# |
owl | http://www.w3.org/2002/07/owl# |
dc | http://purl.org/dc/elements/1.1/ |
revela | https://valospace.org/inspire/revela# |
rdfs:label | rdf:type | Comment |
---|
rdfs:label | rdf:type | rdfs:subClassOf |
---|