Skip to content

Commit 12aa4b8

Browse files
committed
Format the flux files # 589
1 parent 8755e8b commit 12aa4b8

File tree

27 files changed

+239
-449
lines changed

27 files changed

+239
-449
lines changed
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
default basedir = FLUX_DIR;
22

3-
basedir|
4-
read-dir|
5-
filter-strings(".*\\.beacon", passmatches="true")|
6-
open-file|
7-
read-beacon(metadatafilter="name|isil")|
8-
stream-to-triples|
9-
sort-triples(by="subject")|
10-
collect-triples|
11-
encode-formeta(style="multiline")|
12-
write("stdout");
3+
basedir
4+
| read-dir
5+
| filter-strings(".*\\.beacon", passmatches="true")
6+
| open-file
7+
| read-beacon(metadatafilter="name|isil")
8+
| stream-to-triples
9+
| sort-triples(by="subject")
10+
| collect-triples
11+
| encode-formeta(style="multiline")
12+
| write("stdout");
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
default fileName = FLUX_DIR + "austriaforum.beacon";
22

3-
fileName|
4-
open-file(encoding="UTF-8")|
5-
read-beacon(metadatafilter="name|isil")|
6-
encode-formeta(style="multiline")|
7-
write("stdout");
3+
fileName
4+
| open-file(encoding="UTF-8")
5+
| read-beacon(metadatafilter="name|isil")
6+
| encode-formeta(style="multiline")
7+
| write("stdout");

metafacture-runner/src/main/dist/examples/beacon/create/create.flux

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ header|open-file|as-lines|@Y;
1212
//count references
1313
"counting references in " + dump | write("stdout");
1414

15-
dump|
16-
open-file|
17-
as-lines|
18-
catch-object-exception|
19-
decode-pica|
20-
batch-log(batchsize="100000")|
21-
fix(FLUX_DIR + "extract.fix", *)|
22-
stream-to-triples(redirect="true")|
23-
sort-triples(by="subject")|
24-
collect-triples|
25-
fix(FLUX_DIR + "output.fix")|
26-
batch-log("merged ${totalRecords}", batchsize="100000")|
27-
stream-to-triples|
28-
template("${s}")|
29-
@Y;
30-
31-
@Y|
32-
wait-for-inputs("2")|
33-
write(out);
15+
dump
16+
| open-file
17+
| as-lines
18+
| catch-object-exception
19+
| decode-pica
20+
| batch-log(batchsize="100000")
21+
| fix(FLUX_DIR + "extract.fix", *)
22+
| stream-to-triples(redirect="true")
23+
| sort-triples(by="subject")
24+
| collect-triples
25+
| fix(FLUX_DIR + "output.fix")
26+
| batch-log("merged ${totalRecords}", batchsize="100000")
27+
| stream-to-triples
28+
| template("${s}")
29+
| @Y;
30+
31+
@Y
32+
| wait-for-inputs("2")
33+
| write(out);
3434

3535

3636

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
default fileName = FLUX_DIR + "gnd-sample.pica";
22

3-
fileName|
4-
open-file|
5-
as-lines|
6-
decode-pica|
7-
fix(FLUX_DIR + "gnd-type.fix")|
8-
stream-to-triples|
9-
count-triples(countBy="object")|
10-
template("${s}\t${o}")|
11-
write("stdout");
3+
fileName
4+
| open-file
5+
| as-lines
6+
| decode-pica
7+
| fix(FLUX_DIR + "gnd-type.fix")
8+
| stream-to-triples
9+
| count-triples(countBy="object")
10+
| template("${s}\t${o}")
11+
| write("stdout");
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
2-
catalogue|
3-
open-file|
4-
as-lines|
5-
catch-object-exception|
6-
decode-pica|
7-
batch-log(batchsize="100000")|
8-
morph(FLUX_DIR + "subject-cooccurrence.xml")|
9-
stream-to-triples|
10-
count-triples(countBy="object")|
11-
calculate-metrics("X2")|
12-
template("${s} ${o}")|
13-
//write("stdout");
1+
catalogue
2+
| open-file
3+
| as-lines
4+
| catch-object-exception
5+
| decode-pica
6+
| batch-log(batchsize="100000")
7+
| morph(FLUX_DIR + "subject-cooccurrence.xml")
8+
| stream-to-triples
9+
| count-triples(countBy="object")
10+
| calculate-metrics("X2")
11+
| template("${s} ${o}")
12+
| //write("stdout");
1413
write(FLUX_DIR+"x2.dat");

metafacture-runner/src/main/dist/examples/count/subjects/references.flux

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ default catalogue = FLUX_DIR + "10.pica";
55
//count references
66
"counting references in " + catalogue | write("stdout");
77

8-
catalogue|
9-
open-file|
10-
as-lines|
11-
catch-object-exception|
12-
decode-pica|
13-
fix(FLUX_DIR + "references.fix")|
14-
stream-to-triples|
15-
count-triples(countBy="object")|
16-
write(counts);
8+
catalogue
9+
| open-file
10+
| as-lines
11+
| catch-object-exception
12+
| decode-pica
13+
| fix(FLUX_DIR + "references.fix")
14+
| stream-to-triples
15+
| count-triples(countBy="object")
16+
| write(counts);
1717

1818

metafacture-runner/src/main/dist/examples/filter/fix/filter.flux

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
default fileName = FLUX_DIR + "gnd-sample.pica";
44

