Re: Hidden hierarchy example

On 27 May 2014 11:07, Dan Brickley <danbri@google.com> wrote:

> Here's an example of a CSV structure that hides a hierarchy within cell values.
>
> My expectation is that we won't specify a way to access such
> complexity in our core work but it is worth bearing in mind when
> thinking about extensions, hooks for other languages etc.
>
> This link has raw CSV and prettified HTML,
> http://www.onetcenter.org/taxonomy/2010/list.html?d=1 ...
>
> Schema.org currently mentions this dataset as supplying possible
> valuess to use in http://schema.org/JobPosting in the
> http://schema.org/occupationalCategory property. It is very SKOS-like
> data, consisting of a controlled code, with short text, long text, and
> a hierarchy represented within the numeric structure of the codes. A
> simple CSV mapping could expand these out into SKOS Concept like
> structures; a fancy/custom mapping might figure out broader/narrower
> relations that show e.g. 11-9041.01,Biofuels/Biodiesel Technology and
> Product Development Managers as a specialization of
> 11-9041.00,Architectural and Engineering Managers...
>
> I haven't figured out the exact rules to parse a hierarchy yet, but at
> first look I'd guess it needs procedural code.

I had a go at parsing the CSV into something that made the
organisation structure browseable, and this mapping seemed to work
quite well:

11-9041.01,Biofuels/Biodiesel Technology =>
{
  title: 'Biofuels/Biodiesel Technology',
  subsubcategory: '11-9041.01'
  subcategory: '11-9041',
  category: '11',
}

This could be done declaratively: a regular expression
(/^(\d+)-(\d+)\.(\d+)$/) specifies how to parse the hierarchical code
into its constituent parts, then they just need to be combined one
part at a time to get the ids for each level of the hierarchy. In the
user interface, selecting category "11" shows only the items in that
category (for want of a better term), and selecting subcategory
"11-9041" shows only the items in that subcategory.

In this particular case, there doesn't seem to be (as far as I can
tell) an ontology providing labels or relationships between each level
of the hierarchy, which would be useful.

Alf

Received on Friday, 30 May 2014 11:25:09 UTC