<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Loki Presentation of Logic-based Semantic Wiki</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Weronika T. Adrian</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Grzegorz J. Nalepa</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>AGH University of Science and Technology</institution>
          ,
          <addr-line>al. A. Mickiewicza 30, 30-059 Krakow</addr-line>
          ,
          <country country="PL">Poland</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>TOOL PRESENTATION: The paper presents a semantic wiki, called Loki, with strong logical knowledge representation using rules. The system uses a coherent logic-based representation for semantic annotations of the content and implementing reasoning procedures. The representation uses the logic programming paradigm and the Prolog programming language. The proposed architecture allows for rule-based reasoning in the wiki. It also provides a compatibility layer with the popular Semantic MediaWiki platform, directly parsing its annotations.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Motivation</title>
    </sec>
    <sec id="sec-2">
      <title>Architecture</title>
      <sec id="sec-2-1">
        <title>A prototype implementation of Loki, called PlWiki (Prolog Wiki), has been de</title>
        <p>
          veloped [
          <xref ref-type="bibr" rid="ref2 ref4">2,4</xref>
          ]. The main goal of the system design is to deliver a generic and
exible solution. Thus, instead of modifying an existing wiki engine or
implementing a new one, an extension of the DokuWiki 8 system has been developed.
        </p>
        <p>The architecture can be observed in Fig. 1. The stack is based on a simple
runtime including the Unix environment with the Unix lesystem, Apache web
server and PHP stack. Using this runtime, a standard DokuWiki installation is
run. The Loki functionality is implemented with the use of Dokuwiki plugins
allowing to enrich the wikitext with semantic annotations and Prolog clauses, as
well as run the SWI-Prolog interpreter. It is also possible to extend the wikitext
with explicit semantic information encoded using RDF and OWL representation.
This layer uses the Semantic Web library provided by SWI-Prolog.
t
x
e
t
lain wiki
p
xte ogl
t o
iik Pr
w +</p>
        <p>F
D
R</p>
        <p>L
W
O</p>
        <p>XTT
rules</p>
        <sec id="sec-2-1-1">
          <title>PlWiki Prolog Engine</title>
          <p>DokuWiki plwiki
render
render</p>
        </sec>
        <sec id="sec-2-1-2">
          <title>PHP stack</title>
          <p>plwiki
syntax
lexer
wiki
files
SWI</p>
        </sec>
        <sec id="sec-2-1-3">
          <title>Prolog</title>
          <p>Prolog
files</p>
        </sec>
        <sec id="sec-2-1-4">
          <title>Apache Web Server</title>
        </sec>
        <sec id="sec-2-1-5">
          <title>Unix Filesystem</title>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>Categories, relations, attributes and queries are represented by appropriate</title>
        <p>Prolog terms. Technically, SMW markup is converted to Prolog code and then
saved in a Loki le related to a Wiki page. Examples (annotations written on
a page for "The Call of Cthulhu" book) are as follows, with the SMW syntax
given rst, and the Prolog representation below.
[[category:book]]</p>
        <p>wiki_category(’book’,’the_call_of_cthulhu’).
**Author**: [[author::h_p_lovecraft]]</p>
        <p>wiki_relation(’the_call_of_cthulhu’,’author’,’h_p_lovecraft’).
