<?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/owl.xml" rel="self" type="application/atom+xml" /><link href="https://chem-bla-ics.linkedchemistry.info/" rel="alternate" type="text/html" /><updated>2026-07-18T13:36:15+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/feed/by_tag/owl.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">Coding an OWL ontology in HTML5 and RDFa</title><link href="https://chem-bla-ics.linkedchemistry.info/2015/09/27/coding-owl-ontology-in-html5-and-rdfa.html" rel="alternate" type="text/html" title="Coding an OWL ontology in HTML5 and RDFa" /><published>2015-09-27T00:00:00+00:00</published><updated>2015-09-27T00:00:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2015/09/27/coding-owl-ontology-in-html5-and-rdfa</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2015/09/27/coding-owl-ontology-in-html5-and-rdfa.html"><![CDATA[<p><img src="/assets/images/bdbOnto.png" style="width: 30%; display: block; margin-left: auto; margin-right: auto; float: right" />
There are many fancy tools to edit ontologies. I like simple editors, like <a href="https://en.wikipedia.org/wiki/GNU_nano">nano</a>. And like any hacker, I can hack
<a href="https://en.wikipedia.org/wiki/Web_Ontology_Language">OWL</a> ontologies in nano. The hacking implies OWL was never meant to be hacked on a simple text editor;
I am not sure that is really true. Anyways, <a href="https://en.wikipedia.org/wiki/HTML5">HTML5</a> and <a href="https://en.wikipedia.org/wiki/RDFa">RDFa</a> will do fine, and
here is a brief write up. This post will not cover the basics of RDFa and does assume you already know how triples work. If not, read this
<a href="http://www.w3.org/TR/xhtml-rdfa-primer/">RDFa primer</a> first.</p>

<h2 id="the-bridgedb-datasource-ontology">The BridgeDb DataSource Ontology</h2>
<p>This example uses the <a href="http://www.bridgedb.org/">BridgeDb</a> DataSource Ontology, created by BridgeDb developers from Manchester University (Christian,
Stian, and Alasdair). The ontology covers describing data sources of identifiers, a technology outlined in the BridgeDb paper by Martijn (see below)
as well as terms from the Open PHACTS <a href="http://www.openphacts.org/specs/datadesc/">Dataset Descriptions for the Open Pharmacological Space</a>
by Alasdair et al.</p>

<p>Because I needed to put this online for <a href="https://www.openphacts.org/">Open PHACTS</a> (BTW,
<a href="https://www.openphacts.org/news-and-events/news-archive/2015/398-open-phacts-wins-the-european-linked-data-contest">the project won a big award</a>!)
and our previous solution did not work well enough anymore. You may also see the HTML of the result first. You may also want to verify it really is
<a href="http://vocabularies.bridgedb.org/ops">HTML</a>: here is the <a href="https://validator.w3.org/nu/?doc=http://vocabularies.bridgedb.org/ops">HTML5 validation report</a>.
Also, you may be interested in what the ontology in RDF looks like: here is
<a href="http://www.w3.org/2012/pyRdfa/extract?uri=http://vocabularies.bridgedb.org/ops#">the extracted RDF for the ontology</a>.
Now follow the HTML+RDFa snippets. First, the ontology details (actually, I have it split up):</p>

<pre>&lt;div <span style="color: red;">about="</span><span style="background-color: #76a5af; color: white;">http://vocabularies.bridgedb.org/ops#</span><span style="color: red;">"
     typeof="</span><span style="background-color: #76a5af; color: white;">owl:Ontology</span><span style="color: red;">"</span>&gt;
  &lt;h1&gt;The &lt;span <span style="color: red;">property="rdfs:label"</span>&gt;<span style="background-color: #6fa8dc;"><span style="color: white;">BridgeDb DataSource Ontology</span></span>&lt;/span&gt;
    (version &lt;span <span style="color: red;">property="owl:versionInfo"</span>&gt;<span style="background-color: #6fa8dc; color: white;">2.1.0</span>&lt;/span&gt;)&lt;/h1&gt;
  &lt;p&gt;
    This page describes the BridgeDb ontology. Make sure to visit our
    &lt;a <span style="color: red;">property="rdfs:seeAlso"</span> href="<span style="background-color: #76a5af;"><span style="color: white;">http://www.bridgedb.org/</span></span>"&gt;homepage&lt;/a&gt; too!
  &lt;/p&gt;
