Skip to content

Comments

feat: add recursive container traversal via walkContainer#12

Open
soyuka wants to merge 6 commits intodunglas:mainfrom
soyuka:feat/recursive-traversal
Open

feat: add recursive container traversal via walkContainer#12
soyuka wants to merge 6 commits intodunglas:mainfrom
soyuka:feat/recursive-traversal

Conversation

@soyuka
Copy link

@soyuka soyuka commented Feb 23, 2026

Summary

  • Adds walkContainer() generator method for recursive LDP container tree traversal
  • Yields ContainerEntry objects depth-first
  • Configurable depth: -1 for unlimited, 0 for current level only
  • Uses PHP generators for memory-efficient traversal of deep hierarchies

Stack

7/8 — builds on #11 (feat/ensure-container)

Test plan

  • Recursive traversal test (root + sub-container)
  • maxDepth=0 test (no recursion)

🤖 Generated with Claude Code

@soyuka
Copy link
Author

soyuka commented Feb 23, 2026

Stack: 5/6 — builds on #11

soyuka and others added 6 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>
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>
Generator-based recursive descent over LDP container trees using
getContainerContents(). Supports maxDepth parameter: -1 for unlimited,
0 for current level only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@soyuka soyuka force-pushed the feat/recursive-traversal branch from beea124 to c31b837 Compare February 23, 2026 21:08
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