trill_on_swish/commit

help modified

authorrzese
Mon Feb 2 12:14:54 2015 +0100
committerrzese
Mon Feb 2 12:14:54 2015 +0100
commit69a9af4a61ecba8058401e217d7f8829032e4252
treefe551b6aa196d540ecd6817fc175d8324c891fa7
parentc2aadd6d8106520b25368719408d53233ca0f145
Diff style: patch stat
diff --git a/examples/BRCA.owl b/examples/BRCA.owl
index 1f351f5..10691f4 100644
--- a/examples/BRCA.owl
+++ b/examples/BRCA.owl
@@ -3,10 +3,12 @@
 <!--
 /** <examples>
 
-?- instanceOf(\'http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderLifetimeBRCRisk\',\'http://clarkparsia.com/pronto/cancer_ra.owl#Helen\',ListExpl).
 ?- prob_instanceOf(\'http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderLifetimeBRCRisk\',\'http://clarkparsia.com/pronto/cancer_ra.owl#Helen\',Prob).
-?- sub_class(\'http://clarkparsia.com/pronto/cancer_ra.owl#WomanAged3040\',\'http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderLifetimeBRCRisk\',ListExpl).
+?- instanceOf(\'http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderLifetimeBRCRisk\',\'http://clarkparsia.com/pronto/cancer_ra.owl#Helen\',ListExpl).
+
 ?- prob_sub_class(\'http://clarkparsia.com/pronto/cancer_ra.owl#WomanAged3040\',\'http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderLifetimeBRCRisk\',Prob).
+?- sub_class(\'http://clarkparsia.com/pronto/cancer_ra.owl#WomanAged3040\',\'http://clarkparsia.com/pronto/cancer_ra.owl#WomanUnderLifetimeBRCRisk\',ListExpl).
+
 */
 -->
 
diff --git a/examples/DBPedia.owl b/examples/DBPedia.owl
index 98c2020..bbe3a0a 100644
--- a/examples/DBPedia.owl
+++ b/examples/DBPedia.owl
@@ -3,8 +3,9 @@
 <!--
 /** <examples>
 
-?- sub_class(\'http://dbpedia.org/ontology/Village\',\'http://dbpedia.org/ontology/PopulatedPlace\',ListExpl).
 ?- prob_sub_class(\'http://dbpedia.org/ontology/Village\',\'http://dbpedia.org/ontology/PopulatedPlace\',Prob).
+?- sub_class(\'http://dbpedia.org/ontology/Village\',\'http://dbpedia.org/ontology/PopulatedPlace\',ListExpl).
+
 */
 -->
 
diff --git a/examples/biopax-level3.owl b/examples/biopax-level3.owl
index 3b1c057..089b1f0 100644
--- a/examples/biopax-level3.owl
+++ b/examples/biopax-level3.owl
@@ -3,8 +3,9 @@
 <!--
 /** <examples>
 
-?- sub_class(\'http://www.biopax.org/release/biopax-level3.owl#TransportWithBiochemicalReaction\',\'http://www.biopax.org/release/biopax-level3.owl#Entity\',ListExpl).
 ?- prob_sub_class(\'http://www.biopax.org/release/biopax-level3.owl#TransportWithBiochemicalReaction\',\'http://www.biopax.org/release/biopax-level3.owl#Entity\',Prob).
+?- sub_class(\'http://www.biopax.org/release/biopax-level3.owl#TransportWithBiochemicalReaction\',\'http://www.biopax.org/release/biopax-level3.owl#Entity\',ListExpl).
+
 */
 -->
 
diff --git a/examples/people+pets.owl b/examples/people+pets.owl
index 8f80c5f..dc552d2 100644
--- a/examples/people+pets.owl
+++ b/examples/people+pets.owl
@@ -3,8 +3,9 @@
 <!--
 /** <examples>
 
-?- instanceOf(\'http://cohse.semanticweb.org/ontologies/people#natureLover\',\'http://cohse.semanticweb.org/ontologies/people#Kevin\',ListExpl).
 ?- prob_instanceOf(\'http://cohse.semanticweb.org/ontologies/people#natureLover\',\'http://cohse.semanticweb.org/ontologies/people#Kevin\',Prob).
+?- instanceOf(\'http://cohse.semanticweb.org/ontologies/people#natureLover\',\'http://cohse.semanticweb.org/ontologies/people#Kevin\',ListExpl).
+
 */
 -->
 