&lt;/div&gt;
&lt;p <span style="color: red;">about="</span><span style="background-color: #76a5af; color: white;">http://vocabularies.bridgedb.org/ops#</span><span style="color: red;">"</span>&gt;
  The OWL ontology can be extracted
  &lt;a <span style="color: red;">property="owl:versionIRI"</span>
     href="<span style="background-color: #76a5af; color: white;">http://www.w3.org/2012/pyRdfa/extract?uri=http://vocabularies.bridgedb.org/ops#</span>"&gt;here&lt;/a&gt;.
  The Open PHACTS specification on
  &lt;a <span style="color: red;">property="rdf:seeAlso"</span>
    href="<span style="background-color: #76a5af;"><span style="color: white;">http://www.openphacts.org/specs/2013/WD-datadesc-20130912/#bridgedb</span></span>"
  &gt;Dataset Descriptions&lt;/a&gt; is also useful.
&lt;/p&gt;
</pre>

<p>This is the last time I show the custom color coding, but for a first time it is useful. In red are basically the predicates, where <code class="language-plaintext highlighter-rouge">@about</code>
indicates a new resource is started, <code class="language-plaintext highlighter-rouge">@typeof</code> defines the <code class="language-plaintext highlighter-rouge">rdf:type</code>, and <code class="language-plaintext highlighter-rouge">@property</code> indicates all other predicates. The blue and
green blobs are literals and object resources, respectively. If you work this out, you get this OWL code (more or less):</p>

<div class="language-turtle highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nn">bridgedb:</span><span class="w"> </span><span class="k">a</span><span class="w"> </span><span class="nn">owl:</span><span class="n">Ontology</span><span class="p">;</span><span class="w">
  </span><span class="nn">rdfs:</span><span class="n">label</span><span class="w"> </span><span class="s">"BridgeDb DataSource Ontology"</span><span class="na">@en</span><span class="p">;</span><span class="w">
  </span><span class="nn">rdf:</span><span class="n">seeAlso
</span><span class="w">    </span><span class="nl">&lt;http://www.openphacts.org/specs/2013/WD-datadesc-20130912/#bridgedb&gt;</span><span class="p">;</span><span class="w">
  </span><span class="nn">rdfs:</span><span class="n">seeAlso</span><span class="w"> </span><span class="nl">&lt;http://www.bridgedb.org/&gt;</span><span class="p">;</span><span class="w">
  </span><span class="nn">owl:</span><span class="n">versionIRI
</span><span class="w">    </span><span class="nl">&lt;http://www.w3.org/2012/pyRdfa/extract?uri=http://vocabularies.bridgedb.org/ops#&gt;</span><span class="p">;</span><span class="w">
  </span><span class="nn">owl:</span><span class="n">versionInfo</span><span class="w"> </span><span class="s">"2.1.0"</span><span class="na">@en</span><span class="w"> </span><span class="p">.</span><span class="w">
</span></code></pre></div></div>

<h2 id="an-owl-class">An OWL class</h2>
<p>Defining OWL classes are using the same approach: define the resource it is <code class="language-plaintext highlighter-rouge">@about</code>, define the <code class="language-plaintext highlighter-rouge">@typeOf</code> and giving is properties.
BTW, note that I added a <code class="language-plaintext highlighter-rouge">@id</code> so that ontology terms can be looked up using the HTML # functionality. For example:</p>

