Add context7.json + expand README and per-export docs#29
Add context7.json + expand README and per-export docs#29jeswr wants to merge 5 commits intosolid:mainfrom
Conversation
Lets the Context7 MCP server (https://context7.com) index this repository so coding agents that depend on @solid/object can look the API up directly rather than reading the source. Includes the project title, a one-line description, the folders worth parsing (docs, src), the noise to skip (dist, node_modules, test, .github), and a short rules block summarising the wrapper / dataset construction convention and the sub-path import layout. Refs solid#14. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous README was three lines; this rewrite gives consumers enough to get going without opening the source: - npm install instructions and runtime expectations. - Two quick-start examples (read a WebID profile, enumerate ACL authorisations) plus a one-liner for the WAC -> ACP converter. - A table of the four entry points with links into the per-export docs added under docs/api/. - Specification index with links to the Solid Protocol, Solid OIDC, WAC, ACP, LDP, vCard, FOAF, PIM, POSIX and Dublin Core sources the wrappers map onto. - Contributing notes (clone, install, npm test) and a pointer to the context7.json catalogue. Refs solid#14. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
One Markdown file per public sub-path plus a vocabulary file and a docs/README.md index. Each file documents: - What each wrapper class wraps (TermWrapper vs DatasetWrapper from @rdfjs/wrapper, what RDF subject or graph it stands for). - The spec the concept comes from (Solid Protocol, Solid OIDC, WAC, ACP, LDP, vCard, FOAF, PIM, POSIX, Dublin Core), with section anchors where they exist. - Every property: its TypeScript type, the predicate it reads or writes, and whether it's read-only or read/write. - Worked examples using n3 as the RDF/JS implementation. For the WAC -> ACP and ACP -> WAC translators the docs enumerate the exact features that trigger each TranslationError subclass so consumers can decide where to fall back. Refs solid#14. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- conversion.md: wacToAcp does not iterate acl:agentClass — only acl:agent and expanded acl:agentGroup members. Documented the limitation so readers do not expect public/authenticated translation for canonical WAC graphs that express those subjects via acl:agentClass. Reworded the bullet that previously implied agent-class translation. - webid.md: clarified that Agent.name's URL fallback strips any trailing #fragment as well as path segments. - solid.md: noted that Resource.mimeType returns the full IANA-vocabulary class IRI rather than the bare media-type string. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- README: rewrote the wacToAcp quick-start so the AclResource construction is no longer an inline-comment placeholder; the example now parses a small Turtle fixture into a Store first, mirroring the earlier WAC example. - docs/api/webid.md: dropped the `HasValue` type name (the class is not exported from the package) in favour of an inline shape description for `hasEmail` / `hasTelephone` return values. Reworded the WebIdDataset.mainSubject caveat so it no longer links a source-level TODO; describes the limitation directly instead. - docs/api/solid.md: added a "Known issues" note flagging that Telephone.phoneType uses the `vcard:TelephoneType` IRI as a predicate where the vCard ontology defines that IRI as a class — reflects upstream code as-is and warns consumers. - context7.json: stopped excluding the test/ folder so the worked examples in test/unit/ get indexed alongside the docs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds discovery metadata and expanded documentation so consumers of @solid/object can understand and navigate the public API surface without reading the source.
Changes:
- Add
context7.jsonfor Context7 MCP documentation indexing. - Expand the root
README.mdwith install, quick-start examples, package layout, and contribution notes. - Add per-export API reference docs under
docs/api/and an index atdocs/README.md.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/api/webid.md | New WebID wrapper docs for WebIdDataset and Agent. |
| docs/api/wac.md | New WAC wrapper docs for AclResource, Authorization, Group. |
| docs/api/vocabulary.md | New docs for exported vocabulary constant objects. |
| docs/api/solid.md | New docs for Resource/Container and vCard Email/Telephone wrappers. |
| docs/api/conversion.md | New docs for WAC↔ACP translation helpers and error types. |
| docs/api/acp.md | New docs for ACP wrappers (AcrDataset, AccessControlResource, etc.). |
| docs/README.md | Adds a docs landing page and shared conventions for wrappers. |
| context7.json | Adds Context7 catalog metadata and usage rules for indexing. |
| README.md | Major expansion of project-level documentation and navigation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - Properties typed `Set<T>` are live: adding to or removing from the | ||
| returned set mutates the underlying dataset. |
There was a problem hiding this comment.
The convention "Properties typed Set<T> are live" isn’t universally true in the current API: e.g. Agent.storageUrls returns a newly constructed Set union and mutations won’t write back to the dataset. Please qualify this as "SetFrom-backed" sets are live, and call out computed/synthetic sets as snapshots.
| - Properties typed `Set<T>` are live: adding to or removing from the | |
| returned set mutates the underlying dataset. | |
| - Properties typed `Set<T>` are live only when they are `SetFrom`-backed: | |
| adding to or removing from those returned sets mutates the underlying | |
| dataset. Computed or synthetic sets are snapshots, so mutating them does | |
| not write back to the dataset. |
| `@solid/object` re-exports a frozen object per RDF namespace it touches. The | ||
| values are the full IRI strings; pair them with any `DataFactory.namedNode` | ||
| when constructing terms by hand. |
There was a problem hiding this comment.
This doc says each vocabulary export is a "frozen object", but the implementation exports plain const objects (typed as const) and does not Object.freeze them. Please either update the wording to "as const object" / "constant object" or actually freeze the objects in code if immutability at runtime is intended.
| `@solid/object` re-exports a frozen object per RDF namespace it touches. The | |
| values are the full IRI strings; pair them with any `DataFactory.namedNode` | |
| when constructing terms by hand. | |
| `@solid/object` re-exports an `as const` object per RDF namespace it touches. | |
| The values are the full IRI strings; pair them with any | |
| `DataFactory.namedNode` when constructing terms by hand. |
| All properties are read-only getters. Sets are mutable via `@rdfjs/wrapper`'s | ||
| `SetFrom` machinery — adding to or deleting from the returned `Set` mutates | ||
| the underlying dataset. |
There was a problem hiding this comment.
The statement that "Sets are mutable via @rdfjs/wrapper's SetFrom machinery" is not true for every Set-returning getter here: Agent.storageUrls is implemented as new Set([...this.pimStorage, ...this.solidStorage]), so mutating the returned set will NOT update the underlying dataset. Please qualify this note (e.g., only SetFrom-backed properties are live, and computed unions like storageUrls are snapshots).
| | `photoUrl` | `string \| null` | [`vcard:hasPhoto`](https://www.w3.org/TR/vcard-rdf/) | vCard | | ||
| | `pimStorage` | `Set<string>` | [`pim:storage`](http://www.w3.org/ns/pim/space#storage) — the agent's storage roots. | [PIM/space](http://www.w3.org/ns/pim/space) | | ||
| | `solidStorage` | `Set<string>` | [`solid:storage`](http://www.w3.org/ns/solid/terms#storage) — Solid Protocol storage. | [Solid Protocol §4.1](https://solidproject.org/TR/protocol#storage) | | ||
| | `storageUrls` | `Set<string>` | The union of `pimStorage` and `solidStorage`. | — | |
There was a problem hiding this comment.
storageUrls is documented like other live Set<string> properties, but the current implementation returns a new Set union (not a SetFrom-backed set). Please document it as a computed snapshot (read-only; mutating it does not write triples) or adjust the implementation to return a live set-like view.
| | `phone` | `string \| null` | Convenience: `hasTelephone?.value`. | vCard | | ||
| | `hasTelephone` | term wrapper \| `undefined` | [`vcard:hasTelephone`](https://www.w3.org/TR/vcard-rdf/#hasTelephone). Same opaque shape as `hasEmail`. | vCard | | ||
| | `website` | `string \| null` | Computed: `vcardHasUrl` -> `foafHomepage`. | vCard / FOAF | | ||
| | `vcardHasUrl` | `string \| undefined` | [`vcard:hasURL`](https://www.w3.org/TR/vcard-rdf/) | vCard | |
There was a problem hiding this comment.
The predicate is labeled/link-texted as vcard:hasURL, but the library’s vocabulary constant and wrapper use VCARD.hasUrl (IRI ends with #hasUrl). For consistency with the actual API/constants, please change this row to vcard:hasUrl (and update any link text accordingly).
| | `vcardHasUrl` | `string \| undefined` | [`vcard:hasURL`](https://www.w3.org/TR/vcard-rdf/) | vCard | | |
| | `vcardHasUrl` | `string \| undefined` | [`vcard:hasUrl`](https://www.w3.org/TR/vcard-rdf/) | vCard | |
| | `website` | `string \| null` | Computed: `vcardHasUrl` -> `foafHomepage`. | vCard / FOAF | | ||
| | `vcardHasUrl` | `string \| undefined` | [`vcard:hasURL`](https://www.w3.org/TR/vcard-rdf/) | vCard | | ||
| | `foafHomepage` | `string \| undefined` | [`foaf:homepage`](http://xmlns.com/foaf/spec/#term_homepage) | FOAF | |
There was a problem hiding this comment.
foafHomepage is documented as a straightforward foaf:homepage getter, but the current implementation reads it via LiteralAs.string (not NamedNodeAs.string). That means homepage IRIs (the common case) won’t be returned. Either update the docs to note this current limitation, or fix the implementation in code (separately) and keep the docs as-is.
| | `website` | `string \| null` | Computed: `vcardHasUrl` -> `foafHomepage`. | vCard / FOAF | | |
| | `vcardHasUrl` | `string \| undefined` | [`vcard:hasURL`](https://www.w3.org/TR/vcard-rdf/) | vCard | | |
| | `foafHomepage` | `string \| undefined` | [`foaf:homepage`](http://xmlns.com/foaf/spec/#term_homepage) | FOAF | | |
| | `website` | `string \| null` | Computed: `vcardHasUrl` -> `foafHomepage` (note: the `foafHomepage` fallback currently only returns literal-valued `foaf:homepage` values, not IRI/named-node values). | vCard / FOAF | | |
| | `vcardHasUrl` | `string \| undefined` | [`vcard:hasURL`](https://www.w3.org/TR/vcard-rdf/) | vCard | | |
| | `foafHomepage` | `string \| undefined` | [`foaf:homepage`](http://xmlns.com/foaf/spec/#term_homepage). Current limitation: only literal-valued homepages are returned; IRI/named-node homepages are not surfaced by the current implementation. | FOAF | |
| | `title` | `string \| undefined` | [`dc:title`](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/terms/title) | | | ||
| | `label` | `string \| undefined` | [`rdfs:label`](https://www.w3.org/TR/rdf-schema/#ch_label) | | | ||
| | `name` | `string` | Computed: `title` -> `label` -> last URL path segment (URL-decoded where possible). | Always defined. | | ||
| | `modified` | `Date \| undefined` | [`dc:modified`](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/terms/modified) | | |
There was a problem hiding this comment.
The title / modified rows refer to dc:title and dc:modified, but the code uses Dublin Core Terms IRIs (http://purl.org/dc/terms/...) via the DC constants (i.e. dcterms:title / dcterms:modified). Please update the predicate labels in this table to avoid implying the wrong namespace/prefix.
| | `title` | `string \| undefined` | [`dc:title`](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/terms/title) | | | |
| | `label` | `string \| undefined` | [`rdfs:label`](https://www.w3.org/TR/rdf-schema/#ch_label) | | | |
| | `name` | `string` | Computed: `title` -> `label` -> last URL path segment (URL-decoded where possible). | Always defined. | | |
| | `modified` | `Date \| undefined` | [`dc:modified`](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/terms/modified) | | | |
| | `title` | `string \| undefined` | [`dcterms:title`](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/terms/title) | | | |
| | `label` | `string \| undefined` | [`rdfs:label`](https://www.w3.org/TR/rdf-schema/#ch_label) | | | |
| | `name` | `string` | Computed: `title` -> `label` -> last URL path segment (URL-decoded where possible). | Always defined. | | |
| | `modified` | `Date \| undefined` | [`dcterms:modified`](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/terms/modified) | | |
Adds documentation and discovery metadata so consumers of
@solid/objectcan find the API without reading source.What's added
context7.json— catalogue file the context7 MCP reads to serve docs lookups. Without it, every consumer of@solid/object(reactive-fetch, downstream Solid apps, etc.) has to read the source to figure out the API surface.docs/api/covering:webid(Agent,WebIdDataset),solid(Resourceetc.),acp(the access-control wrappers),wac,vocabulary, andconversion. Each documents what the wrapper represents, the spec it follows, public properties + methods, and a usage example.What's NOT changed
No runtime behaviour. Pure docs / metadata addition. The
oidcIssuersgetter onAgentis in a separate small PR (#28); the plannedWebIDProfilerename work is left untouched.Self-review
Reviewed locally with
roborev review --localbefore opening. Two follow-up commits address its findings (accuracy gaps in the docs, plus nits aroundHasValue,mimeType,phoneType, and example correctness).Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com