-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Truncate description field in injected JSON-LD to 5000 characters #1899
Comments
As mentioned in DataONEorg/dataone#12 (comment), we should also pad descriptions that are too short. Something like "For complete metadata, visit..." would do the trick. |
Right now, the logic for managing JSON-LD is spread across multiple views:
If we want to add the general functionality to truncate or pad descriptions, we would need to add this logic in multiples places. So the first step is to consolidate the JSON-LD logic into a single model and view. Then we can add the functionality to truncate or pad descriptions in a single place. |
- Model can handle Dataset and DataCatalog types, and can import attributes from a template string. - Model includes methods for truncating or padding descriptions to meet Google's requirements. - Add unit tests for the model. Issue #1899
- Remove logic for creating and inserting schema.org JSON-LD from AppView, DataCatalogView, MetadataView, and CatalogSearchView. - Use the SchemaOrg model that is set on the MetacatUI.AppView instead. - Move the jsonLD template importing to the SchemaOrgView. - Use the jsonLD template content in jsonLD tag as default for non-dataset and non-dataCatalog pages. Issue #1899
@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 thedescription
field. We then noticed that Google specifies that thedescription
field should be between 50 and 5000 characters: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.
The text was updated successfully, but these errors were encountered: