Semantic MediaWiki and related extensions
|
Public Member Functions | |
getPrintRequests () | |
setPrintRequests (array $printRequests) | |
addPrintRequest (PrintRequest $printRequest) | |
prependPrintRequest (PrintRequest $printRequest) | |
getFingerprint () | |
getMembership () | |
setMembership ( $membership) | |
getQueryString ( $asValue=false) | |
isSingleton () | |
getSize () | |
getDepth () | |
getQueryFeatures () | |
prune (&$maxsize, &$maxDepth, &$log) | |
__toString () | |
Protected Attributes | |
$m_printreqs = [] | |
$fingerprint = null | |
Abstract base class for all descriptions
GNU GPL v2+
SMW\Query\Language\Description::__toString | ( | ) |
SMW\Query\Language\Description::addPrintRequest | ( | PrintRequest | $printRequest | ) |
Add a single SMW.
PrintRequest | $printRequest |
SMW\Query\Language\Description::getDepth | ( | ) |
Compute the depth of the description. Default is 0.
SMW\Query\Language\Description::getFingerprint | ( | ) |
Returns a compound signature that identifies the canonized description. It builds a fingerrint so that [[Foo::123]][[Bar::abc]] returns the same signature as for [[Bar::abc]][[Foo::123]].
FingerprintNotFoundException |
SMW\Query\Language\Description::getMembership | ( | ) |
Identifies an arbitrary membership to a wider circle of descriptions that mostly occurs in connection with a Conjunction, Disjunction, or SomeProperty.
SMW\Query\Language\Description::getPrintRequests | ( | ) |
Get the (possibly empty) array of all print requests that exist for the entities that fit this description.
SMW\Query\Language\Description::getQueryFeatures | ( | ) |
Report on query features used in description. Return values are (sums of) query feature constants such as SMW_PROPERTY_QUERY.
|
abstract |
Return a string expressing this query. Some descriptions have different syntax in property value positions. The parameter $asvalue specifies whether the serialisation should take that into account.
Example: The SMWValueDescription [[Paris]] returns the single result "Paris" but can also be used as value in [[has location::Paris]] which is preferred over the canonical [[has location::<q>[[Paris]]</q>]].
The result should be a plain query string that SMW is able to parse, without any kind of HTML escape sequences.
boolean | $asValue |
SMW\Query\Language\Description::getSize | ( | ) |
Compute the size of the description. Default is 1.
|
abstract |
Return true if the description is required to encompass at most a single result, independently of the knowledge base.
SMW\Query\Language\Description::prependPrintRequest | ( | PrintRequest | $printRequest | ) |
Add a new print request, but at the beginning of the list of requests (thus it will be printed first).
PrintRequest | $printRequest |
SMW\Query\Language\Description::prune | ( | & | $maxsize, |
& | $maxDepth, | ||
& | $log | ||
) |
Recursively restrict query to a maximal size and depth as given. Returns a possibly changed description that should be used as a replacement. Reduce values of parameters to account for the returned descriptions size. Default implementation for non-nested descriptions of size 1. The parameter $log contains a list of all pruned conditions, updated when some description was reduced.
SMW\Query\Language\Description::setMembership | ( | $membership | ) |
string | $membership |
SMW\Query\Language\Description::setPrintRequests | ( | array | $printRequests | ) |
Set the array of print requests completely.
PrintRequest[] | $printRequests |