Expand description
Linked Data Platform (LDP) resource and container semantics.
Phase 2 scope:
- Full
Linkheader set (type + acl + describedby + storage root). Preferheader parsing (PreferMinimalContainer, PreferContainedIRIs).Accept-Postheader for containers.- PATCH via N3 (solid-protocol PATCH):
insert,delete,where. - PATCH via SPARQL-Update (
INSERT DATA,DELETE DATA,DELETE WHERE). - Content negotiation: Turtle, JSON-LD, N-Triples, RDF/XML.
- Server-managed triples (
dc:modified,stat:size,ldp:contains). .metasidecar resolution.
The module intentionally uses a tiny, in-crate RDF triple model so
the crate stays free of the heavier sophia / oxigraph dep trees.
Only Turtle-subset parsing required for real-world Solid Pod PATCH
flows is supported; client-supplied RDF is parsed via the N-Triples
fallback whenever the Turtle fast path hits something exotic.
Modules§
- iri
- Well-known IRI constants used in LDP, WAC, and server-managed triples.
Structs§
- Byte
Range - A parsed byte range.
endis inclusive per RFC 7233 §2.1. - Container
Member - Graph
- Minimal RDF graph — a sorted set of triples.
- Options
Response - Build the set of values returned on OPTIONS for a Solid resource.
- Patch
Outcome - Outcome of evaluating a PATCH request.
- Prefer
Header - Parsed
Preferheader value. Non-return=representationpreferences are ignored (the LDP spec allows this). - Triple
Enums§
- Conditional
Outcome - Outcome of evaluating conditional request headers against a current resource ETag.
- Container
Representation - What portions of a container representation the client wants.
- Patch
Create Outcome - Outcome of applying a PATCH to a path that had no prior resource.
- Patch
Dialect - Pick a PATCH dialect from the
Content-Typeheader. - Range
Outcome - Outcome of evaluating
Range:against a known resource length.Full→ 200 (noRange:header);Partial→ 206;NotSatisfiable→ 416 (not 412, which the oldparse_range_headerconflated). - RdfFormat
- Term
Constants§
- ACCEPT_
PATCH Accept-Patchadvertising the PATCH dialects supported.- ACCEPT_
POST - MIME types recognised by the content negotiator. The order matters:
the first format that matches the
Acceptheader wins, and if the client provides*/*the server defaults to Turtle. - CACHE_
CONTROL_ RDF - RFC 7234
Cache-Controldirective for RDF response variants. - MAX_
SLUG_ BYTES - Maximum byte length of a client-supplied
Slugheader. JSS caps at 255 bytes (POSIX filename limit); we match for interop. - SERVER_
MANAGED_ PREDICATES - List of predicates clients are not allowed to set directly. These are overwritten by the server on PUT.
Traits§
Functions§
- apply_
json_ patch - Apply a JSON Patch document (RFC 6902) to a
serde_json::Valuein place. ReturnsErr(PodError::PreconditionFailed)when atestoperation fails,Err(PodError::Unsupported)for malformed patches. - apply_
n3_ patch - Apply a solid-protocol N3 PATCH document to
target. - apply_
patch_ to_ absent - Apply a PATCH document to an absent resource by seeding an empty graph and running the dialect-specific patcher. JSON Patch is unsupported in this path.
- apply_
sparql_ patch - Apply a SPARQL 1.1 Update document (
INSERT DATA,DELETE DATA,DELETE WHERE) totargetusingspargebrafor parsing. - cache_
control_ for - Return the
Cache-Controlheader value appropriate for a response of the suppliedcontent_type, orNoneto leave the header unset. RDF variants always getCACHE_CONTROL_RDF; non-RDF payloads (binary blobs, images, etc.) are left to caller policy. - evaluate_
preconditions - Evaluate
If-MatchandIf-None-Matchprecondition headers against the current ETag of a resource. The caller passes whatever is observed on the storage side;Nonefor the ETag means the resource does not exist. - find_
illegal_ server_ managed - Return the list of client-supplied triples that attempt to set server-managed predicates. These MUST be ignored at PUT time.
- infer_
dotfile_ content_ type - Infer a content-type for auxiliary “dotfile” resources (
.acl,.meta, and their*.acl/*.metasuffix variants) whose extension-based lookup would otherwise fail. - is_
acl_ path - Return whether a path addresses an ACL sidecar.
- is_
container - Return whether a path addresses an LDP container.
- is_
meta_ path - Return whether a path addresses a
.metasidecar. - is_
rdf_ content_ type - Return
trueifcontent_typeidentifies an RDF serialisation the server emits through content negotiation or stores natively. Matches the formats advertised inACCEPT_POSTplustext/n3andapplication/trig(JSS parity). Parameters (e.g.; charset=utf-8) are tolerated. - link_
headers - Build the full set of
Linkheaders for a given resource path. - meta_
sidecar_ for - Compute the
.metasidecar for a resource. - negotiate_
format - Pick the best RDF format based on an
Acceptheader. - not_
found_ headers - Build the header set returned on
404 Not Foundfor an LDP path. - options_
for - parse_
range_ header - Parse a
Range:header value of the formbytes=start-endorbytes=start-orbytes=-suffix. Multi-range is intentionally not supported — Solid Pods treat non-rangeable media (JSON-LD, Turtle) as opaque and the binary path is the only consumer. - parse_
range_ header_ v2 - JSS-parity range parser. Same grammar as
parse_range_headerbut maps “empty body + header present” and “range past end” toNotSatisfiable. Malformed headers still returnErrso callers can reply400. - patch_
dialect_ from_ mime - render_
container - Backwards-compatible alias for the Phase 1 API.
- render_
container_ jsonld - Render a container as JSON-LD respecting a
Preferheader. - render_
container_ turtle - Render a container as Turtle.
- resolve_
slug - Resolve the target path when POSTing to a container.
- server_
managed_ triples - Compute the server-managed triples for a resource (
dc:modified,stat:size, and for containersldp:containsentries). - slice_
range - Slice a body buffer to a byte range. The slice is a zero-copy
view; callers are expected to
copy_from_sliceor similar when returning it through an HTTP framework. - vary_
header - Value of the
Vary:header depending on whether content negotiation is enabled.AuthorizationandOriginare always listed so shared caches never collapse an authenticated and an anonymous response onto the same cache entry.