Skip to content

Generate only schema.org and OpenActive terms from the schema.org vocabulary - #70

Merged
howaskew merged 1 commit into
masterfrom
fix/skip-non-schema-classes
Oct 21, 2026
Merged

howaskew merged 1 commit into
masterfrom
fix/skip-non-schema-classes

Conversation

@howaskew

Copy link
Copy Markdown
Contributor

Summary

Since data-models 3.0.10 (schema.org 30.1), the generated model libraries are broken. Recent schema.org releases also declare classes and properties from other vocabularies that schema.org terms are mapped to (snomed:, gs1:, dct:, og:, unece:, fibo-* and others: 77 classes and about 156 properties). The vocabulary in data-models 3.0.9 had none. The generators turn them into library code:

Library Problem
TypeScript Classes named after SNOMED codes, e.g. src/oa/63653004.ts: the build fails with 147 errors
Ruby The same numeric classes fail the syntax/lint step
PHP Numeric class names (63653004.php: "unexpected integer"), and PropertyEnumeration.php defines Description three times (schema:, dct:, gs1:/og: description)
.NET PropertyEnumeration.cs has 45 duplicate member names (Address, Audience, ContactPoint, …)

Changes

  • When reading the schema.org vocabulary, skip classes and properties that are not schema: terms.
  • Remove links from schema.org classes to the skipped parent classes (ten schema.org classes now have external parents, e.g. schema:Brand → cmns-cls:Classifier); without this, resolving primary parents never completes. schema:DataType → rdfs:Class, which predates these releases, is unaffected.
  • Build the property enumeration from schema.org and OpenActive properties only, as its own description says.

OpenActive extensions (beta, test interface) are not affected.

Verification

Generated locally against data-models 3.0.10 and the current beta namespace:

Check Result
Generated files compared with a data-models 3.0.9 run Only additions, all matching schema.org terms; the one removal is Quantity, which schema.org 30.1 turned into a data type
TypeScript, built in models-ts with npm run build 3 errors, all in src/test/data-models-examples/ spec files; the same 3 errors occur with data-models 3.0.9 and the current models-lib
Ruby, ruby -c on all generated files 1,091 files, no errors
PHP, php -l on all generated files Only Class.php and Float.php fail (reserved words); the same with data-models 3.0.9
.NET PropertyEnumeration.cs No duplicate member names (45 before)

When merged

Re-run the "Update Data Model" workflow in OpenActive.NET, models-php, models-ruby and models-ts; they check out this repository's default branch. The pre-existing issues above (models-ts example specs, PHP Class/Float) are separate.

…abulary

Recent schema.org releases (since data-models 3.0.10, which uses 30.1)
also declare classes and properties from other vocabularies that
schema.org terms are mapped to, such as snomed:, gs1:, dct:, og:,
unece: and fibo-*. data-models 3.0.9's vocabulary had none.

The generators turned them into library code, which broke every
library:

- classes named after SNOMED codes (e.g. "63653004") are invalid in
  TypeScript, PHP and Ruby
- dct:description, gs1:description and og:description produce
  duplicate "Description" members in the property enumeration (45
  duplicates in C#, 3 duplicate constants in PHP)

Skip non-schema.org classes and properties when reading the schema.org
vocabulary, drop links from schema.org classes to the skipped parent
classes (otherwise resolving primary parents never completes), and keep
only schema.org and OpenActive properties in the property enumeration.

Against data-models 3.0.10 the generated libraries now differ from 3.0.9
only by new schema.org terms (and schema:Quantity, which schema.org 30.1
turned into a data type).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@howaskew
howaskew requested a review from hkir-dev October 21, 2026 10:02
@howaskew
howaskew merged commit a89f892 into master Oct 21, 2026
4 checks passed
@howaskew
howaskew deleted the fix/skip-non-schema-classes branch October 21, 2026 12:12
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.

2 participants