silk-framework/silk — pull request #2 by ziodave (2014-05-15 08:58:11+00:00)
Title: csv datasource add uri pattern and regex filter

Hello,

This PR contains the following improvements for the `CsvDataSource`:

* **uri** pattern, used to build the URIs of entities: currently it is fixed to *prefix* + *line-number*. This PR enables the user to specify a *uri* parameter with the uri pattern. E.g. using the GeoNames CSV files [1], the URI pattern can be configured as `http://sws.geonames.org/{id}` where *id* is the first column in the CSV file (as specified in the *properties* parameter), so to construct a GeoNames URI.
* **regexFilter** parameter, used to filter out CSV rows which should not be used for matching. For example this regex `^(.*\t){6}A\t.*` would consider only rows that have the `A` feature-code set (GeoNames feature code *A* means an administrative division [2]).

This is an example configuration for a `CsvDataSource` using the GeoNames CSV files [1]:
```

```

[1] http://download.geonames.org/export/dump/
[2] http://www.geonames.org/export/codes.html