From 5c8756b8ab754bb49b74d09acc7396b4ac586c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Jusevi=C4=8Dius?= Date: Sat, 24 Oct 2026 10:39:16 +0200 Subject: [PATCH] Document the 422 a write with a malformed IRI is answered with POST, PUT and PATCH refuse an IRI the IRI syntax does not allow with 422, naming each value as an ldh:URISyntaxViolation with ldh:violationValue (AtomGraph/LinkedDataHub#495). Co-Authored-By: Claude Opus 5.5 --- docs/reference/http-api/documents.ttl | 34 +++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/docs/reference/http-api/documents.ttl b/docs/reference/http-api/documents.ttl index 881fb75..5226bb2 100644 --- a/docs/reference/http-api/documents.ttl +++ b/docs/reference/http-api/documents.ttl @@ -47,9 +47,9 @@ Media type not supported - POST - Appends data to a document - 204 No Content + POST + Appends data to a document + 204 No Content 400 Bad Request RDF syntax error @@ -66,16 +66,19 @@ Media type not supported - 422 Unprocessable Entity + 422 Unprocessable Entity Constraint violation in the resulting document Body states the sioc:has_parent/sioc:has_container of a resource other than the document - PUT - Upserts a document - 200 OK

201 Created

308 Permanent Redirect + Malformed IRI in the body (see below) + + + PUT + Upserts a document + 200 OK

201 Created

308 Permanent Redirect 400 Bad Request RDF syntax error @@ -95,12 +98,15 @@ Media type not supported - 422 Unprocessable Entity + 422 Unprocessable Entity Constraint violation in the resulting document Body states the sioc:has_parent/sioc:has_container of a resource other than the document + + Malformed IRI in the body (see below) + DELETE Removes the requested document @@ -117,10 +123,10 @@ The container still has documents: delete them first - PATCH - Modifies a document using SPARQL Update - 204 No Content - 422 Unprocessable Entity + PATCH + Modifies a document using SPARQL Update + 204 No Content + 422 Unprocessable Entity SPARQL update is not a single graph-scoped INSERT/DELETE operation, or removes an rdf:type @@ -129,9 +135,13 @@ Update changes the document's sioc:has_parent/sioc:has_container, or adds one of another resource + + Malformed IRI in the body (see below) +

Any method may additionally answer 403 Forbidden — see Access control. Any method that writes may answer 428 Precondition Required when the request carries no precondition, or 412 Precondition Failed when the one it carries is out of date — see Conditional writes.

+

An IRI the IRI syntax does not allow — such as <http://[::1> or one with a space in it — is refused with 422 Unprocessable Entity, whether it comes in an RDF body, an RDF/POST form or a SPARQL update. The response names each value as an ldh:URISyntaxViolation, with the value as typed in ldh:violationValue; an RDF body names the first one only, as its parser stops there. A Turtle or N-Triples body with a space or < in an IRI is answered 400 Bad Request instead, as its tokenizer does not report the value.

Document metadata