sonofbluerobotFront-End Engineering With Standards

Archive for the ‘semantic web’ Category

Semantic Glossary in HTML5

Posted on: No Comments

Using ruby with dl for English Words

After reading up on dl and the ruby elements on the super awesome html5Doctor, I was inspired to add this markup to my own dev glossary. Being the anal-retentive loser that I am, I frequently visit dictionary.com for correct spellings, and knew they had a viable use for the ruby element already in their markup. So I simply just put them together, nothing new or out of the box here. Below is a screenshot of the dictionary.com reference mentioned:

Screenshot of Definition of Assay on Dictionary.com
Definition of Assay on Dictionary.com

So I whipped up a simple semantic glossary demo for your viewing pleasure. Below is a screenshot and the corresponding markup.

Screenshot of Semantic HTML5 Dictionary
Screenshot of semantic html5 Dictionary

<dl>
  <dt><ruby><dfn>Franscrollow</dfn> <rp>(</rp><rt>fran-scrahl-oh</rt><rp>)</rp></ruby></dt>
  <dd>Verb that eliminates headaches and complexity by combining all relevant stalker-related buzzwords into one easy-to-remember term.  Friend + Fan + Subscribe + Follow = Franscrollow. So please, franscrollow me. You'll never be be made obsolete by smelly geeks again. It's the future, and you're welcome.
    <cite><a href="http://www.baratunde.com/franscrollow" title="Fanscrollow - baratunde.com"><b>Franscrollow</b> found here</a>.</cite></dd>
  <dt><dfn><abbr title="XML Binding Language">xbl</abbr> (<abbr title="Extensible Markup Language">xml</abbr> Binding Language)</dfn></dt>
  <dd>is a language for describing bindings that can be attached to <b>elements</b> in other documents. The <b>element</b> that the <b>binding</b> is attached to is called the <strong><em>bound element</em></strong>, acquires the new behavior specified by the <b>binding</b>. <b>Bindings</b> can contain <b>event handlers</b> that are registered on the <strong><em>bound element</em></strong>, an implementation of new <b>methods</b> and <b>properties</b> that become accessible from the <strong><em>bound element</em></strong>, and anonymous content that is inserted underneath the <strong><em>bound element</em></strong>. Most <abbr title="XML User Interface Language">xul</abbr> widgets are at least partially implemented using <strong><abbr>xbl</abbr></strong>. Developers can build their own widgets from existing <abbr>xul</abbr>, <abbr>html</abbr>, <abbr title="Scaleable Vector Graphics">svg</abbr>, and other primitives using <strong><abbr>xbl</abbr></strong>.
    <cite><a href="https://developer.mozilla.org/en/XBL" title="XBL - MDN Docs"><abbr>xbl</abbr> found here</a></cite></dd>
</dl>

Font Linking Separate Styles for b and i

Posted on: 3 Comments

Regardless of how you feel about the b and i elements, not only are they included in the html5 specification, they have been giving new semantic meaning. These new definitions assure that i != em and b != strong semantically, but when it comes to browser rendering the pairs are still equals. Considering they have separate meanings, it seems intuitive that their display should also convey the differences, or at the very least that they are different.

Opting for subtlety in design, I have chosen to portray the differences in content semantics by capitalizing on font linking optimization, a smart and elegant technique posted on 456 Berea Street.

For demonstration purposes, I grabbed Panefresco from the super fabulous Font Squirrel, namely because it has 16 styles from which to choose from. For brevity, I’m not going to post Panefresco’s @font-face Kit or my alterations entirely, but you can view the original here and my alterations here. The following font linking css displays the technique, notice how they all have the same font-name but each has its own resources as well as its own unique font declaration(s).


