-
Notifications
You must be signed in to change notification settings - Fork 0
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
b/2531 fix license resolution service url and missing extent/theme #11
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,7 @@ describe('formatDcatDataset', () => { | |
const expected = { | ||
'@type': 'dcat:Dataset', | ||
identifier: `${siteUrl}/datasets/00000000000000000000000000000000_0`, | ||
license: null, | ||
license: '', | ||
landingPage: `${siteUrl}/datasets/00000000000000000000000000000000_0`, | ||
title: 'DCAT_Test', | ||
description: 'Some Description', | ||
|
@@ -162,7 +162,7 @@ describe('formatDcatDataset', () => { | |
const expected = { | ||
'@type': 'dcat:Dataset', | ||
identifier: `${siteUrl}/datasets/00000000000000000000000000000000_0`, | ||
license: null, | ||
license: '', | ||
landingPage: `${siteUrl}/datasets/00000000000000000000000000000000_0`, | ||
title: 'DCAT_Test', | ||
description: 'Some Description', | ||
|
@@ -251,7 +251,7 @@ describe('formatDcatDataset', () => { | |
const expected = { | ||
'@type': 'dcat:Dataset', | ||
identifier: `${siteUrl}/datasets/00000000000000000000000000000000_0`, | ||
license: null, | ||
license: '', | ||
landingPage: `${siteUrl}/datasets/00000000000000000000000000000000_0`, | ||
title: 'DCAT_Test', | ||
description: 'Some Description', | ||
|
@@ -342,7 +342,7 @@ describe('formatDcatDataset', () => { | |
const expected = { | ||
'@type': 'dcat:Dataset', | ||
identifier: `${siteUrl}/datasets/00000000000000000000000000000000_0`, | ||
license: null, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @drspacemanphd I changed license to be null instead of '' for an issue a couple months ago. Are we sure we want to go back? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After reviewing, the switch to null was a style preference on Tate's part, not a product requirement. I'm fine to leave this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not really a style thing on my part. It all comes down to the DCAT harvesters. Thomas told me that they seemed to prefer Another thing to be aware of is that when you have a JSON-LD node, sometimes the entire node should be removed when one of the values isn't available. E.g. "foo": {
"@id": "dct:somekey",
"importantValue": null
} I think |
||
license: '', | ||
landingPage: `${siteUrl}/datasets/00000000000000000000000000000000_0`, | ||
title: 'DCAT_Test', | ||
description: 'Some Description', | ||
|
@@ -437,7 +437,7 @@ describe('formatDcatDataset', () => { | |
const expected = { | ||
'@type': 'dcat:Dataset', | ||
identifier: `${siteUrl}/datasets/00000000000000000000000000000000_0`, | ||
license: null, | ||
license: '', | ||
landingPage: `${siteUrl}/datasets/00000000000000000000000000000000_0`, | ||
title: 'DCAT_Test', | ||
description: 'Some Description', | ||
|
@@ -535,7 +535,7 @@ describe('formatDcatDataset', () => { | |
expect(actual.license).toEqual(expectedLicense); | ||
}); | ||
|
||
it('license should be empty when structuredLicense.url is unavailable', () => { | ||
it('license should use licenseInfo when structuredLicense.url is unavailable', () => { | ||
const dataset = { | ||
owner: 'fpgis.CALFIRE', | ||
created: 1570747289000, | ||
|
@@ -565,13 +565,13 @@ describe('formatDcatDataset', () => { | |
structuredLicense: { text: 'structuredLicense text' }, | ||
licenseInfo: 'licenseInfo text', | ||
}; | ||
const expectedLicense = null; | ||
const expectedLicense = 'licenseInfo text'; | ||
|
||
const actual = JSON.parse(formatDcatDataset(dataset, siteUrl, buildDatasetTemplate())); | ||
expect(actual.license).toEqual(expectedLicense); | ||
}); | ||
|
||
it('license should display null when structuredLicense is unavailable', () => { | ||
it('license should display empty string when neither structuredLicense nor licenseInfo are available', () => { | ||
const dataset = { | ||
owner: 'fpgis.CALFIRE', | ||
created: 1570747289000, | ||
|
@@ -598,9 +598,8 @@ describe('formatDcatDataset', () => { | |
wkid: 3310, | ||
}, | ||
}, | ||
licenseInfo: 'licenseInfo text', | ||
}; | ||
const expectedLicense = null; | ||
const expectedLicense = ''; | ||
|
||
const actual = JSON.parse(formatDcatDataset(dataset, siteUrl, buildDatasetTemplate())); | ||
expect(actual.license).toEqual(expectedLicense); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about the
theme
property mentioned in the issue?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently this comes along with extent