summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/src/SPARQLStore/QueryEngine/Condition/FilterCondition.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/src/SPARQLStore/QueryEngine/Condition/FilterCondition.php')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/src/SPARQLStore/QueryEngine/Condition/FilterCondition.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/src/SPARQLStore/QueryEngine/Condition/FilterCondition.php b/www/wiki/extensions/SemanticMediaWiki/src/SPARQLStore/QueryEngine/Condition/FilterCondition.php
new file mode 100644
index 00000000..e03f90c5
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/src/SPARQLStore/QueryEngine/Condition/FilterCondition.php
@@ -0,0 +1,38 @@
+<?php
+
+namespace SMW\SPARQLStore\QueryEngine\Condition;
+
+/**
+ * A SPARQL condition that consists in a FILTER term only (possibly with some
+ * weak conditions to introduce the variables that the filter acts on).
+ *
+ * @ingroup SMWStore
+ *
+ * @license GNU GPL v2+
+ * @since 1.6
+ *
+ * @author Markus Krötzsch
+ */
+class FilterCondition extends Condition {
+
+ /**
+ * Additional filter condition, i.e. a string that could be placed in
+ * "FILTER( ... )".
+ * @var string
+ */
+ public $filter;
+
+ public function __construct( $filter, $namespaces = [] ) {
+ $this->filter = $filter;
+ $this->namespaces = $namespaces;
+ }
+
+ public function getCondition() {
+ return "FILTER( {$this->filter} )\n";
+ }
+
+ public function isSafe() {
+ return false;
+ }
+
+}