aggregate icon indicating copy to clipboard operation
aggregate copied to clipboard

Standardize colon and underscore usage in Aggregate and Briefcase CSV

Open getodk-bot opened this issue 8 years ago • 2 comments

Issue by yanokwa Thursday Jun 08, 2017 at 17:23 GMT Originally opened as https://github.com/opendatakit/opendatakit/issues/1286 (2 comment(s))


Question

Any idea why Aggregate uses colon as a separator in the export, but Briefcase uses underscore?

Answer from @mitchellsundt

Aggregate's Export was written before any of the publishers.

We discovered while writing the publishers that one or both of Google Sheets or Fusion Tables could not handle colons in the column names (not surprising, since these are XML nodes in those protocols).

When I wrote Briefcase, I used the underscores that we switched to for those publishers' column names, so that you could potentially import the exported CSV into Sheets or Fusion Tables without a lot of problems. Otherwise, if you tried to import a csv file into fusion tables or sheets with colons or spaces, etc. in the column headings, it, at one time, would fail. You'd have to manually edit the csv before it could be imported. Google has probably fixed that by now.

Note that the JSON publisher does not concatenate enclosing group and field names to form a unique name -- it just uses the field name. This is largely because that was written after the ascendancy of XLSForm, where the ${fieldname} construct forces each fieldname to be unique within the form, regardless of the group nesting (which, in proper XML would provide the full name of a field -- e.g., see all the 'name' fields in HL7 document spec).

I don't know if Briefcase also remaps malformed field names (e.g., those beginning with numbers -- i.e., 1stQuartile) to precede them with "n" like we do in the publishers. That was a change we made after Briefcase was written. Such names are technically illegal in XML, but XLSForm and other form generators allow them, and Javarosa does not complain, so they would otherwise break the publishers after data was flowing into the system, wreaking havoc.

getodk-bot avatar Nov 28 '17 02:11 getodk-bot

Comment by nilesr Monday Aug 14, 2017 at 17:08 GMT


The benetech UI port to the sync endpoint will have yet another way of exporting CSVs, probably mostly copied over from Briefcase, just another thing to consider when we get a chance to go back and standardize this

getodk-bot avatar Nov 28 '17 02:11 getodk-bot

Comment by linl33 Monday Aug 14, 2017 at 17:19 GMT


That UI will follow conventions define in sync-client, which is also the convention used in Suitcase. On Mon, Aug 14, 2017 at 10:08 AM Niles Rogoff [email protected] wrote:

The benetech UI port to the sync endpoint will have yet another way of exporting CSVs, probably mostly copied over from Briefcase, just another thing to consider when we get a chance to go back and standardize this

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/opendatakit/opendatakit/issues/1286#issuecomment-322249163, or mute the thread https://github.com/notifications/unsubscribe-auth/AH0vP2BZJY_TTTMudCxHjphT5R9Ld4YTks5sYH8fgaJpZM4N0YOT .

getodk-bot avatar Nov 28 '17 02:11 getodk-bot