Database schema

From semantic-mediawiki.org
Jump to: navigation, search
Smw-installer-schematic.png

This page contains some information about the database schema1 and available tables used by the SQLStore in Semantic MediaWiki.

Starting with SMW 2.5 the database schema is defined by the TableSchemaManager 2 together with DB specific implementations that is handled by the TableBuilder interface.

Building on the triple pattern paradigm to organize semantic relations, Semantic MediaWiki uses three tables types to store information in order for them to be queryable.

  • Property table
  • Fixed property table
  • Common data table

Property tables

The property table smw_di_... will contain:

  • s_id subject ID reference (defined in ID TABLE as smw_id)
  • p_id property ID reference (defined in ID TABLE as smw_id)
  • o_... fields that identify object related values to complete the s-p-o pattern

The fixed property table smw_fpt_... will contain:

  • s_id subject ID reference (defined in ID TABLE as smw_id)
  • o_... fields that identify object related values to complete the s-p-o pattern

The fixed property table will have no p_id field as the assigned property is fixed therefore doesn't require a property ID reference. Those with a fixed table assignment are either defined in PropertyTableInfoFetcher (for predefined properties) or by the $smwgFixedProperties setting (for user-defined properties).

Common data tables

Common data tables are follow individual schema definitions and are as well defined by the TableSchemaManager and include:

  • smw_object_ids (aka ID TABLE) contains the entity and subject references
  • smw_query_links (aka QUERY LINKS TABLE) collection of query dependencies3
  • smw_prop_stats collection of property statistics
  • smw_ft_search contains a collection of full-text indexable4 text components

See also

References