diff --git a/examples/vicodi-ontology.owl b/examples/vicodi-ontology.owl
index 59be316..c3a2f2e 100644
--- a/examples/vicodi-ontology.owl
+++ b/examples/vicodi-ontology.owl
@@ -3,10 +3,12 @@
 <!--
 /** <examples>
 
-?- instanceOf(\'http://vicodi.org/ontology#Role\',\'http://vicodi.org/ontology#Anthony-van-Dyck-is-Painter-in-Flanders\',ListExpl).
 ?- prob_instanceOf(\'http://vicodi.org/ontology#Role\',\'http://vicodi.org/ontology#Anthony-van-Dyck-is-Painter-in-Flanders\',Prob).
-?- sub_class(\'http://vicodi.org/ontology#Painter\',\'http://vicodi.org/ontology#Role\',ListExpl).
+?- instanceOf(\'http://vicodi.org/ontology#Role\',\'http://vicodi.org/ontology#Anthony-van-Dyck-is-Painter-in-Flanders\',ListExpl).
+
 ?- prob_sub_class(\'http://vicodi.org/ontology#Painter\',\'http://vicodi.org/ontology#Role\',Prob).
+?- sub_class(\'http://vicodi.org/ontology#Painter\',\'http://vicodi.org/ontology#Role\',ListExpl).
+
 */
 -->
 
diff --git a/src b/src
index 6ac0b2b..58a1a36 160000
--- a/src
+++ b/src
@@ -1 +1 @@
-Subproject commit 6ac0b2bb4cc0fe30fd6c3948479c63bf140e6e2b
+Subproject commit 58a1a36239be6ad2637019d292e6c01dc0cb9d87
diff --git a/web/help/about.html b/web/help/about.html
index ee2016e..b35b23f 100644
--- a/web/help/about.html
+++ b/web/help/about.html
@@ -16,20 +16,32 @@
   <body>
 
 <p>
-<span style="color:darkblue">SWI</span><span
+<span style="color:darkblue">TRILL</span><span style="color:maroon"> on </span><span style="color:darkblue">SWI</span><span
+style="color:maroon">SH</span> was written by Riccardo Zese.
+</p>
+<p><span style="color:darkblue">SWI</span><span
 style="color:maroon">SH</span> was originally written by Torbjörn Lager
 as a homage to SWI-Prolog. Jan Wielemaker designed and implemented the
 present version.
 </p>
 
 <p>
-The <span style="color:darkblue">SWI</span><span
+The <span style="color:darkblue">TRILL</span><span style="color:maroon"> on </span><span style="color:darkblue">SWI</span><span
 style="color:maroon">SH</span> source is available from <a
-href="http://github.com/SWI-Prolog/swish.git">Github</a>. It is under
-heavy development and often requires SWI-Prolog 7 installed from the
+href="https://github.com/friguzzi/trill-on-swish">Github</a>. 
+It requires SWI-Prolog 7 installed from the
 latest <a href="http://github.com/SWI-Prolog/swipl-devel.git">GIT</a>.
 <p>
+<div class="github">
+<iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=friguzzi&amp;repo=trill-on-swish&amp;type=watch&amp;count=true" width="100" height="20" title="Star on GitHub"></iframe>
+<iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=friguzzi&amp;repo=trill-on-swish&amp;type=fork&amp;count=true" width="102" height="20" title="Fork on GitHub"></iframe>
+</div>
 
+<p>
+The <span style="color:darkblue">SWI</span><span
+style="color:maroon">SH</span> source is available from <a
+href="http://github.com/SWI-Prolog/swish.git">Github</a>. 
+<p>
 <div class="github">
 <iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=SWI-Prolog&amp;repo=swish&amp;type=watch&amp;count=true" width="100" height="20" title="Star on GitHub"></iframe>
 <iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=SWI-Prolog&amp;repo=swish&amp;type=fork&amp;count=true" width="102" height="20" title="Fork on GitHub"></iframe>
