W3C home > Mailing lists > Public > public-csv-wg@w3.org > December 2015

Re: Define @type for all rows

From: Jeremy Tandy <jeremy.tandy@gmail.com>
Date: Tue, 15 Dec 2015 11:45:24 +0000
Message-ID: <CADtUq_3Rhffyf-3RsUDV7vARjDGQXzHUX1Cju0T_29Ubmc5qJQ@mail.gmail.com>
To: Colin Maudry <colin@maudry.com>, public-csv-wg@w3.org
Hi Colin- that's the correct mechanism. We were looking for a way to insert
arbitrary triples into the RDF output without needing to resort to a
templating mechanism (like mustache <https://mustache.github.io/>) ... we
thought 'virtual columns' fit the bill.

Jeremy
@jeremytandy

On Mon, 14 Dec 2015 at 16:40 Colin Maudry <colin@maudry.com> wrote:

> Answering my own question:
>
> In the csv2rdf spec, Example 11 [1] uses a virtual column to generate
> more triples:
>
>
> {"name":"type_event","virtual":true,"aboutUrl":"#event-{_row}","propertyUrl":"rdf:type","valueUrl":"schema:MusicEvent"}
>
> This says that:
>
> - a virtual column is described (virtual: true)= not an actual column in
> the table
> - a name was made up (name: type_event)
> - the URI of the subject of the triple is  #event-{_row}, using the
> current @base to resolve to a full URI
> - The predicate/property of the triple is rdf:type
> - the object/value of the triple is schema:MusicEvent.
>
> So for instance for row 1, a triple like that would be generated:
>
> #event-1 rdf:type schema:Event .
>
> ...which is exactly what I was looking for! If there are alternate
> solutions, please  speak up.
>
> [1]
>
> http://www.w3.org/TR/2015/CR-csv2rdf-20150716/#example-events-listing-metadata
>
> Cheers,
> Colin Maudry
> @CMaudry
>
> On 14/12/15 14:09, Colin Maudry wrote:
> > Hello,
> >
> > In this JSON metadata file [1], I annotate this CSV [2] (8 MB) (also in
> > JSON-LD playground [3]).
> >
> > I'm familiar with RDF, and would like to specify in my schema that every
> > row in this table describes an object of @type
> > <https://www.wikidata.org/wiki/Q1244442> ("school building").
> >
> > I think I saw somewhere that it was possible to specify this on a
> > csvw:Row object, but since I only annotate the table and the columns and
> > don't want to annotate every single row, that doesn't seem like a good
> > approach in my case.
> >
> > What would you suggest? Did I miss something?
> >
> > [1]
> >
> https://github.com/ColinMaudry/dgfr-tabular-metadata/blob/develop/etablissements-scolaires/depp-etablissements-premier-et-second-degres-structures-administratives-education-avril-2014.json
> > [2]
> >
> https://raw.githubusercontent.com/ColinMaudry/dgfr-tabular-metadata/develop/etablissements-scolaires/depp-etablissements-premier-et-second-degres-structures-administratives-education-avril-2014.csv
> > [3] http://goo.gl/Yhm2yJ
> >
> > Colin Maudry
> > @CMaudry
> >
> >
>
>
>
Received on Tuesday, 15 December 2015 11:46:04 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 15 December 2015 11:46:04 UTC