Import/Export a dictionary

The import process consists on being able to create entries for a dictionary using a file to define them. This process can be carried out either during the creation, or later on from the dictionary view.

The file does not need to have a specific extension, the only conditions that it must fulfill are that:

  • Each entry is defined in a different line.
  • Each line is formatted according to any of the two formats available for the entry definition:

    Form

    Form\tAliases\tSense ID\tSemantic information

    Important

    The symbol \t represents a tabulation. If the fields Aliases or Sense ID have more than one value associated, they will be separated by pipes, |.

These two formats will be complemented by two fields available in all the import dialogs:

Create importing with more information

These fields define two of the most common aspects associated to a dictionary entry. Both of them are defined within the semantic information associated to the entry (which is explained in detail in the semantic information definition section), but for ease of use purposes, they can be set outside the semantic information.

  • Entry type defines if the entry is considered an entity or a concept. In the import process there are three possible values:
    • Specified in file: selected by default and a way to indicate that the information is in the file imported.
    • Entity, the entries imported will be entities (and value taken by default if it's not defined in this menu or in the file).
    • Concept, the entries imported will be concepts.
  • Ontology type defines if the value within the ontology associated to the entry. The menu has available a number of values from our ontology (the most common ones), but you can also write whichever value you want by selecting Write your own value or select any of the values you have created for other entries in the dictionary.
    Additional info set in the import process

    In this case all the entities imported would be of the type Characters, a node that does not exist in our ontology, in the node Person, which is part of our basic ontology.

Important

If these fields are set and the same information they define is also in the semantic information in the file, this information will be overwriten.

These two formats and the two additional fields provided by the import interface cover the most common scenarios found when working with user dictionaries.

The first format, the one where only the form is defined, derives from the fact that the only thing you need to define an entry is its form. None of the other fields are mandatory, and the only field that will be assigned a type by default is entry type.

Form

This is an example of the first format:

Rachel Green

Joey Tribbiani

Ross Geller

Monica Geller

Phoebe Buffay

Chandler Bing

It's just a list of forms where the only thing you have to make sure is that each entry is in a different line. If you combine this with the entry type and the ontology type, setting them, for instance, to Entity and to Person>Characters (user-defined value seen before), you would be adding easily a list of characters from a tv show.

The second format allows to import entries with all the possible information they may have.

Form\tAliases\tSense ID\tSemantic information

This is an example of this format:

Rachel Green\t\tFR001|-\toccupation_list=waitress|personal shopper|executive at Ralph Lauren

Joey Tribbiani\tDr. Drake Ramoray\tFR002\toccupation_list=actor

Ross Geller\t\tFR003\toccupation_list=paleontologist|college professor

Monica Geller\t\tFR004\toccupation_list=chef

Phoebe Buffay\tRegina Phalange|Princess Consuela Bananahammock\tFR005\toccupation_list=Massage therapist|Musician/singer-songwriter

Chandler Bing\t\tFR006\toccupation_list=Statistical analysis and data reconfiguration|Junior advertising copywriter

There's a more detailed explanation about how to defined this information in the semantic information definition section.

Did you notice...?

That when using a specific format, if one of the entries does not have a value for one of the fields, the space for it must be included even if it has no value. Check for example the aliases in the example for the second import format. Only some of the entries have aliases, but all of them include the position where they'd be included if they had.

Did you notice...?

The sense ID associated to Rachel Green has two values, FR001, and then separated by |, a dash. This dash is how we enable in an import process the use only my senses configuration option.

Important

The import process always creates new entries. In other words, this process does not allow to update any of the entries that are already created in the dictionary. You should update them from the edit entry view.

This is the result of importing the file used as an example for the second import format:

Import result

Did you notice...?

When there are more than two dictionaries in your dashboard, you can choose to show them all or just the most recent ones by clicking on Hide or Show all that appears at the bottom.

There can be errors in the import process, mainly of two types:

  • Format errors, errors in the format of the import file, such as when a line does not have the right number of fields.
  • Plan limit errors, if the amount of entries of your dictionary after the import process exceeds your plan limit.

When a line in the file gives a Format error, it will be ignored. The result of the import process will be specified by a message in the dictionary view, detailing the entries that have generated an error.

Import errors

Usually, when you import a dictionary from a file and there is a format error, you may want to correct the affected rows in the import file (shown in the error message), copy them to a new file and try to import them again.

The error is related to the plan limit, the import won't be carried out and the following message will appear:

Plan limit error

To export a dictionary's entries to a file, you only have to click on the sidebar's Export button. It will create a file with the same format required to import a dictionary (the second format, the most complete one), featuring each entry in a new line and all fields separated with tabulation characters.

It's important to know that this action doesn't create an exact backup of the dictionary. It only exports entries without the ID used to identify them in the system. Other fields of the dictionary like name, language and description are not saved in the export file.