W3C home > Mailing lists > Public > public-csv-wg@w3.org > April 2014

Re: Architecture of mapping CSV to other formats

From: Alf Eaton <eaton.alf@gmail.com>
Date: Thu, 24 Apr 2014 11:01:15 +0100
Message-ID: <CAJVrAaTWkZQ5o6th3naaK1OSeKFY0Ap4OS_rfD-avLcwzTk5rg@mail.gmail.com>
To: Jeni Tennison <jeni@jenitennison.com>
Cc: "public-csv-wg@w3.org" <public-csv-wg@w3.org>
My point in the context of this discussion was that if there's a
straightforward "default" mapping to a particular format (e.g. if the
transformation to XML can be stated as simply "all the values end up
as attributes"), then I think the specification doesn't need to go any
further with allowing different representations (point #1 of the
original list). I'd say that converting the data to any user-specified
XML representation could be outside the scope of this specification,
as they can use their own XSLT to do that transformation.

This depends on how much transformation of the data is expected to
take place before converting between formats, though: is a cell that
contains "1,2,3" expected to be transformed to an array before mapping
to a different format, so it would end up as this:

<example>
  <foo>1</foo>
  <foo>2</foo>
  <foo>3</foo>
</example>

or will it always be treated as a literal value, so would end up as this?:

<example foo="1,2,3"/>

That also depends on whether repeated columns are going to be treated
as replicates of the same property (in which case they would be
transformed to an array as above), or as distinct columns with _1, _2
appended (in which case they could stay as distinct attributes).

Alf

On 24 April 2014 10:45, Jeni Tennison <jeni@jenitennison.com> wrote:
> Alf,
>
> What a good default XML representation would be is outside the scope of this particular discussion :) But if you have strong opinions about it, perhaps you’d like to take on speccing it?!? :)
>
> Jeni
>
> ------------------------------------------------------
> From: Alf Eaton eaton.alf@gmail.com
> Reply: Alf Eaton eaton.alf@gmail.com
> Date: 24 April 2014 at 09:49:13
> To: Jeni Tennison jeni@jenitennison.com
> Cc: public-csv-wg@w3.org public-csv-wg@w3.org
> Subject:  Re: Architecture of mapping CSV to other formats
>
>> On 23 April 2014 20:13, Jeni Tennison wrote:
>>
>> > On the call today we discussed briefly the general architecture of mapping from CSV
>> to other formats (eg RDF, JSON, XML, SQL), specifically where to draw the lines between
>> what we specify and what is specified elsewhere.
>> >
>> > To make this clear with an XML-based example, suppose that we have a CSV file like:
>> >
>> > GID,On Street,Species,Trim Cycle,Inventory Date
>> > 1,ADDISON AV,Celtis australis,Large Tree Routine Prune,10/18/2010
>> > 2,EMERSON ST,Liquidambar styraciflua,Large Tree Routine Prune,6/2/2010
>> > 3,EMERSON ST,Liquidambar styraciflua,Large Tree Routine Prune,6/2/2010
>> >
>> > This will have a basic mapping into XML which might look like:
>> >
>> >
>> >
>> > 1
>> > ADDISON AV
>> > Celtis australis
>> > Large Tree Routine Prune
>> > 10/18/2010
>> >
>> > ...
>> >
>>
>> As there's only ever a single, string value for each property of an
>> item (when the data comes from CSV), it would be most straightforward
>> to map everything to attributes as the default:
>>
>>
>> > trim-cycle="Large Tree Routine Prune" inventory-date="2010-10-18"/>
>> …
>>
>>
>> Alf
>>
>>
>
> --
> Jeni Tennison
> http://www.jenitennison.com/
Received on Thursday, 24 April 2014 10:02:03 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:21:39 UTC