Manual:Managing data in MediaWiki

From mediawiki.org

MediaWiki was designed to manage mostly textual information and it does this very well. However, the only way of structuring content is by Namespaces , Subpages or Categories .

If you want to manage structured data in MediaWiki, e.g. a date or a number, several different approaches exist, handled by dedicated extensions.

The differences and similarities of the most common ones are shown in the following table:

Feature 20210702 Semantic MediaWiki logo with wordmark.png
Semantic MediaWiki
Wikibase logo.svg
Wikibase
Cargo logo.png
Cargo
Main usecase Managing data within a MediaWiki installation, based on Semantic Web standards. Powering Wikidata Managing data within a MediaWiki installation.
Approach Data (properties) are annotated within regular wikitext or by templates. With the datatype "reference", properties can be used to describe items using statements.[1] Properties are defined and used to describe Items using statements. Data is stored in database tables, with each table corresponding to a template.
Available since 2005 2012 2015
Active installations 1000s[2] 100s[3][4][5] 100s[6]
Community 145+ developers[7] 172+ developers[8] 63+ developers[9]
Storage MediaWiki database, Elasticsearch, 5 different SPARQL stores[10] MediaWiki database, Elasticsearch, SPARQL store (Blazegraph for wikidata.org) MediaWiki database (or a separate database)[11]
Property definition By typing wikitext. Properties can be invented freely. They will be of datatype page by default and can be defined later. Datatypes can be changed any time. Properties have to be defined before usage and can not be changed easily.[12] Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.
Value declaration Inline ([[MyProperty::MyValue]]) or with templates. Form-based data entry with Page Forms . Wikibase default form-like input interface. With parser functions in templates. Form-based data entry with Page Forms .
Predefined data types 18[13] 17[14][15] 18
Property management type definitions, constraint schemas, ontology import custom, or import of Wikidata ontology Instead of using properties, data tables are defined with a predetermined (but reconfigurable) set of fields per table.
Page names and internal linking Pages have normal names and can be linked to with their names. Page names are stored with their Q-numbers (displaying labels in available languages). Internal linking must be done to the Q-number; you cannot link to a label. Pages have normal names and can be linked to with their names.
Inline queries yes, with parser functions no (external SPARQL queries); planned
supported via third-party extension LinkedWiki
yes, with parser functions
External querying yes, with either an API or SPARQL querying (available through special extensions such as RDFIO and LinkedWiki) yes, with SPARQL Query service yes, with an API
Result formats[16] ~ 75[17] no native result display; data may be visualized via: ~ 25[18]
Development GitHub Gerrit Gerrit
Complementary extensions 28[19] ~ 51[20], e.g. Semantic Result Formats , Semantic Bundle , Semantic Scribunto ~12[21], e.g. Wikibase Client , WikibaseLexeme , Query Service 2 (Page Forms, Page Schemas). Cargo provides some or all of the functionality of Semantic MediaWiki, Semantic Result Formats, Maps, Semantic Drilldown, Semantic Compound Queries, Semantic Internal Objects and Semantic Scribunto.[22]

Alternative comparisons[edit source]

References[edit source]

  1. https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data
  2. https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki
  3. https://wikiapiary.com/wiki/Extension:WikibaseRepository
  4. https://wikibase-registry.wmflabs.org/wiki/Main_Page
  5. https://addshore.com/2020/05/wbstack-2020-update-2/
  6. https://wikiapiary.com/wiki/Extension:Cargo
  7. https://www.openhub.net/p/smw
  8. https://github.com/wikimedia/mediawiki-extensions-Wikibase
  9. https://github.com/wikimedia/mediawiki-extensions-Cargo
  10. https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore
  11. https://www.mediawiki.org/wiki/Extension:Cargo/Download_and_installation#Setting_the_Cargo_database
  12. d:Help:Data type#Changing datatype
  13. https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes
  14. https://www.wikidata.org/wiki/Special:ListDatatypes
  15. Some datatypes are defined by other extension: Math and Score both define one datatype, JsonConfig defines two, WikibaseLexeme defines three, and Wikibase defines ten.
  16. "Result formats" mean the ability of the wiki to display data (results of an inline query) in various formats, e.g. tables, calendars, maps, timelines, etc.
  17. https://www.semantic-mediawiki.org/wiki/Help:Result_formats
  18. https://www.mediawiki.org/wiki/Extension:Cargo/Display_formats
  19. https://github.com/SemanticMediaWiki
  20. https://www.mediawiki.org/wiki/Category:Semantic_MediaWiki_extensions
  21. https://www.mediawiki.org/wiki/Category:Wikibase_extensions
  22. Extension:Cargo/Cargo and Semantic MediaWiki.

See also[edit source]

  • Multi-Content Revisions - Ability to manage different independent content objects on the same wiki page by a technology change to the back-end of MediaWiki.
  • DynamicPageList – Allows to extract data from pages.
  • WikiDB – Provides database features, somewhat similar to semantic properties.
  • JsonConfig – store JSON (including tabular and map data) in wiki pages, and allow accessing them via Lua; no query support
  • External Data - access data from external URL, local file, and SQL or MongoDB database (which may contain data from non-MediaWiki websites)
  • Structured data across Wikimedia – ongoing (as of 2021) project for improving structured data support in MediaWiki