1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-14 09:42:09 +00:00
seirdy.one/content/notes/rdf-versus-semantic-html.md
2024-05-24 10:24:27 -04:00

2.3 KiB

title date lastMod replyURI replyTitle replyType replyAuthor replyAuthorURI
RDF versus semantic HTML 2022-09-13T21:30:02-07:00 2022-09-13T21:30:02-07:00 https://web.archive.org/web/20231201000536/https://cybre.space/@jauntywunderkind420/108993489770129012 Microdata and rdfa are excellent and wonderful ways to describe individual html elements SocialMediaPosting @jauntywunderkind420@cybre.space https://web.archive.org/web/20230202143104/https://cybre.space/@jauntywunderkind420/

microdata and rdfa both directly mark up existing html content.

Only on a syntactical level. Beyond that, it's the other way around: Microdata and RDFa let you build RDF triples by taking content from HTML elements. They don't exist to add information to HTML elements.

HTML and Microdata/RDFa syntaxes being mixed into the same document doesn't change this. They're only combined so human- and machine-readable data can remain identical without repetition, not to create more linked-data than the sum of its parts. You could re-write the very same RDFa data in e.g. Turtle syntax, with the HTML discarded. That's why I wasn't particularly fond of the (rejected) Microdata/RDFa approach to WAI-Adapt. (I think this was one of the major criticism raised, but I can't seem to find it)

An @id in JSON-LD takes information from, rather than adding information to, the HTML document; HTML-parsing user-agents should ignore it unless they're extracting RDF data from Microdata/RDFa.

there's also itemid...the page can define multiple different resources on it, give a uri to the different bits of content on it.

itemid is just a way to refer to add to another object instead of creating a new one. Again, it's a way to extract information from different parts of an HTML document (or different HTML documents altogether) rather than a way to add to HTML elements.

Microformats sometimes use HTML itself rather than extracting data from it (see the e- prefix). This puts microformats in a sort of gray area, extracting data from HTML but also integrating with it.

I make extensive use of Microdata and microformats on seirdy.one. Strictly speaking, both syntaxes are made of HTML; however, I've certainly found the microformats approach to feel more "HTML-native" than Microdata.