Skip to content

Comments

feat: add ensureContainerExists with recursive parent creation#11

Open
soyuka wants to merge 5 commits intodunglas:mainfrom
soyuka:feat/ensure-container
Open

feat: add ensureContainerExists with recursive parent creation#11
soyuka wants to merge 5 commits intodunglas:mainfrom
soyuka:feat/ensure-container

Conversation

@soyuka
Copy link

@soyuka soyuka commented Feb 23, 2026

Summary

  • Adds ensureContainerExists() which HEADs the target URL and creates it via PUT if missing
  • Recursively ensures parent containers exist first (CSS requires intermediate containers)
  • Stops recursion at the authority level

Stack

6/8 — builds on #10 (feat/container-listing)

Test plan

  • Test that existing containers are not recreated (single HEAD)
  • Test that missing containers trigger HEAD + PUT with parent check

🤖 Generated with Claude Code

@soyuka
Copy link
Author

soyuka commented Feb 23, 2026

Stack: 4/6 — builds on #10

soyuka and others added 2 commits February 23, 2026 21:43
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds the missing HTTP method wrappers to SolidClient:
- put(): creates/overwrites resources, with optional container Link header
- head(): retrieves resource metadata headers
- delete(): removes resources
- patch(): updates resources via SPARQL Update or N3 Patch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@soyuka soyuka force-pushed the feat/ensure-container branch from 8cbaf9c to 923b2f1 Compare February 23, 2026 21:08
soyuka and others added 3 commits February 24, 2026 10:13
Parses HEAD response headers into a structured ResourceMetadata object
with content type, length, last modified, LDP type, WAC-Allow permissions,
and ACL URL from Link headers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds getContainerContents() to parse ldp:contains from JSON-LD responses.
Uses ML\JsonLD\JsonLD::expand() with base URL option to handle relative
IRI resolution (CSS returns relative @id values in expanded JSON-LD).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Checks via HEAD whether a container exists, catches
ClientExceptionInterface for 404 specifically and lets other errors
propagate. Recursively creates missing parent containers via PUT.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@soyuka soyuka force-pushed the feat/ensure-container branch from 923b2f1 to 6e80b78 Compare February 24, 2026 09:14
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