<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>semantic web &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/semantic-web/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Tue, 28 Apr 2026 06:57:37 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>semantic web &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Maximally Semantic Structure for a Blog Post]]></title>
		<link>https://shkspr.mobi/blog/2026/01/maximally-semantic-structure-for-a-blog-post/</link>
					<comments>https://shkspr.mobi/blog/2026/01/maximally-semantic-structure-for-a-blog-post/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 12 Jan 2026 12:34:53 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[schema.org]]></category>
		<category><![CDATA[semantic web]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=63440</guid>

					<description><![CDATA[Yes, I know the cliché that bloggers are always blogging about blogging!  I like semantics. It tickles that part of my delicious meaty brain that longs for structure. Semantics are good for computers and humans. Computers can easily understand the structure of the data, humans can use tools like screen-readers to extract the data they&#039;re interested in.  In HTML, there are three main ways to …]]></description>
										<content:encoded><![CDATA[<p>Yes, I know the cliché that bloggers are always blogging about blogging!</p>

<p>I like semantics. It tickles that part of my delicious meaty brain that longs for structure. Semantics are good for computers and humans. Computers can easily understand the structure of the data, humans can use tools like screen-readers to extract the data they're interested in.</p>

<p>In HTML, there are three main ways to impose semantics - elements, attributes, and hierarchical microdata.</p>

<p>Elements are easy to understand. Rather than using a generic element like <code>&lt;div&gt;</code> you can use something like <code>&lt;nav&gt;</code> to show an element's contents are for navigation. Or <code>&lt;address&gt;</code> to show that the contents are an address. Or <code>&lt;article&gt;&lt;section&gt;</code> to show that the section is part of a parent article.</p>

<p>Attributes are also common.  You can use <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel">relational attributes</a> to show how a link relates to the page it is on. For example <code>&lt;a rel=author href=https://example.com&gt;</code> shows that the link is to the author of the current page. Or, to see that a link goes to the previous page in a series <code>&lt;a rel=prev href=/page5&gt;</code>.</p>

<p>Finally, we enter the complex and frightening world of <em>microdata</em>.</p>

<p>Using the <a href="https://schema.org/">Schema.org vocabulary</a> it's possible to add semantic metadata <em>within</em> an HTML element. For example, <code>&lt;body itemtype=https://schema.org/Blog itemscope&gt;</code> says that the body of this page is a Blog. Or, to say how many words a piece has, <code>&lt;span itemprop=wordCount content=1100&gt;1,100 words&lt;/span&gt;</code>.</p>

<p>There are <em>many</em> properties you can use. Here's the outline structure of a single blog post with a code sample, a footnote, and a comment. You can <a href="https://validator.schema.org/">check its structured data</a> and verify that it is <a href="https://validator.w3.org/">conformant HTML</a>.</p>

<p>Feel free to reuse.</p>

<pre><code class="language-html">&lt;!doctype html&gt;
&lt;html lang=en-gb&gt;
&lt;head&gt;&lt;title&gt;My Blog&lt;/title&gt;&lt;/head&gt;
&lt;body itemtype=https://schema.org/Blog itemscope&gt;

    &lt;header itemprop=headline&gt;
        &lt;a rel=home href=https://example.com&gt;My Blog&lt;/a&gt;
    &lt;/header&gt;

    &lt;main itemtype=https://schema.org/BlogPosting itemprop=blogPost itemscope&gt;
        &lt;article&gt;
            &lt;header&gt;
                &lt;time itemprop=https://schema.org/datePublished datetime=2025-12-01T12:34:39+01:00&gt;
                    1st January, 2025
                &lt;/time&gt;
                &lt;h1 itemprop=headline&gt;
                    &lt;a rel=bookmark href=https://example.com/page&gt;Post Title&lt;/a&gt;
                &lt;/h1&gt;
                &lt;span itemtype=https://schema.org/Person itemprop=author itemscope&gt;
                    &lt;a itemprop=url href=https://example.org/&gt;
                        By &lt;span itemprop=name&gt;Author Name&lt;/span&gt;
                    &lt;/a&gt;
                    &lt;img itemprop=image src=/photo.jpg alt&gt;
                &lt;/span&gt;
                &lt;p&gt;
                    &lt;a itemprop=keywords content=HTML rel=tag href=/tag/html/&gt;HTML&lt;/a&gt; 
                    &lt;a itemprop=keywords content=semantics rel=tag href=/tag/semantics/&gt;semantics&lt;/a&gt; 
                    &lt;a itemprop=commentCount content=6 href=#comments&gt;6 comments&lt;/a&gt;
                    &lt;span itemprop=wordCount content=1100&gt;1,100 words&lt;/span&gt;
                    &lt;span itemtype=https://schema.org/InteractionCounter itemprop=interactionStatistic itemscope&gt;
                        &lt;meta content=https://schema.org/ReadAction itemprop=interactionType&gt;
                        &lt;span itemprop=userInteractionCount content=5150&gt;
                            Viewed ~5,150 times
                        &lt;/span&gt;
                    &lt;/span&gt;
                &lt;/p&gt;
            &lt;/header&gt;

            &lt;div itemprop=articleBody&gt;
                &lt;img itemprop=image src=/hero.png alt&gt;
                &lt;p&gt;Text of the post.&lt;/p&gt;
                &lt;p&gt;Text with a footnote&lt;sup id=fnref&gt;&lt;a role=doc-noteref href=#fn&gt;0&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

                &lt;pre itemtype=https://schema.org/SoftwareSourceCode itemscope translate=no&gt;
                    &lt;span itemprop=programmingLanguage&gt;PHP&lt;/span&gt;
                    &lt;code itemprop=text&gt;&amp;amp;lt;?php echo $postID ?&amp;amp;gt;&lt;/code&gt;
                &lt;/pre&gt;

                &lt;section role=doc-endnotes&gt;
                    &lt;h2&gt;Footnotes&lt;/h2&gt;
                    &lt;ol&gt;
                        &lt;li id=fn&gt;
                            &lt;p&gt;Footnote text. &lt;a role=doc-backlink href=#fnref&gt;↩︎&lt;/a&gt;&lt;/p&gt;
                        &lt;/li&gt;
                    &lt;/ol&gt;
                &lt;/section&gt;
            &lt;/div&gt;
        &lt;/article&gt;

        &lt;section id=comments&gt;
            &lt;h2&gt;Comments&lt;/h2&gt;
            &lt;article itemtype=https://schema.org/Comment itemscope id="comment-123465"&gt;
                &lt;time itemprop=dateCreated datetime=2025-09-11T13:24:54+01:00&gt;
                    &lt;a itemprop=url href=#comment-123465&gt;2025-09-11 13:24&lt;/a&gt;
                &lt;/time&gt;
                &lt;div itemtype=https://schema.org/Person itemprop=author itemscope&gt;
                    &lt;img itemprop=image src="/avatar.jpg" alt&gt;
                    &lt;h3&gt;
                        &lt;span itemprop=name&gt;Alice&lt;/span&gt; says:
                    &lt;/h3&gt;
                &lt;/div&gt;
                &lt;div itemprop=text&gt;
                    &lt;p&gt;Comment text&lt;/p&gt;
                &lt;/div&gt;
            &lt;/article&gt;
        &lt;/section&gt;
    &lt;/main&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>This blog post is entitled "maximally" but, of course, <a href="https://schema.org/BlogPosting">there is <em>lots</em> more that you can add</a> if you really want to.</p>

<p>Remember, none of this is <em>necessary</em>. Computers and humans are pretty good at extracting meaning from unstructured text. But making things easier for others is always time well spent.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=63440&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2026/01/maximally-semantic-structure-for-a-blog-post/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Class Warfare! Can I eliminate CSS classes from my HTML?]]></title>
		<link>https://shkspr.mobi/blog/2025/09/class-warfare-can-i-eliminate-css-classes-from-my-html/</link>
					<comments>https://shkspr.mobi/blog/2025/09/class-warfare-can-i-eliminate-css-classes-from-my-html/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 19 Sep 2025 11:34:55 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[schema.org]]></category>
		<category><![CDATA[semantic web]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=63392</guid>

					<description><![CDATA[I recently read a brilliantly provocative blog post called &#34;This website has no class&#34;. In it, Adam Stoddard makes the case that you might not need CSS classes on a modern website:  I think constraints lead to interesting, creative solutions […]. Instead of relying on built in elements a bit more, I decided to banish classes from my website completely.  Long time readers will know that I&#039;m a big f…]]></description>
										<content:encoded><![CDATA[<p>I recently read a brilliantly provocative blog post called "<a href="https://aaadaaam.com/notes/no-class/">This website has no class</a>". In it, Adam Stoddard makes the case that you might not need CSS classes on a modern website:</p>

<blockquote><p>I think constraints lead to interesting, creative solutions […]. Instead of relying on built in elements a bit more, I decided to banish classes from my website completely.</p></blockquote>

<p>Long time readers will know that I'm a big fan of using semantic HTML where possible. If you peek beneath the curtain of this website you'll only see a handful of <code>&lt;div&gt;</code> elements (mostly because WordPress hardcodes them) - all the other blocks are fully semantic. Regrettably, there are rather too many <code>&lt;span&gt;</code> elements for my liking - normally for accessibility or for supplementing the metadata.</p>

<p>Overall, my CSS contained about 134 rules which selected based on class. Is that a lot? It <em>feels</em> like a lot.</p>

<p>On the one hand, classes are an easy way of splitting and grouping elements. Some <code>&lt;img&gt;</code>s should be displayed one way, the rest another. There's no semantic way to say "This is a hero image and should take up the full width, but this is an icon and should float discretely to the right."</p>

<p>But, on the other hand, <em>why</em> do we need classes?  Keith Cirkel's excellent post "<a href="https://www.keithcirkel.co.uk/css-classes-considered-harmful/">CSS Classes considered harmful</a>" goes through their history and brings together some proposed solutions for replacing them. I think his idea of using <code>data-</code> attributes is a neat hack - but ultimately isn't much different from using classes. It's still a scrap of metadata to be tied into a style-sheet.</p>

<p>Classes are great for when you <em>reuse</em> something.  I have multiple <code>&lt;section&gt;</code> elements but most don't share anything in common with the others. So they probably oughtn't have classes.</p>

<p>Removing classes has some advantages. It makes the HTML fractionally smaller, sure, but it also forces the author to think about the logical structure of their page and the semantics behind it.</p>

<p>Looking through my HTML, lots of classes exist because of laziness. If I want to position all the <code>&lt;time&gt;</code> elements which are within a comment, I don't <em>need</em> to write <code>&lt;time class="whatever"&gt;</code> and to pair it with <code>.whatever { … }</code>. Instead, I can use modern CSS selectors and say <code>#comments time { … }</code>.</p>

<p>But this leads me on to another existential question.</p>

<h2 id="are-ids-necessary-in-modern-html"><a href="https://shkspr.mobi/blog/2025/09/class-warfare-can-i-eliminate-css-classes-from-my-html/#are-ids-necessary-in-modern-html">Are IDs necessary in modern HTML?</a></h2>

<p>Mayyyyybe? I only have one <code>&lt;main&gt;</code> element, so an ID on there is unnecessary. <code>&lt;input&gt;</code> elements need IDs in order to be properly targetted by <code>&lt;label&gt;</code>s - but the label can wrap around the input. I have multiple <code>&lt;aside&gt;</code> elements because there's no semantic <code>&lt;widget&gt;</code> element, so they need unique IDs.</p>

<p>In theory, as suggested by Adam above, I could use an <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements">autonomous custom element</a> like <code>&lt;my-widget&gt;</code> - but that has none of the semantics and, frankly, feels like a bit of a cheat.</p>

<h2 id="trimming-the-fat"><a href="https://shkspr.mobi/blog/2025/09/class-warfare-can-i-eliminate-css-classes-from-my-html/#trimming-the-fat">Trimming the fat</a></h2>

<p>Any day where I can delete some code is a good day. This was an excellent exercise in going through (years) of HTML and CSS to see what cruft had built up.</p>

<p>The first CSS rule I changed was, as mentioned above:</p>

<pre><code class="language-css">time.commentmetadata {
    float: right;
}
</code></pre>

<p>Which became:</p>

<pre><code class="language-CSS">#comments time { 
    float: right;
}
</code></pre>

<p>Classless and slightly more brief. Is it more readable? Having the fact it was about the metadata in a class could have been slightly useful - but if I thought it would be confusing, I could stick a <code>/* comment */</code> in there.</p>

<p>Next, I found <code>&lt;nav class="navigation posts-navigation"&gt;</code> - what a tautology! I have multiple <code>&lt;nav&gt;</code> elements, it is true. But none of them have the same style. So this swiftly became <code>&lt;nav id="posts-navigation"&gt;</code> with an accompanying CSS rewrite.</p>

<p>My theme switcher had a bunch of <code>&lt;label class=button&gt;</code>s. They were all within a container with a unique ID, so could they be changed? Yes. But seeing the class name in the HTML is a good reminder to the author of <em>how</em> they are meant to display. Does that co-mingle content and presentation too much?</p>

<p>Some of the WordPress default classes are ridiculous. The <code>body_class()</code> function injected this into every <code>&lt;body&gt;</code></p>

<p><code>"wp-singular post-template-default single single-post postid-62959 single-format-standard wp-theme-edent-wordpress-theme"</code></p>

<p>Most of that is redundant - what's the difference between single and single-post? For my purposes, nothing! So they were all yeeted into the sun.</p>

<p>Rather than targetting IDs or classes, I targetted the presence or absence of Schema.org microdata.</p>

<p>For example:</p>

<pre><code class="language-css">main[itemprop="blogPost"] { … }
main:not([itemprop="blogPost"]) { … }
</code></pre>

<p>This can go to the extreme. I have lots of comments, each one has an author, the author's details are wrapped in <code>&lt;div class="authordetails"&gt;…&lt;/div&gt;</code></p>

<p>That can be replaced with:</p>

<pre><code class="language-css">/* Comment Author */
li[itemtype="https://schema.org/Comment"] &gt; article &gt; div[itemprop="https://schema.org/author"] {
    margin-bottom: 0;
}
</code></pre>

<p>Is that <em>sensible</em>? It is more semantic, but feels a bit brittle.</p>

<p>Parent selector are also now a thing. If I want a paragraph to have centred text but <em>only</em> when there's a submit button inside it:</p>

<pre><code class="language-css">p:has(input#submit) {
  text-align: center;
}
</code></pre>

<p>Again, am I sure that my button will always be inside a paragraph?</p>

<p>Similarly, <a href="https://css-tricks.com/child-and-sibling-selectors/">sibling selectors</a> are sometimes superior - but they do suppose that your layout never changes.</p>

<h2 id="what-remains"><a href="https://shkspr.mobi/blog/2025/09/class-warfare-can-i-eliminate-css-classes-from-my-html/#what-remains">What remains?</a></h2>

<p>There are some bits of this site which are reusable and do need classes. The code-highlighting you see above requires text to be wrapped in spans with specific classes.</p>

<p>Image alignment was also heavily class based.</p>

<p>There are some accessibility things which are either hidden or exposed using classes.</p>

<p>A bunch of WordPress defaults use classes and, even if they are redundant, it's hard to exorcise them.</p>

<p>As much as I would have liked to get rid of all my IDs, many needed to stay for linking as well as CSS targetting.</p>

<p>All told, the changes I made were:</p>

<ul>
<li>134 class selectors down to about 65.</li>
<li>35 ID selectors up to about 50.</li>
<li>5 attribute selectors up to to about 20.</li>
<li>Deleted or combined a lot of redundant CSS and tidied up my markup considerably.</li>
</ul>

<p>I have around 250 CSS rules, so now the majority target semantics rather than classes or IDs.</p>

<h2 id="is-this-really-necessary"><a href="https://shkspr.mobi/blog/2025/09/class-warfare-can-i-eliminate-css-classes-from-my-html/#is-this-really-necessary">Is this really necessary?</a></h2>

<p>No, of course not. This is an exercise in minimalism, creativity, and constraint. Feel free to litter your HTML with whatever attributes you want!</p>

<p>As I went through, it increasingly became apparent that I was fitting my CSS to my HTML's logical structure rather than to its <em>conceptual</em> structure.</p>

<p>Previously, my comments were targetted with a class. Now they have the slightly more tangled targetting of "divs with this schema attribute whose parent is an article and whose grandparent has this ID".</p>

<p>It is a delightful meditative exercise to go through your code and deeply consider whether something is unique, reusable, or obsolete.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=63392&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2025/09/class-warfare-can-i-eliminate-css-classes-from-my-html/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[What programming language is in this <code> block?]]></title>
		<link>https://shkspr.mobi/blog/2024/08/what-programming-language-is-in-this-code-block/</link>
					<comments>https://shkspr.mobi/blog/2024/08/what-programming-language-is-in-this-code-block/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Tue, 27 Aug 2024 11:34:28 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[schema.org]]></category>
		<category><![CDATA[semantic web]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=52095</guid>

					<description><![CDATA[I&#039;m a little bit obsessed with the idea of Semantic markup. I want the words that I write to be understood my humans and machines.  Imagine this piece of code: print( &#34;Hello, world!&#34; )  Is that code example written in Python? C++? Basic? Go? Perhaps you&#039;re familiar enough with every programming language to tell - but most people aren&#039;t.  Wouldn&#039;t it be nice to give an indication of what…]]></description>
										<content:encoded><![CDATA[<p>I'm a little bit obsessed with the idea of Semantic markup. I want the words that I write to be understood my humans <em>and</em> machines.</p>

<p>Imagine this piece of code: <code>print( "Hello, world!" )</code></p>

<p>Is that code example written in Python? C++? Basic? Go? Perhaps you're familiar enough with every programming language to tell - but most people aren't.  Wouldn't it be nice to give an indication of <em>what</em> programming language is used in an example?</p>

<p>Here's how we might represent it in HTML:</p>

<pre><code class="language-_">&lt;pre&gt;
    &lt;code&gt;
        print( "Hello, world!" )
    &lt;/code&gt;
&lt;/pre&gt;
</code></pre>

<p>How do we let the browser, search engines, and humans know what language that's written in? It might seem obvious to use the <code>lang</code> attribute, right? We're writing in a programming language, so just use <code>&lt;code lang="python"&gt;</code>. Sadly, the HTML specification disagrees.</p>

<blockquote><p>The lang attribute specifies the primary language for the element's contents and for any of the element's attributes that contain text. Its value <strong>must be a valid BCP 47 language tag</strong>, or the empty string. <br> <a href="https://html.spec.whatwg.org/multipage/dom.html#attr-lang">HTML Specification 3.2.6.2 The lang and xml:lang attributes</a> (emphasis added)</p></blockquote>

<p>That means it must be a <em>human</em> language like <code>en</code> or <code>en-GB</code>. No Klingon or Elvish - and certainly no computer languages!</p>

<p>Does the specification give any clues about the <code>&lt;code&gt;</code> element?</p>

<blockquote><p>There is <strong>no formal way to indicate the language of computer code</strong> being marked up. Authors who wish to mark code elements with the language used, e.g. so that syntax highlighting scripts can use the right rules, can use the class attribute, e.g. by adding a class prefixed with "language-" to the element.<br><a href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-code-element">HTML Specification 4.5.15 The code element</a> (emphasis added)</p></blockquote>

<p>So we have to turn to our old friend Schema.org! There is a <a href="https://schema.org/SoftwareSourceCode"><code>SoftwareSourceCode</code> type</a> which is used for exactly this case. Sadly, there is no example documentation because Google likes to start up a project but never quite finish it.</p>

<p>Here's how to write a code snippet in HTML and have it semantically expose the programming language used:</p>

<pre><code class="language-HTML">&lt;pre itemscope itemtype="https://schema.org/SoftwareSourceCode"&gt;
    &lt;span itemprop="programmingLanguage"&gt;Python&lt;/span&gt;
    &lt;meta itemprop="codeSampleType" content="Example"&gt;
    &lt;code itemprop="text"&gt;
        print( "Hello, world!" )
    &lt;/code&gt;
&lt;/pre&gt;
</code></pre>

<p>If you <a href="https://validator.schema.org/#url=https%3A%2F%2Fshkspr.mobi%2Fblog%2F2024%2F08%2Fwhat-programming-language-is-in-this-code-block%2F">run that through the validator</a> you'll see what a computer sees:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2024/08/schema-fs8.png" alt="Semantic representation of the code." width="1648" height="360" class="aligncenter size-full wp-image-52102">

<p>The <code>programmingLanguage</code> is a string - so you can write anything you like in there. You can optionally add a <code>codeSampleType</code> which, again, is a free-text field.</p>

<p>The <code>&lt;meta&gt;</code> items are only viewable to machines. You could also them to the user if you wanted, using a <code>&lt;span&gt;</code> or other suitable element.</p>

<h2 id="alternatives"><a href="https://shkspr.mobi/blog/2024/08/what-programming-language-is-in-this-code-block/#alternatives">Alternatives</a></h2>

<p>It is possible to define <a href="https://www.rfc-editor.org/rfc/rfc5646#section-2.2.6">private subtags of languages</a> for example <code>en-x-python</code> - which could mean "Comments written in English, using the private Python extension. Or even just <code>x-python</code>. That then leads on to how you describe a language - but while <a href="https://www.iana.org/assignments/media-types/application/vnd.acucobol">COBOL has a MIME type</a> not all languages do.  There are some unofficial ones like <a href="https://mimetype.io/text/x-python"><code>text/x-python</code></a> though.</p>

<p>But, of course, <a href="https://sonomu.club/@threedaymonk/112970802651966367">programming languages aren't really languages</a> - so using <code>lang</code> probably isn't suitable.</p>

<p>A <a href="https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes"><code>data-</code> attribute</a> might also work. Adding <code>data-code="python"</code> would allow CSS to style specific code blocks. But data attributes are private to a page, and generally aren't standardised.</p>

<p>I <em>think</em> this is a gap in the specification. I think there ought to be a <code>code-lang</code> attribute or similar. Perhaps something like:</p>

<pre><code class="language-HTML">&lt;code code-lang="python;3.6"&gt;
    print( "Hello, world!" )
&lt;/code&gt;
</code></pre>

<p>Which could allow authors to semantically give the name - and possibly version - of the programming language they are writing in.</p>

<p>Thoughts?</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=52095&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2024/08/what-programming-language-is-in-this-code-block/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Does AI mean we don't need the Semantic Web?]]></title>
		<link>https://shkspr.mobi/blog/2023/05/does-ai-mean-we-dont-need-the-semantic-web/</link>
					<comments>https://shkspr.mobi/blog/2023/05/does-ai-mean-we-dont-need-the-semantic-web/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sat, 20 May 2023 11:34:47 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[schema.org]]></category>
		<category><![CDATA[semantic web]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=45827</guid>

					<description><![CDATA[If you hang around with computerists long enough, they start talking about the Semantic Web. If you can represent human knowledge in a way that&#039;s easy for computers to understand it will be transformative for information processing.  But computers, traditionally, haven&#039;t been very good at parsing ambiguous human text.  Suppose you saw this text written for a human:  Our opening hours are:…]]></description>
										<content:encoded><![CDATA[<p>If you hang around with computerists long enough, they start talking about the Semantic Web. If you can represent human knowledge in a way that's easy for computers to understand it will be transformative for information processing.</p>

<p>But computers, traditionally, haven't been very good at parsing ambiguous human text.</p>

<p>Suppose you saw this text written for a human:</p>

<blockquote><p>Our opening hours are: Weekdays 10 until 7. Weekend 10 until 10 (Early closing 9 o'clock Sunday).</p></blockquote>

<p>Not the most straightforward sentence, but pretty easy for a human to parse.</p>

<p>Until recently, the best way to represent that for a computer was something like:</p>

<pre><code class="language-html">&lt;meta itemprop="openingHours" content="Mo-Fr 10:00-19:00"&gt;
&lt;meta itemprop="openingHours" content="Sa 10:00-22:00"&gt;
&lt;meta itemprop="openingHours" content="Su 10:00-21:00"&gt;
</code></pre>

<p>or</p>

<pre><code class="language-html">&lt;script type="application/ld+json"&gt;
{
   "@context": "https://schema.org",
   "openingHours":["Mo-Fr 10:00-19:00", "Sa 10:00-22:00", "Su 10:00-21:00"]
}
&lt;/script&gt;
</code></pre>

<p>A tightly constrained vocabulary which can be precisely parsed by a simple state-machine. Easy to ingest, interpret, and query. Easy for machines, that is. As much as I love the semantic web, it is <em>hard</em> for humans to write, update, and maintain.</p>

<p>But we have AI now.  So do we need to mark up documents specifically for machines?</p>

<p>I fed the text into OpenAI's ChatGPT.  Here's what it said:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2023/05/ChatGPT-opening-hours.png" alt="User: Read the following sentence: " our="" opening="" hours="" are:="" weekdays="" 10="" until="" 7.="" weekend="" (early="" closing="" 9="" o'clock="" sunday)."="" chatgpt:="" the="" given="" sentence="" states="" of="" a="" certain="" establishment.="" here="" is="" breakdown="" mentioned:="" weekdays:="" establishment="" open="" from="" in="" morning="" 7="" evening.="" weekend:="" on="" weekends,="" at="" night.="" early="" sunday:="" sundays,="" closes="" earlier="" than="" usual,="" please="" note="" that="" this="" information="" based="" solely="" provided="" sentence,="" and="" specific="" or="" its="" type="" not="" mentioned.="" user:="" 2130="" sunday?="" has="" sunday,="" with="" time="" set="" therefore,="" would="" be="" 21:30="" (or="" 9:30="" pm)="" sunday."="" width="1024" height="868" class="aligncenter size-full wp-image-45828">

It isn't just capable of parroting back data - it can perform moderately complex reasoning:

<img src="https://shkspr.mobi/blog/wp-content/uploads/2023/05/0830.png" alt="User: It is 0830 Wednesday. How long until the establishment is open? ChatGPT: Based on the information provided, the establishment's opening hours on weekdays start at 10 in the morning. If it is currently 8:30 on a Wednesday, you would need to wait 1 hour and 30 minutes until the establishment opens at 10:00 AM." width="1024" height="277" class="aligncenter size-full wp-image-45831">

<p>Do we need to write for computers any more?  One of the demands of the Semantic Web was that we should use HTML elements like <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/address"><code>&lt;address&gt;</code> to clearly mark up a contact address</a> and we should wrap dates and times in the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time"><code>&lt;time&gt;</code> element</a>.</p>

<p>Is that now redundant?</p>

<p>We still need to write clearly and unambiguously. But do we need separate "machine-readable" HTML if machines can now read and interpret text designed for humans?</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=45827&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/05/does-ai-mean-we-dont-need-the-semantic-web/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Different ways to do separators in horizontal text]]></title>
		<link>https://shkspr.mobi/blog/2022/05/different-ways-to-do-separators-in-horizontal-text/</link>
					<comments>https://shkspr.mobi/blog/2022/05/different-ways-to-do-separators-in-horizontal-text/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 16 May 2022 11:34:52 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[semantic web]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=42489</guid>

					<description><![CDATA[Quite often on the web, you&#039;ll see a set of &#34;things&#34; with a separator between them.  For example, at the top of this post, you&#039;ll see  Thing 1 &#124; Something Else &#124; Another Thing.  This provides clear visual separation between logical groups. But there are a couple of problems. Firstly, the separator character may not be interpreted correctly by screen readers. They may read out &#34;Vertical Pipe&#34;,…]]></description>
										<content:encoded><![CDATA[<p>Quite often on the web, you'll see a set of "things" with a separator between them.  For example, at the top of this post, you'll see</p>

<p>Thing 1 | Something Else | Another Thing.</p>

<p>This provides clear <em>visual</em> separation between logical groups. But there are a couple of problems. Firstly, the separator character may not be interpreted correctly by screen readers. They may read out "Vertical Pipe", which isn't very user friendly. Similarly, robots may not attach the correct semantics to the separator. Which is a problem if you're trying to do machine learning on text.</p>

<p>HTML and CSS are about the separation of content and style. So let's examine the ways we can provide a better way to do separators.</p>

<h2 id="hide-them"><a href="https://shkspr.mobi/blog/2022/05/different-ways-to-do-separators-in-horizontal-text/#hide-them">Hide Them</a></h2>

<p>I think that this is the least satisfying method.</p>

<pre><code class="language-html">&lt;span aria-hidden="true"&gt;|&lt;/span&gt; Thing 1 &lt;span aria-hidden="true"&gt;|&lt;/span&gt; Something else
</code></pre>

<p>The <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden"><code>aria-hidden</code></a> tag hides the content from accessibility software. It is specifically designed to remove purely decorative items. But, because the separators are simply removed, the text runs together. That's a problem for screen readers.</p>

<h2 id="css-borders"><a href="https://shkspr.mobi/blog/2022/05/different-ways-to-do-separators-in-horizontal-text/#css-borders">CSS Borders</a></h2>

<p>This is another popular way to visually distinguish groups.</p>

<pre><code class="language-css">span {
   border-right: solid #000 1px;
}
</code></pre>

<pre><code class="language-html">&lt;span&gt;Thing 1&lt;/span&gt; &lt;span&gt;Another thing&lt;/span&gt;
</code></pre>

<p>You can style the CSS however you like. Depending on your layout, you may need to use <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:not"><code>:not()</code></a> on the last element to prevent an unnecessary separator.</p>

<p>But, again, there's no way for a screen reader or robot to know that the content is supposed to be distinct from each other.</p>

<h2 id="%e2%8b%aebefore-and-after"><a href="https://shkspr.mobi/blog/2022/05/different-ways-to-do-separators-in-horizontal-text/#%e2%8b%aebefore-and-after"><code>⋮:before</code> and <code>::after</code>?</a></h2>

<p>Similarly, the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/::before"><code>::before</code></a> and <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/::after"><code>::after</code></a> selectors can be used to add content before/after an element:</p>

<pre><code class="language-css">span::after {
   content: " | ";
}
</code></pre>

<pre><code class="language-html">&lt;span&gt;Thing 1&lt;/span&gt; &lt;span&gt;Another thing&lt;/span&gt;
</code></pre>

<h2 id="abuse-the-element"><a href="https://shkspr.mobi/blog/2022/05/different-ways-to-do-separators-in-horizontal-text/#abuse-the-element">Abuse the <code>&lt;hr&gt;</code> element?</a></h2>

<p>This is a bit wacky. The <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr"><code>&lt;hr&gt;</code></a> element is a - somewhat - outdated way to provide a sectioning break by drawing a horizontal line. But it is accessible in CSS. By changing its rotation and width, it makes a passable vertical separator!</p>

<pre><code class="language-css">hr {
   rotate: 90deg;
   width: 1em;
}
</code></pre>

<pre><code class="language-html">Thing 1 &lt;hr style=""&gt; Another thing
</code></pre>

<p>It can be a bit tricky to get the styling just right - but it will effectively separate logical groups.</p>

<h2 id="list-styling"><a href="https://shkspr.mobi/blog/2022/05/different-ways-to-do-separators-in-horizontal-text/#list-styling">List styling</a></h2>

<p>I like using lists for things like this. It groups the items together and provides a logical "block" that either a human or robot can interpret or skip.</p>

<p>Here's a baroque method to make a list horizontal and to replace the content of the bullet.</p>

<pre><code class="language-css">#hz &gt; li::before {
    display: list-item;
    content: "";
    position: absolute;
    margin-inline-start: -.5em;
}
#hz &gt; li {
    display: inline-block;
    list-style-type: "|";
    padding-right: 1em;
}
#hz &gt; li:first-child {
    list-style-type: "";
}
</code></pre>

<pre><code class="language-html">&lt;ul id="hz"&gt;
    &lt;li&gt;Thing 1&lt;/li&gt;
    &lt;li&gt;Another thing&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>That removes all the bullets. Then replaces every one except the first with a pipe spaced back a little from the text. And lays the list out horizontally.</p>

<p>If you want to change the colour or position of the bullet, you can use <a href="https://web.dev/css-marker-pseudo-element/"><code>::marker</code></a> instead.</p>

<h2 id="mix-and-match"><a href="https://shkspr.mobi/blog/2022/05/different-ways-to-do-separators-in-horizontal-text/#mix-and-match">Mix And Match</a></h2>

<p>My preferred way is to use <code>&lt;li&gt;</code>, remove the bullets, and then style a border on the left - except for the first one.  This keeps the semantics of the list, and is a relatively simple piece of CSS.</p>

<pre><code class="language-css">#hz &gt; li {
    display: inline-block;
    border-left: solid #000 1px;
    padding: 0 1em 0 1em;
}
#hz &gt; li:first-child {
    border: none;
}
</code></pre>

<pre><code class="language-html">&lt;ul id="hz"&gt;
    &lt;li&gt;Thing 1&lt;/li&gt;
    &lt;li&gt;Another thing&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<h2 id="is-there-a-best-way"><a href="https://shkspr.mobi/blog/2022/05/different-ways-to-do-separators-in-horizontal-text/#is-there-a-best-way">Is there a <em>best</em> way?</a></h2>

<p>No, it is a matter of personal taste and appetite for complexity.  My "strong opinion weakly held" is that semantic HTML is nearly always preferable to just chucking stuff in a load of <code>&lt;span</code>&gt;s and <code>&lt;div&gt;</code>s. It makes the content easy to understand if you're browsing without CSS, or if you're a robot trying to understand the world.</p>

<p>Similarly, I think simple CSS is better than complicated CSS. Something small and human-readable is always going to be easier to understand and manage in the future.</p>

<p>But, if you think I'm wrong - or know a better way to lay things out - please let me know in the comments.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=42489&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2022/05/different-ways-to-do-separators-in-horizontal-text/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Semantic Comments for WordPress]]></title>
		<link>https://shkspr.mobi/blog/2022/04/semantic-comments-for-wordpress/</link>
					<comments>https://shkspr.mobi/blog/2022/04/semantic-comments-for-wordpress/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Thu, 28 Apr 2022 11:34:13 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[schema.org]]></category>
		<category><![CDATA[semantic web]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=42412</guid>

					<description><![CDATA[As regular readers will know, I love adding Semantic things to my blog.  The standard WordPress comments HTML isn&#039;t very semantic - so I thought I&#039;d change that. Here&#039;s some code which you can add to your blog&#039;s theme - an an explanation of how it works.  The aim is to end up with some HTML which looks like this (edited for brevity):  &#60;li itemscope itemtype=&#34;https://schema.org/Comment&#34;…]]></description>
										<content:encoded><![CDATA[<p>As regular readers will know, I love <a href="https://shkspr.mobi/blog/2020/07/adding-semantic-reviews-rich-snippets-to-your-wordpress-site/">adding Semantic things to my blog</a>.</p>

<p>The standard WordPress comments HTML isn't very semantic - so I thought I'd change that. Here's some code which you can add to your blog's theme - an an explanation of how it works.</p>

<p>The aim is to end up with some HTML which looks like this (edited for brevity):</p>

<pre><code class="language-HTML5">&lt;li itemscope itemtype="https://schema.org/Comment" itemid="#246827"&gt;
    &lt;article&gt;
        &lt;time datetime="2022-04-12T10:22:32+01:00" itemprop="dateCreated"&gt;
            &lt;a href="https://shkspr.mobi/blog/2022/04/semantic-comments-for-wordpress/#comment-246827" itemprop='url'&gt;22-04-12 10:22&lt;/a&gt;
        &lt;/time&gt;
        &lt;div itemprop="https://schema.org/author" itemscope itemtype="https://schema.org/Person"&gt;
            &lt;img itemprop="image" alt='' src='logo.jpg' height='64' width='64'/&gt;
            &lt;span itemprop="name"&gt;
                &lt;a itemprop="url" href="https://twitter.com/example"&gt;Commenter's Name&lt;/a&gt;&lt;/span&gt; says:
        &lt;/div&gt;
        &lt;div itemprop="text"&gt;This is the text of my comment&lt;/code&gt;&lt;/div&gt;
    &lt;/article&gt;
&lt;/li&gt;
</code></pre>

<p>Which will be interpreted as:
<img src="https://shkspr.mobi/blog/wp-content/uploads/2022/04/Schema-Markup-validator.png" alt="A schema tree showing all the properties." width="916" height="310" class="aligncenter size-full wp-image-42415"></p>

<p>This adds <code>&lt;time&gt;</code> elements as well as Schema.org microdata.</p>

<h2 id="howto"><a href="https://shkspr.mobi/blog/2022/04/semantic-comments-for-wordpress/#howto">Howto</a></h2>

<p>In <code>comments.php</code> you'll see something like this:</p>

<pre><code class="language-php">&lt;ol class="comment-list"&gt;
    &lt;?php
        wp_list_comments( array(
            'style'       =&gt; 'ol',
            'short_ping'  =&gt; true,
            'avatar_size' =&gt; 64,
        ) );
    ?&gt;
&lt;/ol&gt;
</code></pre>

<p>You need to add a new <code>callback</code>. In this case, I've called it <code>my_comments_walker</code>:</p>

<pre><code class="language-php">&lt;ol class="comment-list"&gt;
    &lt;?php
        wp_list_comments( array(
            'style'       =&gt; 'ol',
            'short_ping'  =&gt; true,
            'avatar_size' =&gt; 64,
            'callback' =&gt; 'my_comments_walker',
        ) );
    ?&gt;
&lt;/ol&gt;
</code></pre>

<p>You can read more about <a href="https://developer.wordpress.org/reference/classes/walker/">WordPress Walkers on their documentation page</a>.</p>

<p>Now that's done, you need to create a function in your <code>functions.php</code> file.  I added this to the end of my file:</p>

<pre><code class="language-php">function my_comments_walker() {

    //  Basic comment data
    $comment_id          = get_comment_id();
    $comment             = get_comment( $comment_id );

    //  Date the comment was submitted
    $comment_date        = get_comment_date( "c" );
    //  In slightly more human-readable format
    $comment_date_human  = get_comment_date( "y-m-d H:i" );

    //  Author Details
    $comment_author      = get_comment_author();

    //  Author's URl if they've added one
    $comment_author_url  = get_comment_author_url();

    //  If there's an Author URl, link it
    if ($comment_author_url != null) {
        $comment_author_name = "&lt;a itemprop='url' href='{$comment_author_url}' rel='external nofollow ugc' class='url'&gt;{$comment_author}&lt;/a&gt;";
    } else {
        $comment_author_name = "{$comment_author}";
    }

    //  Provide a link to the comment anchor
    $comment_url_link = "&lt;a href="https://shkspr.mobi/blog/2022/04/semantic-comments-for-wordpress/#comment-$comment_id" itemprop='url'&gt;{$comment_date_human}&lt;/a&gt;";

    //  Author's Avatar based on ID
    //  As per https://developer.wordpress.org/reference/functions/get_avatar/ both alt &amp; default must be set
    $gravatar            = get_avatar( $comment, 64, "", "", array('extra_attr' =&gt; 'itemprop="image"') );

    //  Comment needs newlines and links added
    $comment_text        = apply_filters( 'comment_text', get_comment_text(), $comment);


    //  The comment may have various classes. They are stored as an array
    $comment_classes     = get_comment_class();
    $comment_classes_text = "";
    foreach( $comment_classes as $class ) {
        $comment_classes_text .= $class . " ";
    }
    $comment_classes_text = trim($comment_classes_text);

    //  Link to open the reply box
    $comment_reply_link = get_comment_reply_link( [
                    'depth'     =&gt; 20,
                    'max_depth' =&gt; 100,
                    'before'    =&gt; '&lt;div class="reply"&gt;',
                    'after'     =&gt; '&lt;/div&gt;'
            ] );

    //  Write the comment HTML. No need for a closing &lt;/li&gt; as WP handles that.
    echo &lt;&lt;&lt; EOT
    &lt;li id="comment-$comment_id" itemscope itemtype="https://schema.org/Comment" itemid="#comment-$comment_id" class="$comment_classes_text"&gt;
        &lt;article class="comment-body" id="div-comment-$comment_id"&gt;
            &lt;time datetime="$comment_date" class="comment-meta commentmetadata" itemprop="dateCreated"&gt;
                $comment_url_link
            &lt;/time&gt;
            &lt;div class="comment-author vcard" itemprop="https://schema.org/author" itemscope itemtype="https://schema.org/Person"&gt;
                $gravatar
                &lt;span class="fn" itemprop="name"&gt;$comment_author_name&lt;/span&gt; &lt;span class="says"&gt;says:&lt;/span&gt;
            &lt;/div&gt;
            &lt;div itemprop="text" class="comment-text"&gt;$comment_text&lt;/div&gt;
            $comment_reply_link
        &lt;/article&gt;
    EOT;
}
</code></pre>

<p>There are a few extra classes and spans which I use. You can remove them if you like.</p>

<p>And that's it. All your comments will have individual semantic metadata. If you think anything else should be included, please let me know.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=42412&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2022/04/semantic-comments-for-wordpress/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Introducing DOI2HT.ML - the simple semantic citation server]]></title>
		<link>https://shkspr.mobi/blog/2020/11/introducing-doi2ht-ml-the-simple-semantic-citation-server/</link>
					<comments>https://shkspr.mobi/blog/2020/11/introducing-doi2ht-ml-the-simple-semantic-citation-server/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 13 Nov 2020 12:51:22 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<category><![CDATA[schema.org]]></category>
		<category><![CDATA[semantic web]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=37114</guid>

					<description><![CDATA[Academic citations are hard. One of the joys of the Digital Object Identifier System (DOI) is that every academic paper gets a unique reference - like: 10.34053/artivate.8.2.2.  As well as always leading you to a URl of the paper, a DOI also provides lots of metadata. Things like author, publisher, ORCID, year of publication etc.  I&#039;ve built a simple website that turns any DOI into a semantic…]]></description>
										<content:encoded><![CDATA[<p>Academic citations are <em>hard</em>. One of the joys of the Digital Object Identifier System (DOI) is that every academic paper gets a unique reference - like: <code>10.34053/artivate.8.2.2</code>.</p>

<p>As well as always leading you to a URl of the paper, a DOI also provides lots of metadata. Things like author, publisher, ORCID, year of publication etc.</p>

<p>I've built a simple website that turns any DOI into a semantic HTML reference - get started at <a href="https://web.archive.org/web/20221025144116/https://doi2ht.ml/">DOI2HT.ML</a>.</p>

<p>Here's what it looks like:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2020/11/doi2html-fs8.png" alt="Website Screenshot." width="1247" height="779" class="aligncenter size-full wp-image-37116">

<p>Pop a DOI in the box and hit the button. You'll receive an HTML5 citation which has embedded schema.org microdata data.  It makes a human-readable citation <em>and</em> a robot-readable way for search engines to understand your citation.</p>

<p>It uses <a href="https://citation.crosscite.org/docs.html#sec-4">content negotiation</a> to get the canonical citation, then it renders it into standards compliant HTML + microdata.</p>

<p>There's no tracking, no cookies, no selling your data. Just a plain HTML site - the way the web should be.</p>

<p>Enjoy!</p>

<p><a href="https://web.archive.org/web/20221025144116/https://doi2ht.ml/">DOI2HT.ML</a></p>

<p>This is a "scratch my own itch" product. I run a <a href="https://shkspr.mobi/blog/citations">citations page</a> where I track whenever I'm mentioned in academia. Feedback very welcome.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=37114&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2020/11/introducing-doi2ht-ml-the-simple-semantic-citation-server/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
	</channel>
</rss>
