SMWDescription Class Reference
[SMWQuery]

Abstract base class for all descriptions. More...

Inherited by SMWClassDescription, SMWConceptDescription, SMWConjunction, SMWDisjunction, SMWNamespaceDescription, SMWSomeProperty, SMWThingDescription, and SMWValueDescription.

List of all members.

Public Member Functions

 getPrintRequests ()
 Get the (possibly empty) array of all print requests that exist for the entities that fit this description.
 setPrintRequests (array $printrequests)
 Set the array of print requests completely.
 addPrintRequest (SMWPrintRequest $printrequest)
 Add a single SMWPrintRequest.
 prependPrintRequest (SMWPrintRequest $printrequest)
 Add a new print request, but at the beginning of the list of requests (thus it will be printed first).
 getQueryString ($asvalue=false)
 Return a string expressing this query.
 isSingleton ()
 Return true if the description is required to encompass at most a single result, independently of the knowledge base.
 getSize ()
 Compute the size of the decription.
 getDepth ()
 Compute the depth of the decription.
 getQueryFeatures ()
 Report on query features used in description.
 prune (&$maxsize, &$maxdepth, &$log)
 Determine the datatype of the values that are described by this object.

Protected Attributes

 $m_printreqs = array()


Detailed Description

Abstract base class for all descriptions.

Definition at line 17 of file SMW_Description.php.


Member Function Documentation

SMWDescription::getPrintRequests (  ) 

Get the (possibly empty) array of all print requests that exist for the entities that fit this description.

Returns:
array of SMWPrintRequest

Definition at line 30 of file SMW_Description.php.

Referenced by SMWDisjunction::addDescription(), SMWConjunction::addDescription(), SMWSomeProperty::prune(), SMWDisjunction::prune(), SMWConjunction::prune(), SMWClassDescription::prune(), prune(), and SMAreaValueDescription::prune().

SMWDescription::setPrintRequests ( array $  printrequests  ) 

Set the array of print requests completely.

Parameters:
array of SMWPrintRequest $printrequests

Definition at line 39 of file SMW_Description.php.

Referenced by SMWDisjunction::addDescription(), and SMWConjunction::addDescription().

SMWDescription::addPrintRequest ( SMWPrintRequest printrequest  ) 

Add a single SMWPrintRequest.

Parameters:
SMWPrintRequest $printrequest

Definition at line 48 of file SMW_Description.php.

Referenced by SMWPageLister::getQuery(), and SMWQuery::setDescription().

SMWDescription::prependPrintRequest ( SMWPrintRequest printrequest  ) 

Add a new print request, but at the beginning of the list of requests (thus it will be printed first).

Parameters:
SMWPrintRequest 

Definition at line 58 of file SMW_Description.php.

SMWDescription::getQueryString ( asvalue = false  )  [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>]].

Parameters:
boolean $asvalue
Returns:
string

Reimplemented in SMAreaValueDescription, SMGeoCoordsValueDescription, SMWThingDescription, SMWClassDescription, SMWConceptDescription, SMWNamespaceDescription, SMWValueDescription, SMWConjunction, SMWDisjunction, and SMWSomeProperty.

Referenced by prune().

SMWDescription::isSingleton (  )  [abstract]

Return true if the description is required to encompass at most a single result, independently of the knowledge base.

Returns:
boolean

Reimplemented in SMWThingDescription, SMWClassDescription, SMWConceptDescription, SMWNamespaceDescription, SMWValueDescription, SMWConjunction, SMWDisjunction, and SMWSomeProperty.

SMWDescription::getSize (  ) 

Compute the size of the decription.

Default is 1.

Returns:
integer

Reimplemented in SMWThingDescription, SMWClassDescription, SMWValueDescription, SMWConjunction, SMWDisjunction, and SMWSomeProperty.

Definition at line 91 of file SMW_Description.php.

Referenced by prune().

SMWDescription::getDepth (  ) 

Compute the depth of the decription.

Default is 0.

Returns:
integer

Reimplemented in SMWConjunction, SMWDisjunction, and SMWSomeProperty.

Definition at line 100 of file SMW_Description.php.

Referenced by prune(), and SMAreaValueDescription::prune().

SMWDescription::getQueryFeatures (  ) 

Report on query features used in description.

Return values are (sums of) query feature constants such as SMW_PROPERTY_QUERY.

Reimplemented in SMWClassDescription, SMWConceptDescription, SMWNamespaceDescription, SMWConjunction, SMWDisjunction, and SMWSomeProperty.

Definition at line 108 of file SMW_Description.php.

SMWDescription::prune ( &$  maxsize,
&$  maxdepth,
&$  log 
)

Determine the datatype of the values that are described by this object.

Most descriptins can only describe wiki pages, so this is the default, but some descriptions may refer to other datatypes, and overwrite this function accordingly.

Returns:
string 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.
Note:
Objects must not do changes on $this during pruning, since $this can be reused in multiple places of one or many queries. Make new objects to reflect changes!

Reimplemented in SMAreaValueDescription, SMWThingDescription, SMWClassDescription, SMWConjunction, SMWDisjunction, and SMWSomeProperty.

Definition at line 136 of file SMW_Description.php.

References getDepth(), getPrintRequests(), getQueryString(), and getSize().


Member Data Documentation

SMWDescription::$m_printreqs = array() [protected]

Definition at line 22 of file SMW_Description.php.


The documentation for this class was generated from the following file:

Generated on Thu Feb 9 07:15:40 2012 for Semantic MediaWiki by  doxygen 1.5.6