/** Panefresco Regular font weight 100 */
@font-face{font-family:"Panefresco400wtRegular";
src: url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco1wtRegular-webfont.eot");
src: url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco1wtRegular-webfont.eot?#iefix") format("eot"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco1wtRegular-webfont.woff") format("woff"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco1wtRegular-webfont.ttf") format("truetype"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco1wtRegular-webfont.svg#webfontgFFh5vxH") format("svg");
font-weight:100; font-style:normal}
/** Panefresco Italic font weight 100 */
@font-face{font-family:"Panefresco400wtRegular";
src: url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco1wtItalic-webfont.eot");
src: url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco1wtItalic-webfont.eot?#iefix") format("eot"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco1wtItalic-webfont.woff") format("woff"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco1wtItalic-webfont.ttf") format("truetype"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco1wtItalic-webfont.svg#webfontCeET7Ncb") format("svg");
font-weight:100; font-style:italic}
/** Panefresco Regular font weight 250 */
@font-face{font-family:"Panefresco400wtRegular";
src: url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco250wtRegular-webfont.eot");
src: url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco250wtRegular-webfont.eot?#iefix") format("eot"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco250wtRegular-webfont.woff") format("woff"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco250wtRegular-webfont.ttf") format("truetype"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco250wtRegular-webfont.svg#webfontAsSDuy7L") format("svg");
font-weight:200; font-style:normal}
/** Panefresco Italic font weight 250 */
@font-face{font-family:"Panefresco400wtRegular";
src: url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco250wtItalic-webfont.eot");
src: url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco250wtItalic-webfont.eot?#iefix") format("eot"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco250wtItalic-webfont.woff") format("woff"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco250wtItalic-webfont.ttf") format("truetype"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco250wtItalic-webfont.svg#webfontFnMZKWyV") format("svg");
font-weight:200; font-style:italic}
/** Panefresco Regular font weight 400 */
@font-face{font-family:"Panefresco400wtRegular";
src: url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco400wtRegular-webfont.eot");
src: url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco400wtRegular-webfont.eot?#iefix") format("eot"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco400wtRegular-webfont.woff") format("woff"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco400wtRegular-webfont.ttf") format("truetype"),
  url("http://dev.bowdenweb.com/assets/fonts/sans-serif/panefresco/Panefresco400wtRegular-webfont.svg#webfontGS74qLRB") format("svg");
font-weight:400l; font-style:normal}

Note: Panefresco applies font-weight values on 250, 750 and 999, which differ from css specifications that use font-weight values divisible by 100. I’ve spoken about the differences between type design conventions and css conventions before, and this is a perfect example. I’m not taking a side here, just pointing out the obvious. For this example I’ve simply set Panefresco 250 to font-weight:200, Panefresco 750 to font-weight:700 and Panefresco 999 to font-weight:900, but that’s not to say they are correct.

I now have more than enough options to convey semantic meaning to users, while staying within the same font-family, it’s just a matter of styling them. Applying a lighter font-weight value to b than to strong is an obvious solution that I’m actually going to carry over to i and em as well. Personally, I view em implying text with stress emphasis as being both italic and bolded, however I’m usually wrong and moreover, this post is about styling i and b.

After putting the demonstration together, I noticed that even though b and strong have different font-weights, they are not very distinguishable and to compensate I actually set b to bold font-weight:700 and strong above bold to font-weight:900.

You can see view the demo here, or just check out the screenshot below:

Font Linking Separate Styles for <b> and <i> Screenshot - Excerpt from The Last of the Mohicans

Font Linking Separate Styles for <b> and <i> Screenshot - Excerpt from The Last of the Mohicans

So there’s my easy solution to expressing varying degrees of semantics to readers via font linking. Hopefully this will inspire you to embrace a more vivid font design library into your workflows. During the creation of this post, quite a few new ideas popped into mind, hopefully it does the same for you.

Tons of love and gratitude extended to html5doctor, 456 Berea Street and Richard Ishida’s Language Subtag Lookup App, for providing the inspiration and blueprint for this post.

Image Naming Conventions for Increased Findability and SEO

Posted on: No Comments

Image Search is one aspect of Web Development typically overlooked by the vast majority of developers. While it may seem a distant second to the primary goal of Search, it’s actually not that far off. Image naming conventions, when properly applied, can aid in a sites Search, Searchability and Findability.

Typical image naming conventions in Web Development include image-01.png or even worse blargherghdadurpdedoo.png; while they do serve as a unique identifier and therefore conform to their primary purpose, they can be utilized for much more by providing machine-readable text that can be understood by bots when crawling your site(s). Bots have no clue what the below image is:


<img src="http://example.com/images/23432asaere.png"

But bots will have a clue if your image is titled as such:


<img src="http://example.com/images/jordan-dunking-vs-lakers.png"

