{"id":293,"date":"2012-03-29T17:45:12","date_gmt":"2012-03-29T17:45:12","guid":{"rendered":"http:\/\/217.76.133.156\/?p=293"},"modified":"2012-03-30T06:58:00","modified_gmt":"2012-03-30T06:58:00","slug":"serializing-an-owl-ontology-in-dl-syntax","status":"publish","type":"post","link":"https:\/\/www.josemalvarez.es\/?p=293","title":{"rendered":"Serializing an OWL ontology in DL-syntax"},"content":{"rendered":"<p>One \u00a0month ago I was finishing my contribution to a paper and I had to include some of the axioms defined in the ontology we designed. I knew DL-syntax but I did not want to spent time to rewrite the entire ontology (in RDF\/XML format) from the scratch so I decided to look for a method or conversion tool (preferably on-line) to serialize a DL ontology using this syntax. I was surprised that most of the tools do not have support to this feature (on the best of my knowledge) but I went into the <a title=\"OWL-API\" href=\"http:\/\/owlapi.sourceforge.net\/\">OWL-API<\/a>\u00a0(version 3.2.4)\u00a0documentation and source code and I finally found a class, coded by\u00a0<a title=\"Matthew Horridge\" href=\"http:\/\/www.cs.man.ac.uk\/~horridgm\/\">Matthew Horridge<\/a>, in which the load and serialization of ontologies were explained. After that I was checking more documentation about some <a title=\"OWL API Doc\" href=\"http:\/\/owlapi.sourceforge.net\/javadoc\/uk\/ac\/manchester\/cs\/owlapi\/dlsyntax\/DLSyntax.html\">packages<\/a> for serialization and I could customize the previous code to get a DL-syntax serialization of the ontology.<\/p>\n<pre>...\r\nOWLOntologyManager manager = OWLManager.createOWLOntologyManager();\r\nOWLOntology localOntology = manager.loadOntologyFromOntologyDocument(file);\r\nOWLOntologyFormat format = manager.getOntologyFormat(localOntology);\r\nDLSyntaxOntologyFormat dlFormat = new DLSyntaxOntologyFormat();\r\nDLSyntaxOntologyStorer storer = new DLSyntaxOntologyStorer();\r\n\/\/IRI documentIRI: file to save the DL version\r\nif (storer.canStoreOntology(dlFormat)){\r\n  storer.storeOntology(manager, localOntology, documentIRI, dlFormat);\r\n}\r\n...<\/pre>\n<p>It is just a code snippet&#8230;but I spent some time \u00a0to get\u00a0a representation of an OWL ontology in DL-syntax when I thought that it was trivial!<\/p>\n<p>Finally, these are the tools I checked:<\/p>\n<ul>\n<li><a title=\"OWL Syntax Converter\" href=\"http:\/\/owl.cs.manchester.ac.uk\/converter\/\">OWL Syntax Converter<\/a><\/li>\n<li><a title=\"RDF Validator and Converter\" href=\"http:\/\/www.rdfabout.com\/demo\/validator\/\">RDF Validator and Converter<\/a><\/li>\n<li><a title=\"RDF Validator at W3C\" href=\"http:\/\/www.w3.org\/RDF\/Validator\/\">RDF Validation Service at W3C<\/a><\/li>\n<li><a title=\"OWL Validator\" href=\"http:\/\/www.mygrid.org.uk\/OWL\/Validator\">Wonderweb OWL Validator<\/a>\u00a0(maybe the first online from 2003?)<\/li>\n<li>Plugins of <a title=\"Prot\u00e9g\u00e9 IDE\" href=\"http:\/\/protege.stanford.edu\/\">Prot\u00e9g\u00e9<\/a> such as <a title=\"OWL Viz\" href=\"http:\/\/www.co-ode.org\/downloads\/owlviz\/\">OWL Viz<\/a>\u00a0and <a title=\"OntoGraf\" href=\"http:\/\/protegewiki.stanford.edu\/wiki\/OntoGraf\">Ontograf<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<a href=\"https:\/\/www.josemalvarez.es\/?p=293\" rel=\"bookmark\" title=\"Permalink to Serializing an OWL ontology in DL-syntax\"><p>One \u00a0month ago I was finishing my contribution to a paper and I had to include some of the axioms defined in the ontology we designed. I knew DL-syntax but I did not want to spent time to rewrite the entire ontology (in RDF\/XML format) from the scratch so I decided to look for a [&hellip;]<\/p>\n<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[72],"tags":[84,81,80,83,82],"class_list":{"0":"post-293","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-research-blog","7":"tag-code-snippet","8":"tag-ontology","9":"tag-owl","10":"tag-owl-api","11":"tag-serialization","12":"h-entry","13":"hentry"},"_links":{"self":[{"href":"https:\/\/www.josemalvarez.es\/index.php?rest_route=\/wp\/v2\/posts\/293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.josemalvarez.es\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.josemalvarez.es\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.josemalvarez.es\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.josemalvarez.es\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=293"}],"version-history":[{"count":7,"href":"https:\/\/www.josemalvarez.es\/index.php?rest_route=\/wp\/v2\/posts\/293\/revisions"}],"predecessor-version":[{"id":300,"href":"https:\/\/www.josemalvarez.es\/index.php?rest_route=\/wp\/v2\/posts\/293\/revisions\/300"}],"wp:attachment":[{"href":"https:\/\/www.josemalvarez.es\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.josemalvarez.es\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.josemalvarez.es\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}