ldp-container
Use when reading LDP container memberships, building typed listing metadata, sharing listing parsing across Solid clients, filtering untrusted ldp:contains entries, or maintaining @jeswr/ldp-container.
- License 许可
- MIT
- 所属仓库
- jeswr/solid-sdk
- 最近更新
- 2026-11-15
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- ldp-container
- description
- Use when reading LDP container memberships, building typed listing metadata, sharing listing parsing across Solid clients, filtering untrusted ldp:contains entries, or maintaining @jeswr/ldp-container.
02 资源文件 22
- 参考文档biome.json82 B
- 参考文档codegen.config.json747 B
- 其他codegen/listing.ontology.ttl785 B
- 其他codegen/listing.shapes.ttl1.3 KB
- 参考文档package.json2.0 KB
- 参考文档README.md4.9 KB
- 脚本scripts/copy-generated.mjs415 B
- 参考文档src/generated/codegen-manifest.json842 B
- 参考文档src/generated/codegen.lock.json434 B
- 脚本src/generated/model.d.ts2.7 KB
- 脚本src/generated/model.js2.6 KB
- 参考文档src/generated/model.json2.2 KB
- 其他src/generated/shapes.ttl1.7 KB
- 脚本src/index.ts3.6 KB
- 脚本src/listing.ts1.5 KB
- 脚本test/codegen.test.ts2.0 KB
- 脚本test/container.test.ts14.4 KB
- 脚本test/listing.test.ts5.4 KB
- 参考文档tsconfig.build.json116 B
- 参考文档tsconfig.json325 B
- 参考文档tsconfig.test.json220 B
- 脚本vitest.config.ts415 B
03 SKILL.md 正文
<!-- AUTHORED-BY Codex GPT-6.1-Sol -->
Shared LDP container listings
Use readContainerMembers(fetch, containerUrl, { scope, package?, signal?, maxBytes?, maxQuads? })
for ordinary GETs; 404/410 returns null. Inject the caller's scoped, redirect-refusing fetch. This helper
checks the initial URL and delegates transport policy to that fetch.
Pass the body stream directly to parseRdf (null body becomes ""), with maxBytes defaulting
to 16 MiB, optional maxQuads (parser default 1,000,000), and the same signal passed to fetch.
The fetch-rdf hardening change supplies limit/abort enforcement and stream cancellation;
limits reject with code: "PARSE_LIMIT", and abort rejects with AbortError even for stalled
bodies. Cancel missing/non-ok response bodies best effort, without awaiting cancellation.
Use parseContainerMembers(dataset, containerUrl, { scope, allowRoot? }) after custom reads
such as y-solid's capped streaming read. Membership must come from ContainerDataset;
never match triples by hand. Resolve and guard every entry inside its own try/catch, use
the canonical value returned by assertWithinPodScope, and preserve listing order while
deduplicating by URL. Accept only NamedNodes. Guard members against both scope and
containerUrl with { allowRoot: false } for the latter: ancestors, siblings, and all
self aliases must be skipped, even when they are inside the broader scope. allowRoot
only controls the overall scope check. Encoded %2F/%5C paths are refused by guarded-fetch.
Supply a single-container dataset: the first ldp:contains subject selected by
ContainerDataset supplies membership, independently of containerUrl. Mixed-container
datasets are unsupported; containerUrl is the resolution base and containment boundary.
Keep scope guards in @jeswr/guarded-fetch; do not re-export them here. Keep stricter
compatibility filters, sorting, non-container filters, and read caps in callers. Never
weaken those policies while consolidating listings. The runtime must remain browser-safe.
buildListingDataset(containerUrl, entries: Iterable<ListingMetadata>) constructs synthetic
default-graph membership and metadata through the generated ListingMember and
ListingContainer wrappers interpreted by @jeswr/model-runtime. Supply url, title, nullable modified (Date),
size and contentType, plus types. Null fields are omitted; zero, epoch dates and empty
strings survive. Only supplied types are emitted; never call build() or mark() here.
Generated guards reject unsafe subject/type IRIs and drop invalid optional values. The facade
keeps invalid dates throwing RangeError. Callers enforce HTTP(S)/pod-scope policy and collect
a complete successful listing before replacing a cached graph; the builder does no I/O.
Generation uses codegen/'s ontology/SHACL plus codegen.config.json. All fields are sets,
and text sanitization is disabled to preserve literal contents. rdf:type is a reserved
structural predicate: its explicit property shape fails admission, so use the generated
wrapper's built-in .types set. README documents the exact rejection for the generator follow-up.
After building federation-codegen, run pnpm --filter @jeswr/ldp-container run codegen.
Never edit src/generated/; the byte-for-byte drift test, including the lockfile, must pass.
The build copies generated JS/declarations into dist. Keep the listing facade at 100% coverage.
04 同仓库更多 Skills
storage-conformance
Work on @jeswr/storage-conformance, the shared storage conformance suite package in the Solid SDK workspace.
fetch-rdf-engine-tests
Maintain fetch-rdf's real Node WASM parser integration tests without introducing a reverse engine dependency in fetch-rdf.
alpha
Use when checking fixtures, including folded YAML descriptions.
widget
Use when testing package skills: YAML quoting works.
web-seo
Use when improving technical and entity SEO for a modern personal, portfolio, documentation, or marketing site, including crawlable HTML, canonical metadata, sitemap and robots, Person/ProfilePage JSON-LD, Core Web Vitals, and honest ranking expectations.
solid-wac
Use when implementing or auditing Solid server WAC authorization, ACL creation and inheritance, auxiliary-resource escalation, method-to-mode mapping, 401 versus 403 challenges, WAC-Allow, or defensive typed ACL parsing with @solid/object and @rdfjs/wrapper.