Skip to content

RDF conversion of metadata in the DPI#

The data entered into the DPI is stored in JSON format to comply with Vue Formulate specifications. The JSON data is stored according to the step progress bar (e.g. step 1: Essential properties). This is to facilitate mapping when displaying the data in the frontend. The entered data is stored in key-value pairs, where the value contains the entered information and the key contains the URI.

To ensure that entered values are not lost, all data is cached in the browser's local storage after each input (dpi_datasets, dpi_catalogues & dpi_distributions).

// data sorted by information type (dataset)
datasets: {
    step1: { // data sorted by page content (step 1: Essential properties)
        "dct:title": [
            { "@value": "Title", "@language": "en" },
            ...
        ],
        "dct:description": [
            { "@value": "Description", "@language": "en" },
            ...
        ]
    }, 
    step2: {...},
    ...,
    }

// data sorted by information type (distribution)
distributions: [
    {
        step1: {...}, // data sorted by page content (step1: Essentialproperties (for distributions))
        step2: {...},
        ...
    },
    {
        step1: {...},
        step2: {...},
        ...
    }
]

// data sorted by information type (catalogue)
catalogues: {...}

Attention: The data for distribution is sorted by distribution and stored in one object each. If several distributions were created, there is one object per distribution, which contains the data of this distribution.

As soon as the user wants to save the entered data (publish it directly or as a draft), it is converted from JSON to RDFusing the RDF-converter (src/modules/data-provider-interface/utils/RDFconverter.js). Therefore, the JSON objects created per page are merged.

// merged dataset data
datasets: {
    "dct:title": [{...}, {...}],
    "dct:description": [{...},{...}],
    ...
}

The final conversion process iterates over all key-value pairs. The data is distinguished according to its format and stored accordingly into the RDF graph.

The different format types are stored in a config file according to the used schema (src/modules/data-provider-interface/config/[schema]/format-types.js). Each parameter (e.g. "dct:title") is assigned to a format type. Attention: Here we also distinguish between datasets, distributions and catalogues!

Available format types:#

  • singularURI
  • multipleURI (multiURIobjects, multiURIarray)
  • typedStrings
  • singularString
  • multilingualStrings
  • groupedProperties
  • additionalPropertyTypes

The completed RDF graph is sent to the backend in the body of a request. If the request is successful, the data is stored in the backend and the cached data in the frontend and the browser's local storage is deleted.

The conversion from RDF to JSON is done analogously in the input converter (src/modules/data-provider-interface/utils/inputConverter.js).