Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cordis): support fields for exceptional FP4 - EUBFR-215 #167

Merged
merged 2 commits into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 129 additions & 8 deletions docs/types/etls/cordis-csv.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,29 @@ Preprocess `funding_area`
Input fields taken from the `record` are:

- `fundingScheme`
- `Activity Area` (FP4)

**Parameters**

- `record` **[Object][3]** The row received from parsed file

Returns **[Array][4]**

### getTotalCost

Get total cost before formatting.

Input fields taken from the `record` are:

- `totalCost` (FR1-3 + FP5-7)
- `Total Cost` (FP4)

**Parameters**

- `record` **[Object][3]** The row received from parsed file

Returns **[String][5]**

### getBudget

Preprocess budget
Expand All @@ -40,19 +56,20 @@ Returns **Budget**
### getDescription

Preprocess description
Concatenation of several fields as requested in [https://webgate.ec.europa.eu/CITnet/jira/browse/EUBFR-200?focusedCommentId=2808845&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-2808845][5]
Concatenation of several fields as requested in [https://webgate.ec.europa.eu/CITnet/jira/browse/EUBFR-200?focusedCommentId=2808845&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-2808845][6]
Input fields taken from the `record` are:

- `acronym`
- `objective`
- `rcn`
- `acronym` or `Project Acronym` (FP4)
- `objective` or `Objectives` (FP4)
- `General Information` (FP4)
- `rcn` or `RCN` (FP4)
- `topic`

**Parameters**

- `record` **[Object][3]** The row received from parsed file

Returns **[String][6]**
Returns **[String][5]**

### getProjectId

Expand All @@ -61,12 +78,27 @@ Seeks for values in the following precedence:

- `id`
- `reference`
- `Contract Number` (FP4)

**Parameters**

- `record` **[Object][3]** The row received from parsed file

Returns **[String][6]**
Returns **[String][5]**

### getFrameworkProgramme

Preprocess `programme_name`
Seeks for values in the following precedence:

- `frameworkProgramme`
- `Framework Programme` (FP4)

**Parameters**

- `record` **[Object][3]** The row received from parsed file

Returns **[String][5]**

### getLocations

Expand Down Expand Up @@ -120,10 +152,99 @@ output => '1986-01-01T00:00:00.000Z';

Returns **[Date][7]** The date formatted into an ISO 8601 date format

### getProjectWebsite

Preprocess `project_website`

Input fields taken from the `record` are:

- `projectUrl` (FR1-3 + FP5-7)
- `Project Website` (FP4)

**Parameters**

- `record` **[Object][3]** The row received from parsed file

Returns **[String][5]**

### getStatus

Preprocess `status`

Input fields taken from the `record` are:

- `status` (FR1-3 + FP5-7)
- `Status` (FP4)

**Parameters**

- `record` **[Object][3]** The row received from parsed file

Returns **[String][5]**

### getThemes

Preprocess `themes`

Input fields taken from the `record` are:

- `Keywords` (FP4)
- `Subject` (FP4)

**Parameters**

- `record` **[Object][3]** The row received from parsed file

Returns **[String][5]**

### getProjectTitle

Preprocess `title`
Input fields taken from the `record` are:

- `title` (FR1-3 + FP5-7)
- `Project Title` (FP4)

**Parameters**

- `record` **[Object][3]** The row received from parsed file

Returns **[String][5]**

### getStartDate

Get starting date before formatting.

Input fields taken from the `record` are:

- `startDate` (FR1-3 + FP5-7)
- `Start Date`(FP4)

**Parameters**

- `record` **[Object][3]** The row received from parsed file

Returns **[String][5]**

### getEndDate

Get end date before formatting.

Input fields taken from the `record` are:

- `endDate` (FR1-3 + FP5-7)
- `End Date` (FP4)

**Parameters**

- `record` **[Object][3]** The row received from parsed file

Returns **[String][5]**

[1]: https://github.com/ec-europa/eubfr-data-lake/blob/master/services/ingestion/etl/cordis/csv/test/stubs/record.json
[2]: https://github.com/ec-europa/eubfr-data-lake/blob/master/services/ingestion/etl/cordis/csv/src/lib/transform.js
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
[5]: https://webgate.ec.europa.eu/CITnet/jira/browse/EUBFR-200?focusedCommentId=2808845&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-2808845
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[6]: https://webgate.ec.europa.eu/CITnet/jira/browse/EUBFR-200?focusedCommentId=2808845&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-2808845
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date
55 changes: 32 additions & 23 deletions services/ingestion/etl/cordis/csv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,35 @@

Model to compare with is available at: https://ec-europa.github.io/eubfr-data-lake/

| Field | Target |
| -------------------- | --------------------- |
| rcn | description |
| id, reference | project_id |
| acronym | description |
| status | status |
| programme | sub_programme_name |
| topics | description |
| frameworkProgramme | programme_name |
| title | title |
| startDate | timeframe.from |
| endDate | timeframe.to |
| projectUrl | project_website |
| objective | description |
| totalCost | budget.total_cost |
| ecMaxContribution | budget.eu_contrib |
| call | budget.mmf_heading |
| fundingScheme | funding_area |
| coordinator | third_parties.name |
| coordinatorCountry | third_parties.country |
| participants | third_parties.name |
| participantCountries | third_parties.country |
| subjects | |
| Field | Target |
| --------------------------------------------- | --------------------- |
| rcn, RCN | description |
| id, reference, Contract Number | project_id |
| acronym, Project Acronym | description |
| status | status |
| programme | sub_programme_name |
| topics | description |
| frameworkProgramme, Framework Programme (FP4) | programme_name |
| title, Project Title | title |
| startDate, Start Date | timeframe.from |
| endDate, End Date | timeframe.to |
| projectUrl | project_website |
| objective | description |
| totalCost, Total Cost | budget.total_cost |
| ecMaxContribution | budget.eu_contrib |
| call | budget.mmf_heading |
| fundingScheme, Activity Area | funding_area |
| coordinator | third_parties.name |
| coordinatorCountry | third_parties.country |
| participants | third_parties.name |
| participantCountries | third_parties.country |
| Keywords, Subject (FP4) | themes |
| subjects | |
| Duration (FP4) | |
| Date of Signature (FP4) | |
| Total Funding (FP4) | |
| Project Call (FP4) | |
| Contract Type (FP4) | |
| PGA | |
| Coordinator Country | |
| Contractor Country | |
Loading