schema icon indicating copy to clipboard operation
schema copied to clipboard

Updated to use latest version of schema.org (v26.0)

Open FahadYousafMahar opened this issue 1 year ago • 3 comments

This commit introduces changes to generate-schema.php  to allow reading and parsing of schema.jsonld for latest release of schema.org (v26.0).

The changes inside src/Interfaces/ are the new and updated Interfaces for Schema Things.

  • There are 284 new Interfaces which have been made.
  • There are 620 Interfaces which have been modified.

Background for this commit:

I was working on a scraping function in one of our apps, whose purpose was to scrape a any given url and to create a preview card using the meta tags and schema.org json. I encountered some websites of News Media Organizations whose data wasn't getting properly parsed by this package. When I dug deeper into the cause, I learnt that this package didn't have interface for new schema types and many old interfaces had obsolete properties. Therefore, I updated the script and used it on latest schema.jsonld

Now, the package will be parsing all new schema types.

FahadYousafMahar avatar Apr 04 '24 09:04 FahadYousafMahar

Hi, thanks your PR. Indeed, schema.org types have not been updated in a while.

I cannot run generate-schema.php against this file: https://schema.org/version/latest/schemaorg-current-http.jsonld

Did you use another file? Did you make any changes to generate-schema.php to make it work, that are not part of your PR?

BenMorel avatar Aug 27 '25 21:08 BenMorel

I see they've resturcured the jsonLD files in newer releases. You can see the file I used for it at: schemaorgcontext.jsonld used for generate-id-properties.php schemaorg-all-https.jsonld used for generate-schema.php

FahadYousafMahar avatar Aug 28 '25 07:08 FahadYousafMahar

Thank you for the links. I cannot get these files to work either:

Fatal error: Uncaught TypeError: cleanupComment(): Argument #1 ($comment) must be of type string, array given, called in /src/brick/schema/generate-schema.php on line 42 and defined in /src/brick/schema/generate-schema.php:67

I tried with earlier versions up to 9.0, same issue.

BenMorel avatar Aug 28 '25 10:08 BenMorel