metafacture / metafacture-core

Core package of the Metafacture tool suite for metadata processing.
https://metafacture.org
Apache License 2.0
69 stars 34 forks source link

Suppot yaml (encoding/decoding) #399

Closed TobiasNx closed 2 years ago

TobiasNx commented 2 years ago

metafacture should support YAML

blackwinter commented 2 years ago

Would #400 meet your needs?

TobiasNx commented 2 years ago

Would #400 meet your needs?

I think in theory it would. Somehow I can't test the decode/encode-yaml-functions with an metafacture-core version of your branch that I build with ./gradlew installDist.

Exception in thread "main" org.metafacture.commons.reflection.ReflectionException: Class not found: decode-yaml
        at org.metafacture.commons.reflection.ReflectionUtil.loadClass(ReflectionUtil.java:49)
        at org.metafacture.commons.reflection.ReflectionUtil.loadClass(ReflectionUtil.java:40)
        at org.metafacture.flux.parser.FluxProgramm.createElement(FluxProgramm.java:80)
        at org.metafacture.flux.parser.FluxProgramm.addElement(FluxProgramm.java:87)
        at org.metafacture.flux.parser.FlowBuilder.pipe(FlowBuilder.java:736)
        at org.metafacture.flux.parser.FlowBuilder.flowtail(FlowBuilder.java:514)
        at org.metafacture.flux.parser.FlowBuilder.flow(FlowBuilder.java:226)
        at org.metafacture.flux.parser.FlowBuilder.flux(FlowBuilder.java:122)
        at org.metafacture.flux.FluxCompiler.compileFlow(FluxCompiler.java:56)
        at org.metafacture.flux.FluxCompiler.compile(FluxCompiler.java:44)
        at org.metafacture.runner.Flux.main(Flux.java:78)
Caused by: java.lang.ClassNotFoundException: decode-yaml
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        at org.metafacture.commons.reflection.ReflectionUtil.loadClass(ReflectionUtil.java:46)
        ... 10 more
blackwinter commented 2 years ago

Thanks for the hint. The new YAML module has to be added to metafacture-runner (fixed in a30ee56).

TobiasNx commented 2 years ago

I tried yaml2yaml, json2yaml, yaml2json.

This seems to work. +1 Good to know, is that the internal structure of the data has the same naming conventions as JSON in metafacture.