Leaving slide mode.
CBOR-LD, YAML-LD & the JSON-LD Recharter
Benjamin Young, Wes Smith, Gregg Kellogg, Anatoly Scherbakov
TPAC 2024
Anaheim CA, USA
hybrid meeting
23–27 SEPTEMBER 2024
History - early days
2014 - RDF Working Group
2018-2020 - JSON-LD WG
History - current WG
2020-2023 (extended to 2025) - JSON-LD WG (maintenance mode)
2025-2027 - Recharter for new work
- JSON-LD, API, Framing v1.1 (maintain)
- JSON-LD, API, Framing v1.2 (new)
- CBOR-LD (new)
- YAML-LD (new)
- Notes
- Multiple languages in JSON
- Content hash provision in context URLs
CBOR-LD
A semantic compression format for JSON-LD
Concise Binary Object
Representation for Linked
Data
- Enables small data use cases: storage, transfer, constrained encoding (e.g. QR codes)
- Using semantic information from JSON-LD contexts enables powerful compression
- Extensible registry system for self-describing payloads
- Plug-and-play with JSON-LD
CBOR-LD Compression
- Build compression dictionary by processing context files that appear in the JSON-LD
- Assign terms in contexts integer values that they will compress to
- Deterministic algorithms: a 2nd party decompressing the payload will construct the exact same term-to-integer map
- CBOR-LD Tag registry allows further compression and self-describing payloads
- Contexts and CBOR tag are the compression dictionary: no need to modify the JSON-LD!
CBOR-LD Registry
- CBOR tag: header for CBOR payload
- CBOR-LD has a range of CBOR tags:
- Additional precision (optionally) identifies a registry entry
- Registry entry identifies use case, allows expression of additional compression techniques
- Decompressor sees the tag, does a registry lookup, retrieves the decompression information
- Result: CBOR-LD payloads self-describing, can get additional compression power beyond context terms if use case requires it
CBOR-LD Compression Table
Map {
...
'EnvelopedVerifiableCredential' => 110,
'EnvelopedVerifiablePresentation' => 112,
'JsonSchema' => 114,
'JsonSchemaCredential' => 116,
'VerifiableCredential' => 118,
'VerifiablePresentation' => 120
...
}
Utopia Driver's License VC
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://w3id.org/vc-barcodes/v1",
"https://w3id.org/utopia/v2"
],
"type": [
"VerifiableCredential",
"OpticalBarcodeCredential"
],
"credentialSubject": {
"type": "AamvaDriversLicenseScannableInformation",
"protectedComponentIndex": "uggAg"
},
"issuer": "did:key:zDnaeWjKfs1ob9QcgasjYSPEMkwq31hmvSAWPVAgnrt1e9GKj",
...
}
https://w3c-ccg.github.io/vc-barcodes/#example-a-json-ld-vc-for-a-utopia-driver-s-license-vcb
The term to ID map created by CBOR-LD when compressing a Utopia DL.
Map(97) {
'@context' => 0,
'@type' => 2,
...
'VerifiableCredential' => 118,
...
'AamvaDriversLicenseScannableInformation' => 160,
'OpticalBarcodeCredential' => 164,
'TerseBitstringStatusListEntry' => 166,
...
}
CBOR-LD parameters
registryEntryId: 100
typeTable:
{
"context":
{
"https://www.w3.org/ns/credentials/v2": 32768,
"https://w3id.org/vc-barcodes/v1": 32769,
"https://w3id.org/utopia/v2": 32770
},
"https://w3id.org/security#cryptosuiteString":
{
"ecdsa-rdfc-2019": 1,
"ecdsa-sd-2023": 2,
"eddsa-rdfc-2022": 3,
"ecdsa-xi-2023": 4
}
}
https://w3c-ccg.github.io/vc-barcodes/#example-cbor-ld-encoding-parameters
A CBOR-LD compressed Utopia Driver's License VC
d90664a60183198000198001198002189d82187618a418b8a3189c18a618...
Diagnostic:
1636(
{
1: [32768, 32769, 32770],
157: [118, 164],
184: {156: 166, 206: 178, 208: 3851559041},
186: {156: 160, 168: h'75820020'},
190: 170,
...
https://w3c-ccg.github.io/vc-barcodes/#example-a-cbor-ld-compressed-utopia-driver-s-license-vc
A Verifiable Credential Barcode (a PDF417) of the Utopia driver's license.
CBOR-LD - Road Ahead
- Added to charter
- CBOR-LD 1.0 Working Draft
- Incorporate other work
- Gather WG feedback/contribution/changes
YAML-LD
- Enable human-friendly Linked Data
- Stay compatible with JSON-LD for easy transformation
- CCG developed spec
- Stable, but needs implementers
- WG picking up to formalize and build test suite
Multiple languages in JSON
- JSON-LD's Value Object pattern expressed "alone"
- encourage implementations of Value Objects
- encourage use in JSON documents that lack `@context`
- create a referenceable spec/note for other specs
Content hash fragment for context URLs
#hash=
- optionally used by document loaders to verify equality of contexts
- not strictly about HTTP
Thanks!
from Benjamin Young, Wes Smith, Gregg Kellogg, Anatoly Scherbakov