**Date**: [[date:=2011]]</p>
        <p>wiki_attribute(’the_call_of_cthulhu’,’date’,’2011’).
{{#ask: [[category:book]] [[author::h_p_lovecraft]]}}
wiki_category(’book’,Page),
wiki_relation(Page,’author’,’h_p_lovecraft’).</p>
      </sec>
      <sec id="sec-2-3">
        <title>Semantic Web Standards Support RDF annotations can be embedded directly</title>
        <p>in the XML serialization. They are parsed by the SWI-Prolog semweb/rdf_db
library, and turned to the internal representation. Within the wikitext, a SPARQL
query (SELECT, ASK or DESCRIBE) may be posed. The query scope is the
whole wiki system. Analogously to the SMW-like queries, SPARQL ones are also
translated to Prolog goals and then executed by the wiki engine.</p>
        <p>Semantic information gathered in Loki may be exported to the RDF/XML
format. The exported le consists of a header with used namespaces, metadata
of the exported page, and optionally ontological information about categories,
relations and attributes. Categories are exported as OWL Classes, relations
between pages as Object Properties, and attributes as Datatype Properties.
Information about subcategories and subproperties is exported with the the use of
rdfs:subClassOf and rdfs:subProperty .</p>
      </sec>
      <sec id="sec-2-4">
        <title>Rule-based Reasoning An optional rule layer is provided using the HeaRT [3] run</title>
        <p>
          time for the XTT2 framework [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. XTT2 (eXtended Tabular Trees v2) knowledge
representation uses attributive table format. Rules based on the same attributes
are grouped within tables, and the system is split into a network of such
tables representing the inference ow. XTT2 rules can be serialized into a HMR
(HeKatE Meta Representation) format, supported in Loki.
        </p>
        <p>An example rule: xrule a/1: [age in[18to100],movie_types sim[comedy]]==&gt;
[age_filter set union(age_filter,[adult_comedy])]:comedy_rules. would be
interpreted as: for users who are older than 18 and like comedies adjust the
age_lter attribute and redirect the inference to comedy_rules table.</p>
      </sec>
      <sec id="sec-2-5">
        <title>HeaRT (HeKatE RunTime), a dedicated inference engine for the XTT2 rule</title>
        <p>bases, has been added to Loki as a part of the plugin responsible for parsing</p>
      </sec>
      <sec id="sec-2-6">
        <title>Prolog. HMR code is embedded on wiki pages within the &lt;pl&gt;&lt;/pl&gt; tags (see</title>
        <p>Fig. 2). To run reasoning, a &lt;pl scope="" goal=""&gt; tag is used. If the goal is
a valid HeaRT command, the reasoning is performed by the engine, the result is
calculated and rendered on a wiki page. Embedding HeaRT in Loki is currently
in an experimental phase and is not provided with the current release.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Summary</title>
      <sec id="sec-3-1">
        <title>In the paper, a semantic wiki called Loki has been presented. An essential feature</title>
        <p>of the system is a strong rule-based reasoning thanks to a coherent knowledge
representation. In the system, standard semantic annotations are mapped to the</p>
      </sec>
      <sec id="sec-3-2">
        <title>Prolog knowledge base, in which also rule-based reasoning is specied. Moreover,</title>
        <p>a custom rule-based engine using decision tables and trees is provided. Loki
allows for the development of modularized knowledge bases with the use of a wiki.</p>
      </sec>
      <sec id="sec-3-3">
        <title>In future, Loki is planned to be used as a platform for knowledge evaluation [1].</title>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Baumeister</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nalepa</surname>
            ,
            <given-names>G.J.:</given-names>
          </string-name>
          <article-title>Verication of distributed knowledge in semantic knowledge wikis</article-title>
          . In: Lane,
          <string-name>
            <given-names>H.C.</given-names>
            ,
            <surname>Guesgen</surname>
          </string-name>
          , H.W. (eds.) FLAIRS-22
          <source>: Proceedings of the twenty-second international Florida Articial Intelligence Research Society conference: 1921 May</source>
          <year>2009</year>
          ,
          <string-name>
            <given-names>Sanibel</given-names>
            <surname>Island</surname>
          </string-name>
          , Florida, USA. pp.
          <fpage>384389</fpage>
          . FLAIRS, AAAI Press, Menlo Park, California (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Nalepa</surname>
          </string-name>
          , G.J.:
          <article-title>PlWiki a generic semantic wiki architecture</article-title>
          . In: Nguyen,
          <string-name>
            <given-names>N.T.</given-names>
            ,
            <surname>Kowalczyk</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            ,
            <surname>Chen</surname>
          </string-name>
          , S.M. (eds.) Computational Collective Intelligence. Semantic Web,
          <source>Social Networks and Multiagent Systems</source>
          , First International Conference, ICCCI 2009, Wroclaw, Poland, October 5-
          <issue>7</issue>
          ,
          <year>2009</year>
          .
          <source>Proceedings. Lecture Notes in Computer Science</source>
          , vol.
          <volume>5796</volume>
          , pp.
          <fpage>345356</fpage>
          . Springer (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Nalepa</surname>
            ,
            <given-names>G.J.:</given-names>
          </string-name>
          <article-title>Architecture of the HeaRT hybrid rule engine</article-title>
          . In: Rutkowski,
          <string-name>
            <surname>L.</surname>
          </string-name>
          , [et al.
          <source>] (eds.) Articial Intelligence and Soft Computing: 10th International Conference</source>
          , ICAISC 2010: Zakopane, Poland, June 1317,
          <year>2010</year>
          , Pt.
          <source>II. Lecture Notes in Articial Intelligence</source>
          , vol.
          <volume>6114</volume>
          , pp.
          <fpage>598605</fpage>
          . Springer (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Nalepa</surname>
            ,
            <given-names>G.J.:</given-names>
          </string-name>
          <article-title>Collective knowledge engineering with semantic wikis</article-title>
          .
          <source>Journal of Universal Computer Science</source>
          <volume>16</volume>
          (
          <issue>7</issue>
          ),
          <volume>10061023</volume>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Nalepa</surname>
            ,
            <given-names>G.J.:</given-names>
          </string-name>
          <article-title>Loki semantic wiki with logical knowledge representation</article-title>
          . In: Nguyen, N.T. (ed.)
          <source>Transactions on Computational Collective Intelligence III, Lecture Notes in Computer Science</source>
          , vol.
          <volume>6560</volume>
          , pp.
          <fpage>96114</fpage>
          . Springer (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Nalepa</surname>
            ,
            <given-names>G.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ligƒza</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>HeKatE methodology, hybrid engineering of intelligent systems</article-title>
          .
          <source>International Journal of Applied Mathematics and Computer Science</source>
          <volume>20</volume>
          (
          <issue>1</issue>
          ),
          <volume>3553</volume>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>