Skip to content

Commit

Permalink
Merge pull request #376 from metafacture/127-adjustIntegrationTests
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx authored Oct 16, 2024
2 parents d0fc1c6 + 33b1b4a commit 9b4a6c1
Show file tree
Hide file tree
Showing 27 changed files with 39 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
set_array("sourceOrganization[]")
do list_as(orgId: "ccm:university[]", orgName: "ccm:university_DISPLAYNAME[]")
copy_field(orgId, "sourceOrganization[].$append.id")
copy_field(orgName, "sourceOrganization[].$last.name")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
unless exists("animals[]")
set_array("animals[]")
copy_field("animals","animals[].$append")
end
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
unless exists("animals[]")
set_array("animals[]")
copy_field("animals","animals[].$append")
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
set_array("animals[]")
do list(path: "test[]", "var": "$f")
copy_field("$f", "animals[].$append.animal")
copy_field("$f", "animals[].$last.classification.type")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
set_array("animals[]")
do list(path: "test[]", "var": "$f")
copy_field("$f", "animals[].$append.animal")
copy_field("$f", "animals[].$last.classification.type")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
set_array("animals[]")
do list(path: "test[]", "var": "$f")
copy_field("$f", "animals[].$append.animal")
copy_field("$f", "animals[].$last.classification.type")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
set_array("animals[]")
do list(path: "metadata.real.test[]", "var": "$f")
lookup("$f.animal", "./mapfile_2.tsv", "sep_char":"\t")
copy_field("$f.animal", "animals[].$append.animal")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
set_array("animals[]")
do list(path: "metadata.real.test[]", "var": "$f")
lookup("$f.animal", "./mapfile_2.tsv", "sep_char":"\t")
copy_field("$f.animal", "animals[].$append.animal")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
set_array("animals[]")
do list(path: "test[]", "var": "$f")
copy_field("$f", "animals[].$append.animal")
copy_field("$f", "animals[].$last.classification.type")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
put_map("rswk-indicator", s: "SubjectHeading")

set_array("subject[]")

if exists("6890?")
set_array("subject[].$append.type[]", "ComplexSubject")
set_array("subject[].$last.label")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
set_array("inLanguage[]")
copy_field("nested.object.inLanguage", "inLanguage[].$append")
replace_all("inLanguage[].*", '-.*', '')
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
set_array("subject[]")
add_field("subject[].$append.name","Test")
set_array("subject[].$last.altLabel[]")

do list(path:"GST[]", "var": "$i") # Other altLabels have a "," character between $a and $b.
paste("subject[].$last.altLabel[].$append", "$i.a", "~(", "$i.b", "$i.c", "~)")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
set_array("subject[]")
add_field("subject[].$append.name","Test")
set_array("subject[].$last.agent.altLabel[]")

do list(path:"GST[]", "var": "$i") # Other altLabels have a "," character between $a and $b.
paste("subject[].$last.agent.altLabel[].$append", "$i.a", "~(", "$i.b", "$i.c", "~)")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
set_array("test[]")
copy_field("id", "test[].$append.id")

copy_field("dateModified", "test[].$last.dateModified")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
copy_field("datePublished", "dateCreated")
replace_all("dateCreated", 'T.*', '')

set_array("test[]")
copy_field("id", "test[].$append.id")

copy_field("dateModified", "test[].$last.dateModified")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
set_array("test[]")
copy_field("id", "test[].$append.id")

copy_field("node.dateModified", "test[].$last.dateModified")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ do list(path: "650??", "var": "$i")
copy_field("$i.v", "RSWK[].$last.subjectGenre")
end
replace_all("RSWK[].*.subjectGenre", "[.]$", "")

retain("RSWK[]")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"rswk" : [ {
"subjectTopicName" : "Nonprofit organizations"
}, {
"subjectTopicName" : "Nonprofit organizations",
"subjectGenre" : "Case studies"
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<collection xmlns="http://www.loc.gov/MARC21/slim">
<record>
<datafield tag="650" ind1=" " ind2=" ">
<subfield code="a">Nonprofit organizations</subfield>
<subfield code="x">Management.</subfield>
</datafield>
<datafield tag="650" ind1=" " ind2=" ">
<subfield code="a">Nonprofit organizations</subfield>
<subfield code="x">Management</subfield>
<subfield code="v">Case studies.</subfield>
</datafield>
</record>
</collection>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
do list(path: "650??", "var": "$i")
copy_field("$i.a", "rswk[].$append.subjectTopicName")
copy_field("$i.v", "rswk[].$last.subjectGenre")
end
replace_all("rswk[].*.subjectGenre", "[.]$", "")

retain("rswk[]")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.xml"
|open-file
|decode-xml
|handle-marcxml
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See issue #377
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
set_array("contribution[]")

do list(path: "700[01] ", "var": "$i")
set_hash("contribution[].$append.agent")
copy_field("$i.a", "contribution[].$last.agent.label")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
set_array("contribution[]")

do list(path: "700[01] ", "var": "$i")
set_hash("contribution[].$append.agent")
copy_field("$i.a", "contribution[].$last.agent.label")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
set_array("test[]")
copy_field("key", "test[].1.field")
copy_field("key_2", "test[].2.field")
copy_field("key_3", "test[].3.field")
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
set_array("test[]")
move_field("test[]", "animals[].1.test[]")
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ put_vars(
"test": "arrayOfStrings[]",
"test_2": "arrayOfObjects[]"
)
set_array("test[]")
do list (path: "$[test]", "var": "$i")
copy_field("$i", "test[].$append")
end
Expand Down

0 comments on commit 9b4a6c1

Please sign in to comment.