Skip to content

Enhancement pattern: adding units to measurements

Timothy Lebo edited this page Feb 14, 2012 · 14 revisions
csv2rdf4lod-automation is licensed under the [Apache License, Version 2.0](https://github.com/timrdf/csv2rdf4lod-automation/wiki/License)

Row-based

Since 1 is the first column, 0 can represent the row.

  @prefix muo: <http://purl.oclc.org/NET/muo/muo#> .

  conversion:enhance [
     ov:csvCol         0;
     conversion:predicate muo:measuredIn;
     conversion:object    <http://dbpedia.org/resource/United_States_dollar>;
  ];

results in:

@prefix dbpedia: <http://dbpedia.org/resource/> .

:agencyBudgetDistribution_6 
   a vocab:AgencyBudgetDistribution ;
   muo:measuredIn dbpedia:United_States_dollar ;

Cell-based

row 0 can't stand for all cells in a cell-based conversion because different cells may be measured in different units.

Fortunately, specifying the unit for all cell-based rows is relatively terse:

  conversion:enhance [
     ov:csvCol         4, 5, 6, 7, 8, 9, 10, 11, 12;
     conversion:predicate muo:measuredIn;
     conversion:object    <http://dbpedia.org/resource/United_States_dollar>;
  ];

__results in __

     @prefix muo: <http://purl.oclc.org/NET/muo/muo#> .

     conversion:predicate muo:measuredIn;
     conversion:object    <http://dbpedia.org/resource/United_States_dollar>;

result:

typed_agency:thing_1_2
   muo:measuredIn <http://dbpedia.org/resource/United_States_dollar> .

See also conversion:predicate and conversion:object.

http://idi.fundacionctic.org/muo/ucum-instances.html

Clone this wiki locally