Skip to content

Latest commit

 

History

History
68 lines (35 loc) · 3.97 KB

Tutorial.md

File metadata and controls

68 lines (35 loc) · 3.97 KB

Turtle Generator Kettle Plugin

Kettleplugin to write a RDF Turtle file from a CSV file. Turtle Generator is a plugin developed from the DataCube Transformator plugin: https://github.com/mayarahmo/DataCube_Kettle_Plugin

CSV Input: The CSV file needs to be well formated, with one line of header with column names. The first column of data is the subject and the others are the properties from that. An example here: https://github.com/mayarahmo/TurtleGenerator_Kettle_Plugin/blob/master/example.csv

To run a transformation do the following:

#1 Download the dataintegration4.1, Kettle modified with the TurtleGenerator or copy the plugin folder (plugins/steps/TurtleTransformator) into your Kettle plugin folder (this procediment is not garanteed).

OBS: Remove empty lines in any tab.

2 Open the Kette (Spoon) folder and execute spoon.bat.

3 Go to file > new > Transformation.

4 In Design tab go to "LinkedDataBR" and drag the "Turtle Generator" to the Transformation field.

Dragging Turtle Generator into the Transformation

5 In input folder select "CSV file input" and drag it to the transformation field. Do the same to the "Text file Output" inside the "Output" folder.

Drag steps into the Transformation

6 Holl over the "CSV Output Input" click in the right arrow, drag your mouse to the "Turtle Generator", click on it and select "Main output of the step".

Main Output of the Step - Turtle Generator Transformator

7 Do the same to "Turtle Generator". It's going to be like:

Turtle Transformation - Turtle Generator Transformator

8 Open "CSV File Input" and selected the input file in your computer. In "Delimiter" (Delimite) configure to ";" or "," as your CSV delimiter is.

CSV File Input - Turtle Generator Transformator

9 In "Text File Output" select the output file. In "Content" tab deselect "Separator" and "Header".

Text Output File - Turtle Generator Transformator

10 In "TurtleGenerator Transformator" in "Definição e Descrição das Propriedades" each line select the column (property "Propriedade") its label and the uri that describes it (owl:sameAs)

CSV Properties definition - Turtle Generator Transformator

11 In "Prefixos" click in "Defaults" to add. You can add more if you want to.

Prefixes - Turtle Generator Transformator

12 In "Descrição da unidade" put a description to each triples group. p.e. "Pesticide consumption by cultivation and year in Brazil".

Unity Description - Turtle Generator Transformator

13 Describe the hierarchys if exist. Click Ok.

Hierarchys - Turtle Generator Transformator

14 Execute

Execute - Turtle Generator Transformator

15 Well done. Now your output is something like this: https://github.com/mayarahmo/TurtleGenerator_Kettle_Plugin/blob/master/output.txt

output.txt