Initial state @context
{ "^": "urn:valos:", "@base": "urn:valos:chronicle:", "@vocab": "vplot:'", "V": "https://valospace.org/0#", "VLog": "https://valospace.org/log/0#", "VState": "https://valospace.org/state/0#", "&^": { "@id": "VState:globalResources", "@type": "@id", "@container": "@id" }, "&_": { "@id": "VState:subResources", "@type": "@id", "@container": "@id" }, "&-": { "@id": "VState:removes", "@container": "@graph" }, "~P": { "@id": "V:ownsProperty", "@type": "@id", "@container": "@id" }, "~E": { "@id": "V:ownsEntity", "@type": "@id", "@container": "@id" }, "~R": { "@id": "V:ownsRelation", "@type": "@id", "@container": "@id" }, "~M": { "@id": "V:ownsMedia", "@type": "@id", "@container": "@id" }, ".~": { "@id": "V:owner", "@type": "@id" }, ".P~": { "@id": "V:scope", "@type": "@id" }, ".E~": { "@id": "V:parent", "@type": "@id" }, ".R~": { "@id": "V:graph", "@type": "@id" }, ".M~": { "@id": "V:folder", "@type": "@id" }, ".n": { "@id": "V:name" }, ".c": { "@id": "V:content" }, ".iOf": { "@id": "V:instanceOf", "@type": "@id" }, "-hasI": { "@id": "V:hasInstance", "@type": "@id", "@container": "@id" }, ".gOf": { "@id": "V:ghostOf", "@type": "@id" }, "-hasG": { "@id": "V:hasGhost", "@type": "@id", "@container": "@id" }, ".src": { "@id": "V:source", "@type": "@id" }, "-out": { "@id": "V:hasOutRelation", "@type": "@id", "@container": "@list" }, ".tgt": { "@id": "V:target", "@type": "@id" }, "-in": { "@id": "V:hasInRelation", "@type": "@id", "@container": "@list" }, ".src-": { "@id": "V:linkedSource", "@type": "@id" }, ".tgt-": { "@id": "V:linkedTarget", "@type": "@id" }, ".src~": { "@id": "V:ownerSource", "@type": "@id" }, ".tgt~": { "@id": "V:ownerTarget", "@type": "@id" }, "VSourcerer": "https://valospace.org/sourcerer/0#", "~u4": "urn:valos:u4:" }
creates chronicle root entity
we expecttoMatchObjectJSON.parse(JSON.stringify(state = applyVLogDelta(state, { "@context": [{ "0": "~u4:cccccccc-6600-2211-cc77-333333333333" }], "&~": { "": { ".n": "rootName", "V:authorityURI": "valaa-local:" } } })))
({ "@context": [baseStateContext, { "0": "~u4:cccccccc-6600-2211-cc77-333333333333" }], "&^": { "0/": { ".n": "rootName", "V:authorityURI": "valaa-local:" } } })
vplot:chronicle/
and is followed by a route-vplot string. Each vterm of
the local vplot id that matches the pattern
maps to a URI in the chronicle URI lookup. The local vplot id can be
translated to a global valos:urn vplot id by replacing all the mappings
with their corresponding URI and converting the id to urn-vplot form.
delta application to harmonize refs to appropriate stable origin refs
we expecttoMatchObjectJSON.parse(JSON.stringify(state = applyVLogDelta(state, { "@context": [{ "1": "~u4:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "2": "~u4:bbbbbbbb-bbbb-cccc-dddd-eeeeeeeeeeee", "3": "~u4:abababab-bbbb-cccc-dddd-eeeeeeeeeeee", "4": "~u4:babababa-bbbb-cccc-dddd-eeeeeeeeeeee", "5": "valaa-test:?id=(~raw'extl!)#" }], "&~": { "": { ".n": "newRootName" }, "1/": { ".E~": "0/", ".n": "older", "toOutside": { "@id": "5/" }, "absolutelyParent": { "@id": "/0/" }, }, "2/": { ".E~": "0/", ".n": "unger", "toOlder": { "@id": "1/" }, "absolutelyOlder": { "@id": "/1/" }, }, "2/3/": { ".tgt~": "2/", ".n": "SIBLING", ".src": "1/" }, "2/4/": { ".src~": "2/", ".n": "SIBLING", ".tgt": "1/" }, }, })))
{ "@context": [ { "^": "urn:valos:", "@base": "urn:valos:chronicle:", "@vocab": "vplot:'", "V": "https://valospace.org/0#", "VLog": "https://valospace.org/log/0#", "VState": "https://valospace.org/state/0#", "&^": { "@id": "VState:globalResources", "@type": "@id", "@container": "@id" }, "&_": { "@id": "VState:subResources", "@type": "@id", "@container": "@id" }, "&-": { "@id": "VState:removes", "@container": "@graph" }, "~P": { "@id": "V:ownsProperty", "@type": "@id", "@container": "@id" }, "~E": { "@id": "V:ownsEntity", "@type": "@id", "@container": "@id" }, "~R": { "@id": "V:ownsRelation", "@type": "@id", "@container": "@id" }, "~M": { "@id": "V:ownsMedia", "@type": "@id", "@container": "@id" }, ".~": { "@id": "V:owner", "@type": "@id" }, ".P~": { "@id": "V:scope", "@type": "@id" }, ".E~": { "@id": "V:parent", "@type": "@id" }, ".R~": { "@id": "V:graph", "@type": "@id" }, ".M~": { "@id": "V:folder", "@type": "@id" }, ".n": { "@id": "V:name" }, ".c": { "@id": "V:content" }, ".iOf": { "@id": "V:instanceOf", "@type": "@id" }, "-hasI": { "@id": "V:hasInstance", "@type": "@id", "@container": "@id" }, ".gOf": { "@id": "V:ghostOf", "@type": "@id" }, "-hasG": { "@id": "V:hasGhost", "@type": "@id", "@container": "@id" }, ".src": { "@id": "V:source", "@type": "@id" }, "-out": { "@id": "V:hasOutRelation", "@type": "@id", "@container": "@list" }, ".tgt": { "@id": "V:target", "@type": "@id" }, "-in": { "@id": "V:hasInRelation", "@type": "@id", "@container": "@list" }, ".src-": { "@id": "V:linkedSource", "@type": "@id" }, ".tgt-": { "@id": "V:linkedTarget", "@type": "@id" }, ".src~": { "@id": "V:ownerSource", "@type": "@id" }, ".tgt~": { "@id": "V:ownerTarget", "@type": "@id" }, "VSourcerer": "https://valospace.org/sourcerer/0#", "~u4": "urn:valos:u4:" }, { "0": "~u4:cccccccc-6600-2211-cc77-333333333333", "1": "~u4:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "2": "~u4:bbbbbbbb-bbbb-cccc-dddd-eeeeeeeeeeee", "3": "~u4:abababab-bbbb-cccc-dddd-eeeeeeeeeeee", "4": "~u4:babababa-bbbb-cccc-dddd-eeeeeeeeeeee", "5": "valaa-test:?id=(~raw'extl!)#" } ], "&^": { "0/": { ".n": "newRootName", "V:authorityURI": "valaa-local:", "~E": [ "1/", "2/" ] }, "1/": { ".E~": "0/", ".n": "older", "-out": [ "3/" ], "-in": [ "4/" ], "toOutside": { "@id": "5/" }, "absolutelyParent": { "@id": "/0/" } }, "2/": { ".E~": "0/", ".n": "unger", "~R": [ "3/", "4/" ], "-out": [ "4/" ], "-in": [ "3/" ], "toOlder": { "@id": "1/" }, "absolutelyOlder": { "@id": "/1/" } }, "3/": { ".tgt~": "2/", ".n": "SIBLING", ".src": "1/" }, "4/": { ".src~": "2/", ".n": "SIBLING", ".tgt": "1/" } } }
instances a resource with ghosts
we expecttoMatchObjectJSON.parse(JSON.stringify(state = applyVLogDelta(state, { "@context": [{ "6": "~u4:11111111-2255-7744-22cc-eeeeeeeeeeee", "7": "~u4:22222222-2255-7744-22cc-eeeeeeeeeeee", "8": "~u4:d336d336-9999-6666-0000-777700000000" }], "&~": { "2/3/8/": { ".E~": "3/", ".n": "deeplyOwned" }, "6/": { ".E~": "0/", ".iOf": "2/", ".n": "ungerInstance", "&_": { "6/3/": { "instance": { "@id": "6/" }, "absoluteInstance": { "@id": "/6/" }, "deepProto": { "@id": "8/" }, "absoluteDeepProto": { "@id": "/8/" }, }, "6/8/": { ".n": "deeplyOwnedGhost" }, }, }, "7/": { ".E~": "0/", ".iOf": "6/", ".n": "ungerInstanceInstance", "&_": { "7/3/": { "instanceInstance": { "@id": "7/" } }, "7/8/": { ".n": "deeplyOwnedGhostGhost" }, }, }, }, })))
({ "@context": [baseStateContext, { "0": "~u4:cccccccc-6600-2211-cc77-333333333333", "1": "~u4:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "2": "~u4:bbbbbbbb-bbbb-cccc-dddd-eeeeeeeeeeee", "3": "~u4:abababab-bbbb-cccc-dddd-eeeeeeeeeeee", "4": "~u4:babababa-bbbb-cccc-dddd-eeeeeeeeeeee", "5": "valaa-test:?id=(~raw'extl!)#", "6": "~u4:11111111-2255-7744-22cc-eeeeeeeeeeee", "7": "~u4:22222222-2255-7744-22cc-eeeeeeeeeeee", "8": "~u4:d336d336-9999-6666-0000-777700000000" }], "&^": { "0/": { ".n": "newRootName", "V:authorityURI": "valaa-local:", "~E": ["1/", "2/", "6/", "7/"] }, "1/": { ".E~": "0/", ".n": "older", "-out": ["3/"], "-in": ["4/"], "toOutside": { "@id": "5/" }, "absolutelyParent": { "@id": "/0/" } }, "2/": { ".E~": "0/", ".n": "unger", "~R": ["3/", "4/"], "-out": ["4/"], "-in": ["3/"], "-hasI": ["6/"], "toOlder": { "@id": "1/" }, "absolutelyOlder": { "@id": "/1/" } }, "3/": { ".tgt~": "2/", ".n": "SIBLING", ".src": "1/", "~E": ["8/"] }, "4/": { ".src~": "2/", ".n": "SIBLING", ".tgt": "1/" }, "6/": [{ ".E~": "0/", ".n": "ungerInstance", ".iOf": "2/", "-hasI": ["7/"], }, { "@context": { "@base": "6/" }, "&_": { "3/": { "instance": { "@id": "" }, "absoluteInstance": { "@id": "/6/" }, "deepProto": { "@id": "../8/" }, "absoluteDeepProto": { "@id": "/8/" }, }, "8/": { ".n": "deeplyOwnedGhost" } } }], "7/": [{ ".E~": "0/", ".n": "ungerInstanceInstance", ".iOf": "6/", }, { "@context": { "@base": "7/" }, "&_": { "3/": { "instanceInstance": { "@id": "" }, }, "8/": { ".n": "deeplyOwnedGhostGhost" } } }], "8/": { ".E~": "3/", ".n": "deeplyOwned" }, }, })
complex vplot relative references to be normalized
we expecttoMatchObjectJSON.parse(JSON.stringify(state = applyVLogDelta(state, { "@context": [{ "9": "~u4:77777777-1111-eeee-3333-555555555555", }], "&~": { "9/": { ".E~": "0/", ".n": "inceptor", ".iOf": "0/", "&_": { "9/1/": { ".n": "olderGhost" }, "9/2/": { ".n": "ungerGhost" }, "9/3/": { ".n": "toNephewOldceptGhost", ".tgt": "9/9/1/" }, "9/4/": { ".n": "toNephewUngceptGhost", ".tgt": "9/9/2/" }, "9/9/": { ".n": "firstInception" }, "9/9/1/": { ".n": "oldceptGhost" }, "9/9/2/": { ".n": "ungceptGhost" } } }, }, })))
({ "@context": [baseStateContext, { "0": "~u4:cccccccc-6600-2211-cc77-333333333333", "1": "~u4:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "2": "~u4:bbbbbbbb-bbbb-cccc-dddd-eeeeeeeeeeee", "3": "~u4:abababab-bbbb-cccc-dddd-eeeeeeeeeeee", "4": "~u4:babababa-bbbb-cccc-dddd-eeeeeeeeeeee", "5": "valaa-test:?id=(~raw'extl!)#", "6": "~u4:11111111-2255-7744-22cc-eeeeeeeeeeee", "7": "~u4:22222222-2255-7744-22cc-eeeeeeeeeeee", "8": "~u4:d336d336-9999-6666-0000-777700000000", "9": "~u4:77777777-1111-eeee-3333-555555555555" }], "&^": { "0/": { ".n": "newRootName", "V:authorityURI": "valaa-local:", "~E": ["1/", "2/", "6/", "7/", "9/"] }, "1/": { ".E~": "0/", ".n": "older", "-out": ["3/"], "-in": ["4/"], "toOutside": { "@id": "5/" }, "absolutelyParent": { "@id": "/0/" } }, "2/": { ".E~": "0/", ".n": "unger", "~R": ["3/", "4/"], "-out": ["4/"], "-in": ["3/"], "-hasI": ["6/"], "toOlder": { "@id": "1/" }, "absolutelyOlder": { "@id": "/1/" } }, "3/": { ".tgt~": "2/", ".n": "SIBLING", ".src": "1/", "~E": ["8/"] }, "4/": { ".src~": "2/", ".n": "SIBLING", ".tgt": "1/" }, "6/": [{ ".E~": "0/", ".n": "ungerInstance", ".iOf": "2/", "-hasI": ["7/"] }, { "@context": { "@base": "6/" }, "&_": { "3/": { "instance": { "@id": "" }, "absoluteInstance": { "@id": "/6/" }, "deepProto": { "@id": "../8/" }, "absoluteDeepProto": { "@id": "/8/" } }, "8/": { ".n": "deeplyOwnedGhost" } } }], "7/": [{ ".E~": "0/", ".n": "ungerInstanceInstance", ".iOf": "6/" }, { "@context": { "@base": "7/" }, "&_": { "3/": { "instanceInstance": { "@id": "" } }, "8/": { ".n": "deeplyOwnedGhostGhost" } } }], "8/": { ".E~": "3/", ".n": "deeplyOwned" }, "9/": [{ ".E~": "0/", ".n": "inceptor", ".iOf": "0/" }, { "@context": { "@base": "9/" }, "&_": { "1/": { ".n": "olderGhost" }, "2/": { ".n": "ungerGhost" }, "3/": { ".n": "toNephewOldceptGhost", ".tgt": "9/1/" }, "4/": { ".n": "toNephewUngceptGhost", ".tgt": "9/2/" }, "9/": [{ ".n": "firstInception", }, { "@context": { "@base": "9/" }, "&_": { "1/": { ".n": "oldceptGhost", "-in": ["../3/"] }, "2/": { ".n": "ungceptGhost", "-in": ["../4/"] } } }], } }] }, })
resource deletions to be persisted in state
we expecttoMatchObjectJSON.parse(JSON.stringify(state = applyVLogDelta(state, { "@context": [{}], "&~": { "9/": { "&_": { "9/4/": { "&-": { ".tgt": "9/9/2/" } }, "9/9/": { "&-": { "&_": ["9/9/2/"], "~E": ["9/9/2/"] } }, }, }, }, })))
({ "@context": [baseStateContext, { "0": "~u4:cccccccc-6600-2211-cc77-333333333333", "1": "~u4:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "2": "~u4:bbbbbbbb-bbbb-cccc-dddd-eeeeeeeeeeee", "3": "~u4:abababab-bbbb-cccc-dddd-eeeeeeeeeeee", "4": "~u4:babababa-bbbb-cccc-dddd-eeeeeeeeeeee", "5": "valaa-test:?id=(~raw'extl!)#", "6": "~u4:11111111-2255-7744-22cc-eeeeeeeeeeee", "7": "~u4:22222222-2255-7744-22cc-eeeeeeeeeeee", "8": "~u4:d336d336-9999-6666-0000-777700000000", "9": "~u4:77777777-1111-eeee-3333-555555555555" }], "&^": { "0/": { ".n": "newRootName", "V:authorityURI": "valaa-local:", "~E": ["1/", "2/", "6/", "7/", "9/"] }, "1/": { ".E~": "0/", ".n": "older", "-out": ["3/"], "-in": ["4/"], "toOutside": { "@id": "5/" }, "absolutelyParent": { "@id": "/0/" } }, "2/": { ".E~": "0/", ".n": "unger", "~R": ["3/", "4/"], "-out": ["4/"], "-in": ["3/"], "-hasI": ["6/"], "toOlder": { "@id": "1/" }, "absolutelyOlder": { "@id": "/1/" } }, "3/": { ".tgt~": "2/", ".n": "SIBLING", ".src": "1/", "~E": ["8/"] }, "4/": { ".src~": "2/", ".n": "SIBLING", ".tgt": "1/" }, "6/": [{ ".E~": "0/", ".n": "ungerInstance", ".iOf": "2/", "-hasI": ["7/"] }, { "@context": { "@base": "6/" }, "&_": { "3/": { "instance": { "@id": "" }, "absoluteInstance": { "@id": "/6/" }, "deepProto": { "@id": "../8/" }, "absoluteDeepProto": { "@id": "/8/" } }, "8/": { ".n": "deeplyOwnedGhost" } } }], "7/": [{ ".E~": "0/", ".n": "ungerInstanceInstance", ".iOf": "6/" }, { "@context": { "@base": "7/" }, "&_": { "3/": { "instanceInstance": { "@id": "" } }, "8/": { ".n": "deeplyOwnedGhostGhost" } } }], "8/": { ".E~": "3/", ".n": "deeplyOwned" }, "9/": [{ ".E~": "0/", ".n": "inceptor", ".iOf": "0/" }, { "@context": { "@base": "9/" }, "&_": { "1/": { ".n": "olderGhost" }, "2/": { ".n": "ungerGhost" }, "3/": { ".n": "toNephewOldceptGhost", ".tgt": "9/1/" }, "4/": { ".n": "toNephewUngceptGhost" }, "9/": [{ ".n": "firstInception", "&-": { "~E": ["9/2/"] }, }, { "@context": { "@base": "9/" }, "&_": { "1/": { ".n": "oldceptGhost", "-in": ["../3/"] } } }], } }], }, })