Semantic MediaWiki 3.0.0/Migration guide

From semantic-mediawiki.org
< Semantic MediaWiki 3.0.0
Semantic MediaWiki 3.0.0Semantic MediaWiki 3.0.0/Migration guide

This help page contains our migration guide for wikis using Semantic MediaWiki 2.5.x to Semantic MediaWiki 3.0.0Released on 11 October 2018 and compatible with MW 1.27.0 - 1.31.x..

Migration guide

This document contains migration information both for users and administratiors as well as developers when upgrading from Semantic MediaWiki 2.5.x to Semantic MediaWiki 3.0.x. Please consult the respective RELEASE-NOTES when upgrading from an earlier version of Semantic MediaWiki.

Users and administrators

List formats (incl. list, ol, ul, template)

  • Wrapped components of the list format in HTML elements
  • Added class attributes to HTML elements of list, ol and ul formats to facilitate styling
  • Added plainlistformat
  • template format becomes alias of the plainlist format
  • template parameter is used when present, even if format is not template
  • Standardized parameters to templates: All standard parameters start with a #
  • Dedicated separators for values, properties and result "rows": sep, propsep, valuesep
  • Removed final list separator (", and")
  • Removed ? as prefix for template arguments
  • Removed template arguments parameter
  • Removed columns parameter

For details also see the change description.

Maintenance scripts

  • If you are still using maintenance scripts starting with the SMW_ prefix you must now migrate to the new maintenance script names. See the help pages on maintenance scrips for further information.

Resources export

  • Resources are now being exported as Internationalized Resource Identifiers (IRI). This means that the URIs are now being exported using Universal Coded Character Set (UCS) instead of American Standard Code for Information Interchange (ASCII). See the help page on configuration parameter $smwgExportResourcesAsIri for further information.

Developers

Removed classes and methods

  • Removed DIProperty::findPropertyID, deprecated since 2.1, use PropertyRegistry::findPropertyIdByLabel
  • Removed DIProperty::getPredefinedPropertyTypeId, deprecated since 2.1, use PropertyRegistry::getPropertyValueTypeById
  • Removed DIProperty::findPropertyLabel, deprecated since 2.1, use PropertyRegistry::findPropertyLabelById
  • Removed DIProperty::registerProperty, deprecated since 2.1, use PropertyRegistry::registerProperty
  • Removed DIProperty::registerPropertyAlias, deprecated since 2.1, use PropertyRegistry::registerPropertyAlias
  • Deprecated PropertyValue::makeUserProperty, use DataValueFactory::getInstance()->newPropertyValueByLabel;
  • Removed PropertyValue::makeProperty, use DataValueFactory

Result formats

  • Removed RequestContext from the ResultPrinter class; If for some reason someone requires access to the RequestContext then it is suggested to use RequestContext::getMain().

Hooks

  • Renamed smwAddToRDFExport to SMW::Exporter::Controller::AddExpData

Store

  • Store::getPropertySubjects is to return an Iterator hence an array type check should be avoided and if necessary use iterator_to_array to transform a result instance into a standard array

Register predefined property

\Hooks::register( 'SMW::Property::initProperties', function( $propertyRegistry ) {

    $propertyRegistry->registerProperty( '__FOO', '_txt', 'Foo' );

    $propertyRegistry->registerPropertyDescriptionByMsgKey(
        '__FOO',
        'a-mediawiki-msg-key-with-a-description'
    );

    return true;
} );