<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Depth-First: Category Tools</title>
    <link>http://depth-first.com/articles/category/tools</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Walking the Web of Chemical Informatics</description>
    <item>
      <title>Building Chempedia: The Human Element</title>
      <description>&lt;p&gt;&lt;a href="http://chempedia.com" align="right"&gt;&lt;img src="http://depth-first.com/demo/20080513/chempedia.png" align="right"&gt;&lt;/img&gt;&lt;/a&gt;The study of chemistry is an inherently social activity. From the papers we use and cite, to the conferences we attend, to the informal discussions we engage in daily, being a chemist means interacting with your fellow chemists. Yet strangely, most chemical information systems either totally ignore this central fact, or provide only the most meager of tools to harness it to its full potential. This article discusses how &lt;a href="http://chempedia.com"&gt;Chempedia&lt;/a&gt; currently integrates the social with the scientific, and what may be in store for the future.&lt;/p&gt;

&lt;h4&gt;Chempedia as a Tool for Scientific Collaboration&lt;/h4&gt;

&lt;p&gt;Like all chemical reference works, Chempedia is written by people with their own interests, skills, and ambitions. Unlike almost every other chemical reference work, Chempedia (through Wikipedia, on which it's based) offers intriguing possibilities to directly collaborate and learn from its contributors - or even become one of them.&lt;/p&gt;

&lt;p&gt;How can Chempedia better facilitate scientific collaboration?&lt;/p&gt;

&lt;h4&gt;A Simple But Possibly Useful Feature&lt;/h4&gt;

&lt;p&gt;Yesterday, a new feature was added to Chempedia that makes it easier to understand the recent history of a Compound Monograph. The new feature shows the date that a Compound Monograph was last edited, and the Wikiepdia user who edited it:&lt;/p&gt;

&lt;p&gt;&lt;center&gt;&lt;img src="http://depth-first.com/demo/20080515/screen.png"&gt;&lt;/img&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;Clicking on the link takes you to the Wikipedia users page, in this case the one for &lt;a href="http://en.wikipedia.org/wiki/User:Meodipt"&gt;Meodipt&lt;/a&gt;. (Wikipedia users frequently use handles rather than their given names.) From Meodipt's page, we can see that s/he received degrees in chemistry and pharmacology and is currently studying law. Meodipt's interests include pharmacology, chemistry, law, and science. We can also see that Meodipt is maintaining a &lt;a href="http://en.wikipedia.org/wiki/User:Meodipt/casnumbers"&gt;good-sized list of CAS numbers for drugs&lt;/a&gt;, grouped by indication.&lt;/p&gt;

&lt;p&gt;We might be curious about what Meodipt found worth changing, and how s/he changed it. We could do so by first clicking the Chempedia &lt;a href="http://chempedia.com/monographs/pravadoline/edit"&gt;edit link&lt;/a&gt;. In the Wikipedia box (framed by the red dotted lines), we would then click on the 'history' tab. Clicking on the 'last' link for the top entry shows us exactly what Meodipt changed on Pravadoline's compound monograph (also visible through &lt;a href="http://en.wikipedia.org/w/index.php?title=Pravadoline&amp;amp;diff=200731945&amp;amp;oldid=200731624"&gt;this link&lt;/a&gt;).&lt;/p&gt;

&lt;h4&gt;Looking Ahead&lt;/h4&gt;

&lt;p&gt;Linking a real person to changes in a Compound Monograph could be enormously useful, if done properly. After all, bringing people with highly focussed interests together is the essence of scientific collaboration. The Chempedia/Wikipedia combination provides one way to do that.&lt;/p&gt;

&lt;p&gt;As Chis Anderson puts it, "&lt;a href="http://www.longtail.com/the_long_tail/2007/09/social-networki.html"&gt;social networking should be a feature, not a destination&lt;/a&gt;." Scientists were social networking long before the Internet, the computer, and the telephone were invented; indeed scientists who fail to connect with their fellow scientists have a difficult time of prospering. When seen from this perspective, it's surprising that good 'social networking' features would not be viewed as a top priority in chemical information systems.&lt;/p&gt;

&lt;p&gt;The Chempedia author credit system in its current form is rather simplistic and may not actually promote scientific collaboration at all. But it's not hard to imagine ways to make it far more effective. Future articles will discuss some of the possibilities.&lt;/p&gt;</description>
      <pubDate>Thu, 15 May 2008 14:50:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:ae862028-7efd-4e91-b5ee-36b91cbed66e</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/05/15/building-chempedia-the-human-element</link>
      <category>Tools</category>
      <category>chempedia</category>
      <category>wikipedia</category>
      <category>socialnetworking</category>
      <category>collaboration</category>
      <category>author</category>
    </item>
    <item>
      <title>Hacking DOI: Interconvert Bibliographic References and DOIs with CrossRef and OpenURL</title>
      <description>&lt;p&gt;&lt;a href="http://flickr.com/photos/ecstaticist/1340787730/"&gt;&lt;img src="http://depth-first.com/demo/20080506/web.jpg" align="right"&gt;&lt;/img&gt;&lt;/a&gt;Science is in the middle of a transition from print to the internet as the primary medium of communication. This transition, although a boon for many scientists, creates a host of problems for those dealing with scientific information. For example, how would you interconvert a &lt;a href="http://www.doi.org/"&gt;DOI&lt;/a&gt; and its corresponding bibliographic reference?&lt;/p&gt;

&lt;p&gt;A previous Depth-First article discussed &lt;a href="http://depth-first.com/articles/2007/06/27/easily-convert-publisher-urls-and-dois-to-bibliographical-citations-synthesis-synlett-ruby-and-mechanize"&gt;a screen-scraping method&lt;/a&gt; as one solution. Unfortunately, this system relies on an intimate understanding of how individual publishers' Websites work, requires a different implementation for each publisher, and can break at any time without warning.&lt;/p&gt;

&lt;p&gt;This article discusses a far more robust solution to the problem of interconverting bibliographic references and DOIs.&lt;/p&gt;

&lt;h4&gt;Background: OpenURL and CrossRef&lt;/h4&gt;

&lt;p&gt;&lt;a href="http://www.crossref.org/"&gt;CrossRef&lt;/a&gt; is the official &lt;a href="http://www.doi.org/"&gt;DOI&lt;/a&gt; link registration agency for scholarly and professional publications. One of the less well-known services offered by CrossRef is a free, Web-based &lt;a href="http://www.crossref.org/openurl_info.html"&gt;bidirectional DOI/bibliographic reference converter&lt;/a&gt; based on &lt;a href="http://en.wikipedia.org/wiki/OpenURL"&gt;OpenURL&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;A Simple Ruby Library&lt;/h4&gt;

&lt;p&gt;The following Ruby library is all we need to begin using CrossRef and OpenURL:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;rubygems&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;hpricot&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;open-uri&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;

&lt;span class="keyword"&gt;module &lt;/span&gt;&lt;span class="module"&gt;DOI&lt;/span&gt;
  &lt;span class="comment"&gt;# Convert a doi into a bibliographic reference.&lt;/span&gt;
  &lt;span class="keyword"&gt;def &lt;/span&gt;&lt;span class="method"&gt;biblio_for&lt;/span&gt; &lt;span class="ident"&gt;doi&lt;/span&gt;
    &lt;span class="ident"&gt;doc&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;Hpricot&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;open&lt;/span&gt;&lt;span class="punct"&gt;(&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;http://www.crossref.org/openurl/?id=doi:&lt;span class="expr"&gt;#{doi}&lt;/span&gt;&amp;amp;noredirect=true&amp;amp;pid=ourl_sample:sample&amp;amp;format=unixref&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;))&lt;/span&gt;

    &lt;span class="ident"&gt;journal&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;doc&lt;/span&gt;&lt;span class="punct"&gt;/&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;abbrev_title&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;).&lt;/span&gt;&lt;span class="ident"&gt;inner_html&lt;/span&gt;
    &lt;span class="ident"&gt;year&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;doc&lt;/span&gt;&lt;span class="punct"&gt;/&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;journal_issue/publication_date/year&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;).&lt;/span&gt;&lt;span class="ident"&gt;inner_html&lt;/span&gt;
    &lt;span class="ident"&gt;volume&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;doc&lt;/span&gt;&lt;span class="punct"&gt;/&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;journal_issue/journal_volume/volume&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;).&lt;/span&gt;&lt;span class="ident"&gt;inner_html&lt;/span&gt;
    &lt;span class="ident"&gt;number&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;doc&lt;/span&gt;&lt;span class="punct"&gt;/&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;journal_issue/issue&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;).&lt;/span&gt;&lt;span class="ident"&gt;inner_html&lt;/span&gt;
    &lt;span class="ident"&gt;first_page&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;doc&lt;/span&gt;&lt;span class="punct"&gt;/&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;pages/first_page&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;).&lt;/span&gt;&lt;span class="ident"&gt;inner_html&lt;/span&gt;
    &lt;span class="ident"&gt;last_page&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;doc&lt;/span&gt;&lt;span class="punct"&gt;/&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;pages/last_page&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;).&lt;/span&gt;&lt;span class="ident"&gt;inner_html&lt;/span&gt;

    &lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;&lt;span class="expr"&gt;#{journal}&lt;/span&gt; &lt;span class="expr"&gt;#{year}&lt;/span&gt;, &lt;span class="expr"&gt;#{volume}&lt;/span&gt;(&lt;span class="expr"&gt;#{number}&lt;/span&gt;) &lt;span class="expr"&gt;#{first_page}&lt;/span&gt;-&lt;span class="expr"&gt;#{last_page}&lt;/span&gt;&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;
  &lt;span class="keyword"&gt;end&lt;/span&gt;

  &lt;span class="comment"&gt;# Convert a bibliographic reference into a DOI.&lt;/span&gt;
  &lt;span class="keyword"&gt;def &lt;/span&gt;&lt;span class="method"&gt;doi_for&lt;/span&gt; &lt;span class="ident"&gt;journal&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="ident"&gt;year&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="ident"&gt;volume&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="ident"&gt;issue&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="ident"&gt;page&lt;/span&gt;
    &lt;span class="ident"&gt;doc&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;Hpricot&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;open&lt;/span&gt;&lt;span class="punct"&gt;(&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;http://www.crossref.org/openurl/?title=&lt;span class="expr"&gt;#{journal.gsub(/ /, '%20')}&lt;/span&gt;&amp;amp;volume=&lt;span class="expr"&gt;#{volume}&lt;/span&gt;&amp;amp;issue=&lt;span class="expr"&gt;#{issue}&lt;/span&gt;&amp;amp;spage=&lt;span class="expr"&gt;#{page}&lt;/span&gt;&amp;amp;date=&lt;span class="expr"&gt;#{year}&lt;/span&gt;&amp;amp;pid=ourl_sample:sample&amp;amp;redirect=false&amp;amp;format=unixref&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;))&lt;/span&gt;

   &lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;doc&lt;/span&gt;&lt;span class="punct"&gt;/&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;doi&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;).&lt;/span&gt;&lt;span class="ident"&gt;inner_html&lt;/span&gt;
  &lt;span class="keyword"&gt;end&lt;/span&gt;
&lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This code makes use of the excellent Ruby HTML parser library &lt;a href="http://code.whytheluckystiff.net/hpricot"&gt;Hpricot&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;Testing the Library&lt;/h4&gt;

&lt;p&gt;Saving the Ruby code to a file named &lt;strong&gt;doi.rb&lt;/strong&gt;, we can test it using the interactive Ruby shell:&lt;/p&gt;

&lt;div class="console"&gt;
&lt;pre&gt;
$ irb
irb(main):001:0&gt; require 'doi'
=&gt; true
irb(main):002:0&gt; include DOI
=&gt; Object
irb(main):003:0&gt; biblio_for "10.1021/cr00032a009"
=&gt; "Chem. Rev. 1994, 94(8) 2483-2547"
irb(main):004:0&gt; doi_for "Chem. Rev.", 1994, 94, 8, 2483
=&gt; "10.1021/cr00032a009"
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Notice how the journal abbreviation &lt;em&gt;Chem. Rev.&lt;/em&gt; was used; we'd get the same result if we used &lt;em&gt;Chemical Reviews&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Of course, the implementation described here could be refined a lot. With a DOI, it's trivial to &lt;a href="http://dx.doi.org/10.1021/cr00032a009"&gt;construct a URL to the example paper&lt;/a&gt;. But we could take it further than that. With some carefully crafted regular expressions, our &lt;tt&gt;doi_for&lt;/tt&gt; method could accept a freeform bibliographical citation rather than separately identified fragments. From there we might start to think about creating living HTML and/or Wikis from old PDFs and Word documents.&lt;/p&gt;

