Semantic Wiki Implementation

Database Tables

This is an idea of what the database tables could look like that store the relationship data.

Relationship Types

Column Name Type Values
RelationshipTypeId long (unique id)
Name string e.g. “capital of”, “major”
ValueType string “page”, “complex”, “integer”, “date”, ...
DescriptionPageTitle string e.g. “Capitals of Nations”

Complex Values

Column Name Type Values
ComplexId long (unique id)

Page Relationships

Column Name Type Values
PageId long (id of wiki page)
RelationshipTypeId long (id of relationship type)
ValueId long (id of value)

Complex Value Relationships

Column Name Type Values
ComplexId long (id of complex value)
RelationshipTypeId long (id of relationship type)
ValueId long (id of value)

Values

Only the columns used by the value type of the relationship are used; all others are set to NULL.

Column Name Type Values
ValueId long (unique id)
PageTitle string e.g. “Germany”
ComplexId long (id of complex value, which has its own relationships)
Integer long e.g. 115
DateStart date e.g. midnight June 1, 2009 (start of June 2009)
DatePastEnd date e.g. midnight July 1, 2009 (past end of June 2009)
... ... ...

Implementation

Just as the full-text index is rebuilt whenever a wiki page is added or modified, the page must also be scanned for semantic information.

Specifically, when a page is edited, any relationships previously defined by that page must be replaced by whatever relationships are now defined by the page.

When the page with the “SemanticRelationships” page property is edited, the entire semantic database must be rebuilt. First the relationship types are constructed from the content of that page, and then all of the remaining pages of the wiki must be scanned to build the semantic database.

(We may want to protect the “SemanticRelationships” page from being edited by just anyone.



Faithlife Wiki

Welcome, Guest! (sign in)