Skip to content

Commit bd75768

Browse files
committed
Fix typos and grammar
1 parent e1379e2 commit bd75768

File tree

1 file changed

+25
-34
lines changed

1 file changed

+25
-34
lines changed

docs/06_MetafactureCLI.md

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,24 @@ parent: Tutorial
99

1010
## Get Metafacture Runner as CLI Tool
1111

12-
Hint: This lesson requires basic practical knowledge of the command line and Shell.
13-
If you want to get familiar with tit, have a look at the great intro to Unix Shell by Library Carpentry: https://librarycarpentry.github.io/lc-shell/ (Session 1 - 3) You could also have a look at the great introdution by the Programming Historian to Powershell: https://programminghistorian.org/en/lessons/intro-to-powershell
12+
_This lesson requires basic practical knowledge of the command line and Shell.
13+
If you want to get familiar with it, have a look at the great [intro to Unix Shell by Library Carpentry](https://librarycarpentry.github.io/lc-shell/) (Session 1 - 3). You could also have a look at the great [introdution by the Programming Historian to Powershell](https://programminghistorian.org/en/lessons/intro-to-powershell)_
1414

15-
While we had fun with our Metafacture Playground another way to use Metafacture is
16-
the command line. For running a Metafacture flux process we need a terminal and installed JAVA 11 ore higher.
17-
For creating and editing Flux and Fix files we need an texteditor like Codium/VS Code or others.
15+
While we had fun with our Metafacture Playground another way to use Metafacture is by
16+
the command line. For running a Metafacture Flux process we need a terminal and Java 11 ore higher.
17+
For creating and editing Flux and Fix files we need a text editor like Codium/VS Code or others.
1818

1919
For this lesson basic knowledge of the commandline is recommended.
2020

2121
Check if Java 11 or higher is installed with `java -version` in your terminal.
22-
If not, install JAVA 11 or higher.
22+
If not, install Java 11 or higher.
2323

24-
To use Metafacture on the commandline we can download the latest distribution e.g.: `metafacture-core-7.0.0-dist.zip`:
25-
26-
[https://github.com/metafacture/metafacture-core/releases](https://github.com/metafacture/metafacture-core/releases)
27-
28-
Hint: If 7.0.0 is not published yet use the runner version of the [prerelease 7.0.0-rc1](https://github.com/metafacture/metafacture-core/releases/tag/metafacture-core-7.0.0-rc1).
24+
To use Metafacture on the commandline [download the latest (pre-) release](https://github.com/metafacture/metafacture-core/releases).
2925

3026
Download `metafacture-core-$VERSION-dist.tar.gz` or the zip version and extract the archive to your choosen folder.
3127
In the folder you find the `flux.bat` and `flux.sh`
3228

33-
The code below assumes you moved the resulting folder to your home directory and renamed it to `'metafacture'`
34-
35-
$ ~/metafacture/flux.sh # or flux.bat on Windows
29+
The code below assumes you moved the resulting folder to your home directory and renamed it to `"metafacture"`.
3630

3731
## How to run Metafacture via CLI
3832

@@ -50,7 +44,7 @@ or Windows:
5044
~\metafacture\flux.bat path\to\your.flux
5145
```
5246

53-
(Hint: You need to know the path to your file to run the function.)
47+
(Hint: You need to know the path to your Flux file to run it.)
5448

5549
To get quick started let's revisit a Flux we toyed around with in the playground.
5650
The playground has a nice feature to export and import Metafacture Workflows.
@@ -77,12 +71,10 @@ Windows:
7771

7872
To simplify the code examples we will be using unix paths for the terminal commands. Windows Powershell will change these to windows paths automatically.
7973

80-
The result of running the Flux-Script via CLI should be the same as with the Playground.
74+
The result of running the Flux script via CLI should be the same as with the Playground.
8175

82-
The Metafacture CLI Tool expects a flux file for every workflow.
83-
Our runned workflow only has the following flux and no additional files since it is fetching data from the web and it has no fix transformations.
84-
85-
The downloaded file should have the following content, defining the playground specific variables and the flux workflow that you also saw in the playground. You can delete the playground specific variables since they are not needed here.
76+
The Metafacture CLI tool expects a Flux file for every workflow.
77+
Our workflow only has the following Flux and no additional files since it is fetching data from the web and it has no fix transformations. The file should have the following content, defining the playground specific variables and the Flux workflow that you also saw in the playground. You can delete the playground specific variables since they are not needed so you woul end with this:
8678

8779
```text
8880
"https://openlibrary.org/books/OL2838758M.json"
@@ -96,11 +88,11 @@ The downloaded file should have the following content, defining the playground s
9688

9789
## Use local files for transformation
9890

99-
If you want to load a local file instead of fetching data from the web we need to change the flux a little bit with an texteditor.
91+
If you want to load a local file instead of fetching data from the web you need to change the Flux a little bit with an text editor.
10092
Download the following file [11942150X.json](./sample-scripts/lesson_06/11942150X.json)
10193
and adjust the path to your file.
10294

103-
Adjust your `downloads/playground.flux` script, so that it does not load data from the web, but opens a local file with `open-file` and read it `as-recrods` since the json file is pretty printed:
95+
Adjust your `downloads/playground.flux` script, so that it does not load data from the web, but opens a local file with `open-file` and reads it using `as-records` since the json file is pretty printed (not as one record per line):
10496

10597
```text
10698
"path/to/your/file/11942150X.json" // Adjust your path!
@@ -284,7 +276,7 @@ It should output:
284276
}
285277
```
286278

287-
If we want to use fix we need to refrence the fix file that in the playground we only refrenced via `| fix`
279+
If we want to use Fix we need to reference the Fix file (in the playground we only referenced t via `| fix`):
288280

289281
```text
290282
"path/to/your/file/11942150X.json"
@@ -297,20 +289,19 @@ If we want to use fix we need to refrence the fix file that in the playground we
297289
;
298290
```
299291

300-
Create a new file with the name `fixFile.fix`, files with fix scripts should have a `.fix` file suffix.
292+
Create a new file with the name `fixFile.fix`. Files with Fix scripts should have a `.fix` file suffix to easily discriminate them later.
301293

302-
Add the follwoing line as content to this file:
294+
Add the following line as content to this file:
303295

304296
```perl
305297
retain("preferredName","id","type[]")
306-
307298
```
308299

309-
Save it in the same folder as the flux file. (Hint: It does not always have to be in the same folder.)
300+
Save it in the same folder as the Flux file. (Hint: It does not always have to be in the same folder.)
310301

311302
## Use variables
312303

313-
Hint: You can use the varliable FLUX_DIR to shorten the file path if the file is in the same folder as the flux-file.
304+
Hint: You can use the varliable FLUX_DIR to shorten the file path if the file is in the same folder as the Flux file:
314305

315306
```text
316307
FLUX_DIR + "file.json"
@@ -323,7 +314,7 @@ FLUX_DIR + "file.json"
323314
;
324315
```
325316

326-
If you are using variables, that are not defined in the flux, you can pass them on with the CLI:
317+
If you are using variables that are not defined in the flux, you can pass them on with the CLI:
327318

328319
e.g.
329320

@@ -338,7 +329,7 @@ FILE
338329
;
339330
```
340331

341-
You could use:
332+
which you use like:
342333

343334
```bash
344335
~/metafacture/flux.sh path/to/your.flux FILE="path/to/your/file.json"
@@ -348,10 +339,10 @@ You could use:
348339
Excercise: Download the following folder (TODO) with three test examples and run them. Adjust them if needed:
349340

350341
- Run example script locally.
351-
- Adjust example script so that all json files but no other in the folder are read. Get inspired by https://github.com/metafacture/metafacture-core/blob/master/metafacture-runner/src/main/dist/examples/misc/reading-dirs/read-dirs.flux.
352-
- Change the FLUX script so that you write the output in the local file instead of stoudt.
353-
- Add a fix file and add the fix module in the flux. With `nothing()` as content.
354-
- Add some transformations to the fix e.g. add fields.
342+
- Adjust example script so that all json files but no other in the folder are read. Get inspired by the [reading directories example](https://github.com/metafacture/metafacture-core/blob/master/metafacture-runner/src/main/dist/examples/misc/reading-dirs/read-dirs.flux).
343+
- Change the Flux script so that you write the output in the local file instead of stoudt.
344+
- Add a Fix file and add the Fix module in the Flux. With `nothing()` as content.
345+
- Add some transformations to the Fix e.g. add fields.
355346

356347
---------------
357348

0 commit comments

Comments
 (0)