Help:Configuration parameter "$smwgPDefaultType"

From semantic-mediawiki.org
Jump to: navigation, search
edit with form (experimental)


Title $smwgPDefaultType
Description Sets the default datatype for a property if it was not defined manually
Default setting
_wpg
Software Semantic MediaWiki
First version supported 1.1.2
Last version supported still available
Configuration Miscellaneous
Keyword Property · Datatype

$smwgSubPropertyListLimit is a configuration parameter that sets the default datatype for an undefined property, i.e. if the datatype was not specified by adding special property "Has type" to the respective property's page. The configuration parameter was introduced in Semantic MediaWiki 1.1.2.

Default setting

$GLOBALS['smwgPDefaultType'] = '_wpg';

This means that by default all undefined properties, i.e. those without pages or whose pages have no "has type" statement, will be assumed to be of datatype "Page" specified by the corresponding internal datatype ID.

Changing the default setting

To modify this configuration setting, add one of the following lines to your "LocalSettings.php" file after the enableSemantics() call:

Replace the default datatype "Page" by datatype "Text"
$smwgPDefaultType = '_txt';
NoteNote: Under regular circumstances settings other than '_wpg' or '_txt' are not recommended.
Important noteImportant Note: After changing the setting for this configuration parameter the semantic data have to be rebuild either via the command line using the "rebuildData.php" maintenance script or by triggering the special task "Data repair and update" by clicking the button labeled "Start updating data" in the "Data repair and update" section on special page "Semantic MediaWiki".

List of internal datatype IDs

DatatypeID
Annotation URI
_anu
Boolean
_boo
Code
_cod
Date
_dat
Email
_ema
External identifier
_eid
Geographic coordinate
_geo
Monolingual text
_mlt_rec
Number
_num
Page
_wpg
Quantity
_qty
Record
_rec
Telephone number
_tel
Temperature
_tem
Text
_txt
Reference
_ref_rec
URL
_uri
NoteNote: The internal datatype IDs are specified in the files located at "/i18n/extra/XX.json".

See also