Skip to content

Commit

Permalink
Functional Review Extended Maps support
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Dec 8, 2021
1 parent 60c3fe9 commit e477feb
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies {
implementation 'org.metafacture:metafacture-elasticsearch:5.3.0-rc2'
implementation 'org.metafacture:metafacture-xml:5.3.0-rc2'
implementation 'org.metafacture:metafacture-fix:0.2.0-rc2'
implementation 'org.metafacture:metafix:0.2.0-rc6'
implementation 'org.metafacture:metafix:0.2.0-SNAPSHOT'
implementation('org.metafacture:metafacture-biblio:5.3.0-rc2') {
exclude group: 'xml-apis', module: 'xml-apis'
}
Expand Down
5 changes: 5 additions & 0 deletions data/experimental/map/externalMapInLine.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
copy_field("animal", "animalGroup")
lookup("animalGroup", "data/experimental/map/mapfile.tsv", "sep_char":"\t")

copy_field("animal", "animalGroupTEST")
lookup("animalGroupTEST", "data/experimental/map/mapfile.tsv")
4 changes: 4 additions & 0 deletions data/experimental/map/externalPutFilemap.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
put_filemap("data/experimental/map/mapfile.tsv", "map", "sep_char":"\t")

copy_field("animal", "animalGroup")
lookup("animalGroup", "map")
6 changes: 6 additions & 0 deletions data/experimental/map/mapfile.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dog mammal
cat mammal
parrot bird
shark fish
dragon ficational animal
unicorn ficational animal
11 changes: 11 additions & 0 deletions data/experimental/map/putMap.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
put_map("map",
"dog":"mammal",
"cat":"mammal",
"parrot":"bird",
"shark":"fish",
"dragon":"ficational animal",
"unicorn":"ficational animal"
)

copy_field("animal", "animalGroup")
lookup("animalGroup", "map")
10 changes: 10 additions & 0 deletions data/experimental/map/test1_externalMapInline.flux
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
infile = FLUX_DIR + "animals.json";

infile
| open-file
| as-records
| decode-json
| fix(FLUX_DIR + "externalMapInLine.fix")
| encode-json(prettyPrinting="true")
| print
;
10 changes: 10 additions & 0 deletions data/experimental/map/test2_internalPutMap.flux
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
infile = FLUX_DIR + "animals.json";

infile
| open-file
| as-records
| decode-json
| fix(FLUX_DIR + "putMap.fix")
| encode-json(prettyPrinting="true")
| print
;
10 changes: 10 additions & 0 deletions data/experimental/map/test3_externalPutFilemap.flux
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
infile = FLUX_DIR + "animals.json";

infile
| open-file
| as-records
| decode-json
| fix(FLUX_DIR + "externalPutFilemap.fix")
| encode-json(prettyPrinting="true")
| print
;

0 comments on commit e477feb

Please sign in to comment.