-
Notifications
You must be signed in to change notification settings - Fork 147
Description
Environment
- Server version: 7.1.7
- Node.js version: v25.2.1
- npm version: 11.6.2
Description
Non-RDF resources (e.g., .txt, .jpg, .pdf files) return an Accept-Patch header advertising support for RDF patch formats (text/n3, application/sparql-update), but when clients attempt to PATCH these resources with RDF data, they receive a 501 Not Implemented error stating "No conversion path could be made from text/plain to internal/quads".
Expected Behavior
When a client sends a PATCH request with RDF content (N3 Patch or SPARQL Update) to a non-RDF resource, the server should successfully apply the patch to the corresponding .meta file:
PATCH /document.txt HTTP/1.1
Content-Type: application/sparql-update
INSERT DATA { <#subject> <#predicate> "value" . }
HTTP/1.1 205 Reset ContentThe patch should be applied to /document.txt.meta, allowing clients to add metadata to non-RDF resources using the resource URL directly.
Actual Behavior
The server returns a 501 error when attempting to PATCH a non-RDF resource with RDF data:
GET /document.txt HTTP/1.1
HTTP/1.1 200 OK
Content-Type: text/plain
Accept-Patch: text/n3, application/sparql-updatePATCH /document.txt HTTP/1.1
Content-Type: application/sparql-update
INSERT DATA { <#subject> <#predicate> "value" . }
HTTP/1.1 501 Not Implemented
Content-Type: application/json
{
"name": "NotImplementedHttpError",
"message": "No conversion path could be made from text/plain to internal/quads:1,internal/*:0.",
"statusCode": 501,
"errorCode": "H501",
"details": {}
}Steps to Reproduce
- Start the Community Solid Server with default configuration
- Create a non-RDF resource:
curl -X PUT http://localhost:3000/test.txt \ -H "Content-Type: text/plain" \ -d "test content"
- Verify it advertises Accept-Patch:
curl -i http://localhost:3000/test.txt | grep -i accept-patch # Returns: Accept-Patch: text/n3, application/sparql-update
- Try to PATCH with RDF data:
curl -X PATCH http://localhost:3000/test.txt \ -H "Content-Type: application/sparql-update" \ -d "INSERT DATA { <#s> <#p> <#o> . }"
- Observe the 501 error response:
{ "name": "NotImplementedHttpError", "message": "No conversion path could be made from text/plain to internal/quads:1,internal/*:0.", "statusCode": 501 } - Verify that PATCHing the .meta file directly works:
curl -X PATCH http://localhost:3000/test.txt.meta \ -H "Content-Type: application/sparql-update" \ -d "INSERT DATA { <#s> <#p> <#o> . }" # Returns: 205 Reset Content (success)
Impact
- Clients cannot use the
Accept-Patchheader to add metadata to non-RDF resources - The advertised capability (
Accept-Patch: text/n3, application/sparql-update) is misleading - Clients must know to PATCH
.metafiles specifically, rather than using the resource URL