Skip to content

Commit 949dd58

Browse files
author
Sebastian Plott
committed
Rewrote the Tutorial: lift data from tabular data using the workflow and
renewed some pictures
1 parent 727977e commit 949dd58

17 files changed

+95
-104
lines changed
61.5 KB
Loading
40.6 KB
Loading
47.7 KB
Loading
84.6 KB
Loading
80 KB
Loading
40 KB
Loading
12 KB
Loading
44.9 KB
Loading

docs/build/lift-data-from-tabular-data-such-as-csv-xslx-or-database-tables/index.md

Lines changed: 95 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ This beginner-level tutorial shows how you can build a Knowledge Graph based on
2727
The documentation consists of the following steps, which are described in detail below:
2828

2929
1. Registration of the target vocabulary
30-
2. Uploading of the data (file)/Connect to JDBC endpoint
31-
3. (Re-)View your data table
32-
4. Creation of a (target) graph
33-
5. Creation of the transformation rules
34-
6. Evaluation of the results of the transformation rules
35-
7. Execution of the transformation to populate the target graph
30+
2. Uploading of the data (file)
31+
3. Creating the Transformation
32+
4. Configure Mapping
33+
5. Evaluate a Transformation
34+
6. Build the Knowledge Graph
35+
3636

3737
## Sample Material
3838

@@ -72,11 +72,11 @@ The vocabulary contains the classes and properties needed to map the data into t
7272

7373
1. In Corporate Memory, click Vocabularies under **EXPLORE** in the navigation on the left side of the page.
7474

75-
![](explore-vocab-catalog.png){ class="bordered" width="30%" }
75+
![](explore-vocab-catalog.png){ class="bordered" width="50%" }
7676

7777
2. Click **Register new vocabulary** on the top right.
7878

79-
![](vocab-catalog.png){ class="bordered" }
79+
![](vocab-catalog.png){ class="bordered" width="50%" }
8080

8181
3. Define a **Name**, a **Graph URI** and a **Description** of the vocabulary. _In this example we will use:_
8282

@@ -87,6 +87,7 @@ The vocabulary contains the classes and properties needed to map the data into t
8787

8888
![](register-new-vocab.png){ class="bordered" width="50%" }
8989

90+
9091
=== "cmemc"
9192

9293
``` shell-session
@@ -95,46 +96,50 @@ The vocabulary contains the classes and properties needed to map the data into t
9596

9697
---
9798

98-
## 2 Upload the data file / Connect to the JDBC endpoint
99+
## 2 Uploading of the data (file)
99100

100-
=== "CSV + XLSX"
101+
1. In Corporate Memory, click Projects under **BUILD** in the navigation on the left side of the page.
101102

102-
1. In Corporate Memory, click Projects under **BUILD** in the navigation on the left side of the page.
103+
![](menu-build-projects.png){ class="bordered" width="50%" }
103104

104-
![](menu-build-projects.png){ class="bordered" width="30%" }
105+
2. Click **Create** at the top of the page. 
105106

106-
2. Click **Create** at the top of the page. 
107+
3. In **Create new item** window, select **Project** and click **Add**. The Create new item of type Project window appears.  
107108

108-
3. In **Create new item** window, select **Project** and click **Add**. The Create new item of type Project window appears.  
109+
4. Fill in the required details such as Title and Description. Alternatively, import the existing project by clicking **Import Project File** and selecting the file from your system.  
109110

110-
4. Fill in the required details such as Title and Description. Alternatively, import the existing project by clicking **Import Project File** and selecting the file from your system.  
111+
5. Click **Create**. Your project is created.
111112

112-
5. Click **Create**. Your project is created.
113113

114-
6. Optionally, click **Edit** within your project
114+
---
115+
116+
=== "Workflow view"
115117

116-
![](edit-prefix.png){ class="bordered" }
118+
1. Within your project, click on **Create workflow**.
117119

118-
7. Add a prefix and a URI
120+
![](create-workflow.png){ class="bordered" width="50%" }
119121

120-
- Prefix: _**pv**_
121-
- URI: _**<http://ld.company.org/prod-vocab/>**_
122+
2. Fill out a label and click **create**.
122123

123-
![](edit-prefix-add.png){ class="bordered" }
124+
![](workflow.png){ class="bordered" width="50%" }
124125

125-
8. Click **Create** or **Create item**.
126+
3. Drag and drop the **[services.csv](services.csv) sample file** on the grid.
126127

127-
9. In the **Create new item** dialog, select **CSV**.
128+
4. Optionally change the Label, then click on **create**.
128129

129-
![](build-dataset-types-csv.png){ class="bordered" }
130+
![](add-services-csv.png){ class="bordered" width="50%" }
130131

131-
10. Fill out a label and upload the **[services.csv](services.csv) sample file**.
132+
5. Create a second **dataset** by drag & drop it on the grid using [products.xlsx](products.xlsx) file.
132133

133-
![](create new-dataset-csv.png){ class="bordered" }
134+
=== "cmemc"
134135

135-
11. Click **Create**.** Leave all other parameters at their default values.
136+
``` shell-session
137+
$ cmemc project create tutorial-csv
136138

