Skip to content

Conversion to V2

The metadata generated by the application conforms to the first version of the data model for metadata.
This corresponds to the data that can currently be viewed in the DaSCH Metadata Browser.

The initial data model will eventually be replaced by the model V2 which introduces major improvements.
Metadata V2 will eventually be collected directly in the web interface rather than in this python application.
In the mean time until the web interface for editing metadata is implemented, this application provides a script to automatically convert V1 .ttl files into V2 .json files.

Model V2

The most important changes from V1 to V2 include the following additions:

  • Support for multi-language literals

  • howToCite on project level

  • country property for addresses

  • Creation and modification timestamps

  • JSON schema validation

A detailed, formal specification of the model can be found here.

Using the Conversion

Converting to the V2 data model is a multi step process:

  1. Collect and export the data model with the GUI tool, as previousely.
  2. Convert the exportet V1 .ttl data to V2 JSON data.
  3. Clean and post-process the JSON data manually.
  4. Convert the V2 JSON data to V2 RDF (.jsonld and .ttl) data.

Convert V1 RDF to V2 JSON

In the menu bar, click Options > Convert RDF to JSON.

conversion menu item

This will open the JSON conversion dialog.

conversion dialog

Here you need to specify:

  1. Which files to convert.
  2. Where to save the converted files.

To select the files that should be converted, you have three options:

  • Single File: Select a single Turtle file.
  • Multiple Files: Select multiple Turtle files; use shift-click or control-click to select multiple files.
  • Directory (Bulk Transform): Select a folder and it will transform all Turtle files within this folder.

As output simply select a folder. The selected input file(s) will be converted and saved to this folder.
The output files will retain the input file's name but the ending will be replaced from .ttl to .json. If the output folder already contains a file whith such a name, it will get overwritten. It is therefore advisable to select an empty folder.

Finally, hit the Convert button at the very bottom of the dialog.
This button is greyed out as long as either the input or the output is missing. As soon as input and output are specified, the button gets enabled.

The conversion may take a while (especially if multiple files are being converted), the dialog will not be clickable during this time. Once it's done the output folder should open up, and the conversion dialog can be closed.
The process should not take more than a minute per file. On the console you should get minimal indication of the progress.

NB: The conversion requires a local .ttl file. It is therefore necessary to export the data after entering it, before it can be converted.

NB: Be sure to remember to review the data after the conversion. It will require manual post-processing, as described below.

Manual Post-Processing

The conversion can not be fully automated, as the model V2 is more rich in information than V1.

For convenience, the conversion adds the string XX wherever the output can not be determined with sufficient confidence. Please check those instances manually.
Simply open the output file in a text editor and search for XX.

The conversion also does some "guessing" work, as e.g. the language of literal values or the display text for URLs. If the output can be determined with a sufficient level of confidence, the conversion will not add XX. However it is still advisable to check the entirety of the output for potential errors.

As the model V2 supports JSON schema validation, it is also advisable to open the output file in a text editor that supports JSON schema validation. (E.g. Visual Studio Code which automatically validates JSON files that have a schema specified.)
This will highlight potential issues with the data.

Note: The schema validates URLs as URIs. It will therefore consider URLs without scheme as invalid, i.e. meta.dasch.swiss will be highlighted as invalid, whereas https://meta.dasch.swiss will be valid.
These warnings can safely be ignored, or the schemes can be added to get rid of the warnings.

Convert V2 JSON to V2 RDF

Once the JSON data is fully cleaned, it can be converted to V2 RDF (both turtle and JSON-LD) using another conversion tool in the GUI:

In the menu bar, click Options > Convert JSON to RDF.

conversion menu item

This will open the RDF conversion dialog.

conversion dialog

Similarly to the first conversion, you need to specify input and output, and then hit convert.