<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.4">Jekyll</generator><link href="https://chem-bla-ics.linkedchemistry.info/feed/by_tag/ubiquity.xml" rel="self" type="application/atom+xml" /><link href="https://chem-bla-ics.linkedchemistry.info/" rel="alternate" type="text/html" /><updated>2026-06-15T12:00:19+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/feed/by_tag/ubiquity.xml</id><title type="html">chem-bla-ics</title><subtitle>Chemblaics (pronounced chem-bla-ics) is the science that uses open science and computers to solve problems in chemistry, biochemistry and related fields.</subtitle><author><name>Egon Willighagen</name></author><entry><title type="html">Ubiquity fun: entering semantic markup as easy as running a Ubiquity command</title><link href="https://chem-bla-ics.linkedchemistry.info/2008/09/01/ubiquity-fun-entering-semantic-markup.html" rel="alternate" type="text/html" title="Ubiquity fun: entering semantic markup as easy as running a Ubiquity command" /><published>2008-09-01T00:10:00+00:00</published><updated>2008-09-01T00:10:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2008/09/01/ubiquity-fun-entering-semantic-markup</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2008/09/01/ubiquity-fun-entering-semantic-markup.html"><![CDATA[<p>Now, the <a href="https://chem-bla-ics.linkedchemistry.info/2008/09/01/ubiquity-fun-resolving-dois.html">DOI ubiquity scripts <i class="fa-solid fa-recycle fa-xs"></i></a> I just blogged about,
was just the beginning of things. Me exploring the environment and learning the JavaScript language.</p>

<p>I start to become really interesting when we use these technologies to improve things. I am still not sure people will like the
command line nature, but at least I will be a happy user. This is the setting: I’m blogging about some chemistry, like to add an
InChI (or InChIKey) and add that <a href="https://chem-bla-ics.linkedchemistry.info/2006/12/10/including-smiles-cml-and-inchi-in.html">cool sechemtic markup <i class="fa-solid fa-recycle fa-xs"></i></a>
people have been blogging about, but I do not know (or want to know) the HTML details for that.</p>

<p>Well, no worries, no more. Here comes <em>sechemtic-inchi</em> (<a href="http://blueobelisk.sourceforge.net/people/egonw/sechemtic-inchi.html">installer here</a>)!</p>

<h2 id="step-1">Step 1</h2>

<p>I type in the InChI I want in my blog (example showing that of <a href="http://en.wikipedia.org/wiki/Methane">methane</a>):</p>

<p><img src="/assets/images/ubiSechemticStep1.png" alt="" /></p>

<p>And, I select the InChI:</p>

<p><img src="/assets/images/ubiSechemticStep1.5.png" alt="" /></p>

<p>After which I hit the Ubiquity shortcut (ALT-SPACE on Linux) and I type <em>sechemtic-inchi</em>:</p>

<p><img src="/assets/images/ubiSechemticStep2.png" alt="" /></p>

<p>And, viola, there is my RDFa HTML code for chemistry:</p>

<p><img src="/assets/images/ubiSechemticStep3.png" alt="" /></p>

