Skip to content

Truncate description field in injected JSON-LD to 5000 characters #1899

@amoeba

Description

@amoeba

@mbjones noted a few of our datasets on arcticdata.io were failing Google's schema:Dataset validation due to "Invalid string length in field "description". When we go into the Search Console, we can see that Google is seeing the description field. We then noticed that Google specifies that the description field should be between 50 and 5000 characters:

The summary must be between 50 and 5000 characters long.

From: https://developers.google.com/search/docs/advanced/structured-data/dataset#dataset

In at least one of the offending documents, the abstract is 5779 characters so the above rule seems like a likely cause for the failed validation. Let's truncate the description field to 5000 characters for all records and hopefully these errors will go away.

Metadata

Metadata

Labels

bugjsonldAdding JSON-LD to MetacatUI pages

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions