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).

Comments

KarenS created an issue. See original summary.

karens’s picture

StatusFileSize
new828.22 KB

Here's a start.

karens’s picture

StatusFileSize
new2.93 MB

Saving the current state of the work.

karens’s picture

Status: Active » Needs review
StatusFileSize
new2.93 MB

I think this is close, going to see if tests pass.

Status: Needs review » Needs work

The last submitted patch, 4: 3160191-4-schema-client.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

karens’s picture

Status: Needs work » Needs review
StatusFileSize
new1.7 MB
karens’s picture

StatusFileSize
new1.69 MB

Status: Needs review » Needs work

The last submitted patch, 7: 3160191-7-schema-client.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

karens’s picture

Status: Needs work » Needs review
StatusFileSize
new1.69 MB
karens’s picture

StatusFileSize
new2.16 MB
karens’s picture

StatusFileSize
new2.03 MB
karens’s picture

StatusFileSize
new2.05 MB
karens’s picture

StatusFileSize
new2.05 MB
karens’s picture

Title: Pull object types from schema.org » Create ProperyType plugin, pull object types from schema.org, and make configuration alterable.

This evolved into a bigger project than it started out as. See updated text above.

karens’s picture

Issue summary: View changes
karens’s picture

StatusFileSize
new2.13 MB

I'm starting a new branch for this.

karens’s picture

StatusFileSize
new2.13 MB

Start some API information.

  • KarenS committed 36f9a4b on 8.x-2.x
    Issue #3160191 by KarenS: Create ProperyType plugin, pull object types...
karens’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
karens’s picture

Status: Needs review » Fixed

Committed to the new 8.2 branch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.