I found a much better way to architect this code, a way that maps more naturally to the way Schema.org is organized. Instead of having a bunch of custom code for all kinds of tag base classes, there is just one base class, SchemaNameBase. I created a PropertyType plugin that creates property types that map one to one to Schema.org property types. Then the tag configuration just requires that you identify which property type you want to use for your tag. So you can "plug" the code together by creating tag plugins that map to property type plugins.
None of the tags or property type plugins have any custom code, they just consist of configuration. And the configuration can be overridden using plugin alter hooks.
It all seems to be backwards compatible if I retain the original base classes which have been updated to use the new plugins.
I added a service to parse the Schema.org code:
- Expand all the places that allow a selection of types to include all types at that level or below instead of limiting selection to just a few objects. There are currently several outstanding issues asking for something that amounts to just adding more options to one or another of the @type lists.
- Keep the lists in sync with schema.org since they periodically add things we might miss (like the recently added SpecialAnnouncement for Covid 19 data).
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 3160191-17-schema-client.patch | 2.13 MB | karens |
| #16 | 3160191-16-schema-client.patch | 2.13 MB | karens |
| #13 | 3160191-13-schema-client.patch | 2.05 MB | karens |
| #12 | 3160191-12-schema-client.patch | 2.05 MB | karens |
| #11 | 3160191-11-schema-client.patch | 2.03 MB | karens |
Comments
Comment #2
karens commentedHere's a start.
Comment #3
karens commentedSaving the current state of the work.
Comment #4
karens commentedI think this is close, going to see if tests pass.
Comment #6
karens commentedComment #7
karens commentedComment #9
karens commentedComment #10
karens commentedComment #11
karens commentedComment #12
karens commentedComment #13
karens commentedComment #14
karens commentedThis evolved into a bigger project than it started out as. See updated text above.
Comment #15
karens commentedComment #16
karens commentedI'm starting a new branch for this.
Comment #17
karens commentedStart some API information.
Comment #19
karens commentedComment #20
karens commentedCommitted to the new 8.2 branch.