diff --git a/web/help/help.html b/web/help/help.html
index 1bf6a6c..0244f7e 100644
--- a/web/help/help.html
+++ b/web/help/help.html
@@ -2,7 +2,7 @@
 
 <html>
   <head>
-  <title>SWISH: SWI-Prolog for SHaring</title>
+  <title>TRILL on SWISH</title>
   </head>
 <body>
 <h4>Table of Contents</h4>
@@ -11,22 +11,19 @@
     <li><a href="#help-examples">Embedding examples in the program text</a></li>
     <li><a href="#help-share">Save or share your program</a></li>
     <li><a href="#help-preload">Preload SWISH with data</a></li>
+    <li><a href="#help-rdf-xml">RDF/XML syntax and tools</a></li>
+    <li><a href="#help-trill">TRILL manual</a></li>
   </ul>
 
 <h4 id="help-basics">Basic operation</h4>
 <p>
-Prolog is about running a <i>query</i> against a <i>program</i>. The
-<i>query</i> goes into the bottom-right editor and the <i>program</i>
-into the left editor.  The program can be empty, executing queries
-against the <i>built-in</i> predicates of Prolog.  For example:
-
-<pre style="font-size:80%">
-?- format("Hello world!~n").</pre>
+TRILL is about running a <i>query</i> against a <i>knowledge base</i>. 
+It can handle <i>SHOQ</i> knowledge bases writtend in RDF/XML format.
+The <i>query</i> goes into the bottom-right editor and the <i>program</i>
+into the left editor.  
 
 <p>
-A query can be executed by hitting <code>RETURN</code> if the query
-is complete and the caret is behind the '.' that terminates the query
-or by using the <b>Run!</b> button.  At this moment, the following happens:
+A query can be executed by using the <b>Run!</b> button.  At this moment, the following happens:
 
 <ol>
   <li>The interface creates a <em>runner</em> in the top-right window
@@ -49,8 +46,7 @@ or by using the <b>Run!</b> button.  At this moment, the following happens:
 Note that <b>you do not have to save your program to execute it</b>.  If
 your are not satisfied with the answer to a query, you can simply
 edit the program and use the <b>Run!</b> again.  The new query is
-executed in a completely new environment.  In particular, data that
-you asserted in a previous query is not available in the next.
+executed in a completely new environment.
 
 <h4 id="help-examples">Embedding examples in the program text</h4>
 <p>
@@ -58,11 +54,13 @@ If you include example goals inside comments as shown below,
 they will be used to populate the example menu and make the
 first goal show in the Goal input field.
 </p>
