Skip to main content

Display Results in RDF Format

24/03/2026

Alternatively to the JSON format that we have seen in the examples before, the Extractor can also return the extraction results in RDF format.

The method for this is called 'annotate'. Compared to the extract method it has one required parameter more which is 'documentUri'. This is the URI the document will receive in the generated RDF data. A further parameter that we use here is 'displayText' so that the text that is provided as input is returned as part of the result.

One important detail that is not visible in the URL of the method call is the 'accept' header, as shown below. This header specifies the RDF serialization format that the result should be returned in. For the example below we have set the header to 'text/turtle' and therefore the result is produced in Turtle format.

To get the results in a different RDF serialization, change the 'accept' header accordingly.