5-
fileName|
6-
open-file|
7-
as-lines|
8-
decode-pica|
9-
fix(FLUX_DIR + "filter.fix")| // Fix does not use the filter function but has its own filter mechanism within fix.
10-
encode-formeta(style="verbose")|
11-
write("stdout");
5+
fileName
6+
| open-file
7+
| as-lines
8+
| decode-pica
9+
| fix(FLUX_DIR + "filter.fix") // Fix does not use the filter function but has its own filter mechanism within fix.
10+
| encode-formeta(style="verbose")
11+
| write("stdout");
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
default file = FLUX_DIR + "10.marc21";
22

3-
file|
4-
open-file|
5-
as-lines|
6-
decode-marc21|
7-
fix(FLUX_DIR + "morph-marc21.fix")|
8-
stream-to-triples|
9-
template("${o}")|
10-
write("stdout");
3+
file
4+
| open-file
5+
| as-lines
6+
| decode-marc21
7+
| fix(FLUX_DIR + "morph-marc21.fix")
8+
| stream-to-triples
9+
| template("${o}")
10+
| write("stdout");
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
default idn = "1021191485";
22

3-
idn|
4-
template("https://portal.dnb.de/opac.htm?method=requestMarcXml&idn=${o}")|
5-
open-http|
6-
decode-xml|
7-
handle-marcxml|
8-
fix("nothing()")|
9-
encode-formeta(style="multiline")|
10-
write("stdout");
3+
idn
4+
| template("https://portal.dnb.de/opac.htm?method=requestMarcXml&idn=${o}")
5+
| open-http
6+
| decode-xml
7+
| handle-marcxml
8+
| fix("nothing()")
9+
| encode-formeta(style="multiline")
10+
| write("stdout");

metafacture-runner/src/main/dist/examples/fix/pica-to-marcxml/morph-pica-to-marcxml.flux

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
default fileName = FLUX_DIR + "nonNormalized.pica";
55

6-
fileName|
7-
open-file|
8-
as-lines|
9-
lines-to-records|
10-
decode-pica(normalizedSerialization="false", ignoreMissingIdn="true")|
11-
fix(FLUX_DIR + "morph-pica-to-marcxml.fix")|
12-
encode-marcxml(ensurecorrectmarc21xml="true")|
13-
write("stdout");
6+
fileName
7+
| open-file
8+
| as-lines
9+
| lines-to-records
10+
| decode-pica(normalizedSerialization="false", ignoreMissingIdn="true")
11+
| fix(FLUX_DIR + "morph-pica-to-marcxml.fix")
12+
| encode-marcxml(ensurecorrectmarc21xml="true")
13+
| write("stdout");

metafacture-runner/src/main/dist/examples/gnd/crisscross-connections/Ts1-Tg1-without-crisscross.flux

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ default out = base + "Ts1-Tg1-without-crisscross.txt";
44

55
"counting references in " + dump | write("stdout");
66

7-
dump|
8-
open-file|
9-
as-lines|
10-
catch-object-exception|
11-
decode-pica|
12-
batch-log(batchsize="100000")|
13-
fix(FLUX_DIR + "extract.fix")|
14-
stream-to-triples(redirect="true")|
15-
sort-triples(by="subject")|
16-
collect-triples|
17-
fix(FLUX_DIR + "output.fix")|
18-
batch-log(batchsize="100000")|
19-
encode-csv(noquotes="true",separator=";")|
20-
write(out);
7+
dump
8+
| open-file
9+
| as-lines
10+
| catch-object-exception
11+
| decode-pica
12+
| batch-log(batchsize="100000")
13+
| fix(FLUX_DIR + "extract.fix")
14+
| stream-to-triples(redirect="true")
15+
| sort-triples(by="subject")
16+
| collect-triples
17+
| fix(FLUX_DIR + "output.fix")
18+
| batch-log(batchsize="100000")
19+
| encode-csv(noquotes="true",separator=";")
20+
| write(out);
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
default gnd = FLUX_DIR + "Tp-200.pica.gz";
22

3-
gnd|
4-
open-file|
5-
as-lines|
6-
decode-pica(normalizeutf8="true", normalizedserialization="true")|
7-
fix(FLUX_DIR + "tp2json.fix")|
8-
normalize-unicode-stream |
9-
encode-json|
10-
write(FLUX_DIR + "test.txt");
3+
gnd
4+
| open-file
5+
| as-lines
6+
| decode-pica(normalizeutf8="true", normalizedserialization="true")
7+
| fix(FLUX_DIR + "tp2json.fix")
8+
| normalize-unicode-stream
9+
| encode-json
10+
| write(FLUX_DIR + "test.txt");

metafacture-runner/src/main/dist/examples/gnd/references/counts.dat

Lines changed: 0 additions & 9 deletions
This file was deleted.

metafacture-runner/src/main/dist/examples/gnd/references/format-gnd.flux

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
default base = "";
33
default gndsimple = base + "gnd-simplified.dat";
44

5-
gnd|
6-
open-file|
7-
as-lines|
8-
decode-pica|
9-
fix(FLUX_DIR + "format-gnd.fix")|
10-
encode-formeta(style="concise")|
11-
write(gndsimple);
5+
gnd
6+
| open-file
7+
| as-lines
8+
| decode-pica
9+
| fix(FLUX_DIR + "format-gnd.fix")
10+
| encode-formeta(style="concise")
11+
| write(gndsimple);
1212

1313

1414

0 commit comments

Comments
 (0)