TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Semantics in HTML 5

8 pointsby brandonkmover 16 years ago

3 comments

cgranadeover 16 years ago
<i>Edit: Boy, do I feel stupid. What I proposed exists, and is called RDFa.</i> (<a href="http://www.w3.org/TR/rdfa-syntax/" rel="nofollow">http://www.w3.org/TR/rdfa-syntax/</a>)<p>It occurs to me that the W3C already has an extensible semantics framework: RDF. This framework can be represented in many different languages (primarily N3 and XML), and is quite well-understood amongst semantic web people. The trouble is how to associate RDF 3-tuples with (X)HTML elements.<p>To take the date example from the original article, &#60;span id="date1"&#62;May Day next year&#60;/span&#62; could be represented in a machine readable format be the following 3-tuple. (I am not an expert in N3, so please pardon any mistakes. Also, if there's a good existing vocabulary for "equivalent to", please let me know.)<p>&#60;#date1&#62; &#60;<a href="http://example.com/#equivalent&#62" rel="nofollow">http://example.com/#equivalent&#62</a>; date"2009-05-01"<p>In turn, this 3-tuple could be encoded in &#60;meta&#62; and &#60;link&#62; elements a la Dublin Core, or could be stored in an external RDF/XML or N3 document referenced by a &#60;link&#62; element. Perhaps a new element could even be introduced (just one) that allows the direct embedding of RDF content in a manner similar to the embedding of CSS content via the &#60;style&#62; element.<p>This solution would have the benefits of being extensible, flexible, robust and well-understood. The biggest drawback that I can see is that developers would have to learn RDF along with some common ontologies.
s_tecover 16 years ago
Since HTML will be around for a long time, the author says, we need a mechanism for adding new semantics to the language over time. Well, the W3C already has a nice mechanism for doing that called "adding new elements". This system works just fine, and there is no reason to define a monstrosity like &#60;div structure="header"&#62; when defining a new &#60;header&#62; element would accomplish the same goal. The only valid complaint against adding new elements is that IE doesn't apply CSS to elements it doesn't recognize. Fortunately, a simple workaround exists: <a href="http://xopus.com/devblog/2008/style-unknown-elements.html" rel="nofollow">http://xopus.com/devblog/2008/style-unknown-elements.html</a>
评论 #422803 未加载
eli_sover 16 years ago
Allowing developers to create their own semantics as they see fit does not create a more semantic web.<p>The whole point of having semantically meaningful documents is so that <i>machines</i> can better understand them. Having a system where each developer creates their own "meaning hooks" is worse than useless - its a waste of time and bandwidth - and leaves us in the same position we are in today where a machine ignores markup and tries to infer meaning from context.<p>Standards and convention are important.<p>The only way to create a truly searchable and meaningful web is for us all to use an agreed upon set of tags that add meaning.
评论 #422843 未加载