Hi all
I have a question about csv:serialize and blank nodes. Trailing blanks are indicated with a separator, but those in the middle are.
csv:serialize( <rows> <row> <f>1</f> <s>2</s> <t>3</t></row> <row> <f></f> <s></s> <t>3</t></row> <row> <f>1</f> <s></s> <t>3</t></row> <row> <f>1</f> <s></s> <t></t></row> <row> <f>1</f> <s>2</s> <t></t></row> </rows>)
Here is the output (BaseX 7.8.1) , where line 4 and 5 are missing trailing separators:
1,2,3 ,,3 1,,3 1 1,2
Could this be fixed, or is it a feature?
All the best Lars G Johnsen National Library of Norway
Hi Lars,
this behavior is a feature indeed, because the empty strings don't contribute to the result.
Do you encounter any problems when processing the resulting CSV output? If yes, we could have another look at this.
Best, Christian
I have a question about csv:serialize and blank nodes. Trailing blanks are indicated with a separator, but those in the middle are.
csv:serialize( <rows> <row> <f>1</f> <s>2</s> <t>3</t></row> <row> <f></f> <s></s> <t>3</t></row> <row> <f>1</f> <s></s> <t>3</t></row> <row> <f>1</f> <s></s> <t></t></row> <row> <f>1</f> <s>2</s> <t></t></row> </rows>)
Here is the output (BaseX 7.8.1) , where line 4 and 5 are missing trailing separators:
1,2,3 ,,3 1,,3 1 1,2
Could this be fixed, or is it a feature?
All the best Lars G Johnsen National Library of Norway
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
If I may add a comment - I find it counter-intuitive to skip the trailing separators. What I expect from CSV data is strict uniformity, every line same number of cells. This has also a (though modest) control effect, like a a minimalistic checksum: deviations from the expected number of cells indicate errors. And I have not yet encountered a different behaviour when downloading public data. (Maybe one may take different views of CSV, but they have not yet occurred to me.) I wonder if there is an advantage gained by the present behaviour.
Kind regards, Hans-Juergen
-------------------------------------------- Christian Grün christian.gruen@gmail.com schrieb am Sa, 22.3.2014:
Betreff: Re: [basex-talk] Traling empty nodes in csv:serialize An: "Lars Johnsen" yoonsen@gmail.com CC: "BaseX" basex-talk@mailman.uni-konstanz.de Datum: Samstag, 22. März, 2014 12:48 Uhr
Hi Lars,
this behavior is a feature indeed, because the empty strings don't contribute to the result.
Do you encounter any problems when processing the resulting CSV output? If yes, we could have another look at this.
Best, Christian
I have a
question about csv:serialize and blank nodes. Trailing blanks are
indicated with a separator,
but those in the middle are.
csv:serialize( <rows> <row>
<f>1</f> <s>2</s> <t>3</t></row>
<row> <f></f> <s></s> <t>3</t></row>
<row>
<f>1</f> <s></s> <t>3</t></row>
<row> <f>1</f> <s></s> <t></t></row>
<row>
<f>1</f> <s>2</s> <t></t></row>
</rows>)
Here is the output (BaseX 7.8.1) , where line 4 and 5 are missing trailing
separators:
1,2,3 ,,3 1,,3 1 1,2
Could this be fixed,
or is it a feature?
All the best Lars G
Johnsen
National Library of Norway
_______________________________________________
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
_______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Thanks for your assessment. The CSV output of the latest snapshot [1] should now contain all trailing delimiters.
[1] http://files.basex.org/releases/latest/
On Sat, Mar 22, 2014 at 1:08 PM, Hans-Juergen Rennau hrennau@yahoo.de wrote:
If I may add a comment - I find it counter-intuitive to skip the trailing separators. What I expect from CSV data is strict uniformity, every line same number of cells. This has also a (though modest) control effect, like a a minimalistic checksum: deviations from the expected number of cells indicate errors. And I have not yet encountered a different behaviour when downloading public data. (Maybe one may take different views of CSV, but they have not yet occurred to me.) I wonder if there is an advantage gained by the present behaviour.
Kind regards, Hans-Juergen
Christian Grün christian.gruen@gmail.com schrieb am Sa, 22.3.2014:
Betreff: Re: [basex-talk] Traling empty nodes in csv:serialize An: "Lars Johnsen" yoonsen@gmail.com CC: "BaseX" basex-talk@mailman.uni-konstanz.de Datum: Samstag, 22. März, 2014 12:48 Uhr
Hi Lars,
this behavior is a feature indeed, because the empty strings don't contribute to the result.
Do you encounter any problems when processing the resulting CSV output? If yes, we could have another look at this.
Best, Christian
I have a
question about csv:serialize and blank nodes. Trailing blanks are
indicated with a separator,
but those in the middle are.
csv:serialize( <rows> <row>
<f>1</f> <s>2</s> <t>3</t></row>
<row> <f></f>
<s></s> <t>3</t></row>
<row>
<f>1</f> <s></s> <t>3</t></row>
<row> <f>1</f>
<s></s> <t></t></row>
<row>
<f>1</f> <s>2</s> <t></t></row>
</rows>)
Here is the output (BaseX 7.8.1) , where line 4 and 5 are missing trailing
separators:
1,2,3 ,,3 1,,3 1 1,2
Could this be fixed,
or is it a feature?
All the best Lars G
Johnsen
National Library of Norway
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de