Skip to main content

Data Formats

dcupl is able to handle JSON and CSV datasets. It does not matter if the data is added manually via the SDK, loaded from a file server or an API. That means you have total control on how to add data to your application. If you are building an application from scratch you might want to take a look at our dcupl AppLoader to scaffold and manage your application. If you want to test dcupl in an existing application where you already load all necessary data you can also do a direct integration using the SDK.

info

dcupl is able to process JSON and CSV datasets. It does not matter if they are static files or fetched via an API.

JSON

Javascript Object Notation is specified by ECMA.

The following example shows a list of books. Each book is a separate JSON object and identified by a key. The title is a string property and the relation between books and publisher is implemented in the multiValued reference publisher_ids as array of publisher identifier keys.

[
{
"key": 1,
"title": "The World's First Love",
"publisher_ids": ["2778", "5049"]
},
{
"key": 2,
"title": "The Illuminati",
"publisher_ids": ["5049"]
},
{
"key": 3,
"title": "The Servant Leader",
"publisher_ids": ["4902"]
}
]

CSV

Comma-separated values which is specified in RFC 4180.

Each record/row represents a data entry and is defined by its identifier (which is key per default). An alternative key attribute can be configured in the model definition.

  • The default delimiter for columns is ;
  • multiValued reference values are separated by a ,
  • Quoting is disabled by default, but can be set in the AppLoader options
key;title;publisher_ids
1;The World's First Love: Mary Mother of God;2778,5049
2;The Illuminati;20049130001;5049
3;The Servant Leader;23755004321;4902
...

Escaping & Quoting

The default delimiter is ;. If your data contains texts, it may be possible that this text also contains a semicolon. This will mess up your data and therefore you have to quote this string with " to prevent this error.

tip

You can specify the delimiter and quoteChar in the AppLoaderConfiguration, the AppLoaderProcessOptions and on an individual level on the resource directly.

loader.process({
...
csvParserOptions: { delimiter: ';', quoteChar: '"' }
})
id;text;language
id_01;A string containing a ; should be quoted;eng