Semantic MediaWiki and related extensions
|
Public Attributes | |
const | OPT_LAST_MODIFIED = 'opt.last.modified' |
const | OPT_CHECK_REMNANT_ENTITIES = 'opt.check.remnant.entities' |
const | PROC_USER = 'proc.user' |
const | PROC_DELETE = 'proc.delete' |
$stubObject | |
$subContainerDepthCounter = 0 | |
Static Protected Attributes | |
static | $mPropertyPrefix = '' |
Class for representing chunks of semantic data for one given subject. This consists of property-value pairs, grouped by property, and possibly by SMWSemanticData objects about subobjects.
Data about subobjects can be added in two ways: by directly adding it using addSubSemanticData() or by adding a property value of type SMWDIContainer.
By its very design, the container is unable to hold inverse properties. For one thing, it would not be possible to identify them with mere keys. Since SMW cannot annotate pages with inverses, this is not a limitation.
SMW\SemanticData::__construct | ( | DIWikiPage | $subject, |
$noDuplicates = true |
|||
) |
Constructor.
DIWikiPage | $subject | to which this data refers |
boolean | $noDuplicates | stating if duplicate data should be avoided |
SMW\SemanticData::__sleep | ( | ) |
This object is added to the parser output of MediaWiki, but it is not useful to have all its data as part of the parser cache since the data is already stored in more accessible format in SMW. Hence this implementation of __sleep() makes sure only the subject is serialised, yielding a minimal stub data container after unserialisation. This is a little safer than serialising nothing: if, for any reason, SMW should ever access an unserialised parser output, then the Semdata container will at least look as if properly initialised (though empty).
SMW\SemanticData::addDataValue | ( | SMWDataValue | $dataValue | ) |
SMWDataValue | $dataValue |
SMW\SemanticData::addError | ( | $error | ) |
Adds an error array
SMW\SemanticData::addPropertyObjectValue | ( | DIProperty | $property, |
SMWDataItem | $dataItem | ||
) |
Store a value for a property identified by its SMWDataItem object.
$property | DIProperty |
$dataItem | SMWDataItem |
SMW\SemanticData::addPropertyValue | ( | $propertyName, | |
SMWDataItem | $dataItem | ||
) |
Store a value for a given property identified by its text label (without namespace prefix).
$propertyName | string |
$dataItem | SMWDataItem |
SMW\SemanticData::addSubSemanticData | ( | SemanticData | $semanticData | ) |
SemanticData | $semanticData |
SubSemanticDataException |
SMW\SemanticData::clear | ( | ) |
Delete all data other than the subject.
SMW\SemanticData::clearSubSemanticData | ( | ) |
SMW\SemanticData::findSubSemanticData | ( | $subobjectName | ) |
string | $subobjectName |
SMW\SemanticData::getCountMap | ( | ) |
Returns a map of property value counts
SMW\SemanticData::getErrors | ( | ) |
Returns collected errors occurred during processing
SMW\SemanticData::getExtensionData | ( | $key | ) |
string | $key |
SMW\SemanticData::getHash | ( | ) |
Generate a hash value to simplify the comparison of this data container with other containers. Subdata is taken into account.
The hash uses PHP's md5 implementation, which is among the fastest hash algorithms that PHP offers.
SMW\SemanticData::getOption | ( | $key, | |
$default = null |
|||
) |
string | $key | |
mixed | $default |
SMW\SemanticData::getProperties | ( | ) |
Get the array of all properties that have stored values.
SMW\SemanticData::getPropertyValues | ( | DIProperty | $property | ) |
Get the array of all stored values for some property.
DIProperty | $property |
SMW\SemanticData::getSequenceMap | ( | ) |
Returns a hashed value map
SMW\SemanticData::getSubject | ( | ) |
Return subject to which the stored semantic annotations refer to.
SMW\SemanticData::getSubSemanticData | ( | ) |
SMW\SemanticData::hasProperty | ( | DIProperty | $property | ) |
SMW\SemanticData::hasSubSemanticData | ( | $subobjectName = null | ) |
string | $subobjectName,|null |
SMW\SemanticData::hasVisibleProperties | ( | ) |
Return true if there are any visible properties.
SMW\SemanticData::hasVisibleSpecialProperties | ( | ) |
Return true if there are any special properties that can be displayed.
SMW\SemanticData::importDataFrom | ( | SemanticData | $semanticData | ) |
Add all data from the given SMWSemanticData. Only works if the imported SMWSemanticData has the same subject as this SMWSemanticData; an exception is thrown otherwise.
SemanticData | $semanticData | object to copy from |
SemanticDataImportException |
SMW\SemanticData::isEmpty | ( | ) |
Return true if this SemanticData is empty. This is the case when the subject has neither property values nor data for subobjects.
SMW\SemanticData::isStub | ( | ) |
SMW\SemanticData::removeDataFrom | ( | SemanticData | $semanticData | ) |
Removes data from the given SMWSemanticData. If the subject of the data that is to be removed is not equal to the subject of this SMWSemanticData, it will just be ignored (nothing to remove). Likewise, removing data that is not present does not change anything.
SemanticData | $semanticData |
SMW\SemanticData::removeProperty | ( | DIProperty | $property | ) |
Removes a property and all the values associated with this property.
$property | DIProperty |
SMW\SemanticData::removePropertyObjectValue | ( | DIProperty | $property, |
SMWDataItem | $dataItem | ||
) |
Remove a value for a property identified by its SMWDataItem object. This method removes a property-value specified by the property and dataitem. If there are no more property-values for this property it also removes the property from the mProperties.
$property | DIProperty |
$dataItem | SMWDataItem |
SMW\SemanticData::removeSubSemanticData | ( | SemanticData | $semanticData | ) |
SMW\SemanticData::setExtensionData | ( | $key, | |
$value | |||
) |
string | $key | |
mixed | $value |
SMW\SemanticData::setOption | ( | $key, | |
$value | |||
) |
string | $key | |
string | $value |
const SMW\SemanticData::OPT_CHECK_REMNANT_ENTITIES = 'opt.check.remnant.entities' |
const SMW\SemanticData::OPT_LAST_MODIFIED = 'opt.last.modified' |
Returns the last modified timestamp the data were stored to the Store or have been fetched from cache.
const SMW\SemanticData::PROC_DELETE = 'proc.delete' |
Identifies that a data block was initiated by a delete request.
const SMW\SemanticData::PROC_USER = 'proc.user' |
Identifies that a data block was created by a user.