Closed clnsmth closed 1 month ago
The recent commit 0631e98d3ec064a157f8bfd6cbd93b1ce45ffb3f introduced a potential issue where overriding an imported class method could lead to unexpected behavior in the SEO service.
To mitigate this risk, we propose the following solution:
seo.webapp.schema_org
module.soso.main.convert
using the kwargs
parameter to overwrite them.This approach provides more control and flexibility, reducing the dependency on the soso
package's current implementation.
Long-term, we recommend the soso
package adopts a factory pattern to allow for customization without directly modifying imported classes.
Introduction
Recent changes to data package landing pages involving Schema.org markup adoption from Science On Schema.Org (SOSO) v1.3.2 (see https://github.com/PASTAplus/seo/issues/7) introduced
distribution
properties describing data download methods. We have since encountered occasional warnings from Google page harvests for missingencodingFormat
in some data entity distributions.The Issue
Missing
encodingFormat
indistribution
is non-critical, but items might lack features or be less optimized for search. While non-critical, the accumulation of warnings may obscure other more important warnings.Addressing the Issue
The preferred solution is outlined in https://github.com/clnsmth/soso/issues/198. We've chosen to additionally implement a default
encodingFormat
ofapplication/octet-stream
to ensure it's always present.Implementation Details
soso.strategies.eml.EML.get_distribution
method.None
value returned bysoso.strategies.eml.get_data_entity_encoding_format
.application/octet-stream
will be set.soso
package to handle uncommon encoding formats while maintaining the local preference forapplication/octet-stream
as the default.Benefits
encodingFormat
.Considerations