Inherited by SMWDIBlob, SMWDIBoolean, SMWDIConcept, SMWDIContainer, SMWDIError, SMWDIGeoCoord, SMWDINumber, SMWDIProperty, SMWDITime, SMWDIUri, and SMWDIWikiPage.
Public Member Functions | |
| getDIType () | |
| Convenience method that returns a constant that defines the concrete class that implements this data item. | |
| getSortKey () | |
| Return a value that can be used for sorting data of this type. | |
| getSortKeyDataItem () | |
| Create a data item that represents the sortkey, i.e. | |
| getSerialization () | |
| Get a UTF-8 encoded string serialization of this data item. | |
| getHash () | |
| Get a hash string for this data item. | |
Static Public Member Functions | |
| static | newFromSerialization ($diType, $serialization) |
| Create a data item of the given dataitem ID based on the the provided serialization string and (optional) typeid. | |
| static | getDataItemClassNameForId ($diType) |
| Gets the class name of the data item that has the provided type id. | |
Public Attributes | |
| const | TYPE_NOTYPE = 0 |
| Data item ID that can be used to indicate that no data item class is appropriate. | |
| const | TYPE_NUMBER = 1 |
| Data item ID for SMWDINumber. | |
| const | TYPE_STRING = 2 |
| Data item ID for SMWDIString. | |
| const | TYPE_BLOB = 3 |
| Data item ID for SMWDIBlob. | |
| const | TYPE_BOOLEAN = 4 |
| Data item ID for SMWDIBoolean. | |
| const | TYPE_URI = 5 |
| Data item ID for SMWDIUri. | |
| const | TYPE_TIME = 6 |
| Data item ID for SMWDITimePoint. | |
| const | TYPE_GEO = 7 |
| Data item ID for SMWDIGeoCoord. | |
| const | TYPE_CONTAINER = 8 |
| Data item ID for SMWDIContainer. | |
| const | TYPE_WIKIPAGE = 9 |
| Data item ID for SMWDIWikiPage. | |
| const | TYPE_CONCEPT = 10 |
| Data item ID for SMWDIConcept. | |
| const | TYPE_PROPERTY = 11 |
| Data item ID for SMWDIProperty. | |
| const | TYPE_ERROR = 12 |
| Data item ID for SMWDIError. | |
Data items only represent the stored data, and are thus at the core of SMW's data model. Data items are always immutable, i.e. they must not be changed after creation (and this is mostly enforced by the API with some minor exceptions).
The set of available data items is fixed and cannot be extended. These are the kinds of information that SMW can process. Their concrete use and handling might depend on the context in which they are used. In particular, property values may be influences by settings made for their property. This aspect, however, is not part of the data item API.
Definition at line 44 of file SMW_DataItem.php.
| SMWDataItem::getDIType | ( | ) | [abstract] |
Convenience method that returns a constant that defines the concrete class that implements this data item.
Used to switch when processing data items.
Reimplemented in SMWDIBlob, SMWDIBoolean, SMWDIConcept, SMWDIContainer, SMWDIError, SMWDIGeoCoord, SMWDINumber, SMWDIProperty, SMWDIString, SMWDITime, SMWDIUri, and SMWDIWikiPage.
| SMWDataItem::getSortKey | ( | ) | [abstract] |
Return a value that can be used for sorting data of this type.
If the data is of a numerical type, the sorting must be done in numerical order. If the data is a string, the data must be sorted alphabetically.
Wiki pages are a special case in SMW. They are ordered by a sortkey that is assigned to them as a property value. When pages are sorted, this data should be used if possible.
Reimplemented in SMWDIBlob, SMWDIBoolean, SMWDIConcept, SMWDIContainer, SMWDIError, SMWDIGeoCoord, SMWDINumber, SMWDIProperty, SMWDITime, SMWDIUri, and SMWDIWikiPage.
Referenced by getSortKeyDataItem().
| SMWDataItem::getSortKeyDataItem | ( | ) |
Create a data item that represents the sortkey, i.e.
either an SMWDIBlob or an SMWDINumber. For efficiency, these subclasses overwrite this method to return themselves.
Reimplemented in SMWDIBlob, and SMWDINumber.
Definition at line 109 of file SMW_DataItem.php.
References getSortKey().
| SMWDataItem::getSerialization | ( | ) | [abstract] |
Get a UTF-8 encoded string serialization of this data item.
The serialisation should be concise and need not be pretty, but it must allow unserialization. Each subclass of SMWDataItem implements a static method doUnserialize() for this purpose.
Reimplemented in SMWDIBlob, SMWDIBoolean, SMWDIConcept, SMWDIContainer, SMWDIError, SMWDIGeoCoord, SMWDINumber, SMWDIProperty, SMWDITime, SMWDIUri, and SMWDIWikiPage.
Referenced by getHash(), and SMWDISerializer::getSerialization().
| SMWDataItem::getHash | ( | ) |
Get a hash string for this data item.
Might be overwritten in subclasses to obtain shorter or more efficient hashes.
Reimplemented in SMWDIContainer.
Definition at line 133 of file SMW_DataItem.php.
References getSerialization().
Referenced by SMWSemanticData::addPropertyObjectValue(), and SMWExportController::queuePage().
| static SMWDataItem::newFromSerialization | ( | $ | diType, | |
| $ | serialization | |||
| ) | [static] |
Create a data item of the given dataitem ID based on the the provided serialization string and (optional) typeid.
| $diType | integer dataitem ID | |
| $serialization | string | |
| $typeid | string SMW type ID (optional) |
Definition at line 147 of file SMW_DataItem.php.
| static SMWDataItem::getDataItemClassNameForId | ( | $ | diType | ) | [static] |
Gets the class name of the data item that has the provided type id.
| integer | $diType Element of the SMWDataItem::TYPE_ enum |
| InvalidArgumentException |
Definition at line 161 of file SMW_DataItem.php.
| const SMWDataItem::TYPE_NOTYPE = 0 |
Data item ID that can be used to indicate that no data item class is appropriate.
Definition at line 47 of file SMW_DataItem.php.
Referenced by SMWSparqlStoreQueryEngine::addOrderByDataForProperty(), SMWCompatibilityHelpers::dataItemFromDBKeys(), and SMWDataValueFactory::getDataItemId().
| const SMWDataItem::TYPE_NUMBER = 1 |
Data item ID for SMWDINumber.
Definition at line 49 of file SMW_DataItem.php.
Referenced by SRFMath::addNumbersForDataItem(), SMWAggregatablePrinter::addNumbersForDataItem(), SMWCompatibilityHelpers::dataItemFromDBKeys(), SMWExporter::getDataItemExpElement(), SMWCompatibilityHelpers::getDBkeysFromDataItem(), SMWDINumber::getDIType(), SMWCompatibilityHelpers::getIndexFromDataItemId(), SMWDISerializer::getSerialization(), SMWCompatibilityHelpers::getSignatureFromDataItemId(), SMWDataValueFactory::initDatatypes(), and SMWNumberValue::loadDataItem().
| const SMWDataItem::TYPE_STRING = 2 |
Data item ID for SMWDIString.
Definition at line 51 of file SMW_DataItem.php.
Referenced by SMWDataValue::checkAllowedValues(), SMWCompatibilityHelpers::dataItemFromDBKeys(), SMWExporter::getDataItemExpElement(), SMWCompatibilityHelpers::getDBkeysFromDataItem(), SMWDIString::getDIType(), SMWCompatibilityHelpers::getIndexFromDataItemId(), SMWCompatibilityHelpers::getSignatureFromDataItemId(), SMWQuantityValue::initConversionData(), SMWDataValueFactory::initDatatypes(), SMWQuantityValue::initDisplayData(), SMWStringValue::loadDataItem(), SMWPropertyListValue::loadDataItem(), and SMWImportValue::loadDataItem().
| const SMWDataItem::TYPE_BLOB = 3 |
Data item ID for SMWDIBlob.
Definition at line 53 of file SMW_DataItem.php.
Referenced by SMWCompatibilityHelpers::dataItemFromDBKeys(), SMWExporter::getDataItemExpElement(), SMWCompatibilityHelpers::getDBkeysFromDataItem(), SMWDIBlob::getDIType(), SMWDataValueFactory::initDatatypes(), and SMWStringValue::loadDataItem().
| const SMWDataItem::TYPE_BOOLEAN = 4 |
Data item ID for SMWDIBoolean.
Definition at line 55 of file SMW_DataItem.php.
Referenced by SMWCompatibilityHelpers::dataItemFromDBKeys(), SMWExporter::getDataItemExpElement(), SMWCompatibilityHelpers::getDBkeysFromDataItem(), SMWDIBoolean::getDIType(), SMWCompatibilityHelpers::getIndexFromDataItemId(), SMWCompatibilityHelpers::getSignatureFromDataItemId(), SMWDataValueFactory::initDatatypes(), and SMWBoolValue::loadDataItem().
| const SMWDataItem::TYPE_URI = 5 |
Data item ID for SMWDIUri.
Definition at line 57 of file SMW_DataItem.php.
Referenced by SMWCompatibilityHelpers::dataItemFromDBKeys(), SMWExporter::getDataItemExpElement(), SMWCompatibilityHelpers::getDBkeysFromDataItem(), SMWDIUri::getDIType(), SMWCompatibilityHelpers::getIndexFromDataItemId(), SMWCompatibilityHelpers::getSignatureFromDataItemId(), SMWDataValueFactory::initDatatypes(), and SMWURIValue::loadDataItem().
| const SMWDataItem::TYPE_TIME = 6 |
Data item ID for SMWDITimePoint.
Definition at line 59 of file SMW_DataItem.php.
Referenced by SMWCompatibilityHelpers::dataItemFromDBKeys(), SMWExporter::getDataItemExpElement(), SMWExporter::getDataItemHelperExpElement(), SMWCompatibilityHelpers::getDBkeysFromDataItem(), SMWDITime::getDIType(), SMWCompatibilityHelpers::getIndexFromDataItemId(), SMWDISerializer::getSerialization(), SMWCompatibilityHelpers::getSignatureFromDataItemId(), SMWExporter::hasHelperExpElement(), SMWDataValueFactory::initDatatypes(), and SMWTimeValue::loadDataItem().
| const SMWDataItem::TYPE_GEO = 7 |
Data item ID for SMWDIGeoCoord.
Definition at line 61 of file SMW_DataItem.php.
Referenced by SMWCompatibilityHelpers::dataItemFromDBKeys(), SMWExporter::getDataItemExpElement(), SMWCompatibilityHelpers::getDBkeysFromDataItem(), SMWDIGeoCoord::getDIType(), SMWCompatibilityHelpers::getIndexFromDataItemId(), SMWDISerializer::getSerialization(), SMWCompatibilityHelpers::getSignatureFromDataItemId(), SMGeoCoordsValueDescription::getSQLCondition(), SMAreaValueDescription::getSQLCondition(), SMWDataValueFactory::initDatatypes(), SMGeoCoordsHooks::initGeoCoordsType(), and SMGeoCoordsValue::loadDataItem().
| const SMWDataItem::TYPE_CONTAINER = 8 |
Data item ID for SMWDIContainer.
Definition at line 63 of file SMW_DataItem.php.
Referenced by SRFMath::addNumbersForDataItem(), SMWAggregatablePrinter::addNumbersForDataItem(), SMWCompatibilityHelpers::dataItemFromDBKeys(), SMWExporter::getDataItemExpElement(), SMWCompatibilityHelpers::getDBkeysFromDataItem(), SMWDIContainer::getDIType(), SMWCompatibilityHelpers::getIndexFromDataItemId(), SMWSqlStubSemanticData::getPropertyValues(), SMWSQLStore2::getPropertyValues(), SMWCompatibilityHelpers::getSignatureFromDataItemId(), SMWDataValueFactory::initDatatypes(), SMWWikiPageValue::loadDataItem(), and SMWRecordValue::loadDataItem().
| const SMWDataItem::TYPE_WIKIPAGE = 9 |
Data item ID for SMWDIWikiPage.
Definition at line 65 of file SMW_DataItem.php.
Referenced by SMWSparqlStoreQueryEngine::addMissingOrderByConditions(), SMWSparqlStoreQueryEngine::addOrderByData(), SMWExporter::addPropertyValues(), SMWSparqlStoreQueryEngine::buildClassCondition(), SMWSparqlStoreQueryEngine::buildNamespaceCondition(), SMWSparqlStoreQueryEngine::buildPropertyCondition(), SMWCompatibilityHelpers::dataItemFromDBKeys(), SMWExporter::getDataItemExpElement(), SMWCompatibilityHelpers::getDBkeysFromDataItem(), SMWDIWikiPage::getDIType(), SMWCompatibilityHelpers::getIndexFromDataItemId(), SMWStore::getRedirectTarget(), SRFProcess::getResultText(), SMWCategoryResultPrinter::getResultText(), SMWDISerializer::getSerialization(), SMWCompatibilityHelpers::getSignatureFromDataItemId(), SMWDataValueFactory::initDatatypes(), and SMWWikiPageValue::loadDataItem().
| const SMWDataItem::TYPE_CONCEPT = 10 |
Data item ID for SMWDIConcept.
Definition at line 67 of file SMW_DataItem.php.
Referenced by SMWCompatibilityHelpers::dataItemFromDBKeys(), SMWExporter::getDataItemExpElement(), SMWCompatibilityHelpers::getDBkeysFromDataItem(), SMWDIConcept::getDIType(), SMWCompatibilityHelpers::getIndexFromDataItemId(), SMWCompatibilityHelpers::getSignatureFromDataItemId(), SMWDataValueFactory::initDatatypes(), and SMWConceptValue::loadDataItem().
| const SMWDataItem::TYPE_PROPERTY = 11 |
Data item ID for SMWDIProperty.
Definition at line 69 of file SMW_DataItem.php.
Referenced by SMWCompatibilityHelpers::dataItemFromDBKeys(), SMWExporter::getDataItemExpElement(), SMWCompatibilityHelpers::getDBkeysFromDataItem(), SMWDIProperty::getDIType(), SMWCompatibilityHelpers::getIndexFromDataItemId(), SMWStore::getRedirectTarget(), SMWCompatibilityHelpers::getSignatureFromDataItemId(), SMWDataValueFactory::initDatatypes(), and SMWPropertyValue::loadDataItem().
| const SMWDataItem::TYPE_ERROR = 12 |
Data item ID for SMWDIError.
Definition at line 71 of file SMW_DataItem.php.
Referenced by SMWCompatibilityHelpers::dataItemFromDBKeys(), SMWDIError::getDIType(), and SMWErrorValue::loadDataItem().
1.5.6