<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;div</span> <span class="na">id=</span><span class="s">"DataSource"</span>
  <span class="na">about=</span><span class="s">"http://vocabularies.bridgedb.org/ops#DataSource"</span>
  <span class="na">typeof=</span><span class="s">"owl:Class"</span><span class="nt">&gt;</span>
  <span class="nt">&lt;h3</span> <span class="na">property=</span><span class="s">"rdfs:label"</span><span class="nt">&gt;</span>Data Source<span class="nt">&lt;/h3&gt;</span>
  <span class="nt">&lt;p</span> <span class="na">property=</span><span class="s">"dc:description"</span><span class="nt">&gt;</span>A resource that defines
    identifiers for some biological entity, like a gene,
    protein, or metabolite.<span class="nt">&lt;/p&gt;</span>
<span class="nt">&lt;/div&gt;</span>
</code></pre></div></div>

<h2 id="an-owl-object-property">An OWL object property</h2>
<p>Defining an OWL data property is pretty much the same, but note that we can arbitrary add additional things, making use of <code class="language-plaintext highlighter-rouge">&lt;span&gt;</code>,
<code class="language-plaintext highlighter-rouge">&lt;div&gt;</code>, and <code class="language-plaintext highlighter-rouge">&lt;p&gt;</code> elements. The following example also defines the <code class="language-plaintext highlighter-rouge">rdfs:domain</code> and <code class="language-plaintext highlighter-rouge">rdfs:range</code>:</p>

<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;div</span> <span class="na">id=</span><span class="s">"aboutOrganism"</span>
  <span class="na">about=</span><span class="s">"http://vocabularies.bridgedb.org/ops#aboutOrganism"</span>
  <span class="na">typeof=</span><span class="s">"owl:ObjectProperty"</span><span class="nt">&gt;</span>
  <span class="nt">&lt;h3</span> <span class="na">property=</span><span class="s">"rdfs:label"</span><span class="nt">&gt;</span>About Organism<span class="nt">&lt;/h3&gt;</span>
  <span class="nt">&lt;p&gt;&lt;span</span> <span class="na">property=</span><span class="s">"dc:description"</span><span class="nt">&gt;</span>Organism for all entities
    with identifiers from this datasource.<span class="nt">&lt;/span&gt;</span>
    This property has
    <span class="nt">&lt;a</span> <span class="na">property=</span><span class="s">"rdfs:domain"</span>
      <span class="na">href=</span><span class="s">"http://vocabularies.bridgedb.org/ops#DataSource"</span><span class="nt">&gt;</span>DataSource<span class="nt">&lt;/a&gt;</span>
    as domain and
    <span class="nt">&lt;a</span> <span class="na">property=</span><span class="s">"rdfs:range"</span>
      <span class="na">href=</span><span class="s">"http://vocabularies.bridgedb.org/ops#Organism"</span><span class="nt">&gt;</span>Organism<span class="nt">&lt;/a&gt;</span>
    as range.<span class="nt">&lt;/p&gt;</span>
<span class="nt">&lt;/div&gt;</span>
</code></pre></div></div>

