Skip to content

Extend and patch the Knowledge Graph

Introduction

In Studio it is possible to extend the project's Knowledge Graph by adding syncons, relationships between existing syncons and user data to existing syncons.

You can also patch the existing Knowledge Graph by adding, deleting and modifying existing lemmas and many more actions described in detail in the dedicated page.

Warning

Extension and patching are not available if the project was imported from an old project based on the legacy technology without updating the format of the Knowledge Graph.

You do this using the Knowledge Graph Editor Settings window.

The extension—and patch—operations are divided into four common phases:

  1. (Outside Studio) Prepare the files containing the specification of the changes to be made to the Knowledge Graph.
  2. Import the above files in your Studio project: source files are pre-processed to produce files with .kge extension inside the project's kge folder which are suitable for the build operation.
  3. Build the Knowledge Graph with the .kge files produced by the pre-processing referred to in the previous point.
  4. Reload the Knowledge Graph to make the extended and/or patched KG available.

All the actions described below are applied for both extension and patch operations.

Source files preparation

Files with the .txt extension allow you to easily add entities (people, organizations, brands, products, etc.) to the Knowledge Graph. Files with the .csv extension allow for more operations.

A few things to remark:

  • While for the Knowledge Graph extension you can use both .txt and .csv files, for the Knowledge Graph patches, only .csv files are allowed.
  • If you have to extend and patch the Knowledge Graph, two files are necessary:

    • One with the patch operations in the Patch tab.
    • One with the extension operations in the Extension tab.

Read the article in the appendix to learn how to prepare these files according to your needs.

Import .txt files

To import a .txt file, in the Knowledge Graph Editor Settings window:

  1. Select the Extension tab and select Add Import File .
  2. Select the .txt file to import. The Import into Knowledge Graph dialog will appear.
  3. In KGE Filename enter the name to give to the corresponding pre-processed file (.kge extension).
  4. In Separator select the character possibly used in your .txt files to separate multiple lemmas for the same syncon.
  5. Select the button representing a funnel to look for the parent syncon. The search dialog has the same properties of the Knowledge Graph Search tool window. Your selection will fill the Parent Syncon field.

    Info

    The parent syncon is the syncon to which the syncons of the entities created with the extension operation will be connected with the supernomen/subnomen link. Entities syncons will be "children" (subnomen) of the specified parent syncon.

  6. In Definition enter the gloss for all the syncons listed in the file (all the syncons will have the same gloss)1.

  7. Check Copy in project folder to create a copy of your file in the kge\source folder of the project.
  8. Select Import. The file is added to the imported files list and corresponding files with .kge and .import extensions are created under the project's kge folder. Also, the kge\main.kge file is updated.

Import .csv files

To import a .csv file, in the Knowledge Graph Editor Settings window:

  1. Select the Extension tab for extension operations or the Patch tab for patch operations.
  2. Select Add Import File .
  3. Select the .csv file to import. The Import into Knowledge Graph dialog will appear.
  4. In KGE Filename enter the name to give to the corresponding pre-processed file (.kge extension).
  5. In CSV Type select:

    • EXT for .csv files used to extend the Knowledge Graph.
    • PATCH for .csv files used to patch the Knowledge Graph.
  6. Check Copy in project folder to create a copy of your file in the kge\source folder of the project.

  7. Select Import. The file is added to the imported files list and corresponding files with .kge and .import extensions are created under the project's kge folder. Also, the kge\main.kge file is updated.

Note

Some example files and Excel templates are already downloadable and ready to be used.

Remove a file

To remove an imported file, in the Knowledge Graph Editor Settings window:

  1. Select the Extension tab or the Patch tab.
  2. Select the file from the list, then select Remove Import File .
    Corresponding files with .kge and .import extensions inside the project's kge folder are deleted and the kge\main.kge file is updated.

Change the evaluation order

Pre-processed files—those with .kge extension in the project's kge folder—are evaluated one after the other during the build operation, using the same order in which they are listed in the Knowledge Graph Extension Settings window.

To change the order in which files are evaluated during the build operation, in the Knowledge Graph Editor Settings window:

  1. Select the Extension or Patch tab.
  2. Select a file, then select:

    • Up to move the file up one step.

    Or:

    • Down to move the file down one step.

Re-import a file

To re-import a source file after some changes, in the Knowledge Graph Editor Settings window:

  1. Select the Extension or Patch tab.
  2. Select the file, then Reimport File .

Build the extended Knowledge Graph

  1. Select Build to build the extended and/or patched Knowledge Graph.
  2. In the dialog, select Yes. Studio will be restarted to apply changes.

After reloading, the extended and/or patched Knowledge Graph is available and changes are accessible via the Knowledge Graph and the Knowledge Graph Search tool windows.

Reset the Knowledge Graph extensions

To remove the extensions of the Knowledge Graph, in the Knowledge Graph Editor Settings window:

  1. Select Reset Extensions.
  2. In the dialog, select Yes. Studio will be restarted to apply changes.

Reset the Knowledge Graph

To reset the Knowledge Graph, that is to remove both extensions and patches:

  1. In the Knowledge Graph Editor Settings window, select Reset.
  2. In the dialog, select Yes. Studio will be restarted to apply changes.

  1. Glosses may be invisible inside the Knowledge Graph and the Knowledge Graph Search tool windows depending on the type of Knowledge Graph.