Skip to content

Comments

feat: add JSON-LD response parser for CSS#8

Closed
soyuka wants to merge 3 commits intodunglas:mainfrom
soyuka:feat/jsonld-parsing
Closed

feat: add JSON-LD response parser for CSS#8
soyuka wants to merge 3 commits intodunglas:mainfrom
soyuka:feat/jsonld-parsing

Conversation

@soyuka
Copy link

@soyuka soyuka commented Feb 23, 2026

Summary

  • Adds JsonLdParser class for parsing JSON-LD responses from Solid/CSS servers
  • Uses json_decode directly since CSS returns already-expanded JSON-LD for Accept: application/ld+json
  • parse() normalizes single objects and arrays into a consistent list<array> format
  • findById() for node lookup by @id

Stack

3/8 — builds on #7 (feat/resource-metadata)

Test plan

  • Tests for single object, expanded array, and LDP container parsing
  • Tests for findById lookup

🤖 Generated with Claude Code

soyuka and others added 3 commits February 23, 2026 17:09
Implements the four missing LDP HTTP methods:
- put(): idempotent resource creation/update at a known URI, with optional
  LDP BasicContainer Link header for container creation
- head(): inspect resource metadata without fetching the body
- delete(): remove resources or containers
- patch(): partial RDF updates via SPARQL Update (default) or N3 Patch

Also applies CS Fixer auto-fixes (explicit nullable types, \sprintf).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds ResourceMetadata, a typed value object parsed from HEAD response
headers providing: contentType, contentLength, lastModified, ldpType
(container vs resource from Link header), wacAllow (parsed permissions),
and aclUrl (from Link rel="acl").

Adds getResourceMetadata() to SolidClient as a convenience wrapper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CSS returns expanded JSON-LD by default for Accept: application/ld+json.
JsonLdParser uses json_decode directly (not the ml/json-ld processor)
since CSS responses are already in expanded form. Provides parse() for
normalizing single objects and arrays, and findById() for node lookup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@soyuka soyuka closed this Feb 23, 2026
@soyuka soyuka deleted the feat/jsonld-parsing branch February 23, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant