Updated at: 2023-02-16 06:22:37

Data is the foundation of knowledge graph. The current data sources support MySQL, Hive, RabbitMQ, and AnyShare. The structured data includes CSV, JSON. Unstructured data includes Word, Excel, PPT, PDF, Txt document format, see data format requirements for details.

 

This section provides an example of structured data related to consumption to help you quickly familiarise yourself with the process of creating a knowledge graph. Once created, you can search and preview the knowledge graph of the relevant entity, or you can fully update or incrementally update the graph based on the existing graphs.

 

Prerequisites

1. Click the [Dataset Download link]. After downloading the dataset locally, import the sample dataset into MySQL database.

2. Log in to the AnyDATA Workbench and click any knowledge network you like, click [Create] button to pop up the "Create Knowledge Network" dialog box.

3. Fill in the knowledge network name "Sales" in the dialog box, fill in the knowledge network description "about sales and user order data" in the "Description" text box, and click the [OK] button.

4. Now you enter the default page --"Knowledge Graph" page.

 

Procedure

Step 1:  Basic Information Entering

Enter the basic information on the "Create Knowledge Graph" page.

Parameter Description
Knowledge Graph Name The knowledge graph name consists of Chinese, English, numbers and underscores, and the length is 1-50 digits.
Storage Location You can choose the built-in storage location or go to [System Settings] > [Storage Management] > [Graph Database] to configure the storage location.
Description The description consists of Chinese, English, numbers and special symbols, and the length is 0-150 digits.

 

Step 2: Data Source Selecting

1. On the "Data Source Selecting" page, click [Create] button to pop up the "Create Data Source" dialog box.

2. Fill in the data source name "Sales_data" ,select data source type " MySQL" and enter other information in accordance with data sample.

3. Click the [Test] button to test whether the database is connected.

 

Step 3: Ontology Creating

Create entities

1. On the "Create Ontology" page, click [Create Entity Class] button to create an entity class. The "Entity Class" edit box is displayed on the left.

2. In the "Entity Class" text box, enter the following information:

Parameter Description Example Value
Entity Class Name The entity class name consists of uppercase and lowercase letters, numbers and underscores, and the length is 1-50 digits. In this example, we need to create two entity classes, which can be named "order_detail" and "user" respectively.
Display Name The display name consists of Chinese, English, numbers and underscores, and the length is 1-50 digits. In this example, we can change the display names of the two entity classes, which could be named "Order Details" and "User".
Color Select the color of the entity class.

-

Attributes All entity class names have a default attribute of "name" and the default attribute type is "string".

You can add the attributes "id," "orderid," "itemid," "itemname," "price," and "itemnum" for the entity class "Order Details."

 

You can add properties "id", "sex", "age", and "createtime" for the entity class "User".

Create relationships

1. Click the [Create Relationship Class] button, click the entity "User" on the canvas and drag out a line, move the line to the target entity point "Order Details". At this point, we have created a relationship between "Order Details" and "User".

2. In the relationship sidebar, we need to fill in the relationship class name "order" and display name "Order" for this relationship. (See Create entities for details.)


NOTE:

You can click the [+] button to add more attributes for entity classes.


 

Step 4: Information Extracting

1. Click the [Select Data Source] button in the data list on the left of the "Information Extracting" page, and the "Select Data Source" dialog box will pop up.

2. We need to select the data source "sales_data" and the data tables "order", "order_detail", and "user" in data list.

3. Click [OK] button.

 

Step 5: Knowledge Mapping

In this step, we need to establish the corresponding relationship between "Step 3: Ontology Creating" and "Step 4: Information Extracting".

Entity mapping

1. In the left configuration list, select [Entity Class] >[Hand-painted Entities].

2. Click [Order Details].

  • Select the extracting object "order_detail" in the entity mapping. Similarly, we can select the extracting object "user" in the entity class "User".
  • Configure extracting object properties in property mapping.

Relationship mapping

1. In the left configuration list, select [Relationship Class] >[Hand-painted Relationships].

2. Click [Order].

  • Select the extracting object "order" in the relationship mapping. 
  • Configure extracting object properties in property mapping.
  • Select the starting entity class attribute "id", relationship- starting relationship object "uesr_id", relationship- ending relationship object "id"  and ending entity class attribute "orderid".

 

Step 6: Fusion

In this step, we need to integrate and disambiguate data we configured in the following steps.