Simple CLI useable OWL Reasoner - Semantic Overflow most recent 30 from http://www.semanticoverflow.com2010-03-19T17:29:42Zhttp://www.semanticoverflow.com/feeds/question/235http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://www.semanticoverflow.com/questions/235/simple-cli-useable-owl-reasonerSimple CLI useable OWL ReasonerJerven2009-11-10T16:27:40Z2009-11-19T04:18:48Z
<p>Hi All,</p>
<p>I am looking for a simple to use OWL reasoner.
e.g: preferably
reasoner -owl core.owl -rdf P05067.rdf
which will tell me if the small P05067.rdf file contradicts any rules in the core.owl
As well as show which triples are inferred. Preferably explaining which rules are the source of the contradiction and/or inference.</p>
<p>The use case is debugging and testing a owl or the rdf file for correctness. i.e. sometimes I want to check that the OWL file does not declare OWL legal inferences that are real world wrong. And at other times I want to check if an class instance in a RDF file does not contain contradiction.</p>
<p>Regards,</p>
<p>Jerven</p>
<p>e.g.</p>
<p>I want to check if
<a href="http://purl.uniprot.org/taxonomy/9606" rel="nofollow">http://purl.uniprot.org/taxonomy/9606</a>
meets the requirements of
<a href="ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/rdf/core.owl" rel="nofollow">ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/rdf/core.owl</a>
without adapting either file if at all possible.</p>
<p>For example an owl:restriction? e.g. one of the things <em>I think</em> I can say in OWL is that the species in the following example must be one of the Rank instances defined in the core.owl. Using <em>something like</em></p>
<p><code>
@base <a href="http://purl.uniprot.org/core/" rel="nofollow">http://purl.uniprot.org/core/</a> .<br/>
t a :Taxon<br/>
[ a owl:Restriction; <br/>
owl:onProperty t:rank <br/>
owl:allValuesFrom :Rank ] <br/></p>
<p>@base <a href="http://purl.uniprot.org/core/" rel="nofollow">http://purl.uniprot.org/core/</a> .<br/>
@prefix rdf:<a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rel="nofollow">http://www.w3.org/1999/02/22-rdf-syntax-ns#</a> .<br/>
@prefix rdfs:<a href="http://www.w3.org/2000/01/rdf-schema#" rel="nofollow">http://www.w3.org/2000/01/rdf-schema#</a> .<br/>
@prefix owl:<a href="http://www.w3.org/2002/07/owl#" rel="nofollow">http://www.w3.org/2002/07/owl#</a> .<br/>
<a href="http://purl.uniprot.org/taxonomy/9606" rel="nofollow">http://purl.uniprot.org/taxonomy/9606</a>> rdf:type :Taxon ;<br/>
:rank :Species ;<br/>
</code></p>
<p>As well as cardinality restricitions etc...</p>
http://www.semanticoverflow.com/questions/235/simple-cli-useable-owl-reasoner/236#236Answer by Bastian Spanneberg for Simple CLI useable OWL ReasonerBastian Spanneberg2009-11-10T17:01:51Z2009-11-10T17:01:51Z<p><a href="http://clarkparsia.com/pellet" rel="nofollow">Pellet</a> should be what you are looking for.</p>
http://www.semanticoverflow.com/questions/235/simple-cli-useable-owl-reasoner/244#244Answer by yadnem for Simple CLI useable OWL Reasoneryadnem2009-11-10T21:27:31Z2009-11-10T21:27:31Z<p>Hi Jerven, </p>
<p>This isn't a full answer :(, but it should be quite possible to write a nice command line tool around something like Jena, doing what you require, including have a split between instances and ontology (as you comment above). </p>
<p>Roger</p>
http://www.semanticoverflow.com/questions/235/simple-cli-useable-owl-reasoner/252#252Answer by Ivan for Simple CLI useable OWL ReasonerIvan2009-11-11T07:44:09Z2009-11-11T07:44:09Z<p>Jerven,</p>
<p>to be able to answer your question (well, attempting to do so) I should understand it in details which I don't:-( I am not sure what 'core owl' means, for example. But I will try anyway, in the hope that this will be helpful... </p>
<p>There are different aspects that I can try to reflect on...</p>
<ol>
<li>proper OWL engines will give you an answer two out of the three issues, namely finding the 'contradictions' (ie, whether there is consistency error) and showing which triples are inferred. There are several sites that list implementations; <a href="http://www.w3.org/2007/OWL/wiki/Implementations" rel="nofollow">the implementation report of the OWL Working group</a> is probably one of the most recent. Note that, afaik, some of the editors in the list will also detect inconsistencies, or at least some of them, so it is worth looking at those. (I am not a user of Pellet, but I must admit I did not understand your answer to that proposal. Merging two RDF files into one is really not a difficult issue, if this is the only problem you have with Pellet...)</li>
</ol>
<p>I could not look at the details of your ontology, it is fairly large, but you might want to see whether it fits one of the <a href="http://www.w3.org/TR/2009/REC-owl2-profiles-20091027/" rel="nofollow">OWL 2 profiles</a>. If so, there might be some simpler tools around. Eg, if it falls under the <a href="http://www.w3.org/TR/2009/REC-owl2-profiles-20091027/#OWL%5F2%5FRL" rel="nofollow">OWL 2 RL</a> category, then simpler rule engine based implementation may also work. (I do not know whether there is already a Jena based implementation available, but if not, it is only a question of time.</p>
<ol>
<li>you also asked "explaining which rules are the source of the contradiction and/or inference". <em>That</em> is much more of an R&D question, I am afraid. The best paper award for the ISWC2008 conference, for example, touched exactly on that aspect; current tools still have to evolve in this area...</li>
</ol>
<p>As I said, I hope this helps...</p>
<p>Ivan</p>
http://www.semanticoverflow.com/questions/235/simple-cli-useable-owl-reasoner/264#264Answer by Samuel Lampa for Simple CLI useable OWL ReasonerSamuel Lampa2009-11-12T13:22:41Z2009-11-12T13:31:38Z<p>One hint would be to look into using SWI-Prolog and the accompanying <a href="http://www.swi-prolog.org/pldoc/package/semweb.html" rel="nofollow">SemWeb</a> (RDF) and <a href="http://www.semanticweb.gr/thea/" rel="nofollow">Thea</a> (OWL) packages. In addition some of the <a href="http://www.blipkit.org/modules.html" rel="nofollow">BlipKit SWI-Prolog modules</a> might prove useful.</p>
<p>I can not answer how hard or easy your task would be (currently using only the SemWeb/RDF methods, which are convenient to work with indeed), but the functionality should be there I assume, and SWI-Prolog seems to be scriptable enough, looking at the <a href="http://dev.cs.uni-magdeburg.de/misc/swi-prolog/Manual/cmdline.html" rel="nofollow">command line options</a>.</p>
http://www.semanticoverflow.com/questions/235/simple-cli-useable-owl-reasoner/284#284Answer by Kendall Clark for Simple CLI useable OWL ReasonerKendall Clark2009-11-13T19:46:38Z2009-11-13T19:46:38Z<p>Pellet will allow you to put OWL axioms (or, if you prefer, rules) in one file and RDF statements in the other. And it will process that quite happily from command line. It will also explain inferences, again from the command line. I don't know why Ivan says that's more R&D, since Pellet's had this feature for an age; it works perfectly well w/ the "pellet explain" subcommand.</p>
<p>Finally, in the upcoming 2.0 release -- which will drop on Monday -- the command line tools are much improved and act like proper Unix tools, etc.</p>
http://www.semanticoverflow.com/questions/235/simple-cli-useable-owl-reasoner/310#310Answer by Kendall Clark for Simple CLI useable OWL ReasonerKendall Clark2009-11-19T04:18:48Z2009-11-19T04:18:48Z<p>The command to get help for Pellet's command-line is, from a prompt, "pellet help"; to get help for the inference explanation function, type "pellet help explain". Using a reasoner with explanation support is one reason not to use a simple rule engine implementation, since none of those have advanced reasoning services like inference explanation. But YMMV.</p>