1+ import { isNotEmpty } from '../../../../../shared/empty.util' ;
12import { Item } from '../../../../shared/item.model' ;
23import { SchemaType } from '../schema-type' ;
34import { schemaJsonLDForEntity } from '../schema-type-decorator' ;
@@ -6,6 +7,11 @@ import { schemaJsonLDForEntity } from '../schema-type-decorator';
67export 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