Re: [basex-talk] Yaml serialization
Am 17.08.2020 um 11:55 schrieb Christian Grün: > out why before we follow this path). Has anyone of you already worked > with XML representations of YAML? Joe Wicentowski[1] did something here [2]. But I did not use it, yet. [1]: https://github.com/joewiz [2]: https://gist.github.com/joewiz/ed624a43cb6f9e15cc44b6e30553ad5e -- Goody Bye, Minden jót, Mit freundlichen Grüßen, Andreas Mixich
Re: [basex-talk] Yaml serialization
Hi Marco, Hans-Jürgen, Martin, Fabrice, I had a look at the YAML spec [1], and I noticed it’s somewhat more bulky than the JSON spec [2]. In addition, I checked out the YAML to XML conversion of FasterXML. It seems to handle the basic cases, but e.g. cannot process lists, comments or references. Maybe I’m not properly using it, though. I have attached a very basic Eclipse project for those who want to have a closer look. My guess is that there is no existing implementation of the official XML binding draft available [3] (and it might be interesting to find out why before we follow this path). Has anyone of you already worked with XML representations of YAML? Best, Christian [1] https://yaml.org/spec/1.2/spec.html [2] https://tools.ietf.org/html/rfc8259 [3] https://yaml.org/xml On Wed, Aug 12, 2020 at 7:21 PM Christian Grün wrote: > > Hans-Jürgen, thanks for you assessment. I see that there may be no real need > for a JsonML equivalent for YAML. And my assumption is that the binding from > yaml.org my be the most appropriate solution for now. Similar to our JSON > mapper, it uses underscore element names to represent arrays. > > > > > Hans-Juergen Rennau schrieb am Mi., 12. Aug. 2020, 18:59: >> >> Remark: support for a roundtrip-able XML representation of YAML would >> consolidate BaseX's great position as a data integration platform, further >> increasing the number of continents (mediatypes) which can be travelled on >> the highway of XPath (XML, JSON, CSV, HTML, YAML). >> >> In comparison, I think, YAML representation of arbitrary XML would be a >> nicety without strategic significance. >> >> Hans-Jürgen >> >> Am Mittwoch, 12. August 2020, 18:38:10 MESZ hat Christian Grün >> Folgendes geschrieben: >> >> >> I was wondering if you can successfully serialize any arbitrary XML document >> to a YAML representing, ideally without losing information (attributes, >> comments, etc.), and convert the result back to the original XML >> representation. >> >> I would guess that YAML to XML conversions is easier. >> >> Apart from that, it would surely be possible to write a little XQuery module >> that performs all the conversions (just a matter of time?). >> >> >> >> >> Marco Lettere schrieb am Mi., 12. Aug. 2020, 18:31: >> >> >> > @Marco: Do you know which conversions are provided by FasterXML: >> > arbitrary XML → YAML, arbitrary YAML → XML, or both? If the underlying >> > conversion rules are promising, we could include them a 'fasterxml' >> > format in BaseX (similar to the 'jsonml' format). >> > >> As far as I can understand from the docs and the code on github there >> Jackson is a sort of hub with several dataformat modules which are able >> to parse and serialize from the various formats. >> >> I don't know whether, with the term arbitrary, you mean to be able to >> provide your own syntax for the XML serialization. In this case I am not >> sure. >> >> M. >> <> 34843 2001-01-03 Chris Dumars 458 Walkman Dr. Suite #292 Royal Oak MI 48046 id001 BL394D 4 Basketball 450.0 BL4438 1 Super Hoop 2392.0 251.42 4443.52 Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338 invoice.yaml Description: Binary data
Re: [basex-talk] Yaml serialization
Hans-Jürgen, thanks for you assessment. I see that there may be no real need for a JsonML equivalent for YAML. And my assumption is that the binding from yaml.org my be the most appropriate solution for now. Similar to our JSON mapper, it uses underscore element names to represent arrays. Hans-Juergen Rennau schrieb am Mi., 12. Aug. 2020, 18:59: > Remark: support for a roundtrip-able XML representation of YAML would > consolidate BaseX's great position as a data integration platform, further > increasing the number of continents (mediatypes) which can be travelled on > the highway of XPath (XML, JSON, CSV, HTML, YAML). > > In comparison, I think, YAML representation of arbitrary XML would be a > nicety without strategic significance. > > Hans-Jürgen > > Am Mittwoch, 12. August 2020, 18:38:10 MESZ hat Christian Grün < > christian.gr...@gmail.com> Folgendes geschrieben: > > > I was wondering if you can successfully serialize any arbitrary XML > document to a YAML representing, ideally without losing information > (attributes, comments, etc.), and convert the result back to the original > XML representation. > > I would guess that YAML to XML conversions is easier. > > Apart from that, it would surely be possible to write a little XQuery > module that performs all the conversions (just a matter of time?). > > > > > Marco Lettere schrieb am Mi., 12. Aug. 2020, 18:31: > > > > @Marco: Do you know which conversions are provided by FasterXML: > > arbitrary XML → YAML, arbitrary YAML → XML, or both? If the underlying > > conversion rules are promising, we could include them a 'fasterxml' > > format in BaseX (similar to the 'jsonml' format). > > > As far as I can understand from the docs and the code on github there > Jackson is a sort of hub with several dataformat modules which are able > to parse and serialize from the various formats. > > I don't know whether, with the term arbitrary, you mean to be able to > provide your own syntax for the XML serialization. In this case I am not > sure. > > M. > >
Re: [basex-talk] Yaml serialization
Remark: support for a roundtrip-able XML representation of YAML would consolidate BaseX's great position as a data integration platform, further increasing the number of continents (mediatypes) which can be travelled on the highway of XPath (XML, JSON, CSV, HTML, YAML). In comparison, I think, YAML representation of arbitrary XML would be a nicety without strategic significance. Hans-Jürgen Am Mittwoch, 12. August 2020, 18:38:10 MESZ hat Christian Grün Folgendes geschrieben: I was wondering if you can successfully serialize any arbitrary XML document to a YAML representing, ideally without losing information (attributes, comments, etc.), and convert the result back to the original XML representation. I would guess that YAML to XML conversions is easier. Apart from that, it would surely be possible to write a little XQuery module that performs all the conversions (just a matter of time?). Marco Lettere schrieb am Mi., 12. Aug. 2020, 18:31: > @Marco: Do you know which conversions are provided by FasterXML: > arbitrary XML → YAML, arbitrary YAML → XML, or both? If the underlying > conversion rules are promising, we could include them a 'fasterxml' > format in BaseX (similar to the 'jsonml' format). > As far as I can understand from the docs and the code on github there Jackson is a sort of hub with several dataformat modules which are able to parse and serialize from the various formats. I don't know whether, with the term arbitrary, you mean to be able to provide your own syntax for the XML serialization. In this case I am not sure. M.
Re: [basex-talk] Yaml serialization
I was wondering if you can successfully serialize any arbitrary XML document to a YAML representing, ideally without losing information (attributes, comments, etc.), and convert the result back to the original XML representation. I would guess that YAML to XML conversions is easier. Apart from that, it would surely be possible to write a little XQuery module that performs all the conversions (just a matter of time?). Marco Lettere schrieb am Mi., 12. Aug. 2020, 18:31: > > > @Marco: Do you know which conversions are provided by FasterXML: > > arbitrary XML → YAML, arbitrary YAML → XML, or both? If the underlying > > conversion rules are promising, we could include them a 'fasterxml' > > format in BaseX (similar to the 'jsonml' format). > > > As far as I can understand from the docs and the code on github there > Jackson is a sort of hub with several dataformat modules which are able > to parse and serialize from the various formats. > > I don't know whether, with the term arbitrary, you mean to be able to > provide your own syntax for the XML serialization. In this case I am not > sure. > > M. > >
Re: [basex-talk] Yaml serialization
@Marco: Do you know which conversions are provided by FasterXML: arbitrary XML → YAML, arbitrary YAML → XML, or both? If the underlying conversion rules are promising, we could include them a 'fasterxml' format in BaseX (similar to the 'jsonml' format). As far as I can understand from the docs and the code on github there Jackson is a sort of hub with several dataformat modules which are able to parse and serialize from the various formats. I don't know whether, with the term arbitrary, you mean to be able to provide your own syntax for the XML serialization. In this case I am not sure. M.
Re: [basex-talk] Yaml serialization
The XML binding from yaml.org might be a good start (https://yaml.org/xml). I have opened a little issue for a future YAML Module [1]. @Marco: Do you know which conversions are provided by FasterXML: arbitrary XML → YAML, arbitrary YAML → XML, or both? If the underlying conversion rules are promising, we could include them a 'fasterxml' format in BaseX (similar to the 'jsonml' format). @Martin: Thanks for the link to Norm’s demo, I’ll have a look at it. [1] https://github.com/BaseXdb/basex/issues/1921 On Wed, Aug 12, 2020 at 2:47 PM Marco Lettere wrote: > > Hm, not sure but maybe FasterXML's Jackson? It supports alternative non JSON > data formats among which YAML, XML. > But maybe that one is a huge dependency. > M. > > On 12/08/20 12:38, Christian Grün wrote: > > Hi Marco, hi Fabrice, > > YAML serialization would be a nice feature indeed. > > Are you aware of existing (ideally bidirectional) mappings that would be > appropriate for general use? > > Cheers > Christian > > > > > > Marco Lettere schrieb am Mi., 12. Aug. 2020, 12:04: >> >> Dear BaseX team, >> >> just out of curiosity, could you imagine what kind of effort it would be >> to provide YAML as another serialization method for BaseX in addition to >> XML, HTML, JSON, CSV? >> >> The datamodel seems pretty close to the JSON one so maybe a very similar >> transformation to XML could be implemented ... >> >> Ciao, >> >> Marco. >> >
Re: [basex-talk] Yaml serialization
Hm, not sure but maybe FasterXML's Jackson? It supports alternative non JSON data formats among which YAML, XML. But maybe that one is a huge dependency. M. On 12/08/20 12:38, Christian Grün wrote: Hi Marco, hi Fabrice, YAML serialization would be a nice feature indeed. Are you aware of existing (ideally bidirectional) mappings that would be appropriate for general use? Cheers Christian Marco Lettere mailto:m.lett...@gmail.com>> schrieb am Mi., 12. Aug. 2020, 12:04: Dear BaseX team, just out of curiosity, could you imagine what kind of effort it would be to provide YAML as another serialization method for BaseX in addition to XML, HTML, JSON, CSV? The datamodel seems pretty close to the JSON one so maybe a very similar transformation to XML could be implemented ... Ciao, Marco.
Re: [basex-talk] Yaml serialization
Am 12.08.2020 um 12:38 schrieb Christian Grün: YAML serialization would be a nice feature indeed. Are you aware of existing (ideally bidirectional) mappings that would be appropriate for general use? At XML Prague, Norm did a demo of casting YAML to JSON as described in https://so.nwalsh.com/2020/02/15/xproc-30, he said there he has that built in into his (some day) upcoming XProc 3 processor. I am not sure the other direction is supported as well and while there is some repository containing "Calabash 2" doing some cast https://github.com/ndw/xmlcalabash2/blob/84b06fbd8331797d1b91f96646d4e55dd9ab26a9/src/main/scala/com/xmlcalabash/steps/CastContentType.scala#L287 I have no idea it reflects the approach used in the demo or whether it makes sense for any general YAML to JSON mapping.
Re: [basex-talk] Yaml serialization
Hi Marco, hi Fabrice, YAML serialization would be a nice feature indeed. Are you aware of existing (ideally bidirectional) mappings that would be appropriate for general use? Cheers Christian Marco Lettere schrieb am Mi., 12. Aug. 2020, 12:04: > Dear BaseX team, > > just out of curiosity, could you imagine what kind of effort it would be > to provide YAML as another serialization method for BaseX in addition to > XML, HTML, JSON, CSV? > > The datamodel seems pretty close to the JSON one so maybe a very similar > transformation to XML could be implemented ... > > Ciao, > > Marco. > >
Re: [basex-talk] Yaml serialization
Dear all, I agree with Marco, Yaml serialization/deserialization would be a big plus. I am currently using a great datawarehouse transformation tool that makes heavy use of yaml for configuration and documentation (dbt<http://www.getdbt.com>), and as a BaseX's old friend, I naturally use XQuery to process these yaml files, but it requires a call to a unix command line tool in order to transform to json first. And thank you for the summer edition ! Best regards from french west coast, Fabrice De : BaseX-Talk de la part de Marco Lettere Envoyé : mercredi 12 août 2020 12:04 À : BaseX Objet : [basex-talk] Yaml serialization Dear BaseX team, just out of curiosity, could you imagine what kind of effort it would be to provide YAML as another serialization method for BaseX in addition to XML, HTML, JSON, CSV? The datamodel seems pretty close to the JSON one so maybe a very similar transformation to XML could be implemented ... Ciao, Marco.
[basex-talk] Yaml serialization
Dear BaseX team, just out of curiosity, could you imagine what kind of effort it would be to provide YAML as another serialization method for BaseX in addition to XML, HTML, JSON, CSV? The datamodel seems pretty close to the JSON one so maybe a very similar transformation to XML could be implemented ... Ciao, Marco.