Bots crawling your site will now index this image with reference to “Jordan Dunking vs. Lakers”, which provides an extremely more relevant and detailed description than “23432asaere”.

Apply the kiss Principle here: don’t overthink your file names, thereby (even if not intentional) spamming keywords via your file names. I like to rely on two or three word names for images.

Image Naming Rules

  • Separate words with hyphens (-)
  • Using at most two or three keywords
  • Use only alphanumeric characters and hyphens in file names, not underscores (_), spaces ( , or special characters
  • Use descriptive Directory Naming Conventions in tandem with Image Naming Conventions

Added Benefits of Precise Image Naming Conventions

Image Naming Conventions also will aid in a sites Information Architecture, organizing files and directories to benefit your development team, as well as users and bots. Your team can also use them to track document versions, like so:


<img src="screenshot-issue-11-04-2009-001" />

Adding Precise Image Naming Conventions to Workflows

Adding image naming conventions to your workflow(s) is extremely easy and should not be overthought. Simply think about what an image is before you name it. If the image is part of a set, think about suffixing a number to the end of all the images in the set, or putting them all into a directory, that aptly names the set. It’s really that simple, and you’ll greatly benefit by making this part of your development process instead of a post development afterthought.

Add Humans.txt to Your Site for Increased Findability

Posted on: No Comments

Add Humans.TXT to your site and flaunt your practices for the humanoid searcher. Humans.TXT is a simple text file that you add to the your root file, which is filled with information about the people behind the site.

Humans.TXT is an initative to inform users about the people behind a website; typically it contains information about all the different people who have contributed to the development process of a site. So mine is sparce and only contains information about me; lame, but it’s a start. More importantly, I did it to help spread the word and also add it into Front-End workflows.

Humans.TXT uses a text file because its simple and easy and not intrusive with your code. Using Humans.TXT you can prove your authorship (not your property) very fast and in an accessible way.

Make sure that your file is utf-8 capable and lowercase; You can also add in thank you’s as well as information behind your site.

GeoNames Geographical Database

Posted on: No Comments

GeoNames is a geographical database that integrates various related geodata. GeoNames is shared under a creative commons attribution license, is available for download free of charge, and users can manually edit, or add new data as need be.

I read about GeoNames while researching Linked Data, after a quick run through of the user manual, I did a search for Virginia Beach in the United States. It returned GeoNameId : 4791259, the GeoNames representation of Virginia Beach, va. While there is a plethora of named places in Virginia Beach, it still seems quite sparse to me; randomly, there is an overwhelming mobile home representation amongst the named places (some realtor knew what they were doing). The data is available in csv and png formats for download. The png representation of Virginia Beach’s Geoname is shown below.

Virginia Beach, United States

It seems like GeoNames could use some serious updates; any idea(s) how this can be achieved without manually entering/editing it all? How would you use this data?

Linked Open Data Star Ratings

Posted on: No Comments

The Semantic Web is all about Linked Data, primarily made up of machine-readable links, aka machine tags. Search optimized urls are machine-readable in this sense, though primarily for search engines. Microformats, Microdata, and rdfa are all examples of machine tags that search engines have adopted. The html a element, when used in conjunction with href="" attribute provide the connectivity that has enabled the web of hypertext. As amazing as the hypertext web is, it has its limitations, including only having local scope(s), and primarily only linking to data embedded in html documents. While data embedded in html documents are accessible on the web, it is not in the web.

The Semantic Web marks a shift from this method of thinking, from human readable to machine readable. You can make your data machine readable by adhering to Linked Data Expectations of Behavior to make the data interconnected. The more connected the data is, the more opportunities it has for unexpected reuse.

It is the unexpected re-use of information which is the value added by the web.

Tim Berners-Lee

To promote Linked Data, the lidrc Laboratory has published Linked Open Data Star Examples and Linked Open Data Star Badges. Use the former to define your data and the latter to promote your data. I have put them all together into a sprite to help promote Linked Open Data.

Linked Open Data Star Ratings Badges Sprite

In the process of doing so, I noticed that some of the badges had different heights, as well as all of them not having transparent corners, so I went ahead and took out the backgrounds of each and made them uniform. I would love to see them implemented in css, but that will be for another post. The Linked Open Data Badges Kit (available here) consists of uniform badges (88 x 32), original sizes and .psds.