Validation of RDF¶
EntryStore makes use of several different libraries and classes that handle RDF differently. Some libraries fail when sending in RDF that does not conform completely to the specification, others are more relaxed.
When sending in erroneous metadata, EntryStore responds with a HTTP 400 status code. In order to find out about the exact reason it is possible to use the validator resource. It performs checks in three stages:
- Can the RDF be deserialized into a Graph object.
- Do all IRIs used in subject, predicate, object and context (named graph identifier) position, as well as literals starting with
http://orhttps://, are valid IRIs according to RDF4J'sValidatingValueFactory. - Can the graph be loaded into a repository.
The validator requires a logged in user (guests receive 401). The RDF data is sent in the body of a POST request. All RDF formats supported by RDF4J may be used; the format is taken from the URL parameter format or, if it is not given, from the Content-Type header. An unsupported or missing format is answered with 400. Request bodies larger than 10 MB, or without Content-Length, are answered with 413.
A successfully validated request is answered with HTTP status 200 and an empty body. If the validation fails, the response has HTTP status 400 and the standard error JSON structure; the error field contains the reason. For invalid IRIs it lists up to 50 of them, separated by ;. It is not possible to validate the IRIs if the request body cannot be deserialized into a proper RDF graph before.
If an error occurs on the server side that is unrelated to the request, an HTTP status 500 is responded with.
EntryStore 5.x
In 5.x the response is a JSON object with an errors array (empty on success), guests receive 403, and the request size is not limited.
Example¶
POST http://{base}/validator
Content-Type: application/n-triples
<http://example.org/a> <http://example.org/p> "http://bad uri/x" .
Example response¶
{
"timestamp": "2026-01-01T12:00:00.000",
"status": 400,
"path": "/store/validator",
"error": "Invalid IRI: http://bad uri/x"
}