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

CBOR-LD

A semantic compression format for JSON-LD

Concise Binary Object Representation for Linked Data

CBOR-LD Compression

CBOR-LD Registry

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

See also: YAML-LD version of this document.

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

JSON-LD vs. CBOR-LD

A comparision of two QR codes: one JSON-LD based QR code (at 1,217 bytes) vs. the other CBOR-LD based QR codes (at 325 bytes)

CBOR-LD - Road Ahead

YAML-LD

Utopia Driver's License VC
in YAML-LD!

{
  "@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"
}

YAML ⊋ JSON ⇒ This is a valid YAML document!

Commas & curly braces

"@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"

Square braces

"@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"

Quotes

"@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

Multiline strings

"@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

Comments

"@context":
  - https://www.w3.org/ns/credentials/v2
  - https://w3id.org/vc-barcodes/v1
  - https://w3id.org/utopia/v2
# This is a Verifiable Credential (VC) renderable as a Barcode
type: [VerifiableCredential, OpticalBarcodeCredential]
credentialSubject:
  # This is a driver's license
  type: AamvaDriversLicenseScannableInformation
  protectedComponentIndex: uggAg
# Here is a Decentralized Identifier (DID) which you can verify
issuer: >-
  did:key:zDnaeWjKfs1ob9QcgasjYSPEMkwq31hmvSAWPVAgnrt1e9GKj

Use cases for YAML-LD

YAML-LD possible uses

…interpreting those as Linked Data

YAML-LD implementations

@ quoting

"@context":
  - https://schema.org/
  - https://json-ld.org/contexts/dollar-convenience.jsonld
$type: TechArticle
name: Introducing YAML-LD

YAML-LD: Next Steps

Perspectives

Multiple languages in JSON

Content hash fragment for context URLs

Thanks!

from
Benjamin Young, Wes Smith, Gregg Kellogg, Anatoly Scherbakov