Skip to content

Commit ec6d304

Browse files
committed
Merged in task/dspace-cris-2023_02_x/DSC-2121 (pull request DSpace#3058)
Task/dspace cris 2023 02 x/DSC-2121
2 parents 8c6a0a6 + e27b86e commit ec6d304

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/app/core/metadata/schema-json-ld/schema-types/product/product-creative-work-schema-type.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { isNotEmpty } from '../../../../../shared/empty.util';
12
import { Item } from '../../../../shared/item.model';
23
import { SchemaType } from '../schema-type';
34
import { schemaJsonLDForEntity } from '../schema-type-decorator';
@@ -6,6 +7,11 @@ import { schemaJsonLDForEntity } from '../schema-type-decorator';
67
export class ProductCreativeWorkSchemaType extends SchemaType {
78

89
protected createSchema(item: Item): Record<string, any> {
10+
11+
const description: string|string[] = isNotEmpty(SchemaType.getMetadataValue(item, 'dc.description')) ?
12+
SchemaType.getMetadataValue(item, 'dc.description') :
13+
SchemaType.getMetadataValue(item, 'dc.description.abstract');
14+
915
return {
1016
'@context': 'https://schema.org',
1117
'@type': 'CreativeWork',
@@ -18,6 +24,7 @@ export class ProductCreativeWorkSchemaType extends SchemaType {
1824
'inLanguage': SchemaType.getMetadataValue(item, 'dc.language.iso'),
1925
'genre': SchemaType.getMetadataValue(item, 'dc.subject'),
2026
'abstract': SchemaType.getMetadataValue(item, 'dc.description.abstract'),
27+
'description': description,
2128
'funding': SchemaType.getMetadataValue(item, 'dc.relation.funding'),
2229
'sponsor': SchemaType.getMetadataValue(item, 'dc.description.sponsorship')
2330
};

0 commit comments

Comments
 (0)