Semantic MediaWiki and related extensions
|
Public Member Functions | |
__construct ( $key, $inverse=false) | |
getDIType () | |
getKey () | |
isInverse () | |
getSha1 () | |
getSortKey () | |
isShown () | |
isUserDefined () | |
isUserAnnotable () | |
getLabel () | |
getCanonicalLabel () | |
getPreferredLabel (string $languageCode='') | |
setInterwiki (string $interwiki) | |
getDiWikiPage (string $subobjectName='') | |
getCanonicalDiWikiPage (string $subobjectName='') | |
getRedirectTarget () | |
setPropertyTypeId ( $valueType) | |
setPropertyValueType (string $valueType) | |
findPropertyTypeId () | |
findPropertyValueType () | |
getSerialization () | |
equals (SMWDataItem $di) | |
Public Member Functions inherited from SMWDataItem | |
getDIType () | |
getSortKey () | |
equals (SMWDataItem $di) | |
getSortKeyDataItem () | |
getSerialization () | |
getSha1 () | |
getHash () | |
__toString () | |
setOption ( $key, $value) | |
getOption ( $key, $default=null) | |
Static Public Member Functions | |
static | doUnserialize (?string $serialization) |
static | newFromUserLabel (string $label, bool $inverse=false, $languageCode=false) |
Static Public Member Functions inherited from SMWDataItem | |
static | newFromSerialization ( $diType, $serialization) |
static | getDataItemClassNameForId ( $diType) |
Public Attributes | |
const | TYPE_SUBOBJECT = '_SOBJ' |
const | TYPE_ERROR = '_ERRP' |
const | TYPE_CATEGORY = '_INST' |
const | TYPE_SUBCATEGORY = '_SUBC' |
const | TYPE_SORTKEY = '_SKEY' |
const | TYPE_MODIFICATION_DATE = '_MDAT' |
const | TYPE_CREATION_DATE = '_CDAT' |
const | TYPE_LAST_EDITOR = '_LEDT' |
const | TYPE_NEW_PAGE = '_NEWP' |
const | TYPE_HAS_TYPE = '_TYPE' |
const | TYPE_CONVERSION = '_CONV' |
const | TYPE_ASKQUERY = '_ASK' |
const | TYPE_MEDIA = '_MEDIA' |
const | TYPE_MIME = '_MIME' |
const | TYPE_DISPLAYTITLE = '_DTITLE' |
const | TYPE_CHANGE_PROP = '_CHGPRO' |
Public Attributes inherited from SMWDataItem | |
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_BLOB = 2 |
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. | |
This class implements Property item
SMW\DIProperty::__construct | ( | $key, | |
$inverse = false |
|||
) |
Initialise a property. This constructor checks that keys of predefined properties do really exist (in the current configuration of the wiki). No check is performed to see if a user label is in fact the label or alias of a predefined property. If this should be done, the function self::newFromUserLabel() can be used.
string | bool | null | $key | Key for the property (internal SMW key or wikipage DB key) |
bool | $inverse | States if the inverse of the property is constructed |
|
static |
Create a data item from the provided serialization string and type ID.
?string | $serialization |
SMW\DIProperty::equals | ( | SMWDataItem | $di | ) |
SMW\DIProperty::findPropertyTypeId | ( | ) |
SMW\DIProperty::findPropertyValueType | ( | ) |
Find the property's type ID, either by looking up its predefined ID (if any) or by retrieving the relevant information from the store. If no type is stored for a user defined property, the global default type will be used.
SMW\DIProperty::getCanonicalDiWikiPage | ( | string | $subobjectName = '' | ) |
string | $subobjectName |
SMW\DIProperty::getCanonicalLabel | ( | ) |
SMW\DIProperty::getDIType | ( | ) |
SMW\DIProperty::getDiWikiPage | ( | string | $subobjectName = '' | ) |
Get an object of type DIWikiPage that represents the page which relates to this property, or null if no such page exists. The latter can happen for special properties without user-readable label.
It is possible to construct subobjects of the property's wikipage by providing an optional subobject name.
string | $subobjectName |
SMW\DIProperty::getKey | ( | ) |
SMW\DIProperty::getLabel | ( | ) |
Find a user-readable label for this property, or return '' if it is a predefined property that has no label. For inverse properties, the label starts with a "-".
SMW\DIProperty::getPreferredLabel | ( | string | $languageCode = '' | ) |
Borrowing the skos:prefLabel definition where a preferred label is expected to have only one label per given language (skos:altLabel can have many alternative labels)
An empty string signals that no preferred label is available in the current user language.
string | $languageCode |
SMW\DIProperty::getRedirectTarget | ( | ) |
SMW\DIProperty::getSerialization | ( | ) |
SMW\DIProperty::getSha1 | ( | ) |
SMW\DIProperty::getSortKey | ( | ) |
SMW\DIProperty::isInverse | ( | ) |
SMW\DIProperty::isShown | ( | ) |
Specifies whether values of this property should be shown in the Factbox. A property may wish to prevent this if either (1) its information is really dull, e.g. being a mere copy of information that is obvious from other things that are shown, or (2) the property is set in a hook after parsing, so that it is not reliably available when Factboxes are displayed. If a property is internal so it should never be observed by users, then it is better to just not associate any translated label with it, so it never appears anywhere.
Examples of properties that are not shown include Modification date (not available in time), and Has improper value for (errors are shown directly on the page anyway).
SMW\DIProperty::isUserAnnotable | ( | ) |
Whether a user can freely use this property for value annotation or not.
SMW\DIProperty::isUserDefined | ( | ) |
Return true if this is a usual wiki property that is defined by a wiki page, and not a property that is pre-defined in the wiki.
|
static |
Construct a property from a user-supplied label. The main difference to the normal constructor of DIProperty is that it is checked whether the label refers to a known predefined property. Note that this function only gives access to the registry data that DIProperty stores, but does not do further parsing of user input.
To process wiki input, SMWPropertyValue should be used.
string | $label | |
bool | $inverse | = false |
$languageCode | = false |
SMW\DIProperty::setInterwiki | ( | string | $interwiki | ) |
string | $interwiki |
SMW\DIProperty::setPropertyTypeId | ( | $valueType | ) |
SMW\DIProperty::setPropertyValueType | ( | string | $valueType | ) |
string | $valueType |
DataTypeLookupException | |
RuntimeException |
const SMW\DIProperty::TYPE_CHANGE_PROP = '_CHGPRO' |
Change propagation
const SMW\DIProperty::TYPE_SUBOBJECT = '_SOBJ' |