-
Notifications
You must be signed in to change notification settings - Fork 34
Add fix variations of mf runner examples #598 #663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
592aa08
Add fix variations of mf runner examples #598
TobiasNx 926037e
Adjust commet as suggested by reviewer #651
TobiasNx f11ddb9
Delete empty line #598
TobiasNx a5f6eec
Use generic transform #589
TobiasNx d9aec25
Adjust fix transformation to match the morph result #589
TobiasNx 6077d6f
Improve mapping for 490 #589
TobiasNx 44d5471
Delete unnecessary comment #589
TobiasNx 77e15f3
Adjust fix transformation to match the morph result #589
TobiasNx 2fa6dbc
Adjust fix flux workflow to match the morph workflow #589
TobiasNx b0c99c0
Align Flux workflow examples so that both variants match as closely a…
blackwinter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
metafacture-runner/src/main/dist/examples/beacon/create/create.fix.flux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//creates a beacon file based on a pica+ dump of the DNB CBS data. | ||
|
||
default type = "ALL"; | ||
default out = dump + "-" + type + ".beacon"; | ||
default header = FLUX_DIR + "header.txt"; | ||
|
||
|
||
//read header | ||
"reading header " + header | write("stdout"); | ||
header|open-file|as-lines|@Y; | ||
|
||
//count references | ||
"counting references in " + dump | write("stdout"); | ||
|
||
dump| | ||
open-file| | ||
as-lines| | ||
catch-object-exception| | ||
decode-pica| | ||
batch-log(batchsize="100000")| | ||
fix(FLUX_DIR + "extract.fix", *)| | ||
stream-to-triples(redirect="true")| | ||
sort-triples(by="subject")| | ||
collect-triples| | ||
fix(FLUX_DIR + "output.fix")| | ||
batch-log("merged ${totalRecords}", batchsize="100000")| | ||
stream-to-triples| | ||
template("${s}")| | ||
@Y; | ||
|
||
@Y| | ||
wait-for-inputs("2")| | ||
write(out); | ||
|
||
|
||
|
File renamed without changes.
50 changes: 50 additions & 0 deletions
50
metafacture-runner/src/main/dist/examples/beacon/create/extract.fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 002@ not repeatable | ||
|
||
if any_match("002@.0", "^Tp.*$") | ||
copy_field("002@.0","ok") | ||
end | ||
|
||
# DBSM: | ||
# (006U $0 “04p01*”) or (017A $a “yy”) | ||
if any_match("006U.0","04p01.*") | ||
add_field("@value","DBSM|ALL") | ||
elsif any_equal("017A.a","yy") | ||
add_field("@value","DBSM|ALL") | ||
|
||
# DEA: | ||
# (001@ $a 2””) or (209A $f “Exilarchiv” or 209A $f “HB/EB”) | ||
elsif any_equal("001@.a","2") | ||
add_field("@value","DEA|ALL") | ||
elsif any_equal("209A.f","HB/EB") | ||
add_field("@value","DEA|ALL") | ||
|
||
# DMA: | ||
# (002@ $0 “G*” or 002@ $0 “M*”) or (006U $0 “10,P01*”) | ||
|
||
elsif any_equal("002@.0","^[GM].*") | ||
add_field("@value","DMA|ALL") | ||
|
||
elsif any_equal("006U.0","^10,P01.*") | ||
add_field("@value","DMA|ALL") | ||
else | ||
add_field("@value","ALL") | ||
end | ||
|
||
# Test if type variable fits | ||
|
||
if any_contain("@value","$[type]") | ||
add_field("@value","$[type]") | ||
else | ||
remove_field("@value") | ||
end | ||
|
||
do list(path: "041A*|028A*|029B*|028C*|028Q*|028P*|028F*|028M*|028D*|028E*", "var":"$i") | ||
trim("$i.9") | ||
to_var("$i.9","ref") | ||
if exists("$i.9") | ||
copy_field("@value","{to:$[ref]}refed") | ||
end | ||
end | ||
|
||
retain("{to*","ok") | ||
|
8 changes: 8 additions & 0 deletions
8
metafacture-runner/src/main/dist/examples/beacon/create/output.fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
unless exists("refed") | ||
remove_field("ok","") | ||
end | ||
|
||
unless exists("ok") | ||
remove_field("ok","") | ||
end | ||
|
11 changes: 11 additions & 0 deletions
11
metafacture-runner/src/main/dist/examples/count/gnd/count-gnd-types.fix.flux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
default fileName = FLUX_DIR + "gnd-sample.pica"; | ||
|
||
fileName| | ||
open-file| | ||
as-lines| | ||
decode-pica| | ||
fix(FLUX_DIR + "gnd-type.fix")| | ||
stream-to-triples| | ||
count-triples(countBy="object")| | ||
template("${s}\t${o}")| | ||
write("stdout"); |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
metafacture-runner/src/main/dist/examples/count/gnd/gnd-type.fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
replace_all("002@.0","^.(.).*","$1") #only keep the second letter | ||
copy_field("002@.0","") | ||
retain("") # only keep the relevent element | ||
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
metafacture-runner/src/main/dist/examples/count/subjects/references.fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
do list(path:"041A*|041A","var":"$i") # Until https://github.com/metafacture/metafacture-core/issues/651 is fixed one hass to add "041A" | ||
copy_field("$i.9","relevantField.$append") | ||
end | ||
|
||
trim("relevantField.*") | ||
uniq("relevantField") | ||
|
||
retain("relevantField") |
19 changes: 19 additions & 0 deletions
19
metafacture-runner/src/main/dist/examples/count/subjects/references.fix.flux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
default counts="myflux/counts.dat"; | ||
default catalogue = FLUX_DIR + "10.pica"; | ||
|
||
//count references | ||
"counting references in " + catalogue | write("stdout"); | ||
|
||
catalogue| | ||
open-file| | ||
as-lines| | ||
catch-object-exception| | ||
decode-pica| | ||
fix(FLUX_DIR + "references.fix")| | ||
stream-to-triples| | ||
count-triples(countBy="object")| | ||
|
||
write("subjects.dat"); | ||
|
||
|
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
if any_match("002@.0","^Tp.*") | ||
if any_match("041R.a",".*[Aa][Rr][Zz][Tt].*") | ||
nothing() | ||
else | ||
reject() | ||
end | ||
else | ||
reject() | ||
end |
11 changes: 11 additions & 0 deletions
11
metafacture-runner/src/main/dist/examples/filter/filter.fix.flux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// opens file 'fileName', interprets the content as pica and filters the results | ||
|
||
default fileName = FLUX_DIR + "gnd-sample.pica"; | ||
|
||
fileName| | ||
open-file| | ||
as-lines| | ||
decode-pica| | ||
fix(FLUX_DIR + "filter.fix")| // Fix does not use the filter function but has its own filter mechanism within fix. | ||
encode-formeta(style="verbose")| | ||
write("stdout"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions
20
...ner/src/main/dist/examples/gnd/crisscross-connections/Ts1-Tg1-without-crisscross.fix.flux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
default base = ""; | ||
default dump = FLUX_DIR + "10.pica"; | ||
default out = base + "Ts1-Tg1-without-crisscross.txt"; | ||
|
||
"counting references in " + dump | write("stdout"); | ||
|
||
dump| | ||
open-file| | ||
as-lines| | ||
catch-object-exception| | ||
decode-pica| | ||
batch-log(batchsize="100000")| | ||
fix(FLUX_DIR + "extract.fix")| | ||
stream-to-triples(redirect="true")| | ||
sort-triples(by="subject")| | ||
collect-triples| | ||
fix(FLUX_DIR + "output.fix")| | ||
batch-log(batchsize="100000")| | ||
encode-csv(noquotes="true",separator=";")| | ||
write(out); |
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.