Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It'd help to understand what's complete and incomplete if we had a table of all of the schema.org attributes for each object currently supported.
Comment | File | Size | Author |
---|---|---|---|
#10 | schema-audit-2937846.patch | 791.02 KB | KarenS |
| |||
#8 | schema-audit-2937846.patch | 791.01 KB | KarenS |
Comments
Comment #2
KarenS CreditAttribution: KarenS at Lullabot commentedThinking out loud. Rather than a manually-maintained table in a documentation page, which will probably be wrong and out of date as soon as it's posted, I'd like to see some sort of self-documentation, where you use the plugin system to discover a list of groups and tags that are provided and spit out a list. That list could be generated by any site that has all the modules enabled and copied or linked to in some way. I'm open to ideas.
Comment #3
ChristophWeber CreditAttribution: ChristophWeber as a volunteer and at BIZX LLC commentedI like that idea. It would not need to be a site with all schema_metatag modules enabled, just the code base installed and daily updates via cronjobs running git, composer or drush. Then have a small custom module crawl through the schemas and tags and list what's found. In fact. said site could contain the current stable releases of 8.x-1.x and 7.x-1.x, and HEAD for both from git, and list supported schemas and tags for all of them.
However, documenting what is complete or not is a fool's errand, as schema.org and Google's validator are both moving targets.
Comment #4
DamienMcKennaI love it.
If we could add something to crawl schema.org too we could also build a giant todo list of what's left to be done =)
Comment #5
thejimbirch CreditAttribution: thejimbirch as a volunteer commentedI like the idea of automating the list of supported and not-yet-supported schemas.
Comment #6
KarenS CreditAttribution: KarenS at Lullabot commentedThe source data is available at https://github.com/schemaorg/schemaorg/blob/master/data/releases/3.3/sch.... You can get the attributes for a class at a url like http://schema.org/Person.jsonld.
Comment #7
KarenS CreditAttribution: KarenS at Lullabot commentedI have a module (not yet committed) that can retrieve all the Schema.org info. So I've figured that part out.
Trying to identify which of those items is supported is more complicated than you might think. If the modules aren't enabled they won't be discovered. Even if enabled, we have modules that support some of the Schema.org objects but we also have base classes that support objects. Both have objects and properties but they don't look the same, and they're different in D7 and D8. So I see no easy way to identify them.
On top of that I can't decide how to display the results, it will be a gigantic list or a gigantic table that might have to be paged. If I could figure all that out it might be a matter of creating the table in a working site and then copy/pasting it into the documentation, then updating it periodically.
Comment #8
KarenS CreditAttribution: KarenS at Lullabot commentedGot something working. The Schema Audit module creates a custom page where you can see the table at admin/config/development/schema-metatag.
Comment #10
KarenS CreditAttribution: KarenS at Lullabot commentedOops, left a typo in that.
Comment #12
KarenS CreditAttribution: KarenS at Lullabot commentedThis includes three clients, once to process Schema.org data, one to process Google's data, and one to process Drupal data. I gave up on the Google one, there is no easy way to collect a list of their requirements. All you can do is scrape their pages and the pages aren't even organized in a consistent way.
I collect Drupal data from the Drupal.org repository, so it will be the same and current no matter what is in your repository and what is enabled. I use DomDocument to navigate the repository pages and pull the data in.
For Schema.org, there are rest endpoints for each object but none that give you a list of all possible objects to start with. Their Github repository has a jsonld download page that has all the data for all objects and properties, so I copied that into the module and I process that file. That file can be replaced periodically to stay current with changes on Schema.org.
This table tells you which objects and properties are created by Drupal 8 modules. There are more if you look at the base classes, but I ignored that for now. I also tried to put in place a way this could be tweaked to get Drupal 7 data, but I didn't try to get that working for now.
Enable Schema Audit (in the Development section), they there is a link to the audit page under config > development.
Comment #13
ChristophWeber CreditAttribution: ChristophWeber as a volunteer and at BIZX LLC commentedNice! I have updated https://www.drupal.org/docs/8/modules/schemaorg-metatag/schemaorg-coverage
I think the report page would have a better home under /admin/reports, but that's just me.
Comment #14
KarenS CreditAttribution: KarenS at Lullabot commentedI picked dev to indicate this is something you would only enable on dev, not prod.
Comment #15
KarenS CreditAttribution: KarenS at Lullabot commentedJust a note for anyone following this issue, I added in coverage for the base classes as well. I had to hard-code that part but at least the report now reflects all the objects that are covered.
Comment #17
KarenS CreditAttribution: KarenS at Lullabot commentedAnd now I've added in a comparison for the items that Google wants/uses. It's rough but gets some of that data into the table.