diff --git a/resources/examples/Fixes/add_field b/resources/examples/Fixes/add_field new file mode 100644 index 0000000..9fc004f --- /dev/null +++ b/resources/examples/Fixes/add_field @@ -0,0 +1 @@ +https://test.metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Add+a+new+field%0Aadd_field%28%22another%22%2C+%22keyword%22%29%0A&data=%7B%0A++%22key%22+%3A+%22word%22%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/copy_field b/resources/examples/Fixes/copy_field new file mode 100644 index 0000000..f1d6443 --- /dev/null +++ b/resources/examples/Fixes/copy_field @@ -0,0 +1 @@ +https://test.metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Copy+a+new+field%0Acopy_field%28%22key%22%2C+%22anotherKey%22%29%0A&data=%7B%0A++%22key%22+%3A+%22word%22%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/put_filemap b/resources/examples/Fixes/put_filemap new file mode 100644 index 0000000..f182f22 --- /dev/null +++ b/resources/examples/Fixes/put_filemap @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7C+open-file%0A%7C+as-records%0A%7C+decode-json%0A%7C+fix%28transformationFile%29%0A%7C+encode-json%28prettyPrinting%3D%22true%22%29%0A%7C+print%3B&transformation=put_filemap%28%22https%3A//gitlab.com/oersi/oersi-etl/-/raw/master/data/maps/oefos2destatis.tsv%3Fref_type%3Dheads%22%2C%22oefos2destatis%22%2C%22sep_char%22%3A%22%5Ct%22%29%0A%0Aset_array%28%22test%5B%5D%22%29%0Ado+list%28path%3A%22about%5B%5D%22%2C%22var%22%3A%22%24i%22%29%0A++++copy_field%28%22%24i.id%22%2C%22test%5B%5D.%24append.id%22%29%0A++++lookup%28%22test%5B%5D.%24last.id%22%2C%22oefos2destatis%22%29%0Aend&data=%7B%0A++++%22about%22%3A+%5B%0A++++++++%7B%0A%09%09%09%22id%22%3A+%22https%3A//w3id.org/oerbase/vocabs/oefos2012/1%22%0A%09%09%7D%2C%0A%09%09%7B%0A%09%09%09%22id%22%3A+%22https%3A//w3id.org/oerbase/vocabs/oefos2012/102%22%0A%09%09%7D%2C%0A%09%09%7B%0A%09%09%09%22id%22%3A+%22https%3A//w3id.org/oerbase/vocabs/oefos2012/1020%22%0A%09%09%7D%0A++++%5D+%0A%7D \ No newline at end of file diff --git a/resources/examples/Fixes/put_map b/resources/examples/Fixes/put_map new file mode 100644 index 0000000..b6bcb1b --- /dev/null +++ b/resources/examples/Fixes/put_map @@ -0,0 +1 @@ +https://metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=%23+Define+a+map+within+the+fix+file%0Aput_map%28%22map%22%2C%0A++%22dog%22%3A%22mammal%22%2C%0A++%22cat%22%3A%22mammal%22%2C%0A++%22parrot%22%3A%22bird%22%2C%0A++%22shark%22%3A%22fish%22%2C%0A++%22dragon%22%3A%22fictional+animal%22%2C%0A++%22unicorn%22%3A%22fictional+animal%22%29%0A%0Alookup%28%22animals%5B%5D.%2A.type%22%2C+%22map%22%29%0A&data=%7B%0A++%22animals%22%3A+%5B%7B%0A++++%22name%22%3A+%22Jake%22%2C%0A++++%22type%22%3A+%22dog%22%0A++%7D%2C%7B%0A++++%22name%22%3A+%22Blacky%22%2C%0A++++%22type%22%3A+%22parrot%22%0A++%7D%5D%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/put_rdfmap b/resources/examples/Fixes/put_rdfmap new file mode 100644 index 0000000..6907bef --- /dev/null +++ b/resources/examples/Fixes/put_rdfmap @@ -0,0 +1 @@ +https://test.metafacture.org/playground/?flux=%22http%3A//lobid.org/download/marcXml-8-records.xml%22%0A%7C+open-http%0A%7C+decode-xml%0A%7C+handle-marcxml%0A%7C+fix%28transformationFile%29%0A%7C+encode-json%28prettyPrinting%3D%22true%22%29%0A%7C+print%0A%3B&transformation=do+once%28%22maps%22%29%0A++++put_rdfmap%28%22https%3A//raw.githubusercontent.com/acka47/dnb-sg-skos/main/sg_skos_2020.ttl%22%2C+%22idLookup%22%2Ctarget%3A%22skos%3Anotation%22%29%0A++++put_rdfmap%28%22https%3A//raw.githubusercontent.com/acka47/dnb-sg-skos/main/sg_skos_2020.ttl%22%2C+%22labelLookup%22+%2C+target%3A+%22skos%3AprefLabel%22%2C+select_language%3A%22de%22%29%0Aend%0A%0Aset_array%28%22dnb_sg%5B%5D%22%29%0A%0Ado+list%28path%3A%22084%3F%3F%22%2C%22var%22%3A%22%24i%22%29%0A++++if+any_match%28%22%24i.2%22%2C+%22sdnb%7Czdbs%22%29%0A++++++++do+list%28path%3A%22%24i.a%22%2C%22var%22%3A%22%24j%22%29%0A++++++++++++copy_field%28%22%24j%22%2C%22dnb_sg%5B%5D.%24append.notation%22%29%0A++++++++++++copy_field%28%22%24j%22%2C%22dnb_sg%5B%5D.%24last.id%22%29%0A++++++++++++copy_field%28%22%24j%22%2C%22dnb_sg%5B%5D.%24last.label%22%29%0A++++++++end%0A++++end%0Aend%0A%0Alookup%28%22dnb_sg%5B%5D.%2A.id%22%2C%22idLookup%22%29%0Alookup%28%22dnb_sg%5B%5D.%2A.label%22%2C%22idLookup%22%29%0Alookup%28%22dnb_sg%5B%5D.%2A.label%22%2C%22labelLookup%22%29%0A%0Aretain%28%22dnb_sg%5B%5D%22%29 \ No newline at end of file diff --git a/resources/examples/Fixes/put_var b/resources/examples/Fixes/put_var new file mode 100644 index 0000000..0cf397a --- /dev/null +++ b/resources/examples/Fixes/put_var @@ -0,0 +1 @@ +https://test.metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=put_var%28%22test%22%2C%22variable%22%29%0Aadd_field%28%22Show_Me_The%22%2C+%22%24%5Btest%5D%22%29%0A&data=%7B%0A++%22key%22+%3A+%22word%22%0A%7D%0A \ No newline at end of file diff --git a/resources/examples/Fixes/put_vars b/resources/examples/Fixes/put_vars new file mode 100644 index 0000000..bdbfcf4 --- /dev/null +++ b/resources/examples/Fixes/put_vars @@ -0,0 +1 @@ +https://test.metafacture.org/playground/?flux=inputFile%0A%7Copen-file%0A%7Cas-records%0A%7Cdecode-json%0A%7Cfix%28transformationFile%29%0A%7Cencode-json%28prettyPrinting%3D%22true%22%29%0A%7Cprint%0A%3B%0A&transformation=put_vars%28%0A++%22status%22%3A+%22yes%22%2C%0A++%22redist%22%3A+%22allowed%22%0A%29%0A%0A%0Aadd_field%28%22open%22%2C+%22%24%5Bstatus%5D%22%29%0Aadd_field%28%22reuse%22%2C+%22%24%5Bredist%5D%22%29%0A&data=%7B%0A++%22key%22+%3A+%22word%22%0A%7D%0A \ No newline at end of file