From b09aa80025d204b1f3bdaefb4fbb3e086a7edefa Mon Sep 17 00:00:00 2001 From: Stefanie Taepke Date: Mon, 10 Sep 2018 14:00:19 +0200 Subject: [PATCH] add documentation for multilang-support --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index 65b58d07..428561d4 100644 --- a/README.md +++ b/README.md @@ -805,7 +805,40 @@ This makes it very easy to display the fields in the current language. To disable this behavior, you can set the following config value in your ini file (default: True): ckanext.dcat.translate_keys = False + +## Multilingual RDF support +To add multilingual values from RDF to ckan, the function `_object_value` can be called with optional parameter `multilang=true` (defaults to `false`)). +If `_object_value` is called with the `multilang=true`-parameter, but no language-attribute is found, the value will be added as Literal with the default language (en). + +Example RDF: +```xml +Dataset Title (EN) +Dataset Title (DE) +Dataset Title (FR) +``` +```json +{ + "title": + { + "en": "Dataset Title (EN)", + "de": "Dataset Title (DE)", + "fr": "Dataset Title (FR)" + } +} +``` +Example with missing language in RDF: +```xml +Dataset Title +``` +```json +{ + "title": + { + "en": "Dataset Title" + } +} +``` ## Structured data and Google Dataset Search indexing