- Wiki database
A wiki-based database is a collection of wiki files that can be accessed using
SQL -like commands. The first (and, as of2006 , the only) such system was designed and developed byReliable Software as part of their P2P version-control system,Code Co-op , which features aPeer-to-peer wiki system.Database
The database is implemented as a collection of wiki files (records) stored inside s, which play the role of tables. In a file-based P2P wiki, a namespace/table is implemented as a subdirectory of the main wiki directory.
The files (records) may contain any , but in order to be accessible through SQL commands, they must define some tuples, or property-value pairs. This is done by embedding a wiki table inside a record. The first column of this wiki table defines the names of properties, the second specifies their values. For instance, a record in the "Student" table (namespace) may contain the following wiki table:
which defines two properties, Name and Courses, and assigns values to them.Name Chad Codewell Courses Programming, Anger Management Queries
The properties defined inside records may be used to formulate SQL queries. For instance, the following query may be embedded in a wiki file (a query line starts with a question mark): ?SELECT Name FROM Student WHERE Courses CONTAINS "Anger Management" ORDER BY NameWhen the wiki file is displayed, the SELECT statement is expanded into a wiki table that lists the results of the query. In the above example, the result might look like this:
The ID column shows the name of the record (in a file-based system, this is the name of the file minus the extension .wiki). It also serves as a wiki link to the record. When the user clicks on it, the whole record is displayed like any other wiki file.ID Name Student:13 Chad Codewell Student:18 Lewis Black Forms
Wiki files may contain markup for displaying HTML forms. The target of a form (the "action" associated with the form) may be another wiki file. When the form is accepted, the target wiki file is displayed. The properties defined by the form can be accessed in the target file using the syntax
[?propName] . In particular, the values from a form may be used in SQL queries in the target page.A form may also be used to create new records. In that case, the target file would contain the INSERT command that creates a new record and fills its property table with specified values. For instance, continuing the above example, the target file may contain: ?INSERT INTO Student (Name =
[?name] , Courses =[?courses] )where the values of the properties are set by a form that activats this file.
Wikimedia Foundation. 2010.