On adding structured data to this website

In the limbo of waiting for what's in the cards with an upcoming re-org and the yearly planning, I've been playing with some tech, because why not.

Before getting into it, though, I just want to make a personal statement about AI[^1] as in my circles there's a lot of skepticism about it, in particular LLMs – and rightly so for the social, ecological and economical impact of it all.

Whilst I'm not an AInthusiast, I believe that for the most part the very real problems on people's radar are "technical" problems, and, as such, problems that can and will be resolved, whilst the technology has a huge potential, if used right[^2].

The one problem that worries me the most, though, is[^3] "who owns the means of production": the world AI is shaping is a terrifying landscape of richer folks getting richer and poorer folks getting poorer. And I don't see any type of technical advancement that could sort this out, as it's mostly a political problem, and politics is not ready to deal with anything moving at this pace – they still haven't figured out digital currencies 😒.

So there's that, but that doesn't mean that the technology is bad per se. Many of the technologies that shape the world today were born for military advancement, and yet today we use them for cat pics. But the Western world moved resources from public to private investment, and here we are.

And that's what is making me uncomfortable[^4].

With that in mind, without any further ado[^5]...

A while back I blocked all the AI bots from this website[^6], but then I realised that I don't care if my content gets read by bots. It's a personal blog after all, I'm not sharing any key reusable information, and when I found a good rationale for letting a bot access my content I decided to embrace it.

I asked Perplexity to recommend a movie given my ratings and reviews, and it couldn't. I was surprised, since I had lifted my AI agents block, but it turns out that not only there were quite a few accessibilities issues in my markup when it came to rating, but also that Perplexity struggled with dealing with the UI.

So I rethought about structured data, and I provided both inline and as dedicated json+ld schema.org content, for movies, books and music.

Generating the files in Astro is very straightforward:

// src/pages/schemas/movies.jsonld.js

import { getCollection } from "astro:content"
import { movieSchema } from "~/schemas/movies"

export async function GET() {
const movies = await getCollection("movies")

return new Response(
JSON.stringify({
"@context": "https://schema.org",
"@graph": movies.map(({ data: movie }) => movieSchema(movie, movie.review)),
}),
{
headers: {
"Content-Type": "application/ld+json",
},
},
)
}

// src/schemas/movies.js

import { schemaDate } from "~/utils/date-helpers"
import { withCdn } from "~/utils/cdn"
import { getEntry } from "astro:content"

const { data: settings } = await getEntry("meta", "settings")

export function movieSchema(item, review) {
return {
"@type": "Review",
itemReviewed: {
"@type": "Movie",
name: item.title,
dateCreated: item.year,
image: withCdn(item.cover, "standard"),
url: `${settings.url}/movies/${item.slug}/`,
},
reviewRating: {
"@type": "Rating",
ratingValue: item.rating / 2,
worstRating: 0.5,
bestRating: 5,
},
author: {
"@type": "Person",
name: "cedmax",
},
datePublished: schemaDate(item.watched),
...(review ? { reviewBody: review.replace(/<[^>]*>/g, "").trim() } : {}),
}
}

./src/schemas/books.js

And for discoverability purposes I used a mix of standards and emerging standards:

this header in my HTML page:




and /llms.txt

# cedmax.net

> Personal website for [cedmax](https://cedmax.net/me/). Engineering leadership, Londoner, former pixel pusher & conference organiser. An optimist with a plan B. He / Him.

# Structured Data

- [Movie Reviews](https://cedmax.net/schemas/movies.jsonld): Movie reviews and ratings (JSON-LD, Schema.org Review format)
- [Book Reviews](https://cedmax.net/schemas/books.jsonld): Book reviews and ratings (JSON-LD, Schema.org Review format)
- [Music Playlists](https://cedmax.net/schemas/music.jsonld): Music charts, songs liked and earworms and curated playlists (JSON-LD, Schema.org MusicPlaylist and Rating format)

With this in place, Perplexity was able to offer some insightful movie suggestions:

Colossal (2016) - Independent sci-fi dramedy with Anne Hathaway about an unemployed woman who discovers a connection to a giant monster in Seoul. Given your appreciation for Safety Not Guaranteed and genre-bending indies, this should appeal to you.

The Vast of Night (2019) - Retro sci-fi gem with excellent reviews and low budget. Matches your interest in Coherence and intelligent sci-fi.

Beyond the Infinite Two Minutes (2020) - Clever Japanese time-loop comedy made for ~$20K. Given your enjoyment of Coherence, this inventive premise should work well.

Before the closing notes: I also added more themes than light/dark on the site, removed shazams (too many pages, too little value) and joined liked songs and songworms in a unified list, sorted my homelab SSL renewal automation and figured out a much better way to do db backups with databasus[^7] .

So why did I do all of this for getting recommendations? Jealousy.

My mate Raibaz shared a post (in Italian) about how he dialogues with a chatbot about books to find new inspiration. Thing is, his words not mine, I'm a nerd[^8].

So I decide to automate it a little, and given that I had already all the data needed to highlight my preferences, why not using it.

I got into tech because I was slightly more comfortable talking to machine than people, whilst that evolved over time[^9], why would I want to talk to machines in the same way I talk to people?

Which leads to my last, for now, unasked opinion about AI: I've seen conversations in relation to how AI bots and agents will change the web, about whether UI/CSS/UX is still going to be a thing, and frankly I find it a bit narrow-visioned.

AI doesn't care for those things, but only for the underlying structured data, it's about layering access to the data, and actionable APIs, rather than disrupting what's already there.

he web industry faced a similar challenge when mobile apps came out: a lot of companies had the website coupled with the data and the information, and they needed long transformation processes to unwind them. Now we should be in a better place to add separate layers – whether they are mcp servers, structured data, or whatever else is needed. And a lot of interesting new standards are emerging, like the Universal Commerce Protocol, which should allow common interfaces, and breaking the monopoly of some big player having bespoke integration with agentic AI.

[^1] I know, no one asked 🤷‍♀️.

[^2] you could say I'm pragmAItic.

[^3] and forgive me for going all 20th century on y'all.

[^4] yep, late stage capitalism.

[^5] oh, you thought I was going anywhere with this?

[^6] Mostly a response to peer pressure. AI bots are frankly the worst when it comes to having to deal with infrastructure and load and it's absolutely reasonable that people want to protect themselves, but I use Netlify and Cloudflare, what do I care?

[^7] the last one might be worth another posts.

[^8] he said, before sharing his DIY walkie-talkie WiFi messenger built with ESP32, hand-soldered and wrapped in Lego (post also in Italian).

[^9] the irony of having become a manager is not lost on me.