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

 lazyPatchRevelations(gatewayMock,
    { a: [1] },
    { a: [2] })
toEqual
 ({ a: [1, 2] })

spread of a simple relative import

we expect

 lazyPatchRevelations(gatewayMock,
    {},
    { "!!!": "./path" })
toMatchObject
 ({ revealOrigin: "/site/revelation/path", someField: 1 })

spread of an explicit site root import followed by field access

we expect

 lazyPatchRevelations(gatewayMock,
    "",
    { "!!!": ["/path", "revealOrigin"] })
toEqual
"/site/path"

spread of a URI import followed by pick-array append

we expect

 lazyPatchRevelations(gatewayMock,
    [0],
    { "!!!": [
      ["@$https.foobar.com%2Fpath"],
      [["@.:fetchedField"], ["@.:options@.:revealOrigin@@"]],
    ] },
    undefined,
    ["last"])
toEqual
 [0, 1, "https://foobar.com/path", "last"]

non-evaluated spreader contents to be segmented but non-cemented

we expect

 lazyPatchRevelations(gatewayMock,
    {},
    { "!!!": ["@@", [{ value: ["@$expanded.but-unbound"] }]] })
toEqual
 ({ value: ["@$expanded", "but-unbound"] })

nested import & invoke spread to resolve all spreads

we expect

 expose(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 },
          },
        }
      }
    }))
toEqual
 ({
  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

revela ontology specifies the verbs specific to revela.json files.

§ revela IRI prefixes

Prefix IRI
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfshttp://www.w3.org/2000/01/rdf-schema#
xsdhttp://www.w3.org/2001/XMLSchema#
owlhttp://www.w3.org/2002/07/owl#
dchttp://purl.org/dc/elements/1.1/
revelahttps://valospace.org/inspire/revela#

§ revela valos_raem:Verb vocabulary

rdfs:label rdf:type Comment

§ revela remaining vocabulary

rdfs:label rdf:type rdfs:subClassOf