<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Ok, than we need to align Catmandy with Metafacture. I've a pull request ready to should add support for empty paths in Catmandu:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
<a href="https://github.com/LibreCat/Catmandu/pull/397" id="LPlnkOWALinkPreview">https://github.com/LibreCat/Catmandu/pull/397</a><br>
</div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1">
<div id="LPBorder_GTaHR0cHM6Ly9naXRodWIuY29tL0xpYnJlQ2F0L0NhdG1hbmR1L3B1bGwvMzk3" class="LPBorder233330" style="width: 100%; margin-top: 16px; margin-bottom: 16px; position: relative; max-width: 800px; min-width: 424px;">
<table id="LPContainer233330" role="presentation" style="padding: 12px 36px 12px 12px; width: 100%; border-width: 1px; border-style: solid; border-color: rgb(200, 200, 200); border-radius: 2px;">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td>
<div id="LPImageContainer233330" style="position: relative; margin-right: 12px; height: 120px; overflow: hidden; width: 240px;">
<a target="_blank" id="LPImageAnchor233330" href="https://github.com/LibreCat/Catmandu/pull/397"><img id="LPThumbnailImageId233330" alt="" height="120" style="display: block;" width="240" src="https://opengraph.githubassets.com/e26327752db703a1b491a89cecdc756189634aa631eeef86a75b7af94ebe04bc/LibreCat/Catmandu/pull/397"></a></div>
</td>
<td style="width: 100%;">
<div id="LPTitle233330" style="font-size: 21px; font-weight: 300; margin-right: 8px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; margin-bottom: 12px;">
<a target="_blank" id="LPUrlAnchor233330" href="https://github.com/LibreCat/Catmandu/pull/397" style="text-decoration: none;">Adding support for empty paths by phochste · Pull Request #397 · LibreCat/Catmandu</a></div>
<div id="LPDescription233330" style="font-size: 14px; max-height: 100px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; margin-bottom: 12px; margin-right: 8px; overflow: hidden; color: rgb(102, 102, 102);">
Adding support for empty paths in fixes. E.g. echo '{"": "Empty", "ok": 1}' | catmandu convert JSON --fix "remove_field('')" should give {"ok": 1 }</div>
<div id="LPMetadata233330" style="font-size: 14px; font-weight: 400; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; color: rgb(166, 166, 166);">
github.com</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
BR</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
Patrick</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> librecat-dev-bounces@lists.uni-bielefeld.de <librecat-dev-bounces@lists.uni-bielefeld.de> on behalf of Tobias Bülte <tobias.buelte@hbz-nrw.de><br>
<b>Sent:</b> 13 September 2023 17:57<br>
<b>To:</b> Nicolas Franck <Nicolas.Franck@UGent.be><br>
<b>Cc:</b> librecat-dev@lists.uni-bielefeld.de <librecat-dev@lists.uni-bielefeld.de><br>
<b>Subject:</b> Re: [librecat-dev] Vacuum fix on keys?</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">I was not sure about the behaviour in Catmandu.<br>
<br>
But since we implemented fix as transformation language in metafacture,<br>
I tested it there and with MF it works:<br>
<br>
<a href="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%0A%3B&transformation=remove_field%28%22%22%29&data=%7B%0A++++%22Hello%22%3A+%22World%22%2C%0A++++%22%22+%3A+%22This+is+an+empty+key%22%0A%7D">https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmetafacture.org%2Fplayground%2F%3Fflux%3DinputFile%250A%257C%2Bopen-file%250A%257C%2Bas-records%250A%257C%2Bdecode-json%250A%257C%2Bfix%2528transformationFile%2529%250A%257C%2Bencode-json%2528prettyPrinting%253D%2522true%2522%2529%250A%257C%2Bprint%250A%253B%26transformation%3Dremove_field%2528%2522%2522%2529%26data%3D%257B%250A%2B%2B%2B%2B%2522Hello%2522%253A%2B%2522World%2522%252C%250A%2B%2B%2B%2B%2522%2522%2B%253A%2B%2522This%2Bis%2Ban%2Bempty%2Bkey%2522%250A%257D&data=05%7C01%7CPatrick.Hochstenbach%40UGent.be%7Cb132083a6fe04d3fd6a808dbb4725ce3%7Cd7811cdeecef496c8f91a1786241b99c%7C1%7C0%7C638302176105386674%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=Own%2F4qnPUqr5k%2FcgVJOgzSwnyUfDFDkTmdF9rRXdb7E%3D&reserved=0</a><br>
<br>
Seems that MF and Catmandu behave differently with this regard.<br>
<br>
Am 13.09.23 um 15:18 schrieb Nicolas Franck:<br>
> @Tobias: if only that were true. Maybe it has two, or three spaces?<br>
><br>
> Another solution would be to copy the input record to another and<br>
> specify all of the valid keys by name, and then run vacuum on that copy.<br>
> This way the weird keys are gone.<br>
><br>
>> On 13 Sep 2023, at 15:02, Tobias Bülte <tobias.buelte@hbz-nrw.de> wrote:<br>
>><br>
>> Wouldn't remove_field("") do the trick?<br>
>><br>
>><br>
>> Am 13.09.23 um 14:34 schrieb Peil, Vitali:<br>
>>> Hi all,<br>
>>><br>
>>> I came across some bad data ;-). Tried to fix this with the vacuum fix. The data I have includes empty field names which I want to clean.<br>
>>><br>
>>> with the vacuum fix:<br>
>>> $ echo '[{"ok": 1, "empty": "", "":"some bad data"}]' | catmandu convert to JSON --fix "vacuum()"<br>
>>> Output: [{"":"some bad data","ok":1}]<br>
>>><br>
>>> but I would expect as output<br>
>>> [{"ok":1}]<br>
>>><br>
>>> Is this a bug in the vacuum fix? Is there another way doing this?<br>
>>><br>
>>> Best,<br>
>>> Vitali<br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> librecat-dev mailing list<br>
>>> - send list mails to librecat-dev@lists.uni-bielefeld.de<br>
>>> - to unsubscribe or change options, visit <a href="https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev">
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.uni-bielefeld.de%2Fmailman2%2Fcgi%2Funibi%2Flistinfo%2Flibrecat-dev&data=05%7C01%7CPatrick.Hochstenbach%40UGent.be%7Cb132083a6fe04d3fd6a808dbb4725ce3%7Cd7811cdeecef496c8f91a1786241b99c%7C1%7C0%7C638302176105386674%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=Coc5bfPCrNQv1Hpcd43k0xUfsuYJMqF8SaRXFbknL94%3D&reserved=0</a><br>
>>> - project website: <a href="http://librecat.org/">https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibrecat.org%2F&data=05%7C01%7CPatrick.Hochstenbach%40UGent.be%7Cb132083a6fe04d3fd6a808dbb4725ce3%7Cd7811cdeecef496c8f91a1786241b99c%7C1%7C0%7C638302176105386674%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=md1Cl0mrDmchKpxhCzgLUIZa0q2723yaPTLb2nV3Wvk%3D&reserved=0</a><br>
>> _______________________________________________<br>
>> librecat-dev mailing list<br>
>> - send list mails to librecat-dev@lists.uni-bielefeld.de<br>
>> - to unsubscribe or change options, visit <a href="https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev">
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.uni-bielefeld.de%2Fmailman2%2Fcgi%2Funibi%2Flistinfo%2Flibrecat-dev&data=05%7C01%7CPatrick.Hochstenbach%40UGent.be%7Cb132083a6fe04d3fd6a808dbb4725ce3%7Cd7811cdeecef496c8f91a1786241b99c%7C1%7C0%7C638302176105386674%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=Coc5bfPCrNQv1Hpcd43k0xUfsuYJMqF8SaRXFbknL94%3D&reserved=0</a><br>
>> - project website: <a href="http://librecat.org/">https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibrecat.org%2F&data=05%7C01%7CPatrick.Hochstenbach%40UGent.be%7Cb132083a6fe04d3fd6a808dbb4725ce3%7Cd7811cdeecef496c8f91a1786241b99c%7C1%7C0%7C638302176105386674%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=md1Cl0mrDmchKpxhCzgLUIZa0q2723yaPTLb2nV3Wvk%3D&reserved=0</a><br>
_______________________________________________<br>
librecat-dev mailing list<br>
- send list mails to librecat-dev@lists.uni-bielefeld.de<br>
- to unsubscribe or change options, visit <a href="https://lists.uni-bielefeld.de/mailman2/cgi/unibi/listinfo/librecat-dev">
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.uni-bielefeld.de%2Fmailman2%2Fcgi%2Funibi%2Flistinfo%2Flibrecat-dev&data=05%7C01%7CPatrick.Hochstenbach%40UGent.be%7Cb132083a6fe04d3fd6a808dbb4725ce3%7Cd7811cdeecef496c8f91a1786241b99c%7C1%7C0%7C638302176105386674%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=Coc5bfPCrNQv1Hpcd43k0xUfsuYJMqF8SaRXFbknL94%3D&reserved=0</a><br>
- project website: <a href="http://librecat.org/">https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibrecat.org%2F&data=05%7C01%7CPatrick.Hochstenbach%40UGent.be%7Cb132083a6fe04d3fd6a808dbb4725ce3%7Cd7811cdeecef496c8f91a1786241b99c%7C1%7C0%7C638302176105386674%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=md1Cl0mrDmchKpxhCzgLUIZa0q2723yaPTLb2nV3Wvk%3D&reserved=0</a><br>
</div>
</span></font></div>
</body>
</html>