User Tools

Site Tools


Sidebar

Hello!

Start here!

Download

Loki Semantic Wiki

BiFröST Framework

Semantic Business Platform

BPWiki

SBVRwiki

Other Projects



docs:plwiki1api
startSectionEdit: $data "section" is NOT an array! One of your plugins needs an update.
startSectionEdit: $data "section" is NOT an array! One of your plugins needs an update.
startSectionEdit: $data "section" is NOT an array! One of your plugins needs an update.
startSectionEdit: $data "section" is NOT an array! One of your plugins needs an update.

PlWiki 1.0 - Plugin API

Examples available here

IMPORTANT:

This code should be placed on every page using PlWiki plugin:

 ~~NOCACHE~~ 

Prolog Code in Loki

The simplest use case. Without cache. Only process knowledge between “pl” tags.

<pl goal="woman(X),write(X),nl,fail">
woman(kate).
man(john).
</pl>

Result:
kate

More interesting use case: adding knowledge to the page:

<pl cache="true">
man(jack).
man(jim).
</pl>

Now when we have prolog code associated with DokuWiki page, we can “query” selected scope or Wiki page. Scope accepts POSIX Regular Expressions.

<pl goal="man(X),write(X),nl,fail"  scope="docs:plwiki1ex" >
%
% Prolog code may be placed here but it is not necessairly.
%
</pl>

Result:
jack
jim

Prolog interface

Loki plugin also contains loki.pl prolog script, which allows to query knowledge gathered in Loki from Prolog.

We can list all predicates in selected scope:

<pl goal="consult('lib/plugins/loki/loki.pl'),wikiconsult('docs/plwiki1api'),list."></pl>

Result:
man
wiki_header
wiki_internallink
woman

We can also list informations about selected predicate.

<pl goal="consult('lib/plugins/loki/loki.pl'),wikiconsult('docs/plwiki1api'),list(man)."></pl>

Result:
man(john).
man(jack).
man(jim).

Categories, Relations, Attributes

Semantic MediaWiki syntax is also supported, there are some methods of semantic annotation:

  • categories - a simple form of annotation that allows users to classify pages. To state that article (Wiki page) belongs to the category “category1” we have to write
    [[category:category1]]
  • relations - there is a possibility to describe relationships between two Wiki pages. For example there is a relation “capital_of” between “cities:warsaw” and “coutries:poland”. To express this we have to just edit the page “countries:warsaw” and add
    [[capital of::countries:poland]]
  • attributes - allows to specify relationships of Wiki pages to things that are not Wiki pages. For example, one can state that Wiki page “namespace:page” was created at April 22 2009 by writing
    [[created:=April 22 2009]]
  • In addition to this users can search for articles using a simple query language that was developed based on the known syntax of the Wiki. For example:
    {{#ask: [[category:cities]] [[capital_of::countries:poland]]}}


docs/plwiki1api.txt · Last modified: 2022/03/23 16:59 (external edit)