diff options
Diffstat (limited to 'SemanticMediaWiki/includes/src/SPARQLStore/QueryEngine/Condition/SingletonCondition.php')
-rw-r--r-- | SemanticMediaWiki/includes/src/SPARQLStore/QueryEngine/Condition/SingletonCondition.php | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/SemanticMediaWiki/includes/src/SPARQLStore/QueryEngine/Condition/SingletonCondition.php b/SemanticMediaWiki/includes/src/SPARQLStore/QueryEngine/Condition/SingletonCondition.php new file mode 100644 index 00000000..1bedad0b --- /dev/null +++ b/SemanticMediaWiki/includes/src/SPARQLStore/QueryEngine/Condition/SingletonCondition.php @@ -0,0 +1,55 @@ +<?php + +namespace SMW\SPARQLStore\QueryEngine\Condition; + +use SMWExpElement; + +/** + * A SPARQL condition that can match only a single element, or nothing at all. + * + * @ingroup SMWStore + * + * @license GNU GPL v2+ + * @since 1.6 + * + * @author Markus Krötzsch + */ +class SingletonCondition extends Condition { + + /** + * Pattern string. Anything that can be used as a WHERE condition + * when put between "{" and "}". Can be empty if the result + * unconditionally is the given element. + * @var string + */ + public $condition; + + /** + * The single element that this condition may possibly match. + * @var SMWExpElement + */ + public $matchElement; + + /** + * Whether this condition is safe. + * @see SMWSparqlCondition::isSafe(). + * @var boolean + */ + public $isSafe; + + public function __construct( SMWExpElement $matchElement, $condition = '', $isSafe = false, $namespaces = array() ) { + $this->matchElement = $matchElement; + $this->condition = $condition; + $this->isSafe = $isSafe; + $this->namespaces = $namespaces; + } + + public function getCondition() { + return $this->condition; + } + + public function isSafe() { + return $this->isSafe; + } + +} |