Updates to CSV-LD definition

I'm planning on changes to the Wiki definition of CSV-LD [1] based on work I'm doing in a Ruby gem designed to implement this budding spec [2]. The README contains an update to the spec, and an implementation is begun in lib/csv/ld.rb.

The main difference is to change from using field headers as term definitions, and substitution patterns to support composite identifiers to the use of substitution patterns everywhere. I think this is simpler, and allows a mapping frame to be passed through JSON-LD algorithms without loss.

Basically, values within a mapping template may include "xxx{field reference}yyy", with _field reference_ being replaced with the value of that field within a record. Everything previously described as being supported continues to be supported, but processing is more unified using this updated definition; once value templates were introduced, it made sense to use them everywhere rather than depend on two different mechanisms.

An example template is the following:

    {
      "@context": {
        "@extension": "http://www.w3.org/ns/csv-ld",
        "@vocab": "http://schema.org/",
        "homepage": {"@type": "@id"},
        "image": {"@type": "@id"},
      },
      "name": "{name}",
      "homepage": "{homepage}",
      "image": "{image}"
    }

I'll update the Wiki after the Ruby gem is largely completed.

Gregg Kellogg
gregg@greggkellogg.net

[1] https://www.w3.org/2013/csvw/wiki/CSV-LD
[2] https://github.com/gkellogg/csv-ld

Received on Tuesday, 25 March 2014 01:58:57 UTC