Multilingual Linked Open Data Patterns

Language Content Negotiation

Description

In this pattern, the server attends the language preferences of the user agent, presented in the Accept-language header and returns different data for each language preference.

Context

This pattern can be used to reduce network bandwidth and client processing.

Notice that a user agent retrieves a subset of all the triples in languages that he has included in the header.

Example

Imagine that the server contains the following triples

:juan :position "Professor"@en . 
:juan :position "Catedrático"@es . 
:juan :workPlace "León Universiy"@en . 
:juan :workPlace "Universidad de León"@es .

If we try to obtain those triples from a server, which does language-content negotiation, and the header contains Accept-language:es then the server returns:

:juan :position "Catedrático"@es . 
:juan :workPlace "Universidad de León"@es .

while if the header is Accept-language:en, it returns:

:juan :position "Professor"@en . 
:juan :workPlace "Len Universiy"@en .

Notice that the semantics of the HTTP content negotiation mechanism should return the whole dataset, if there is no language preference.

Discussion

This feature reduces network traffic and the load of client applications as the server would only send triples of a given language.

Content negotiation is part of the Web architecture. This solution can improve the performance of clients limiting the number of triples in languages that they are not interested.

Nevertheless, implementing language content negotiation complicates the development. Another problem is that if we return different representations in different languages, we should ensure that the content represented in one language is equivalent to the content represented in other language.

This can raise problems on semantic equivalence between natural language text.

See also

This pattern is related to the content negotiation exposed as a best practice recipe for publishing RDF vocabularies in [Berrueta 08] where language content negotiation is applied to offer different representations for HTML or RDF content.

Although this pattern is meant for human oriented representations, like HTML, for RDF there is no such specification.

There are non-standard implementations by triple-stores (like the sql:BEST_LANGMATCH function in Virtuoso) that can provide the above mentioned functionality.