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

Re: Some comments on the RDF->CSV document

From: Gregg Kellogg <gregg@greggkellogg.net>
Date: Wed, 23 Apr 2014 10:55:01 -0700
Cc: Andy Seaborne <andy@apache.org>, W3C CSV on the Web Working Group <public-csv-wg@w3.org>
Message-Id: <9B01B636-B724-4EB5-892B-A189BA93D0FD@greggkellogg.net>
To: Ivan Herman <ivan@w3.org>
On Apr 23, 2014, at 8:13 AM, Ivan Herman <ivan@w3.org> wrote:

> (To avoid any misunderstandings, I looked at http://w3c.github.io/csvw/csv2rdf/)
> 
> I am o.k. with the general approach, and with the level of simplicity/complexity of the templates. I would probably want each feature in the templates to be backed up with a reasonable use case (ideally, a use case in real use), but the 'melody', as is documented now, is fine to me. My litmus test is whether the mapping is implementable in simple and small JS library running on client side (not exclusively there, but also there). I think this is essential if we want any acceptance of this by client side web apps, ie, if we want to maintain a minimal level of hope that client side applications would use this:-). 

Agreed. If we have general agreement on the approach, we can begin to flesh out the document; it certainly should include concrete examples that illustrate the different cases, as well as defined test cases. Using real-world use cases, if simple, is fine, but they can be messy, so settling on a simplified set of use cases may work better within such a spec. We can always make more complicated test cases, which also serve to illustrate behavior.

> For the syntax question: I think my litmus test also means that a JSON syntax is almost a must: I do not expect anybody to start writing a turtle parser in JS for the purpose of an RDF mapping. The template seems to be fairly simple and probably has a straightforward description in JSON, ie, I do not believe that to be an issue...

The methods I used in the CSV2RDF document are substantially the same as that used in CSV-LD for creating JSON-LD. In fact, the transformation process can probably be done simply at the syntax layer except for datatype coercions. The CSV-LD use case also benefits from information in an associated context. In particular, in mapping fields with sub-delimiters for representing multiple values. But, I think that looking further at RFC-6570 provides some other means (for example {list*} could expand to an array of the delimited values. At this point, a purely syntactic transformation becomes unfeasible, at least for multiple subject or predicate values.

> ---
> 
> The templates are on rows on columns, which presupposes a homogeneity of the table; again, I would want to check that against use cases. In particular, I wonder whether the templates that sets the language tag for a whole column is o.k. (e.g., if the column is something like 'native name' for cities, then each cell may have a different language tag; I am not sure how we would handle that.)

Using a Turtle syntax, I don't see how we can represent a literal language using a template representation. This would likely require using some non-literal representation in which language was a property. OTOH, a CSV-LD representation could use a template for languages (or datatypes).

> ---
> 
> From a more general point of view, an obvious issue on which we will have to give an answer to is the relationship of the template language to R2RML. As far as I could see, the features in the current template language are an almost strict subset of R2RML (I am not sure about the datatype mappings; R2RML makes use of SQL datatypes which we do not want to refer to). 
> 
> That being said, if we just referred to R2RML in our spec we would scare away a lot of people; meaning that we should probably not do it. However, a precise mapping to R2RML may still be necessary to be written down in the document, in case somebody want to use an existing R2RML engine. We should also check that the simple (template-less) mapping is similarly a subset to Direct Mapping, and document that

I was reaching for something that doesn't require a deep understanding of RDF, which IMO, R2RML does. I think R2RML is important for handling complex use cases (maybe this includes the language issue you mentioned), and we should reference it as such. This could allow us to focus on the 80% use case and keep things as simple as possible.

> ---
> 
> I was also wondering on the call, whether the template is RDF specific, or whether at least the general direction could be reused for a JSON mapping or, if needed, XML. I guess this is certainly true for JSON: the templates to use the right predicate names can be reused to generate the keys, for example. But I have not done a detailed analysis on this, and there are, almost surely, RDF specific features. But we should probably try to factor out the common parts.

Probably what's RDF specific is performing URI- or datatype-specific processing when casting field values to the appropriate representation, and dealing with multiple sub-values, where it comes to treating them as subject or predicate.

> (Of course, there is a question whether we need a separate JSON, or whether the current mapping would simply produce JSON-LD, ie, JSON. I am a little bit afraid of the RDF features, like blank nodes or @type, transpire into generic JSON which people may not want...
> 
> ---
> 
> Minor issue: the automatic numbering/naming of predicates should take into account RTL writing direction, see Yakov's examples for CSV files in Arabic or Hebrew...

We haven't gotten into metadata about the entire document, which would include RTL and other things like skip rows and skip columns. Presumably, RTL would just cause a processor to reverse each record, which may also be a function of an underlying CSV library.

Gregg

> Ivan
> 
> ----
> Ivan Herman, W3C 
> Digital Publishing Activity Lead
> Home: http://www.w3.org/People/Ivan/
> mobile: +31-641044153
> GPG: 0x343F1A3D
> FOAF: http://www.ivan-herman.net/foaf
> 
> 
> 
> 
> 
Received on Wednesday, 23 April 2014 17:55:34 UTC

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