&lt;p&gt;With a little creative thought, other possibilities are well within reach.&lt;/p&gt;

&lt;h4&gt;Caveat&lt;/h4&gt;

&lt;p&gt;Before extensively experimenting with CrossRef's OpenURL system, you might want to &lt;a href="http://www.crossref.org/requestaccount/"&gt;sign up for a free account&lt;/a&gt;. CrossRef is understandably interested in tracking usage and this is their way to do it.&lt;/p&gt;

&lt;h4&gt;Conclusions&lt;/h4&gt;

&lt;p&gt;DOIs and traditional bibliographical citations now coexist in a variety of settings, from literature citation managers to journals themselves. Using CrossRef, OpenURL and a little bit of code, it's now possible to make a great deal more sense of it all.&lt;/p&gt;

&lt;p&gt;Harvesting bibliographical citations must be one of the least sexy topics in cheminformatics. But as Google demonstrated (building on the approach taken by &lt;a href="http://scientific.thomson.com/products/sci/"&gt;&lt;em&gt;Science Citation Index&lt;/em&gt;&lt;/a&gt;), cataloging citation behavior leads to a unique and highly productive way to view many tough problems. Future articles will discuss how this might apply to cheminformatics.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Image Credit: &lt;a href="http://flickr.com/photos/ecstaticist/"&gt;ecstaticist&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 06 May 2008 15:50:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:8eafadd6-bf10-4e65-ac43-2a3bf37de457</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/05/06/hacking-doi-interconvert-bibliographic-references-and-dois-with-crossref-and-openurl</link>
      <category>Tools</category>
      <category>openurl</category>
      <category>crossref</category>
      <category>ruby</category>
      <category>hpricot</category>
      <category>sciencecitationindex</category>
      <category>citations</category>
    </item>
    <item>
      <title>Cheminformatics Puzzler #2: Planar Chiral Paracyclophanes</title>
      <description>&lt;p&gt;&lt;center&gt;&lt;a href="http://dx.doi.org/10.1021/jo800468x"&gt;&lt;img src="http://depth-first.com/demo/20080501/abstract.png"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Source: Duan, Ma, Xia, Liu, Ma, and Sun &lt;a href="http://dx.doi.org/10.1021/jo800468x"&gt;J. Org. Chem.&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Without using 3D coordinates, represent the chirality of this class of planar chiral paracyclophanes (&lt;a href="http://depth-first.com/articles/2007/01/22/a-molecular-language-for-modern-chemistry-flexmol-and-planar-chiral-metacyclophanes"&gt;hint&lt;/a&gt;).&lt;/p&gt;</description>
      <pubDate>Thu, 01 May 2008 09:25:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:6ac2b6b8-b424-4bdd-ad5e-34a45dab983e</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/05/01/cheminformatics-puzzler-2-planar-chiral-paracyclophanes</link>
      <category>Tools</category>
      <category>flexmol</category>
      <category>planarchirality</category>
      <category>puzzler</category>
    </item>
    <item>
      <title>Just a Flesh Wound</title>
      <description>&lt;blockquote&gt;
    &lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Black_Knight_(Monty_Python)"&gt;&lt;img src="http://depth-first.com/demo/20080430/black_knight.png" align="right"&gt;&lt;/img&gt;&lt;/a&gt;&lt;strong&gt;SEMANTIC KNIGHT&lt;/strong&gt;: None shall pass without formally defining the ontological
    meta-semantic thingies of their domain something-or-others!&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; What?&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; None shall pass without using all sorts of semantic
    meta-meta-meta-stuff that we will invent Real Soon Now!&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; I have no quarrel with you, good Sir Knight, but I must get my
    work done on the Web. Stand aside!&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; None shall  find anything on the Internet without semantic metadata!&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; So be it!&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER and SEMANTIC KNIGHT:&lt;/strong&gt; Aaah!, hiyaah!, etc.&lt;/p&gt;
    
    &lt;p&gt;&lt;em&gt;[HACKER chops the SEMANTIC KNIGHT's first argument off by building efficent statistical/heuristic search engines]&lt;/em&gt;&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; Now stand aside, worthy adversary.&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; 'Tis but a scratch.&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; A scratch? Your argument has been cut off!&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; No, it isn't.&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; Well, what's that, then?&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; I've had worse.  None shall have an effective syndication network without RDF Site Summaries!&lt;/p&gt;
    
    &lt;p&gt;&lt;em&gt;[clang]&lt;/em&gt;&lt;/p&gt;
    
    &lt;p&gt;Hiyaah!&lt;/p&gt;
    
    &lt;p&gt;&lt;em&gt;[clang]&lt;/em&gt;&lt;/p&gt;
    
    &lt;p&gt;Aaaaaaaah!&lt;/p&gt;
    
    &lt;p&gt;&lt;em&gt;[HACKER chops the SEMANTIC KNIGHT's second argument off by building the blogs/RSS/Aggregators/Bloglines/etc. network ]&lt;/em&gt;&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; Victory is mine!&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; Have at you!&lt;/p&gt;
    
    &lt;p&gt;&lt;em&gt;[kick]&lt;/em&gt;&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; Eh. You are indeed brave, Sir Knight, but the fight is mine.&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; Oh, had enough, eh?&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; Look, you stupid &amp;amp;^%$# You've got no arguments left.&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; Yes, I have.&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; Look!&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; Just a flesh wound.&lt;/p&gt;
    
    &lt;p&gt;&lt;em&gt;[kick]&lt;/em&gt;&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; Look, stop that.&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; You won't be able to get machine-machine services without an
    ontology to formally describe all the relationships!&lt;/p&gt;
    
    &lt;p&gt;&lt;em&gt;[kick]&lt;/em&gt;&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; Right!&lt;/p&gt;
    
    &lt;p&gt;&lt;em&gt;[whop]&lt;/em&gt;&lt;/p&gt;
    
    &lt;p&gt;&lt;em&gt;[HACKER chops the SEMANTIC KNIGHT's third argument off by building
    SOAPy and RESTful services with only implicit semantic descriptions]&lt;/em&gt;&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; Right. I'll do you for that!&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; You'll what?&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; Come here!&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; What are you going to do, bleed on me?&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; I'm invincible!&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; You're a looney.&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; The SEMANTIC Knight always triumphs! Have at you! Come on, then. I have an battalion of KR theorists on my side!&lt;/p&gt;
    
    &lt;p&gt;&lt;em&gt;[whop]&lt;/em&gt;&lt;/p&gt;
    
    &lt;p&gt;&lt;em&gt;[HACKER chops the SEMANTIC KNIGHT's last argument off with an army of actual code writers]&lt;/em&gt;&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; Oh? All right, we'll call it a draw.&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;HACKER:&lt;/strong&gt; Come on, folks, let's go.&lt;/p&gt;
    
    &lt;p&gt;&lt;strong&gt;SEMANTIC KNIGHT:&lt;/strong&gt; Oh. Oh, I see. Running away, eh? You yellow ^&amp;amp;^%$s! Come back here and take what's coming to you. I'll bite your legs off! &lt;/p&gt;
    
    &lt;p&gt;-&lt;cite&gt;Michael Champion, &lt;a href="http://lists.xml.org/archives/xml-dev/200504/msg00260.html"&gt;xml-dev list&lt;/a&gt;&lt;/cite&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description>
      <pubDate>Wed, 30 Apr 2008 18:24:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:4e8cb57c-4704-4385-9832-6fada8248d82</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/04/30/just-a-flesh-wound</link>
      <category>Tools</category>
      <category>semanticweb</category>
      <category>designingtheobvious</category>
      <category>rest</category>
    </item>
    <item>
      <title>Solve Web Application Scaling Problems With Signed Applets</title>
      <description>&lt;p&gt;&lt;center&gt;&lt;img src="http://depth-first.com/demo/20080425/signature.png"&gt;&lt;/img&gt;&lt;/center&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 25 Apr 2008 13:12:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:8bb7ed9e-2e45-4afc-ab7c-1d0f09987ae6</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/04/25/solve-web-application-scaling-problems-with-signed-applets</link>
      <category>Tools</category>
      <category>applet</category>
      <category>signature</category>
      <category>signedapplet</category>
      <category>designingtheobvious</category>
      <category>userinterface</category>
      <category>webdesign</category>
    </item>
    <item>
      <title>CampDepict: Building a Simple SMILES Depict Web Application With JRuby, Structure CDK, and Camping</title>
      <description>&lt;p&gt;&lt;a href="http://redhanded.hobix.com/bits/campingAMicroframework.html"&gt;&lt;img src="http://depth-first.com/demo/20080423/camping.png" align="right"&gt;&lt;/img&gt;&lt;/a&gt;Today's tribute to the power of simplicity comes by way of &lt;a href="http://goeslightly.blogspot.com/"&gt;John Jaeger&lt;/a&gt;, who has built one of the simplest cheminformatics Web applications ever written. His creation, &lt;a href="http://goeslightly.blogspot.com/2008/04/campdepict-jruby-cdk-and-camping.html"&gt;CampDepict&lt;/a&gt;, interactively produces a raster image of a 2D chemical structure given a SMILES string, not unlike &lt;a href="http://www.daylight.com/daycgi/depict"&gt;Daylight's Depict application&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;CampDepict uses the Ruby Web microframework &lt;a href="http://redhanded.hobix.com/bits/campingAMicroframework.html"&gt;Camping&lt;/a&gt;. From the &lt;a href="http://camping.rubyforge.org/files/README.html"&gt;README&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;Camping is a web framework which consistently stays at less than 4kb of code. You can probably view the complete source code on a single page. But, you know, it&#8216;s so small that, if you think about it, what can it really do?&lt;/p&gt;
    
    &lt;p&gt;The idea here is to store a complete fledgling web application in a single file like many small CGIs. But to organize it as a Model-View-Controller application like Rails does. You can then easily move it to Rails once you&#8216;ve got it going.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;John's application is loosely-based on the &lt;a href="http://depth-first.com/articles/2006/12/04/anatomy-of-a-cheminformatics-web-application-ajaxifying-depict"&gt;Rails Depict&lt;/a&gt; application first described in 2006 here on Depth-First. His code makes use of &lt;a href="http://cdk.sf.net"&gt;CDK&lt;/a&gt; and &lt;a href="http://sf.net/projects/structure"&gt;Structure CDK&lt;/a&gt;, and it runs on &lt;a href="http://jruby.codehaus.org/"&gt;JRuby&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you've ever been curious about what Ruby has to offer cheminformatics, CampDepict could be just the application to get your feet wet.&lt;/p&gt;</description>
      <pubDate>Wed, 23 Apr 2008 11:16:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:b831ffb0-cb0a-46ed-aaa1-a5cddc2acfcf</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/04/23/campdepict-building-a-simple-smiles-depict-web-application-with-jruby-structure-cdk-and-camping</link>
      <category>Tools</category>
      <category>camping</category>
      <category>ruby</category>
      <category>jruby</category>
      <category>campdepict</category>
      <category>structurecdk</category>
      <category>cdk</category>
      <category>webapplication</category>
    </item>
    <item>
      <title>User-Created Compound Monographs on Chempedia.net: Open Sourcing the Collation and Indexing of Chemical Information</title>
      <description>&lt;p&gt;&lt;a href="http://chempedia.com"&gt;&lt;img src="http://chempedia.net/images/global/logo.png" align="right"&gt;&lt;/img&gt;&lt;/a&gt;Printed encyclopedias of chemical information like the &lt;a href="http://www.merckbooks.com/mindex/"&gt;Merck Index&lt;/a&gt; suffer from the problem of becoming obsolete on publication. When new compounds are discovered, or when the information about a compound changes, those changes can take many months or years to appear in print form due to the high cost of publication. It doesn't have to be that way. This article introduces a new feature to the free online chemical encyclopedia &lt;a href="http://chempedia.com"&gt;Chempedia&lt;/a&gt; that lets working scientists update is contents via &lt;a href="http://wikipedia.org"&gt;Wikipedia&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;About Chempedia.net&lt;/h4&gt;

&lt;p&gt;A &lt;a href="http://depth-first.com/articles/2008/04/04/chempedia-net-mashing-up-pubchem-and-wikipedia"&gt;recent article&lt;/a&gt; introduced &lt;a href="http://chempedia.com"&gt;Chempdia&lt;/a&gt;, the free online chemical encyclopedia. This service is built on two of the largest &lt;a href="http://depth-first.com/articles/2007/01/24/thirty-two-free-chemistry-databases"&gt;free and open repositories of chemical information&lt;/a&gt; in existence: &lt;a href="http://wikipedia.org"&gt;Wikipedia&lt;/a&gt; and &lt;a href="http://pubchem.ncbi.nlm.nih.gov/"&gt;PubChem&lt;/a&gt;. PubChem supplies low-level chemical information such as connection tables, and Wikipedia supplies free-text descriptions of the properties and uses of certain molecules.&lt;/p&gt;

&lt;h4&gt;Which Molecules?&lt;/h4&gt;

&lt;p&gt;Currently, Chempedia.net only includes &lt;a href="http://depth-first.com/articles/2008/04/02/wikipedia-for-cheminformatics-a-simple-web-api-for-finding-cas-numbers-in-compound-monographs"&gt;compound monographs&lt;/a&gt; for about 1,000 of its over 300,000 molecules. These monographs were located by a manual process in which the titles for all Wikipedia articles were downloaded in alphabetized form; this process clustered titles that represented IUPAC nomenclature due to its use of leading numbers and symbols. IUPAC nomenclature titles were extracted, and then a script was written to extract the chemical information from these titles and combine it with that from PubChem.&lt;/p&gt;

&lt;p&gt;This method, although useful for getting a service running, is clearly flawed. The biggest problem is in how to discover new compound monographs.&lt;/p&gt;

&lt;h4&gt;Why Not Put Users in Control?&lt;/h4&gt;

&lt;p&gt;Chempedia users themselves are in the best position to know when an existing Wikipedia compound monograph should appear in Chempedia but doesn't, when an existing monograph needs to be updated, or when a new monograph is written and needs to be linked.&lt;/p&gt;

&lt;p&gt;How can the process be &lt;a href="http://depth-first.com/articles/2006/08/19/history-of-abstracting-at-chemical-abstracts-service"&gt;automated&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;As a partial answer to this question, users &lt;a href="http://chempedia.net/articles/new"&gt;now have the ability to notify Chempedia of any changes to a Wikipedia compound monograph&lt;/a&gt;, and to have those changes immediately reflected in the next viewing of a Chempedia compound monograph.&lt;/p&gt;

&lt;h4&gt;An Example&lt;/h4&gt;

&lt;p&gt;As an example, let's take &lt;a href="http://en.wikipedia.org/wiki/anandamide"&gt;anandamide&lt;/a&gt;, a compound I've had some experience with during my time as a medicinal chemist. Although the &lt;a href="http://chempedia.net/compounds/6030"&gt;Chempedia entry for ananandamide&lt;/a&gt; exists, there is (or as of today - was) no link to the Wikipedia compound monograph. Let's create one.&lt;/p&gt;

&lt;p&gt;At the top of &lt;a href="http://chempedia.com/"&gt;Chempedia's main menu&lt;/a&gt;, you'll see a link titled '&lt;a href="http://chempedia.net/articles/new"&gt;Update&lt;/a&gt;'. Choosing this link leads to a form that will ask for two pieces of information: (1) the title of the Wikipedia article to which you want Chempedia to link - in this case '&lt;a href="http://en.wikipedia.org/wiki/anandamide"&gt;anandamide&lt;/a&gt;'; and (2) &lt;a href="http://depth-first.com/articles/2007/09/18/six-reasons-i-like-recaptcha-or-how-to-build-a-web-service-worth-talking-about"&gt;reCaptcha&lt;/a&gt; text to keep robots from making mischief.&lt;/p&gt;

&lt;p&gt;Submitting this information is all that's needed to create a new or updated link from Chempedia to Wikipedia. Chempedia handles the rest.&lt;/p&gt;

&lt;h4&gt;Conclusions&lt;/h4&gt;

&lt;p&gt;Wikipedia is a vast source of free, high-quality, semi-structured chemical information just waiting to have good chemically-aware interfaces applied to it. Chempedia.net is an attempt to do just that, but it's a bit more as well. Although it may appear that Chempedia is the major beneficiary in this relationship, Wikipedia also benefits. When chemists have a tool that allows them to query and visualize Wikipedia using their native language (the chemical structure) they're in a better position to both use and contribute to Wikipedia itself - something I've started to do.&lt;/p&gt;

&lt;p&gt;This positive feedback effect is the real value of exposing Web services. The question is: who in cheminformatics is willing and able to take the risk to discover this simple principle and its benefits?&lt;/p&gt;</description>
      <pubDate>Thu, 17 Apr 2008 17:50:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:9db0f83e-ebaf-49cc-af9d-03d44250c05d</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/04/17/user-created-compound-monographs-on-chempedia-net-open-sourcing-the-collation-and-indexing-of-chemical-information</link>
      <category>Tools</category>
      <category>chempedia</category>
      <category>wikipedia</category>
      <category>webservice</category>
      <category>mashup</category>
      <category>compoundmonograph</category>
      <category>merckindex</category>
    </item>
    <item>
      <title>Chempedia.net: Mashing Up PubChem and Wikipedia</title>
      <description>&lt;p&gt;&lt;a href="http://chempedia.com"&gt;&lt;img src="http://chempedia.net/images/global/logo.png" align="right"&gt;&lt;/img&gt;&lt;/a&gt;&lt;a href="http://pubchem.ncbi.nlm.nih.gov/"&gt;PubChem&lt;/a&gt; and &lt;a href="http://wikipedia.net"&gt;Wikipedia&lt;/a&gt; represent two of the largest open repositories of chemical information in the world. And they complement each other very nicely. PubChem contains mainly low-level chemical structure information whereas Wikipedia contains free-text descriptions of chemical compounds in the form of &lt;a href="http://depth-first.com/articles/2008/04/02/wikipedia-for-cheminformatics-a-simple-web-api-for-finding-cas-numbers-in-compound-monographs"&gt;compound monographs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Both services offer permission and access to copy and reuse their contents. But neither service is, by itself, nearly as useful as it could be.&lt;/p&gt;

&lt;p&gt;Why not mash them up?&lt;/p&gt;

&lt;p&gt;To explore that question my company, &lt;a href="http://metamolecular.com"&gt;Metamolecular, LLC&lt;/a&gt; has launched &lt;a href="http://chempedia.com"&gt;Chempedia&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To my knowledge, Chempedia represents the first publicly-facing database of compounds to incorporate Wikipedia's collection of organic compound monographs. And it's one of the few cheminformatics services to make use of free-text descriptions generated by individual chemists.&lt;/p&gt;

&lt;p&gt;Chempedia has been somewhat selective about the compounds it includes. To date, it has spidered over 2,500 monographs, combining them with over 300,000 of the most interesting compounds from PubChem. Not every Chempedia.net molecule has a monograph, but now there's a tool that can actually make that absence apparent.&lt;/p&gt;

&lt;p&gt;Chempedia is both an experiment and a service. It's immediately useful for anyone in the business of making or doing things with organic molecules. It's created several unexpected moments of "Oh, that's actually a useful molecule!" It also will serve as a platform to test some of the ideas discussed in Depth-First over the last year or so on the advantages of the Web for collaboration in chemistry.&lt;/p&gt;

&lt;p&gt;Stay tuned for more details about how Chempedia was created and some of its applications in chemistry.&lt;/p&gt;</description>
      <pubDate>Fri, 04 Apr 2008 10:06:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:168432fb-c064-43c2-a60d-728c7c29c406</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/04/04/chempedia-net-mashing-up-pubchem-and-wikipedia</link>
      <category>Tools</category>
      <category>chempedia</category>
      <category>wikipedia</category>
      <category>pubchem</category>
      <category>rails</category>
      <category>ruby</category>
      <category>chemwriter</category>
      <category>applet</category>
      <category>java</category>
      <category>jruby</category>
    </item>
    <item>
      <title>Wikipedia for Cheminformatics: A Simple Web API for Finding CAS Numbers in Compound Monographs</title>
      <description>&lt;p&gt;&lt;a href="http://wikipedia.org"&gt;&lt;img src="http://depth-first.com/demo/20070123/wikipedia.jpg" align="right"&gt;&lt;/img&gt;&lt;/a&gt;Good news for cheminformatics: Chemical Abstracts Service (CAS) &lt;a href="http://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Chemistry/CAS_validation"&gt;has agreed&lt;/a&gt; to help Wikipedia users curate its collection of CAS numbers. As a result of the diligence of some hard-working volunteers, chemistry's most universal system for referring to chemicals can now be used far more effectively by the worlds biggest open repository of knowledge.&lt;/p&gt;

&lt;p&gt;Wouldn't it be great to be able to pull these CAS numbers from Wikipedia programmatically?&lt;/p&gt;

&lt;h4&gt;Perspective&lt;/h4&gt;

&lt;p&gt;Estimates place the number of Wikipedia pages dealing with individual &lt;a href="http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Chemicals/Inorganics"&gt;inorganic&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/List_of_organic_compounds"&gt;organic&lt;/a&gt; substances in the thousands. (I'll use the term "compound monographs" to describe them.) One factor acting to keep this number low is poor visibility of these entries. Unlike most &lt;a href="http://depth-first.com/articles/2007/01/24/thirty-two-free-chemistry-databases"&gt;chemical databases&lt;/a&gt;, Wikipedia can't, by itself, be easily searched by structure. As chemically-aware tools for indexing Wikipedia begin to emerge, look for six things to happen:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The number of Wikipedia compound monographs will increase significantly.&lt;/li&gt;
&lt;li&gt;The quality of monographs for intermediate- to well-known compounds will increase substantially.&lt;/li&gt;
&lt;li&gt;Demand for user-friendly interfaces to Wikipedia's chemical content will increase.&lt;/li&gt;
&lt;li&gt;Wikipedia users will become interested in storing and finding ever more diverse kinds of information about each compound.&lt;/li&gt;
&lt;li&gt;Bench chemists will start to include Wikipedia as one of their preferred literature search techniques, leading to...&lt;/li&gt;
&lt;li&gt;More creative tools for using the chemical content of Wikipedia.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As noted previously, it wasn't too long ago that indexing of the chemical literature &lt;a href="http://depth-first.com/articles/2006/08/19/history-of-abstracting-at-chemical-abstracts-service"&gt;was done solely by volunteers&lt;/a&gt;. Wikipedia offers an intriguing way to channel the innate drive for chemists to combine their own work and experience with that of others to build useful information tools for the community.&lt;/p&gt;

&lt;p&gt;But for now we are left with the question of how to index the chemical content of Wikipedia. Although a few systems have been proposed, the only practical method is through the use of CAS numbers. Which brings us to the subject of today's tutorial.&lt;/p&gt;

&lt;h4&gt;A Quick CAS Number API for Wikipedia&lt;/h4&gt;

&lt;p&gt;The Ruby program below will accept the title of any Wikipedia compound monograph title and return the CAS number for the compound being discussed, or an error message if none was found:&lt;/p&gt;

&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;rubygems&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;hpricot&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;open-uri&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;cgi&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;

&lt;span class="keyword"&gt;class &lt;/span&gt;&lt;span class="class"&gt;Wikikemi&lt;/span&gt;
  &lt;span class="attribute"&gt;@cas&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;nil&lt;/span&gt;

  &lt;span class="ident"&gt;attr_reader&lt;/span&gt; &lt;span class="symbol"&gt;:cas&lt;/span&gt;

  &lt;span class="keyword"&gt;def &lt;/span&gt;&lt;span class="method"&gt;initialize&lt;/span&gt; &lt;span class="ident"&gt;title&lt;/span&gt;
    &lt;span class="ident"&gt;uri&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;URI&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;escape&lt;/span&gt;&lt;span class="punct"&gt;(&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;http://en.wikipedia.org/wiki/&lt;span class="expr"&gt;#{title}&lt;/span&gt;&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;)&lt;/span&gt;
    &lt;span class="ident"&gt;puts&lt;/span&gt; &lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;loading... &lt;span class="expr"&gt;#{uri}&lt;/span&gt;&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;
    &lt;span class="ident"&gt;doc&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;Hpricot&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;open&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;uri&lt;/span&gt;&lt;span class="punct"&gt;))&lt;/span&gt;
    &lt;span class="ident"&gt;table&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;doc&lt;/span&gt;&lt;span class="punct"&gt;/&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;table&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;)[&lt;/span&gt;&lt;span class="number"&gt;0&lt;/span&gt;&lt;span class="punct"&gt;]&lt;/span&gt;

    &lt;span class="ident"&gt;table&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;inner_html&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;match&lt;/span&gt;&lt;span class="punct"&gt;(/&lt;/span&gt;&lt;span class="regex"&gt;([0-9]{2,7}?&lt;span class="escape"&gt;\-&lt;/span&gt;[0-9]{2}&lt;span class="escape"&gt;\-&lt;/span&gt;[0-9])&lt;/span&gt;&lt;span class="punct"&gt;/)&lt;/span&gt; &lt;span class="keyword"&gt;if&lt;/span&gt; &lt;span class="ident"&gt;table&lt;/span&gt;

    &lt;span class="attribute"&gt;@cas&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="global"&gt;$1&lt;/span&gt;
  &lt;span class="keyword"&gt;end&lt;/span&gt;
&lt;span class="keyword"&gt;end&lt;/span&gt;

&lt;span class="comment"&gt;# Returns the CAS number present in the Wikipedia monograph with&lt;/span&gt;
&lt;span class="comment"&gt;# the indicated title, or an error message if none is found. Try, for example,&lt;/span&gt;
&lt;span class="comment"&gt;# &amp;quot;benzene.&amp;quot;.&lt;/span&gt;
&lt;span class="keyword"&gt;while&lt;/span&gt; &lt;span class="constant"&gt;true&lt;/span&gt;
  &lt;span class="ident"&gt;puts&lt;/span&gt; &lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;Enter the title of the Wikipedia page, for example: 'benzene'&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;
  &lt;span class="ident"&gt;monograph_title&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="ident"&gt;gets&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;chomp&lt;/span&gt;
  &lt;span class="ident"&gt;w&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;Wikikemi&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;new&lt;/span&gt; &lt;span class="ident"&gt;monograph_title&lt;/span&gt;
  &lt;span class="ident"&gt;puts&lt;/span&gt; &lt;span class="ident"&gt;w&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;cas&lt;/span&gt; &lt;span class="punct"&gt;?&lt;/span&gt; &lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;[&lt;span class="expr"&gt;#{w.cas}&lt;/span&gt;]&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="punct"&gt;:&lt;/span&gt; &lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;CAS number not found&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;
&lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This program makes use of the excellent Ruby HTML parser, &lt;a href="http://code.whytheluckystiff.net/hpricot/"&gt;Hpricot&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Saving the above code to a file called &lt;strong&gt;wikikemi.rb&lt;/strong&gt;, we can run it with:&lt;/p&gt;

&lt;div class="console"&gt;
&lt;pre&gt;
$ ruby wikikemi.rb
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;For example, we can look up the CAS numbers for Ferrocene, Lipitor, or 1,2,3,4,4a,5,6,7,8,8a-Decahydronaphthalene:&lt;/p&gt;

&lt;div class="console"&gt;
&lt;pre&gt;
$ ruby wikikemi.rb
Enter the title of the Wikipedia page, for example: 'benzene'
ferrocene
loading... http://en.wikipedia.org/wiki/ferrocene
[102-54-5]
Enter the title of the Wikipedia page, for example: 'benzene'
lipitor
loading... http://en.wikipedia.org/wiki/lipitor
[134523-00-5]
Enter the title of the Wikipedia page, for example: 'benzene'
1,2,3,4,4a,5,6,7,8,8a-Decahydronaphthalene
loading... http://en.wikipedia.org/wiki/1,2,3,4,4a,5,6,7,8,8a-Decahydronaphthalene
[91-17-8]
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;All this method requires is that the Wikipedia page lists the correct CAS number in its &lt;a href="http://en.wikipedia.org/wiki/Template:Drugbox"&gt;Drugbox&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/Template:Chembox_new"&gt;Chembox&lt;/a&gt; template. Fortunately, CAS has agreed to help make this happen.&lt;/p&gt;

&lt;h4&gt;Conclusions&lt;/h4&gt;

&lt;p&gt;A little Ruby code is all it takes to build a working CAS number lookup system using Wikipedia. Although this may be useful as a standalone tool, it becomes much more powerful when made part of &lt;a href="http://depth-first.com/articles/2007/05/21/simple-cas-number-lookup-with-pubchem"&gt;a larger cheminformatics system&lt;/a&gt;. But that's a story for another time.&lt;/p&gt;

&lt;p&gt;See also &lt;a href="http://www.chemspider.com/blog/a-message-of-support-and-public-service-from-the-chemical-abstracts-service.html"&gt;Antony Williams' announcement on CAS and Wikipedia&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Wed, 02 Apr 2008 17:29:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:c11402b2-406a-4ec9-8b65-fc34da179c1a</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/04/02/wikipedia-for-cheminformatics-a-simple-web-api-for-finding-cas-numbers-in-compound-monographs</link>
      <category>Tools</category>
      <category>cas</category>
      <category>acs</category>
      <category>casnumber</category>
      <category>lookup</category>
      <category>wikipedia</category>
      <category>ruby</category>
    </item>
    <item>
      <title>NetBeans 6, Ruby, and Rails: A Surprisingly Effective Combination</title>
      <description>&lt;p&gt;For far too long Ruby has lacked a development environment that supported important features developers in other languages now take for granted: code completion; refactoring; platform-independence; and speed. Although &lt;a href="http://www.netbeans.org/"&gt;NetBeans&lt;/a&gt; may not spring to mind when thinking of Rails IDEs, it should be at the top of the list for anyone interested in the subject.&lt;/p&gt;

&lt;p&gt;Getting started with Ruby, Rails and NetBeans is as easy as &lt;a href="http://download.netbeans.org/netbeans/6.0/final/"&gt;downloading the installer&lt;/a&gt; and running it. If you later decide to add Java support to your installation (which is also excellent), that can be done by downloading and running the &lt;a href="http://download.netbeans.org/netbeans/6.0/final/"&gt;Java installer&lt;/a&gt;. You'll end up with a single IDE that supports both languages.&lt;/p&gt;

&lt;h4&gt;Code Completion&lt;/h4&gt;

&lt;p&gt;Although other IDEs support some form of Ruby code completion, NetBeans takes it to another level. Can't remember the exact name of the method you're looking for? Type the period and let NetBeans look up both the name and documentation for you:&lt;/p&gt;

&lt;p&gt;&lt;center&gt;&lt;img src="http://depth-first.com/demo/20080326/code_completion.png"&gt;&lt;/img&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;Hitting return enters the method and creates a template for parameters and any needed blocks.&lt;/p&gt;

&lt;h4&gt;Refactoring&lt;/h4&gt;

&lt;p&gt;One of the things that makes Java such a powerful language for large projects is the refactoring support offered by most IDEs. NetBeans brings this power to Ruby. Need to rename a class, method, or variable? Let NetBeans do it for you:&lt;/p&gt;

&lt;p&gt;&lt;center&gt;&lt;img src="http://depth-first.com/demo/20080326/refactor.png"&gt;&lt;/img&gt;&lt;/center&gt;&lt;/p&gt;

&lt;h4&gt;Conclusions&lt;/h4&gt;

&lt;p&gt;There's much more to NetBeans 6 and Ruby/Rails than what's been shown here, including formatting/highlighting for JavaScript and CSS, user-definable Ruby/JRuby interpreter, and menu-based script execution. Whether you're looking for a way to get started with using Ruby and Rails or a way to become more efficient at it, NetBeans 6 is well worth the time.&lt;/p&gt;</description>
      <pubDate>Thu, 27 Mar 2008 13:46:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:b1fbcff2-4f5b-496f-9eeb-35f96e8d0b5d</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/03/27/netbeans-6-ruby-and-rails-a-surprisingly-effective-combination</link>
      <category>Tools</category>
      <category>ruby</category>
      <category>rails</category>
      <category>netbeans</category>
      <category>ide</category>
      <category>refactoring</category>
      <category>codecompletion</category>
    </item>
  </channel>
</rss>
