{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "chem-bla-ics",
  "description": "Chemblaics (pronounced chem-bla-ics) is the science that uses open science and computers to solve problems in chemistry, biochemistry and related fields.",
  "home_page_url": "https://chem-bla-ics.linkedchemistry.info/",
  "feed_url": "https://chem-bla-ics.linkedchemistry.info/2015/09/27/coding-owl-ontology-in-html5-and-rdfa.json",
  "icon": "https://chem-bla-ics.linkedchemistry.info/assets/images/chem-bla-ics_logo.png",
  "language": "en",
  "authors": [
    {
      "name": "Egon Willighagen",
      "url": "https://orcid.org/0000-0001-7542-0286",
      "_orcid": "0000-0001-7542-0286"
    }
  ],
  "items": [

    {
      "id": "https://doi.org/10.59350/4k55a-8c261",
      "url": "https://chem-bla-ics.linkedchemistry.info/2015/09/27/coding-owl-ontology-in-html5-and-rdfa.html",
      "title": "Coding an OWL ontology in HTML5 and RDFa",
      "content_html": "<p><img src=\"/assets/images/bdbOnto.png\" style=\"width: 30%; display: block; margin-left: auto; margin-right: auto; float: right\" />\nThere 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\n<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;\nI 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\nhere 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\n<a href=\"http://www.w3.org/TR/xhtml-rdfa-primer/\">RDFa primer</a> first.</p>\n\n<h2 id=\"the-bridgedb-datasource-ontology\">The BridgeDb DataSource Ontology</h2>\n<p>This example uses the <a href=\"http://www.bridgedb.org/\">BridgeDb</a> DataSource Ontology, created by BridgeDb developers from Manchester University (Christian,\nStian, and Alasdair). The ontology covers describing data sources of identifiers, a technology outlined in the BridgeDb paper by Martijn (see below)\nas well as terms from the Open PHACTS <a href=\"http://www.openphacts.org/specs/datadesc/\">Dataset Descriptions for the Open Pharmacological Space</a>\nby Alasdair et al.</p>\n\n<p>Because I needed to put this online for <a href=\"https://www.openphacts.org/\">Open PHACTS</a> (BTW,\n<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>!)\nand 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\n<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>.\nAlso, you may be interested in what the ontology in RDF looks like: here is\n<a href=\"http://www.w3.org/2012/pyRdfa/extract?uri=http://vocabularies.bridgedb.org/ops#\">the extracted RDF for the ontology</a>.\nNow follow the HTML+RDFa snippets. First, the ontology details (actually, I have it split up):</p>\n\n<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;\">\"\n     typeof=\"</span><span style=\"background-color: #76a5af; color: white;\">owl:Ontology</span><span style=\"color: red;\">\"</span>&gt;\n  &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;\n    (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;\n  &lt;p&gt;\n    This page describes the BridgeDb ontology. Make sure to visit our\n    &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!\n  &lt;/p&gt;\n&lt;/div&gt;\n&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;\n  The OWL ontology can be extracted\n  &lt;a <span style=\"color: red;\">property=\"owl:versionIRI\"</span>\n     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;.\n  The Open PHACTS specification on\n  &lt;a <span style=\"color: red;\">property=\"rdf:seeAlso\"</span>\n    href=\"<span style=\"background-color: #76a5af;\"><span style=\"color: white;\">http://www.openphacts.org/specs/2013/WD-datadesc-20130912/#bridgedb</span></span>\"\n  &gt;Dataset Descriptions&lt;/a&gt; is also useful.\n&lt;/p&gt;\n</pre>\n\n<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>\nindicates 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\ngreen blobs are literals and object resources, respectively. If you work this out, you get this OWL code (more or less):</p>\n\n<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\">\n  </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\">\n  </span><span class=\"nn\">rdf:</span><span class=\"n\">seeAlso\n</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\">\n  </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\">\n  </span><span class=\"nn\">owl:</span><span class=\"n\">versionIRI\n</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\">\n  </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\">\n</span></code></pre></div></div>\n\n<h2 id=\"an-owl-class\">An OWL class</h2>\n<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.\nBTW, 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>\n\n<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>\n  <span class=\"na\">about=</span><span class=\"s\">\"http://vocabularies.bridgedb.org/ops#DataSource\"</span>\n  <span class=\"na\">typeof=</span><span class=\"s\">\"owl:Class\"</span><span class=\"nt\">&gt;</span>\n  <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>\n  <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\n    identifiers for some biological entity, like a gene,\n    protein, or metabolite.<span class=\"nt\">&lt;/p&gt;</span>\n<span class=\"nt\">&lt;/div&gt;</span>\n</code></pre></div></div>\n\n<h2 id=\"an-owl-object-property\">An OWL object property</h2>\n<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>,\n<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>\n\n<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>\n  <span class=\"na\">about=</span><span class=\"s\">\"http://vocabularies.bridgedb.org/ops#aboutOrganism\"</span>\n  <span class=\"na\">typeof=</span><span class=\"s\">\"owl:ObjectProperty\"</span><span class=\"nt\">&gt;</span>\n  <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>\n  <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\n    with identifiers from this datasource.<span class=\"nt\">&lt;/span&gt;</span>\n    This property has\n    <span class=\"nt\">&lt;a</span> <span class=\"na\">property=</span><span class=\"s\">\"rdfs:domain\"</span>\n      <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>\n    as domain and\n    <span class=\"nt\">&lt;a</span> <span class=\"na\">property=</span><span class=\"s\">\"rdfs:range\"</span>\n      <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>\n    as range.<span class=\"nt\">&lt;/p&gt;</span>\n<span class=\"nt\">&lt;/div&gt;</span>\n</code></pre></div></div>\n\n<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>\n\n<h4>References</h4>\n<div class=\"csl-bib-body\">\n    <div class=\"csl-entry\">van Iersel, M. P., Pico, A. R., Kelder, T., Gao, J., Ho, I., Hanspers, K., Conklin, B. R., &#38; Evelo, C. T. (2010). The BridgeDb framework: standardized access to gene, protein and metabolite identifier mapping services. <i>BMC Bioinformatics</i>, <i>11</i>(1). https://doi.org/10.1186/1471-2105-11-5 <a href=\"https://doi.org/10.1186/1471-2105-11-5\">CrossRef</a> <a href=\"https://qlever.scholia.wiki/doi/10.1186/1471-2105-11-5\">Scholia</a></div>\n  </div>",
      "summary": "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.",
      "image": "https://chem-bla-ics.linkedchemistry.info/assets/images/bdbOnto.png",
      "date_published": "2015-09-27T00:00:00+00:00",
      "date_modified": "2015-09-27T00:00:00+00:00",
      "tags": ["ontology","bridgedb","web","rdf","owl","rdfa"],
      "_references": [
        
          
          
            { "url": "https://doi.org/10.1186/1471-2105-11-5", "doi": "10.1186/1471-2105-11-5"
             }
            
          
        ],
      
      
      
      
      
      
        "authors": [ { "name": "Egon Willighagen", "url": "https://orcid.org/0000-0001-7542-0286" } ]
      
    }

  ]
}