<p>Now, with only minor amounts of fantasy, you can imagine where this is going: SMILES, InChiKey, etc, etc. Hook it up with
<a href="http://rguha.wordpress.com/2008/08/30/ubiquity-and-chemical-information/">chemistry webservices</a> to autoconvert
SMILES to InChIKeys, and Bob’s your uncle.</p>]]></content><author><name>Egon Willighagen</name></author><category term="rdf" /><category term="javascript" /><category term="web" /><category term="ubiquity" /><summary type="html"><![CDATA[Now, the DOI ubiquity scripts I just blogged about, was just the beginning of things. Me exploring the environment and learning the JavaScript language.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://chem-bla-ics.linkedchemistry.info/assets/images/ubiSechemticStep1.5.png" /><media:content medium="image" url="https://chem-bla-ics.linkedchemistry.info/assets/images/ubiSechemticStep1.5.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Ubiquity fun: resolving DOIs</title><link href="https://chem-bla-ics.linkedchemistry.info/2008/09/01/ubiquity-fun-resolving-dois.html" rel="alternate" type="text/html" title="Ubiquity fun: resolving DOIs" /><published>2008-09-01T00:00:00+00:00</published><updated>2008-09-01T00:00:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2008/09/01/ubiquity-fun-resolving-dois</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2008/09/01/ubiquity-fun-resolving-dois.html"><![CDATA[<p>Now, I’m really after something else, but here’s my first <a href="https://wiki.mozilla.org/Labs/Ubiquity">Ubiquity</a>
<a href="http://blueobelisk.sourceforge.net/people/egonw/ubiquity.html">scripts</a>. It allow you to select a DOI on any
web page (which really only makes sense if it is not already a hyperlink), you hit ALT-SPACE (Linux), CTRL-SPACE (Windows),
or whatever the shortcut is on your operating system, and type <em>resolve-doi</em> and it will automatically convert the DOI
into a hyperlink to look up the paper.</p>

<p>What I am actually interested in, is being able to use this command in a blog editing environment; however, I
have not managed to get that working in one command. And because I am apparently not able to put in two ubiquity
commands in blog items, you need to go to <a href="http://blueobelisk.sourceforge.net/people/egonw/ubiquity.html">this page</a>.</p>

<p>Second warning. I have only tried them with Ubiquity 0.1, not 0.1.1, or even later.</p>

<p>For the curious, the script looks like:</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">CmdUtils</span><span class="p">.</span><span class="nc">CreateCommand</span><span class="p">({</span>
  <span class="na">name</span><span class="p">:</span> <span class="dl">"</span><span class="s2">resolve-doi</span><span class="dl">"</span><span class="p">,</span>
  <span class="na">homepage</span><span class="p">:</span> <span class="dl">"</span><span class="s2">http://chem-bla-ics.blogspot.com/</span><span class="dl">"</span><span class="p">,</span>
  <span class="na">author</span><span class="p">:</span> <span class="p">{</span> <span class="na">name</span><span class="p">:</span> <span class="dl">"</span><span class="s2">Egon Willighagen</span><span class="dl">"</span><span class="p">,</span> <span class="na">email</span><span class="p">:</span> <span class="dl">"</span><span class="s2">egon.willighagen@gmail.com</span><span class="dl">"</span><span class="p">},</span>
  <span class="na">description</span><span class="p">:</span> <span class="dl">"</span><span class="s2">Resolves a DOI into a URL</span><span class="dl">"</span><span class="p">,</span>
  <span class="na">license</span><span class="p">:</span> <span class="dl">"</span><span class="s2">GPL</span><span class="dl">"</span><span class="p">,</span>
  <span class="na">takes</span><span class="p">:</span> <span class="p">{</span><span class="dl">"</span><span class="s2">doi</span><span class="dl">"</span><span class="p">:</span> <span class="nx">noun_arb_text</span><span class="p">},</span>

  <span class="na">preview</span><span class="p">:</span> <span class="kd">function</span><span class="p">(</span> <span class="nx">pblock</span><span class="p">,</span> <span class="nx">doi</span> <span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">msg</span> <span class="o">=</span> <span class="dl">'</span><span class="s1">Inserts a URL for the DOI: ${doi}</span><span class="dl">'</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">d</span> <span class="o">=</span> <span class="nx">doi</span><span class="p">.</span><span class="nx">text</span> <span class="o">||</span> <span class="nx">CmdUtils</span><span class="p">.</span><span class="nf">getSelection</span><span class="p">();</span>
    <span class="nx">pblock</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">CmdUtils</span><span class="p">.</span><span class="nf">renderTemplate</span><span class="p">(</span><span class="nx">msg</span><span class="p">,</span> <span class="p">{</span><span class="na">doi</span><span class="p">:</span> <span class="nx">d</span><span class="p">});</span>
  <span class="p">},</span>

  <span class="na">execute</span><span class="p">:</span> <span class="kd">function</span><span class="p">(</span> <span class="nx">doi</span> <span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">msg</span> <span class="o">=</span> <span class="dl">'</span><span class="s1">&lt;a href="http://dx.doi.org/${doi}"&gt;${doi}&lt;/a&gt;</span><span class="dl">'</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">d</span> <span class="o">=</span> <span class="nx">doi</span><span class="p">.</span><span class="nx">text</span> <span class="o">||</span> <span class="nx">CmdUtils</span><span class="p">.</span><span class="nf">getSelection</span><span class="p">();</span>
    <span class="kd">var</span> <span class="nx">newText</span> <span class="o">=</span> <span class="nx">CmdUtils</span><span class="p">.</span><span class="nf">renderTemplate</span><span class="p">(</span><span class="nx">msg</span><span class="p">,</span> <span class="p">{</span><span class="na">doi</span><span class="p">:</span> <span class="nx">d</span><span class="p">});</span>
    <span class="nx">CmdUtils</span><span class="p">.</span><span class="nf">setSelection</span><span class="p">(</span><span class="nx">newText</span><span class="p">);</span>
  <span class="p">}</span>
<span class="p">})</span>
</code></pre></div></div>

<p>Comments on this code most welcome! It’s <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>. Details can be found in
<a href="https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_Author_Tutorial">this tutorial</a> and examples in
<a href="http://rguha.wordpress.com/2008/08/30/ubiquity-and-chemical-information/">Rajarshi’s blog</a>.</p>]]></content><author><name>Egon Willighagen</name></author><category term="javascript" /><category term="web" /><category term="doi" /><category term="ubiquity" /><summary type="html"><![CDATA[Now, I’m really after something else, but here’s my first Ubiquity scripts. It allow you to select a DOI on any web page (which really only makes sense if it is not already a hyperlink), you hit ALT-SPACE (Linux), CTRL-SPACE (Windows), or whatever the shortcut is on your operating system, and type resolve-doi and it will automatically convert the DOI into a hyperlink to look up the paper.]]></summary></entry></feed>