+<p>
+<b>NOTE:</b> if a complex string containing special characters (s.a. &#35;), surround it with escaped single quote (\'). See <a href="#help-trill">TRILL manual</a> section for a list of possible queries.
+</p>
 <pre style="font-size:80%">
 /** &lt;examples&gt;
 
-?- loves(X, mia).
-?- jealous(X, Y).
+?- instanceOf(\'http://my.ontology.org/ontologies/foo#myClass\',\'http://my.ontology.org/ontologies/foo#myIndividual\',ListExpl).
 
 */</pre>
 
@@ -82,39 +80,151 @@ that provides shared editing, chat and voice communication.
 
 <h4 id="help-preload">Preload SWISH with data</h4>
 <p>
-You can make <span style="color:darkblue">SWI</span><span style="color:maroon">SH</span>
-start with a loaded program using the URL <code>http://swish.swi-prolog.org/</code> and
+You can make <span style="color:darkblue">TRILL</span><span style="color:maroon"> on </span><span style="color:darkblue">SWI</span><span
+style="color:maroon">SH</span>
+start with a loaded program using the URL <code>http://trill.lamping.unife.it/swish/</code> and
 providing the parameters below.  The URL accepts both `GET` and `POST` requests.
 
   <dl>
   <dt>code<dd>
-  Either the concrete code or a URL from which the code will be downloaded.
-  </dd>
-  <dt>background<dd>
-  As <code>code</code>, but this part of the code will not be visible in
-  the editor.
-  </dd>
-  <dt>examples<dd>
-  As the above described examples comment block.
+  The value can be either the KB or a URL from which the KB is available and downloadable.
   </dd>
   <dt>q<dd>
-  The initial query to load into the query window.  Note that the following
-  characters need to be escaped: '#', '&' and the space.
+  The query to set in the query pane.
   </dd>
   </dl>
 
-<p>The URL below opens <span style="color:darkblue">SWI</span><span style="color:maroon">SH</span> on a file from GitHub with a default query.
+<p>The URL below opens <span style="color:darkblue">TRILL</span><span style="color:maroon"> on </span><span style="color:darkblue">SWI</span><span
+style="color:maroon">SH</span> on a file from GitHub with a default query.
 
-<pre>
-http://swish.swi-prolog.org/?code=https://github.com/SWI-Prolog/swipl-devel/raw/master/demo/likes.pl&amp;q=likes(sam,Food).</pre>
+<pre style="font-size:80%">
+http://trill.lamping.unife.it/swish/?code=https://github.com/friguzzi/trill-on-swish/raw/master/examples/BRCA.</pre>
 
-</body>
-</html>
 
+ <h4 id="help-rdf-xml">RDF/XML syntax and tools</h4>
+ <p>RDF/XML knowledge bases consist of a set of possibly annotated axioms.
+ An axiom is a proposition that models an information of the domain. There are several different axioms:
+ <dl>
+  <dt>concept membership axioms<dd>
+  An individual belongs to a certain class.
+  </dd>
+  <dt>role membership axioms<dd>
+  Two individuals are connected through a certain role.
+  </dd>
+  <dt>transitivity axioms<dd>
+  The role is transitive.
+  </dd>
+  <dt>role inclusion axioms<dd>
+  Hierarchy between roles.
+  </dd>
+  <dt>concept inclusion axioms<dd>
+  Hierarchy between concepts.
+  </dd>
+ </dl>
+ 
+ <p>  Consider the following axioms 
+
+ <pre style="font-size:80%">
+classAssertion(Cat,fluffy)
+subClassOf(Cat,Pet)
+propertyAssertion(hasAnimal,kevin,fluffy)
+</pre>
+</p>
+<p>The first axiom states that <i>fluffy</i> is a <i>Cat</i>. The second states that every <i>Cat</i> is also a <i>Pet</i>. The third states that the role <i>hasAnimal</i> links together <i>kevin</i> and <i>fluffy</i>.
+
+<p>RDF (Resource Descritpion Framework) is a standard W3C. See <a href="http://www.w3.org/TR/REC-rdf-syntax/">here</a> the syntax specification.
+RDF is a standard XML-based used for representing knowledge by means of triples.
+A representations of the three axioms seen above is shown below.
+ <pre style="font-size:80%">
+&lt;owl:NamedIndividual rdf:about="fluffy"&gt;
+  &lt;rdf:type rdf:resource="Cat"/&gt;
+&lt;/owl:NamedIndividual&gt;
+
+&lt;owl:Class rdf:about="Cat"&gt;
+  &lt;rdfs:subClassOf rdf:resource="Pet"/&gt;
+&lt;/owl:Class&gt;
+
+&lt;owl:ObjectProperty rdf:about="hasAnimal"/&gt;
+&lt;owl:NamedIndividual rdf:about="kevin"&gt;
+ &lt;hasAnimal rdf:resource="fluffy"/&gt;
+&lt;/owl:NamedIndividual&gt;
+</pre>
+</p>
 
+<p>
+An axiom can be annotated with a probability which defines the degree of belief in the truth of the axiom. See [1] for details.
+</p>
+<p>
+Below, an example of an annotated axiom, following the RDF/XML syntax.
+ <pre style="font-size:80%">
+&lt;owl:Class rdf:about="Cat"&gt;
+ &lt;rdfs:subClassOf rdf:resource="Pet"/&gt;
+&lt;/owl:Class&gt;
+&lt;owl:Axiom&gt;
+ &lt;disponte:probability rdf:datatype="&amp;xsd;decimal"&gt;0.6&lt;/disponte:probability&gt;
+ &lt;owl:annotatedSource rdf:resource="Cat"/&gt;
+ &lt;owl:annotatedTarget rdf:resource="Pet"/&gt;
+ &lt;owl:annotatedProperty rdf:resource="&amp;rdfs;subClassOf"/&gt;
+&lt;/owl:Axiom&gt;
+</pre>
+The annotation must be declared in the knowledge base as follow
+  <pre style="font-size:80%">
+&lt;!DOCTYPE rdf:RDF [
+ ...
+ &lt;!ENTITY disponte "https://sites.google.com/a/unife.it/ml/disponte#" &gt;
+]&gt;
+
+&lt;rdf:RDF
+ ...
+ xmlns:disponte="https://sites.google.com/a/unife.it/ml/disponte#"
+ ...&gt;
+
+ ...
+ &lt;owl:AnnotationProperty rdf:about="&amp;disponte;probability"/&gt;
+ ...
+&lt;/rdf:RDF&gt;
+</pre>
+</p>
 
+<p>There are many editors for developing knowledge bases, some of them are listed 
+<a href="http://www.w3.org/2001/sw/wiki/Category:Editor">here</a>.
+</p>
 
+<h4 id="help-trill">TRILL manual</h4>
+<p>
+TRILL ("Tableau Reasoner for descrIption Logics in Prolog") implements a tableau algorithm in
+Prolog to compute the set of all the explanations of a query. After generating the explanations, TRILL can computes the probability of the query. TRILL can answer   and , and can find explanations both for the  contained in the KB or for the inconsistency of the entire KB. TRILL is implemented in Prolog, so the management of the rules' non-determinism is delegated to this language.
+</p>
+<p>
+The types of query that are available are shown below:
+<dl>
+  <dt><b>instanceOf(Class,Individual),
+instanceOf(Class,Individual,Expl),
+prob instanceOf(Class,Individual,Prob)</b><dd>
+  Concept membership queries.
+  </dd>
+  <dt><b>sub class(Class1,Class2),
+sub class(Class1,Class2,Expl),
+prob sub class(Class1,Class2,Prob)</b>
+  <dd>
+  Subsumption queries.
+  </dd>
+  <dt><b>unsat(ClassExpression),
+unsat(ClassExpression,Expl),
+prob unsat(ClassExpression,Prob)</b><dd>
+  Unsatifiability of a concept.
+  </dd>
+  <dt><b>inconsistent_theory,
+inconsistent_theory(Expl),
+prob inconsistent_theory(Prob)</b><dd>
+  Inconsistency of the knowledge base.
+  </dd>
+  </dl>
+Each query has three versions which respectively test entailment, find an explanation Expl or com pute the probability Prob of the query.
+</p>
 
+</body>
+</html>
 
 
 
diff --git a/web/help/query.html b/web/help/query.html
index 507a7ff..6e83743 100644
--- a/web/help/query.html
+++ b/web/help/query.html
@@ -15,14 +15,18 @@ You can either type a query or embed queries in a comment block in the
 program and select it from the <b>Examples</b> dropup menu. Queries are
 added to the <b>History</b> dropup menu for re-use.
 
+<p>
+<b>NOTE:</b> if a complex string containing special characters (s.a. &#35;), surround it with escaped single quote (\'). See <a href="#help-trill">TRILL manual</a> section for a list of possible queries.
+</p>
+
 <p>
 Example queries embedded in your program must be formatted like this:
 
 <pre class="prolog">
 /** &lt;examples&gt;
 
-?- run.
-?- known(X).
+?- instanceOf(\'http://my.ontology.org/ontologies/foo#myClass\',\'http://my.ontology.org/ontologies/foo#myIndividual\',ListExpl).
+?- axiom(X).
 */
 </pre>
 
diff --git a/web/help/runner.html b/web/help/runner.html
index d830504..ee1c653 100644
--- a/web/help/runner.html
+++ b/web/help/runner.html
@@ -29,7 +29,7 @@ table.runner-states tr.group th {
 }
 </style>
 
-<h4>Keyboard shortcuts</h4>
+<!--h4>Keyboard shortcuts</h4>
 
   <table class="runner-states">
   <tr><th>";", &lt;space&gt;</th><td>Next</td>
@@ -37,7 +37,7 @@ table.runner-states tr.group th {
   <tr><th>"a", &lt;Esc&gt;</th><td>Stop or abort</td>
   <tr><th>&lt;Del&gt;</th><td>Close</td>
   <tr><th>&lt;F1&gt;</th><td>Help (this page)</td>
-  </table>
+  </table-->
 
 <h4>Running states</h4>