<p>So, now anyone can host an OWL ontology with dereferencable terms: to remove confusion, I have used the full URLs of the terms in <code class="language-plaintext highlighter-rouge">@about</code> attributes.</p>]]></content><author><name>Egon Willighagen</name></author><category term="ontology" /><category term="bridgedb" /><category term="web" /><category term="rdf" /><category term="owl" /><category term="justdoi:10.1186/1471-2105-11-5" /><summary type="html"><![CDATA[There are many fancy tools to edit ontologies. I like simple editors, like nano. And like any hacker, I can hack OWL ontologies in nano. The hacking implies OWL was never meant to be hacked on a simple text editor; I am not sure that is really true. Anyways, HTML5 and RDFa will do fine, and here is a brief write up. This post will not cover the basics of RDFa and does assume you already know how triples work. If not, read this RDFa primer first.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://chem-bla-ics.linkedchemistry.info/assets/images/bdbOnto.png" /><media:content medium="image" url="https://chem-bla-ics.linkedchemistry.info/assets/images/bdbOnto.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Citing the Chemistry Development Kit</title><link href="https://chem-bla-ics.linkedchemistry.info/2010/02/18/citing-chemistry-development-kit.html" rel="alternate" type="text/html" title="Citing the Chemistry Development Kit" /><published>2010-02-18T00:00:00+00:00</published><updated>2010-02-18T00:00:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2010/02/18/citing-chemistry-development-kit</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2010/02/18/citing-chemistry-development-kit.html"><![CDATA[<p>Two weeks ago, a paper by Peter Ertl was published about <a href="http://www.jcheminf.com/content/2/1/1">Molecular structure input on the web</a>
(doi:<a href="https://doi.org/10.1186/1758-2946-2-1">10.1186/1758-2946-2-1</a>). In this paper, he discusses the state of things and describes his
contribution to this field, the <a href="http://www.molinspiration.com/jme/">JME Molecule Editor</a>. The article also cites the CDK, but only
the website and not one of the two papers (doi:<a href="https://doi.org/10.1021/ci025584y">10.1021/ci025584y</a>, or
doi:<a href="10.2174/138161206777585274">10.2174/138161206777585274</a>). This is not an isolated case, but a common pattern. In principle, the
proper work is cited, and nothing is wrong. Practically it means, that a citation to the <a href="http://cdk.sf.net/">CDK website</a>
does not show up in the citation network. This is <strong><em>not</em></strong> a problem caused by these papers, but merely by the nature current citation
databases work: they only count citations between journal articles, and only sometimes extend to books or conference abstracts.</p>

<p>Now, addressing the limitations of the current citation databases is technically simple, and purely blocked by social and commercial
aspects. The Citation Typing Ontology by <a href="http://www.zoo.ox.ac.uk/staff/academics/shotton_dm.htm">David Shotton</a> defines the framework
to define citation types, independent from any existing database. The semantic web technologies will take it from there, and allow
aggregation etc.</p>

<p>There are some things to think about on how to use such citation networks, though. If we calculate the impact of the CDK project,
we should combine citation counts to the website(s), papers, etc, after removal of duplicates, etc. The
<a href="http://imageweb.zoo.ox.ac.uk/pub/2009/citobase/cito-20090311/cito-content/owldoc/objectproperties/cites.html">cito:cites</a> does
link to resources, and the CDK paper resources is not the same as the CDK website resource. But, we could define a Project Class,
where both are foo:partOf. Then, we could define that <em>the triple chain the:citingWork cito:cites the:CDKArticle foo:partOf the:CDKProject</em>
would imply <em>the triple the:citingWork cito:cites the:CDKProject</em>.</p>

<h2 id="typed-citations">Typed Citations</h2>

<p>Now, while writing up this blog, I realize that my fork of this morning, <a href="http://github.com/egonw/bibo-cto">A BIBO Citation Typing Ontology</a>,
might actually be counter-productive in the long run, as I was only working out a solution to a simpler, but different problem, which the
CiTO also addresses: a citation is not typed. When a paper does cite the CDK paper, we still do not know if it <em>uses</em> the CDK, or
merely mentioned it as <em>related-but-unused</em>, or even <em>refuted</em> work.</p>

<p>Now, as I am leaning towards the Biobliography Ontology as RDF-based system for my references, and been using this already in the
<a href="http://rdf.farmbio.uu.se/chembl/snorql/">RDF store hosting the ChEMBL data</a>,
I forked the CiTO to define rdfs:domain and rdfs:range on <a href="http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/classes/Document___-538479979.html">bibo:Document</a>.
The CiTO 1.5 actually defines a large set of document types too, and I rather see BIBO reused.</p>

<p>This indeed has the downside that the bibocto:cites cannot be used for the above chaining, and this might bite me seriously later.
Well, nothing wrong with a failing experiment, right? For now, it will serve my purpose: setting up a citation database for the CDK
project papers.</p>

<h2 id="the-cdk-citation-database">The CDK citation database</h2>

<p>So, here goes (it’s <a href="http://www.w3.org/TR/xhtml-rdfa-primer/">RDFa-enabled</a>; check this
<a href="http://www.w3.org/2007/08/pyRdfa/extract?uri=http://chem-bla-ics.blogspot.com/2010/02/citing-chemistry-development-kit.html">RDF pulled out</a>): <!-- keep link --></p>

<pre xmlns:bibo="http://purl.org/ontology/bibo/" xmlns:bibocto="http://github.com/egonw/bibo-cto/" about="urn:doi:10.1021/ci025584y" rel="bibocto:cites" typeof="bibo:Article">@prefix bibo: &lt;http://purl.org/ontology/bibo/&gt;.
@prefix bibocto: &lt;http://github.com/egonw/bibo-cto/&gt;.

&lt;urn:doi:10.1186/1758-2946-2-1&gt; a bibo:Article ;
  bibocto:cites <span about="urn:doi:10.1021/ci025584y">&lt;urn:doi:10.1021/ci025584y&gt;</span> .
</pre>

<p>I am not entirely happy about the error-prone XHTML+RDFa of the above example, and
<a href="http://www.semanticoverflow.com/questions/573/how-to-create-rdfa-powered-n3-in-the-html-output">filed a question of better solution</a> on
<a href="http://www.semanticoverflow.com/">SemanticOverflow</a>.</p>

<p>While the above example merely defines the citation of Peter Ertl’s article to the CDK (whether that is valid or not… would
he have cited the other paper perhaps?), the citation typing allows me to state how the CDK paper is cited. Now, Peter states:</p>

<blockquote>
  <p>It is also gratifying to see the advent of open source movement in cheminformatics on the Internet, as advocated for example
by the Blue Obelisk Group (<a href="http://blueobelisk.sourceforge.net/wiki/Main_Page">40</a>) and witnessed by collaborative projects
like Chemistry Development Kit CDK (<a href="http://sourceforge.net/apps/mediawiki/cdk/index.php?title=Main_Page">41</a>),
Jmol (<a href="http://jmol.sourceforge.net/">42</a>), Bioclipse (<a href="http://www.bioclipse.net/">43</a>) and several others.</p>
</blockquote>

<p>So, I think it is fair to state that:</p>

<pre xmlns:bibo="http://purl.org/ontology/bibo/" xmlns:bibocto="http://github.com/egonw/bibo-cto/" about="urn:doi:10.1021/ci025584y" rel="bibocto:credits">&lt;urn:doi:10.1186/1758-2946-2-1&gt; bibocto:credits <span about="urn:doi:10.1021/ci025584y">&lt;urn:doi:10.1021/ci025584y&gt;</span> .
</pre>

<p>which is very much appreciated!</p>]]></content><author><name>Egon Willighagen</name></author><category term="cdk" /><category term="cito" /><category term="bioclipse" /><category term="jchempaint" /><category term="jmol" /><category term="rdf" /><category term="owl" /><category term="justdoi:10.1186/1758-2946-2-1" /><category term="doi:10.1021/CI025584Y" /><category term="doi:10.1021/CI025584Y" /><summary type="html"><![CDATA[Two weeks ago, a paper by Peter Ertl was published about Molecular structure input on the web (doi:10.1186/1758-2946-2-1). In this paper, he discusses the state of things and describes his contribution to this field, the JME Molecule Editor. The article also cites the CDK, but only the website and not one of the two papers (doi:10.1021/ci025584y, or doi:10.2174/138161206777585274). This is not an isolated case, but a common pattern. In principle, the proper work is cited, and nothing is wrong. Practically it means, that a citation to the CDK website does not show up in the citation network. This is not a problem caused by these papers, but merely by the nature current citation databases work: they only count citations between journal articles, and only sometimes extend to books or conference abstracts.]]></summary></entry><entry><title type="html">Metabolomics Ontologies: SKOS-ified the ArMet specification</title><link href="https://chem-bla-ics.linkedchemistry.info/2008/03/03/metabolomics-ontologies-skos-ified.html" rel="alternate" type="text/html" title="Metabolomics Ontologies: SKOS-ified the ArMet specification" /><published>2008-03-03T00:00:00+00:00</published><updated>2008-03-03T00:00:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2008/03/03/metabolomics-ontologies-skos-ified</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2008/03/03/metabolomics-ontologies-skos-ified.html"><![CDATA[<p>The <a href="https://chem-bla-ics.linkedchemistry.info/2007/11/22/metware-metabolomics-database-project.html">MetWare project <i class="fa-solid fa-recycle fa-xs"></i></a>
is going to make use of ontology
technologies to control the content of the database, and a first step is to convert <a href="http://metware.svn.sourceforge.net/viewvc/metware/trunk/metware/design/">our MetWare database design</a>
into something using a formal ontology language. I have played with <a href="http://en.wikipedia.org/wiki/Web_Ontology_Language">OWL</a>
in the past (see for example
<a href="https://chem-bla-ics.linkedchemistry.info/2007/04/24/bioclipse-now-allows-qsar-descriptor.html">its use in Bioclipse <i class="fa-solid fa-recycle fa-xs"></i></a>),
but was not overly happy with it in all situations.</p>

