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

Example conditional stuff

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 4 Jun 2014 14:19:12 +0100
To: Andy Seaborne <andy@apache.org>, public-csv-wg@w3.org
Message-ID: <etPan.538f1cd1.7de67713.5cbf@jenit.local>
Andy,

Take Dan’s example from 

  http://lists.w3.org/Archives/Public/public-csv-wg/2014May/0152.html

where the CSV looks like:

O*NET-SOC 2010 Code,O*NET-SOC 2010 Title
11-1011.00         ,Chief Executives
11-1011.03         ,Chief Sustainability Officers
11-1021.00         ,General and Operations Managers
11-1031.00         ,Legislators
11-2011.00         ,Advertising and Promotions Managers
11-2011.01         ,Green Marketers
11-2021.00         ,Marketing Managers
11-2022.00         ,Sales Managers
11-2031.00         ,Public Relations and Fundraising Managers

The codes are structured so ideally the structure would look something like:

soc:11-1011.00
  rdfs:label “Chief Executives” ;
  skos:notation “11-1011.00” ;
  .

soc:11-1011.03
  rdfs:label “Chief Sustainability Officers” ;
  skos:notation “11-1011.03” ;
  skos:broader soc:11-1011.00 ;
  .

To get this, what you’d want in a template is to be able to say:

  IF the code ends with something other than ’00'
  THEN
     add a skos:broader property
     whose value is first 8 characters + ’00'

That’s the kind of thing I’m talking about in terms of having conditional statements and needing to have functions that operate over the values.

Jeni
--  
Jeni Tennison
http://www.jenitennison.com/
Received on Wednesday, 4 June 2014 13:19:42 UTC

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