Skip to content

Fix schemaorg-grammar subclass handling for priceSpecification range checks#20

Merged
ziodave merged 1 commit intomainfrom
fix/schemaorg-price-spec-subclass-range
Apr 17, 2026
Merged

Fix schemaorg-grammar subclass handling for priceSpecification range checks#20
ziodave merged 1 commit intomainfrom
fix/schemaorg-price-spec-subclass-range

Conversation

@ziodave
Copy link
Copy Markdown
Member

@ziodave ziodave commented Apr 17, 2026

Summary

  • fix false-positive Schema.org range check: priceSpecification. warnings when the value is a valid subclass (for example schema:UnitPriceSpecification)
  • add a bundled schema.org subclass ontology (rdfs:subClassOf) used to resolve subclass relationships during issue extraction
  • apply the same subclass-aware filtering in both validation issue extraction and graph-audit schema compliance extraction
  • add regression tests for positive and negative priceSpecification range behavior and graph-audit coverage of the case

Why

Bluehost case artifacts reproduced a warning for:

  • Offer -> priceSpecification -> UnitPriceSpecification

That should be treated as valid subclass usage.

Implementation Notes

  • kept validator behavior scoped: no global ontology inference changes for all shapes
  • instead, filter only schema.org grammar range-check warnings when the warning value type is a subclass of the expected class from the source shape

Tests

  • uv run pytest tests/test_product_snippet_validation.py -k schemaorg_grammar_price_specification -q
  • uv run pytest tests/test_graph_audit.py -k "unit_price_specification_no_range_warning or auditor_uses_schema_validation_for_rich_snippets" -q
  • uv run python tests/tools/run_slice_tests.py graph -- -q
  • uv run python tests/tools/run_slice_tests.py validation -- -q

@ziodave ziodave merged commit 11e5f5d into main Apr 17, 2026
11 checks passed
@ziodave ziodave deleted the fix/schemaorg-price-spec-subclass-range branch April 17, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant