You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/03_Introduction_into_Metafacture-Fix.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,15 @@ parent: Tutorial
7
7
8
8
# Lesson 3: Introduction into Metafacture Fix
9
9
10
-
In the last session we learned about Flux moduls.
11
-
Flux moduls can do a lot of things. They configure the "high-level" transformation pipeline.
10
+
In the last session we've learned about Flux modules.
11
+
Flux modules can do a lot of things. They configure the "high-level" transformation pipeline.
12
12
13
-
But the main transformation of incoming data at record, elemenet and value level is usually done by the transformation moduls[Fix](https://metafacture.github.io/metafacture-documentation/docs/flux/flux-commands.html#fix) or [Morph](https://metafacture.github.io/metafacture-documentation/docs/flux/flux-commands.html#morph) as one step in the pipeline.
13
+
But the main transformation of incoming data at record, element and value level is usually done by the transformation modules[Fix](https://metafacture.github.io/metafacture-documentation/docs/flux/flux-commands.html#fix) or [Morph](https://metafacture.github.io/metafacture-documentation/docs/flux/flux-commands.html#morph) as one step in the pipeline.
14
14
15
15
By transformation we mean things like:
16
16
17
17
* Manipulating element names and element values
18
-
*Change hierachies and structures of records
18
+
*Changing hierachies and structures of records
19
19
* Lookup values in concordance list
20
20
21
21
But not changing serialization that is part of encoding and decoding.
@@ -47,10 +47,10 @@ You should end up with something like:
47
47
title: "Ordinary vices"
48
48
```
49
49
50
-
The Fix module, called by `fix`, in Metafacture is used to manipulate the input data filtering fields we would like to see. Only one fix-function was used: `retain`, which throws away all the data from the input except the stated `"title"` field. Normally all incoming data is passed through, unless it is somehow manipulated or a `retain` function is used.
50
+
The Fix module, called by `fix`, is used to manipulate the input data filtering fields we would like to see. Only one Fix-function was used: `retain`, which throws away all the data from the input except the stated `"title"` field. Normally all incoming data is passed through, unless it is somehow manipulated or a `retain` function is used.
51
51
52
-
HINT: As long as you embedd the fix functions in the Flux Workflow, you have to use double quotes to fence the fix functions,
53
-
and single quotes in the fix functions. As we did here: `fix ("retain('title')")`
52
+
HINT: As long as you embed the Fix functions in the Flux Workflow, you have to use double quotes to fence the Fix functions,
53
+
and single quotes in the Fix functions. As we did here: `fix ("retain('title')")`
54
54
55
55
Now let us additionally keep the info that is given in the element `"publish_date"` and the subfield `"key"` in `'type'` by adding `'publish_date', 'type.key'` to `retain`:
56
56
@@ -76,9 +76,9 @@ notes:
76
76
77
77
```
78
78
79
-
When manipulating data you often need to create many fixes to process a data file in the format and structure you need. With a text editor you can write all fix functions in a singe separate Fix file.
79
+
When manipulating data you often need to create many Fixes to process a data file in the format and structure you need. With a text editor you can write all Fix functions in a singe separate Fix file.
80
80
81
-
The playground has an transformationFile-content area that can be used as if the Fix is in a separate file.
81
+
The playground has a transformationFile-content area that can be used as if the Fix is in a separate file.
82
82
In the playground we use the variable `transformationFile` to adress the Fix file in the playground.
2)[Add a field with todays date called `"map_date"`.](https://metafacture.org/playground/?flux=%22https%3A//openlibrary.org/books/OL2838758M.json%22%0A%7C+open-http%0A%7C+as-lines%0A%7C+decode-json%0A%7C+fix+%28transformationFile%29%0A%7C+encode-yaml%0A%7C+print%0A%3B&transformation=move_field%28%22type.key%22%2C%22pub_type%22%29%0Areplace_all%28%22pub_type%22%2C%22/type/%22%2C%22%22%29%0A...%28%22mape_date%22%2C%22...%22%29%0Aretain%28%22title%22%2C+%22publish_date%22%2C+%22by_statement%22%2C+%22pub_type%22%29)
171
171
172
-
Have a look at the fix functions: https://metafacture.org/metafacture-documentation/docs/fix/Fix-functions.html (Hint: you could use `add_field` or `timestamp`. And don't forget to add the new element to `retain`)
172
+
Have a look at the [Fix functions](https://metafacture.org/metafacture-documentation/docs/fix/Fix-functions.html). (Hint: you could use `add_field` or `timestamp`. And don't forget to add the new element to `retain`)
0 commit comments