Help:Notes on record types

From semantic-mediawiki.org
Help:Datatype "Record"Help:Notes on record types

Record related datatypes rely on special treatment in Semantic MediaWiki as the Help:DataItem is stored as separate entity while display characteristics are that of a "flat" Help:DataValue where in fact it is represented as DIContainer using ContainerSemanticData.

ResultArray1 2 contains special handing to allow to use the |+index=... output selector and QueryResultSerializer to contain extra export data necessary for the serialization for this datatype.

Extension[edit]

A new record type should be registered with the name to include `_rec` 1 so existing container related handling (as in case of ResultArray) can be make use of it.

Register a newly created record type as subtype 3.

$dataTypeRegistry->registerDatatype(
	'_sci_freq_rec',
	'\SCI\DataValues\CitationFrequencyValue',
	DataItem::TYPE_WIKIPAGE,
	false,
	true // subtype
);
  • SMW\DataValues\MonolingualTextValue as _mlt_rec
  • SCI\DataValues\CitationFrequencyValue as _sci_freq_rec


References

  1. a b  
    GitHub commit gh:smw:8e4351f
  2. ^  Semantic External Query Lookup: GitHub pull request gh:seql:22
  3. ^  Semantic MediaWiki: GitHub pull request gh:smw:1275