SMWClassDescription Class Reference
[SMWQuery]

Description of a single class as given by a wiki category, or of a disjunction of such classes. More...

Inherits SMWDescription.

List of all members.

Public Member Functions

 __construct ($content)
 Constructor.
 addDescription (SMWClassDescription $description)
 getCategories ()
 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.
 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_diWikiPages


Detailed Description

Description of a single class as given by a wiki category, or of a disjunction of such classes.

Corresponds to (disjunctions of) atomic classes in OWL and to (unions of) classes in RDF.

Definition at line 198 of file SMW_Description.php.


Constructor & Destructor Documentation

SMWClassDescription::__construct ( content  ) 

Constructor.

Parameters:
mixed $content SMWDIWikiPage or array of SMWDIWikiPage
Exceptions:
Exception 

Definition at line 212 of file SMW_Description.php.


Member Function Documentation

SMWClassDescription::addDescription ( SMWClassDescription description  ) 

Parameters:
SMWClassDescription $description

Definition at line 225 of file SMW_Description.php.

References getCategories().

SMWClassDescription::getCategories (  ) 

Returns:
array of SMWDIWikiPage

Definition at line 232 of file SMW_Description.php.

Referenced by addDescription().

SMWClassDescription::getQueryString ( asvalue = false  ) 

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 from SMWDescription.

Definition at line 236 of file SMW_Description.php.

References SMWDataValueFactory::newDataItemValue().

Referenced by prune().

SMWClassDescription::isSingleton (  ) 

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

Returns:
boolean

Reimplemented from SMWDescription.

Definition at line 257 of file SMW_Description.php.

SMWClassDescription::getSize (  ) 

Compute the size of the decription.

Default is 1.

Returns:
integer

Reimplemented from SMWDescription.

Definition at line 261 of file SMW_Description.php.

References $smwgQSubcategoryDepth.

Referenced by prune().

SMWClassDescription::getQueryFeatures (  ) 

Report on query features used in description.

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

Reimplemented from SMWDescription.

Definition at line 270 of file SMW_Description.php.

SMWClassDescription::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 from SMWDescription.

Definition at line 278 of file SMW_Description.php.

References SMWDescription::getPrintRequests(), getQueryString(), and getSize().


Member Data Documentation

SMWClassDescription::$m_diWikiPages [protected]

Definition at line 203 of file SMW_Description.php.


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

Generated on Fri Feb 10 07:15:45 2012 for Semantic MediaWiki by  doxygen 1.5.6