User Tools

Site Tools


PROV plugin for DokuWiki

PROV (abbreviation from Provenance) is a W3C Standard to describe entities, activities, and people involved in producing a piece of data. Provenance description is saved in a form of an graph. Presented plugin uses PROV to describe provenance of DokuWiki pages. PROV graph is serialized into the form of OWL2 Ontology using Turtle syntax.

If you only want to know how to start with PROV plugin, read the How to use PROV plugin section. Other sections will give you a brief overview of PROV Standard and mechanics behind the PROV plugin.

PROV W3C Standard

PROV Model is based on three main concepts:

  • Entities: physical, digital, conceptual, or other kinds of thing. In DokuWiki entities are: wiki pages and resources used during page creation and edition.
  • Activities: dynamic aspects of the world, such as actions, processes, etc. In DokuWiki there are three main activities: page creation, edition and deletion.
  • Agents: a person, a piece of software, an inanimate object, an organization, or other entities that may be responsible for activities. In DokuWiki agents are wiki users.

They are connected with proper relations defined in standard, such as these on the figure.

Comprehensive description of PROV Standard is placed on W3C web page: PROV Model Primer.

Due to standard notation, there is also possibility to provide standard ways to access and query PROV files (e.g. using SPARQL Query Language for PROV files serialized to OWL2). W3C prepared a note with such recommendations: PROV-AQ: Provenance Access and Query.


Plugin was developed as a part of the PhD dissertation: Collaborative Knowledge Engineering. Methods and Tools for System Design. Primary goal of the plugin was to describe how members of the group involved in the knowledge engineering process are interacting with each other and how the process of developing knowledge in Semantic Wiki (Loki) looks like.

As a result, the plugin uses only selected constructs from PROV - not the whole power of this standard. If you have an idea that more PROV constructs will be useful in the plugin contact us! Together we can do more!

How to use PROV plugin

To use PROV plugin simply download it and install.

PROV fields will be available in every page edition form:

It consists of three main components:

  • URIs/URLs for used resources (put one URI in one line) field (red frame on figure) – here all URIs goes; one URI in one line; you can simple write down URIs for resources you have used (e.g. books URIs or URLs for web pages) or…
  • if your edition is based on other pages from wiki you can simply select them (and double-click on them) from the second field (green frame); this page will appear in the left field with the lokipage: prefix
  • if there are a lot of pages in your wiki, you can use a filter field (blue frame).
  • PROV plugin uses also standard DokuWiki 'Edit summary' field (black frame) for comments in the PROV file.

Final list of URIs can look like this (two external URIs and two internal URIs with lokipage: prefix):

PROV files are saved in $DOKUWIKI_HOME/data/prov directory. There is a separate PROV file for each DokuWiki page.

How the PROV plugin works

PROV plugin works during page saving. There are three cases: page creation, edition and deletion. PROV plugin simply takes values from user (via fields in page edition form) and use them in specific places to generate PROV file according to the prepared schema:

Head of the PROV file:
@prefix prov: <> .
@prefix dc: <> .
@prefix lokipage: <{$wiki_address}> .				#eg.
@prefix lokievent: <{$wiki_address}special:lokievent#> .	#eg.
@prefix lokiuser: <{$wiki_address}user:> .			#eg.

Page creation. New page revision ($newRev) is created:
lokipage:{$page}		a			prov:Entity .
lokipage:{$page}.{$newRev}	a			prov:Entity ;
				prov:specializationOf	lokipage:{$page} ;
				prov:wasGeneratedBy	lokievent:created_{$page}.{$newRev} .

lokievent:created_{$page}.{$newRev}	a			prov:Activity ;
					prov:wasAssociatedWith	lokiuser:{$author} ;
					dc:description		"{$comment}" ; 
					prov:used		{$link1} ,
								{$link2} .

Page edition. New page revision ($newRev) is created based on previous page revision ($oldRev):
lokipage:{$page}.{$newRev}	a			prov:Entity ;
				prov:specializationOf	lokipage:{$page} ;
				prov:wasRevisionOf	lokipage:{$page}.{$newRev} ;
				prov:wasGeneratedBy	lokievent:edited_{$page}.{$newRev} .

lokievent:edited_{$page}.{$newRev}	a			prov:Activity ;
					prov:wasAssociatedWith	lokiuser:{$author} ;
					dc:description		"{$comment}" ;
					prov:used		lokipage:{$page}.{$oldRev} ,
								{$link1} ,
								{$link2} .

Page deletion:
lokievent:deleted_{$page}.{$newRev}	a			prov:Activity ;
					prov:used		lokipage:{$page}.{$oldRev} ;
					prov:wasAssociatedWith	lokiuser:{$author} ;
					dc:description		"{$comment}" .

  * for guests lokiuser:special:guest is used instead of lokiuser:{$autor}
  * page revisions ($oldRev and $newRev) are timestamps of specified pages

Note that in PROV there are only connections between different revisions, users and used resources. If you want to compare different versions of the page, you need standard DokuWiki changelog.

docs/prov.txt · Last modified: 2015/12/01 18:14 by kkutt