137-
12. Create a second **dataset**. Choose **Excel** and upload the [products.xlsx](products.xlsx) file.
139+
$ cmemc dataset create --project tutorial-csv services.csv
140+
141+
$ cmemc dataset create --project tutorial-csv products.xlsx
142+
```
138143

139144
=== "JDBC"
140145

@@ -179,82 +184,40 @@ The vocabulary contains the classes and properties needed to map the data into t
179184

180185
Instead of selecting a table you can also specify a custom SQL query in the _source query_ field.
181186

182-
=== "cmemc"
183-
184-
``` shell-session
185-
$ cmemc project create tutorial-csv
186-
187-
$ cmemc dataset create --project tutorial-csv services.csv
188-
189-
$ cmemc dataset create --project tutorial-csv products.xlsx
190-
```
191-
192187
---
193188

194-
## 3 (Re-)View your Data Table
195-
196-
To validate that the input data is correct, you can preview the data table in Corporate Memory.
189+
## 3 Creating the Transformation
197190

198-
1. On the dataset page, press the **Load preview** button
199-
200-
![](dataset-services.png){ class="bordered" }
201-
202-
2. Once the preview is loaded, you can view a couple of rows to check that your data is accessible.
203-
204-
![](dataset-services-preview.png){ class="bordered" }
205-
206-
3. Optionally, you can click **start profiling** and explore statistics about the dataset.
207-
208-
![](dataset-services-profiling.png){ class="bordered" }
209-
210-
---
191+
The transformation defines how an input dataset (e.g. CSV) will be transformed into an output dataset (e.g. Knowledge Graph).
211192

212-
## 4 Create a Knowledge Graph
193+
1. Click on the right dot and select **Connect to the newly created Transformation**.
213194

214-
1. Click Create at the top of the page.
195+
![](create-transformation.png){ class="bordered" width="50%" }
215196

216-
2. In Create new item window, select Knowledge Graph and click Add.
197+
2. Fill out the **Label** with _**Lift Service Database**_.
217198

218-
![](build-dataset-types-kg.png){ class="bordered" }
199+
![](transformation-label.png){ class="bordered" width="50%" }
219200

220-
3. The Create new item of type Knowledge Graph window appears.
221201

222-
4. Define a **Label** for the Knowledge Graph and provide a **graph** uri. Leave all the other parameters at the default values. _In this example we will use:_
202+
3. Scroll down to **Target vocabularies** and choose **Products vocabulary**.
223203

224-
- Label: _**Service Knowledge Graph**_
225-
- Graph: _**<http://ld.company.org/prod-instances/>**_
204+
![](select-vocabulary.png){ class="bordered" width="50%" }
226205

227-
5. Click **Create**.
206+
4. Click on **create**.
228207

229208
---
230209

231-
## 5 Create a Transformation
232-
233-
The transformation defines how an input dataset (e.g. CSV) will be transformed into an output dataset (e.g. Knowledge Graph).
234-
235-
1. Click **Create** in your project.  
236-
237-
2. On the **Create New Item** window, select **Transform** and click **Add** to create a new transformation.
210+
## 4 Configure Mapping
238211

239-
3. Fill out the the details leaving the **target vocabularies** field at its default value **all installed vocabularies,** which will enable us to create a transformation to the previously installed products vocabulary. _In this example we will use:_
212+
1. Click on the 3 Dots from the previous created Transormation an choose **Mapping Editor**.
240213

241-
- Name: _**Lift Service Database**_
242-
- _In the section **INPUT TASK** in the field **Dataset**, select the previously created dataset: **Services** (Input Dataset)._
243-
- _Select the previously created dataset as the Output Dataset: **Service Knowledge Graph**_
214+
2. Click **Mapping** in the main area to expand its menu.
244215

245-
4. In the main area you will find the **Mapping editor**.
216+
3. Click **Edit** to create a base mapping.
246217

247-
![](services-mapping.png){ class="bordered" }
218+
![](services-mapping-rule.png){ class="bordered" width="50%" }
248219

249-
5. Click **Mapping** in the main area to expand its menu.
250-
251-
![](mapping-header.png){ class="bordered" }
252-
253-
6. Click **Edit** to create a base mapping.
254-
255-
![](services-mapping-rule.png){ class="bordered" }
256-
257-
7. Define the **Target entity type** from the vocabulary, the **URI pattern** and a **label** for the mapping. _In this example we will use:_
220+
4. Define the **Target entity type** from the vocabulary, the **URI pattern** and a **label** for the mapping. _In this example we will use:_
258221

259222
- Target entity type: _**Service**_
260223
- URI pattern:
@@ -266,55 +229,83 @@ The transformation defines how an input dataset (e.g. CSV) will be transformed i
266229

267230
- _An optional Label: **Service**_
268231

269-
![](services-mapping-class.png){ class="bordered" }
232+
![](services-mapping-class.png){ class="bordered" width="50%" }
270233

271-
8. Click **Save** _Example RDF triple in our Knowledge Graph based on the mapping definition:_
234+
5. Click **Save** _Example RDF triple in our Knowledge Graph based on the mapping definition:_
272235

273236
```nt
274237
<http://ld.company.org/prod-inst/Y704-9764759> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://ld.company.org/prod-vocab/Service>
275238
```
276239
277-
9. Evaluate your mapping by clicking the Expand ![](button-expand.png) button in the **Examples of target data** property to see at most three generated base URIs.
240+
6. Evaluate your mapping by clicking the Expand ![](button-expand.png) button in the **Examples of target data** property to see at most three generated base URIs.
278241
279-
![](mapping-inline-preview.png){ class="bordered" }
242+
![](mapping-inline-preview.png){ class="bordered" width="50%" }
280243
281244
We have now created the Service entities in the Knowledge Graph. As a next step, we will add the name of the Service entity.
282245
283-
10. Press the circular **Blue + button** on the lower right and select **Add value mapping**.
246+
7. Press the circular **Blue + button** on the lower right and select **Add value mapping**.
284247
285-
![](services-mapping-add-rule.png){ class="bordered" }
248+
![](services-mapping-add-rule.png){ class="bordered" width="50%" }
286249
287-
11. Define the **Target property**, the **Data type**, the **Value path** (column name) and a **Label** for your value mapping. _In this example we will use:_
250+
8. Define the **Target property**, the **Data type**, the **Value path** (column name) and a **Label** for your value mapping. _In this example we will use:_
288251
289252
- Target Property: **_name_**
290253
- Data type: _**String**_
291254
- Value path: _**ServiceName**_ (which corresponds to the column of that name)
292255
- An optional Label: _**service name**_
293256
294-
![](services-mapping-rule-edit.png){ class="bordered" }
257+
![](services-mapping-rule-edit.png){ class="bordered" width="50%" }
295258
296-
12. Click **Save.**
259+
9. Click **Save**.
297260
298261
---
299262
300-
## 6 Evaluate a Transformation
263+
## 5 Evaluate a Transformation
301264
302265
Go the **Transform evaluation** tab of your transformation to view a list of generated entities. By clicking one of the generated entities, more details are provided.
303266
304-
![](mapping-evaluation.png){ class="bordered" }
267+
![](mapping-evaluation.png){ class="bordered" width="50%" }
268+
305269
306270
---
307271
308-
## 7 Build the Knowledge Graph
272+
## 6 Build the Knowledge Graph
273+
274+
1. Switch back to the **Workflow view**.
275+
276+
2. Select the red dot on the right side and click **Connect to the newly created Knowledge graph**.
277+
278+
![](create-knowledge-graph.png){ class="bordered" width="50%" }
279+
280+
3. Define a **Label** for the Knowledge Graph and provide a **graph** uri. Leave all the other parameters at the default values. _In this example we will use:_
281+
282+
- Label: _**Service Knowledge Graph**_
283+
- Graph: _**<http://ld.company.org/prod-instances/>**_
284+
285+
![](knowledge-graph.png){ class="bordered" width="50%" }
286+
287+
4. Click **Create**.
288+
289+
5. Press the ![](button-play.png) button and click on **Save and run workflow**.
290+
291+
6. Validate the results by selecting **Workflow report** In this example, 9x Service triples were created in our Knowledge Graph based on the mapping.
292+
293+
![](mapping-execution-result.png){ class="bordered" width="50%" }
294+
295+
296+
7. Click Knowledge Graph under **Explore** in the navigation on the left side of the page.
297+
298+
![](explore-knowledge-graph.png){ class="bordered" width="50%" }
299+
300+
8. Optionally, you can click on the Settings Icon and add more columns to the viw.
309301
310-
1. Go into the mapping and visit the **Transform execution** tab.
302+
![](graph-settings.png){ class="bordered" width="50%" }
311303
312-
![](mapping-execution.png){ class="bordered" }
304+
9. Here you can add **Names** for example.
313305
314-
2. Press the ![](button-play.png) button and validate the results. In this example, 9x Service triples were created in our Knowledge Graph based on the mapping.
306+
![](add-name-column.png){ class="bordered" width="50%" }
315307
316-
![](mapping-execution-result.png){ class="bordered" }
308+
10. Finally you can use the Explore **Knowledge Graphs** module to (re-)view of the created Knowledge Graph: <http://ld.company.org/prod-instances/>
317309
318-
3. Finally you can use the Explore **Knowledge Graphs** module to (re-)view of the created Knowledge Graph: <http://ld.company.org/prod-instances/>
310+
![](kg-result.png){ class="bordered" width="50%" }
319311
320-
![](kg-result.png){ class="bordered" }

0 commit comments

Comments
 (0)