From 6dd1fa5d3623f6c4fed7d74522c50cf0a3570ffc Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 29 Apr 2019 14:35:42 +0200 Subject: [PATCH] update test data --- integration/utils/ddo-metadata-generator.ts | 45 ++++++++++++++------- src/ddo/MetaData.ts | 7 +++- test/ddo/DDO.test.ts | 18 +++------ test/testdata/MetaData.ts | 11 +++-- test/testdata/ddo.json | 24 +++++++---- 5 files changed, 64 insertions(+), 41 deletions(-) diff --git a/integration/utils/ddo-metadata-generator.ts b/integration/utils/ddo-metadata-generator.ts index 03e2f06..741f97d 100644 --- a/integration/utils/ddo-metadata-generator.ts +++ b/integration/utils/ddo-metadata-generator.ts @@ -5,28 +5,43 @@ const metadata: Partial = { name: undefined, type: "dataset", description: "Weather information of UK including temperature and humidity", - dateCreated: "2012-02-01T10:55:11+00:00", + dateCreated: "2012-10-10T17:00:000Z", + datePublished: "2012-10-10T17:00:000Z", author: "Met Office", license: "CC-BY", copyrightHolder: "Met Office", - // tslint:disable-next-line - workExample: "stationId,latitude,longitude,datetime,temperature,humidity423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68", - files: [ - { - url: "https://raw.githubusercontent.com/oceanprotocol/squid-js/develop/package.json", - }, - { - url: "https://raw.githubusercontent.com/oceanprotocol/squid-js/develop/README.md", - }, - ], + workExample: "423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68", links: [ - {sample1: "http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-daily/"}, - {sample2: "http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-averages-25km/"}, - {fieldsDescription: "http://data.ceda.ac.uk/badc/ukcp09/"}, + { + sample1: "http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-daily/", + }, + { + sample2: "http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-averages-25km/", + }, + { + fieldsDescription: "http://data.ceda.ac.uk/badc/ukcp09/", + }, ], inLanguage: "en", - tags: "weather, uk, 2011, temperature, humidity", + categories: ["Economy", "Data Science"], + tags: ["weather", "uk", "2011", "temperature", "humidity"], price: 10, + files: [ + { + url: "234ab87234acbd09543085340abffh21983ddhiiee982143827423421", + checksum: "efb2c764274b745f5fc37f97c6b0e761", + contentLength: 4535431, + resourceId: "access-log2018-02-13-15-17-29-18386C502CAEA932", + }, + { + url: "234ab87234acbd6894237582309543085340abffh21983ddhiiee982143827423421", + checksum: "085340abffh21495345af97c6b0e761", + contentLength: 12324, + }, + { + url: "80684089027358963495379879a543085340abffh21983ddhiiee982143827abcc2", + }, + ], }, } diff --git a/src/ddo/MetaData.ts b/src/ddo/MetaData.ts index aea373a..294096b 100644 --- a/src/ddo/MetaData.ts +++ b/src/ddo/MetaData.ts @@ -87,14 +87,17 @@ export interface MetaDataBase { description?: string /** - * The date on which the asset was created by the originator in ISO 8601 format, Coordinated Universal Time. + * The date on which the asset was created by the originator in + * ISO 8601 format, Coordinated Universal Time. * @type {string} * @example "2019-01-31T08:38:32Z" */ dateCreated: string /** - * The date on which the asset DDO was registered into the metadata store. This value is created automatically by Aquarius upon registering, so this value can't be set. + * The date on which the asset DDO was registered into the metadata store. + * This value is created automatically by Aquarius upon registering, + * so this value can't be set. * @type {string} * @example "2019-01-31T08:38:32Z" */ diff --git a/test/ddo/DDO.test.ts b/test/ddo/DDO.test.ts index fa7f98f..562cfc8 100644 --- a/test/ddo/DDO.test.ts +++ b/test/ddo/DDO.test.ts @@ -93,19 +93,12 @@ describe("DDO", () => { name: "UK Weather information 2011", type: "dataset", description: "Weather information of UK including temperature and humidity", - size: "3.1gb", dateCreated: "2012-10-10T17:00:000Z", + datePublished: "2012-10-10T17:00:000Z", author: "Met Office", license: "CC-BY", copyrightHolder: "Met Office", - encoding: "UTF-8", - compression: "zip", - contentType: "text/csv", workExample: "423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68", - contentUrls: [ - "https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip", - "https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip", - ], links: [ { // tslint:disable-next-line @@ -120,19 +113,20 @@ describe("DDO", () => { }, ], inLanguage: "en", - tags: "weather, uk, 2011, temperature, humidity", + categories: ["Economy", "Data Science"], + tags: ["weather", "uk", "2011", "temperature", "humidity"], price: 10, files: [ { url: "234ab87234acbd09543085340abffh21983ddhiiee982143827423421", checksum: "efb2c764274b745f5fc37f97c6b0e761", - contentLength: "4535431", + contentLength: 4535431, resourceId: "access-log2018-02-13-15-17-29-18386C502CAEA932", }, { url: "234ab87234acbd6894237582309543085340abffh21983ddhiiee982143827423421", checksum: "085340abffh21495345af97c6b0e761", - contentLength: "12324", + contentLength: 12324, }, { url: "80684089027358963495379879a543085340abffh21983ddhiiee982143827abcc2", @@ -143,7 +137,7 @@ describe("DDO", () => { curation: { rating: 0.93, numVotes: 123, - schema: "Binary Votting", + schema: "Binary Voting", }, additionalInformation: { updateFrecuency: "yearly", diff --git a/test/testdata/MetaData.ts b/test/testdata/MetaData.ts index 50630a8..9a54b67 100644 --- a/test/testdata/MetaData.ts +++ b/test/testdata/MetaData.ts @@ -6,15 +6,17 @@ export const metadataMock: MetaData = { type: "dataset", description: "Weather information of UK including temperature and humidity", dateCreated: "2012-10-10T17:00:000Z", + datePublished: "2012-10-10T17:00:000Z", author: "Met Office", license: "CC-BY", copyrightHolder: "Met Office", workExample: "423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68", files: [ { + index: 0, url: "https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip", checksum: "085340abffh21495345af97c6b0e761", - contentLength: "12324", + contentLength: 12324, }, { url: "https://testocnfiles.blob.core.windows.net/testfiles/testzkp2.zip", @@ -34,17 +36,18 @@ export const metadataMock: MetaData = { }, ], inLanguage: "en", - tags: "weather, uk, 2011, temperature, humidity", + categories: ["Economy", "Data Science"], + tags: ["weather", "uk", "2011", "temperature", "humidity"], price: 10, checksum: "", }, curation: { rating: 0.93, numVotes: 123, - schema: "Binary Votting", + schema: "Binary Voting", }, additionalInformation: { - updateFrecuency: "yearly", + updateFrequency: "yearly", structuredMarkup: [ { uri: "http://skos.um.es/unescothes/C01194/jsonld", diff --git a/test/testdata/ddo.json b/test/testdata/ddo.json index 8272643..cd53e6b 100644 --- a/test/testdata/ddo.json +++ b/test/testdata/ddo.json @@ -166,18 +166,25 @@ "name": "UK Weather information 2011", "type": "dataset", "description": "Weather information of UK including temperature and humidity", - "size": "3.1gb", "dateCreated": "2012-10-10T17:00:000Z", "author": "Met Office", "license": "CC-BY", "copyrightHolder": "Met Office", - "encoding": "UTF-8", - "compression": "zip", - "contentType": "text/csv", "workExample": "423432fsd,51.509865,-0.118092,2011-01-01T10:55:11+00:00,7.2,68", "contentUrls": [ "https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip" ], + "files": [ + { + "index": 0, + "url": "https://testocnfiles.blob.core.windows.net/testfiles/testzkp.zip", + "checksum": "085340abffh21495345af97c6b0e761", + "contentLength": 12324 + }, + { + "url": "https://testocnfiles.blob.core.windows.net/testfiles/testzkp2.zip" + } + ], "links": [ { "name": "Sample of Asset Data", @@ -191,16 +198,17 @@ } ], "inLanguage": "en", - "tags": "weather, uk, 2011, temperature, humidity", + "categories": ["Economy", "Data Science"], + "tags": ["weather", "uk", "2011", "temperature", "humidity"], "price": 10 }, "curation": { "rating": 0.93, "numVotes": 123, - "schema": "Binary Votting" + "schema": "Binary Voting" }, "additionalInformation": { - "updateFrecuency": "yearly", + "updateFrequency": "yearly", "structuredMarkup": [ { "uri": "http://skos.um.es/unescothes/C01194/jsonld", @@ -215,4 +223,4 @@ } } ] -} \ No newline at end of file +}