Preamble
I've been discussing and committed to a Schema.org-first approach to building content models in Drupal for several years. Along the way, someone described Schema.org as "food for machines."
Originally, for Schema.org "machines" meant search engines; now it definitely means AIs and LLMs. Defining and generating accurate, well-structured Schema.org JSON-LD for a website is challenging and often treated as an afterthought. Even if you use my Schema.org Blueprints to create a Schema.org-first content model, it still requires significant work to set up and maintain.
AI can analyze vast amounts of information and provide instant answers to complex questions, or complete challenging tasks within minutes. Last year, I began to see how one could prompt an AI to recommend the ideal Schema.org JSON-LD markup by providing URLs to example content and linking to the appropriate Schema.org types and properties. Keep in mind that the LLMs behind AIs understand every public webpage and actively examine every piece of Schema.org markup on the web.
AIs are experts at creating the food (aka Schema.org markup) they need to consume and digest.
This realization led me to the notion that in Drupal, we can leverage our existing AI modules and tools to have AIs generate Schema.org JSON-LD markup for content with as little as a well-thought-out prompt.
Before I introduce you to my AI Schema.org JSON-LD module, three things need to be stated immediately and will be addressed in this post and a follow-up.
First, for everyone, this module addresses a paradigm shift, showing that it is important to provide food for an AI without a complex recipe or meal preparation.
Second, for developers, this entire module was built using AI with a human in the loop.
Finally, for site builders and owners, embracing AI can help us better understand our content, making it more adaptable and optimized for AI consumption.
The remainder of this post is directly copied from the module's project page, with the understanding that additional posts are needed to cover the implications of this module for developers, such as myself, and for site builders and owners.
About this module
The AI Schema.org JSON-LD module provides a straightforward way to send a prompt that includes a webpage's content and data, along with instructions and requirements, to an AI provider and to receive a valid Schema.org JSON-LD response for saving and embedding in a webpage.
This AI Schema.org JSON-LD module is a "glue module" that combines AI Automators, Field Widget Actions, and JSON Field to create an AI-powered 'Schema.org JSON-LD' field for content entities.
What does this module do?
This module adds a 'Schema.org JSON-LD' field, a native JSON data type, to content entities, including nodes, media, and taxonomy terms. The 'Schema.org JSON-LD' field is populated by an AI automator using a Field Widget Action, which sends the entity's content and data in a prompt to an AI provider. The AI provider returns the Schema.org JSON-LD for the content, which the content author reviews, saves, and embeds in the content's webpage. Additionally, a sub-module can be enabled to log prompts and responses so that they can be reviewed and improved by humans and AIs.
What are the benefits of this module?
The AI Schema.org JSON-LD module
- Provides a straightforward way to generate Schema.org JSON-LD for content using AI.
- Demonstrates a reusable, replicable pattern for configuring AI automators with field widget actions.
- Focuses on a prompt-and-response workflow with logging for generating Schema.org JSON-LD.
- Stores Schema.org JSON-LD as native JSON data, creating a fully queryable knowledge graph for a website.
- Allows both old and new sites with complex nested structures, such as paragraphs and components, to have AI parse and generate structured data.
How to set up this module?
- Install the module as you would any other Drupal module.
- Configure a default AI provider. (/admin/config/ai/providers).
- Decide which entity types and bundles should include Schema.org JSON-LD via the UI, Drush, or a Drupal recipe (/admin/config/ai/schemadotorg-jsonld).
- Experiment with and customize the prompts to get the best Schema.org JSON-LD response from the AI provider.
How should one implement this module?
For each content type, have the AI recommend the appropriate Schema.org JSON-LD for your existing content or for similar content on the web. When working with the AI, cite types and properties directly from Schema.org. Also include articles, recommendations, and examples from Google Structured Data.
Once you have the ideal Schema.org JSON-LD, have the AI adjust your prompt. Test your prompt across different models. Download the logged prompts and responses for an SEO/AEO export review, or ask an AI to further optimize your prompts.
What is the philosophy and concept behind this module?
Use AI to build a tool that helps AI understand your website while always keeping a human in the loop."
Similar and related modules
The most distinguishing aspect of this module is that it relies heavily on the Drupal AI ecosystem, which includes AI Automators and Field Widget Actions, which, in turn, enable sending simple prompts to an AI provider and receiving Schema.org JSON-LD.
Here are similar modules that generate Schema.org JSON-LD with AI.
Helps site builders and content editors add schema.org JSON-LD structured data to a Drupal site without writing JSON by hand.
Bring AI automation to your Drupal metatags.
Here are more traditional modules for creating Schema.org JSON-LD without AI
Provides a set of tools to create perfect data structures (Schema.org), pristine APIs (JSON:API), and great SEO (JSON-LD) within the best content authoring and administration user experience.
Extends Drupal's Metatag module to display structured data as JSON-LD in the head of web pages.
How should you contribute?
Contributing to the code
This module was built using coding agents such as Claude and Codex. Therefore, we encourage the use of these tools to build and maintain this module. That said, all contributed code must include test coverage and be reviewed by humans.
Join the Drupal AI Learner Club to master how best to use AI coding agents with Drupal.
Contributing to the prompts
As a community, we need to determine the best default prompts with guidelines/requirements for generating pristine Schema.org JSON-LD. As LLMs improve, AI-generated Schema.org JSON-LD will continue to improve.
One of the biggest contributions someone could make is experimenting with crafting the ideal prompt and sharing the experience.
Postamble
Ironically, the AI Schema.org JSON-LD module is a fairly simple concept to understand: it "uses AI to build a tool that helps AI understand your website".
With an AI coding agent that has agentic skills, I created a module in 4 days that surpasses my 4 years of work on the Schema.org Blueprints module. The AI wrote better code with higher test coverage. I have to accept that "AI ate my work, and I need to be okay with that."
Having an AI-generated, adaptable Schema.org knowledge graph that helps AIs understand our content is a major win for SEO/AEO and general content management. We also need to recognize that "AI is going to eat our websites, and we need to prepare for that."
I will be discussing these implications for developers and websites in future blog posts.
As a developer or site owner, how are you implementing AI tools and preparing for how AI accesses and understands your content?
For now, I hope that you find the AI Schema.org JSON-LD module useful, that it gives you some food for thought, and that it helps you feed the machines.