SMWDisjunction Class Reference
[SMWQuery]

Description of a collection of many descriptions, at least one of which must be satisfied (OR, disjunction). More...

Inherits SMWDescription.

List of all members.

Public Member Functions

 __construct ($descriptions=array())
 getDescriptions ()
 addDescription (SMWDescription $description)
 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)
 Recursively restrict query to a maximal size and depth as given.

Protected Attributes

 $m_descriptions
 $m_classdesc = null
 $m_true = false


Detailed Description

Description of a collection of many descriptions, at least one of which must be satisfied (OR, disjunction).

Corresponds to disjunction in OWL and SPARQL. Not available in RDFS.

Definition at line 582 of file SMW_Description.php.


Constructor & Destructor Documentation

SMWDisjunction::__construct ( descriptions = array()  ) 

Definition at line 588 of file SMW_Description.php.

References addDescription().


Member Function Documentation

SMWDisjunction::getDescriptions (  ) 

SMWDisjunction::addDescription ( SMWDescription description  ) 

TODO: use subdisjunct. for multiple SMWSomeProperty descs with same property

TODO: This may not be a good solution, since it does modify $description and since it does not react to future cahges

Definition at line 598 of file SMW_Description.php.

References getDescriptions(), SMWDescription::getPrintRequests(), and SMWDescription::setPrintRequests().

Referenced by __construct().

SMWDisjunction::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 630 of file SMW_Description.php.

Referenced by prune().

SMWDisjunction::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 658 of file SMW_Description.php.

SMWDisjunction::getSize (  ) 

Compute the size of the decription.

Default is 1.

Returns:
integer

Reimplemented from SMWDescription.

Definition at line 667 of file SMW_Description.php.

SMWDisjunction::getDepth (  ) 

Compute the depth of the decription.

Default is 0.

Returns:
integer

Reimplemented from SMWDescription.

Definition at line 677 of file SMW_Description.php.

SMWDisjunction::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 687 of file SMW_Description.php.

SMWDisjunction::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.

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 697 of file SMW_Description.php.

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


Member Data Documentation

SMWDisjunction::$m_descriptions [protected]

Definition at line 583 of file SMW_Description.php.

SMWDisjunction::$m_classdesc = null [protected]

Definition at line 584 of file SMW_Description.php.

SMWDisjunction::$m_true = false [protected]

Definition at line 586 of file SMW_Description.php.


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

Generated on Sun Mar 18 07:15:43 2012 for Semantic MediaWiki by  doxygen 1.5.6