Skip to content

conversion:Repeat_previous_if_empty_column

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

Structural conversion:Enhancements:


Some abbreviations are used in CSVs that are authored by humans in Excel. One such abbreviation is to leave empty cells when the value repeats. These implicit values can be filled in by using the RepeatPreviousIfEmptyEnhancement. If, after passing the onlyIfCol test, a value is not present in a CSV row, use the value from the previous row.

e.g., Dataset 1623

@prefix conversion: <http://purl.org/twc/vocab/conversion/> .
@prefix :           <http://logd.tw.rpi.edu/source/data-gov/dataset/1623/version/2009-May-18/params/enhancement/1/> .

:dataset a void:Dataset;
   conversion:base_uri           "http://logd.tw.rpi.edu"^^xsd:anyURI;
   conversion:source_identifier  "data-gov";
   conversion:dataset_identifier "1623";
   conversion:dataset_version    "2009-May-18";
   conversion:conversion_process [
      a conversion:RawConversionProcess;
      conversion:enhancement_identifier "1";
      conversion:enhance [
         ov:csvRow        7;
         a conversion:HeaderRow;
      ];
      conversion:enhance [
         ov:csvCol        1;
         conversion:label "Region";
         conversion:range rdfs:Resource;
         a conversion:Repeat_previous_if_empty_column;
      
         a conversion:TypedResourcePromotion;
         conversion:range_name "Region";
      ];

Other datasets that benefit from this structural parameter include Dataset 311, and Dataset 10030.

What datasets use this enhancement?

PREFIX conversion: <http://purl.org/twc/vocab/conversion/>
SELECT distinct ?dataset
WHERE {
  GRAPH <http://logd.tw.rpi.edu/vocab/Dataset>  {
    ?dataset a void:Dataset;
      conversion:conversion_process [
        conversion:enhance [
           a conversion:Repeat_previous_if_empty_column;
        ];
      ]
    .
  }
}
Clone this wiki locally