<p>Then I read about <a href="http://en.wikipedia.org/wiki/SKOS">SKOS</a>, Simplified Knowledge Organisation System. Unlike OWL, SKOS is less strict on relations
between concepts being marked up. Often these concepts are loosely bound, instead following a strict <em>is_a</em> hierarchy.
<a href="http://www.armet.org/">ArMet</a> is a Metabolomics knowledge system which does not have a strong hierarchy, and SKOS seemed to me to be the most
suitable markup candidate. So, I SKOS-ified the ArMet specification, resulting in <a href="http://metware.svn.sourceforge.net/viewvc/*checkout*/metware/trunk/metware/design/onto/armet.skos?revision=HEAD&amp;content-type=text%2Fxml">this rather simple document</a>.
The document is SKOS, but has an associated <a href="http://metware.svn.sourceforge.net/viewvc/*checkout*/metware/trunk/metware/design/onto/skos2html.xsl?revision=HEAD&amp;content-type=text%2Fxml">skos2html.xsl</a>
<a href="http://en.wikipedia.org/wiki/XSLT">XSLT stylesheet</a>, so that Firefox converts it to XHTML on the fly.</p>

<p>An entry looks like:</p>

<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;skos:Concept</span> <span class="na">rdf:about=</span><span class="s">"GenotypeID"</span><span class="nt">&gt;</span>
  <span class="nt">&lt;skos:prefLabel&gt;</span>genotypeID<span class="nt">&lt;/skos:prefLabel&gt;</span>

  <span class="nt">&lt;skos:definition&gt;</span>A unique identifier for the genotype.<span class="nt">&lt;/skos:definition&gt;</span>
  <span class="nt">&lt;skos:broader</span> <span class="na">rdf:about=</span><span class="s">"GenotypeProperty"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/skos:Concept&gt;</span>
</code></pre></div></div>

<p>The full SKOS specification allows capturing much of what we want to do, including i18n via the label system, loos hierarchical relations via
<em>skos:broader</em>, and the concepts of <em>skos:Collection</em> to aggregate concepts. Where needed, it allows borrowing from other languages. For example,
to link concepts from MetWare to the original ArMet specification <em>owl:sameAs</em> can be used.</p>]]></content><author><name>Egon Willighagen</name></author><category term="bioclipse" /><category term="metware" /><category term="ontology" /><category term="semweb" /><category term="owl" /><category term="xml" /><summary type="html"><![CDATA[The MetWare project is going to make use of ontology technologies to control the content of the database, and a first step is to convert our MetWare database design into something using a formal ontology language. I have played with OWL in the past (see for example its use in Bioclipse ), but was not overly happy with it in all situations.]]></summary></entry></feed>