Semantic MediaWiki and related extensions
Extension

Repository extension

The repository extension is meant to change the SESP repository itself in providing additional services that can be enabled via the $sespgEnabledPropertyList setting.

$sespgEnabledPropertyList = [
'_CUSER',
'_VIEWS',
'_PAGEID',
'_ETX1'
];

Each extension is expected to be represented by a definition and a corresponding PropertyAnnotator implementation.

Property definition expansion

Expand the property definition in definitions.json with something like:

Examples

"_ETX1": {
"id": "___EXT1",
"type": "_num",
"alias": "sesp-property-ext-1",
"label": "Ext ID",
"desc": "sesp-property-ext-1-desc"
}

PropertyAnnotator implementation

Local extension

The local extension mechanism has been introduced to avoid having to alter the SESP repository directly and instead provide a method for simple local adaptation.

$sespgEnabledPropertyList = [
'_CUSER',
'_VIEWS',
'_PAGEID',
'_MY_CUSTOM1',
'_MY_CUSTOM2'
];

$sespgLocalDefinitions contains encapsulate property definitions that are only valid locally to a wiki and are loaded from the LocalSettinsg.php.

Examples

$sespgLocalDefinitions['_MY_CUSTOM1'] = [
'id' => '___MY_CUSTOM1',
'type' => '_wpg',
'alias' => 'some-...',
'label' => 'SomeCustomProperty',
'callback' => function( $appFactory, $property, $semanticData ) {
return \SMW\DIWikiPage::newFromText( 'Foo' );
}
];
$sespgLocalDefinitions['_MY_CUSTOM2'] = [
'id' => '___MY_CUSTOM2',
'type' => '_wpg',
'alias' => 'some-...',
'label' => 'SomeCustomProperty2',
'callback' => [ 'FooCustom', 'addAnnotation' ]
];
class FooCustom {
/**
* @param AppFactory $appFactory
* @param DIProperty $property
* @param SemanticData $semanticData
*/
public static function addAnnotation( $appFactory, $property, $semanticData ) {
return \SMW\DIWikiPage::newFromText( 'Bar' );
}
}

← README | Configuration | migration-to-200.md "Migration to 2.0.0" →


About | General disclaimer | Privacy policy