Lucas Werkmeister (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404477 )

Change subject: Add missing DISTINCT to SPARQL query
......................................................................

Add missing DISTINCT to SPARQL query

Bug: T184705
Change-Id: Ie76949e4b85e9529b5b721691e5e6e5b8c46d319
---
M src/ConstraintCheck/Helper/SparqlHelper.php
M tests/phpunit/Helper/SparqlHelperTest.php
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints
 refs/changes/77/404477/1

diff --git a/src/ConstraintCheck/Helper/SparqlHelper.php 
b/src/ConstraintCheck/Helper/SparqlHelper.php
index 42d98c9..54bf3f7 100644
--- a/src/ConstraintCheck/Helper/SparqlHelper.php
+++ b/src/ConstraintCheck/Helper/SparqlHelper.php
@@ -179,7 +179,7 @@
                }
 
                $query = <<<EOF
-SELECT ?otherEntity WHERE {
+SELECT DISTINCT ?otherEntity WHERE {
   BIND(wds:$guid AS ?statement)
   BIND(p:$pid AS ?p)
   BIND(ps:$pid AS ?ps)
@@ -237,7 +237,7 @@
                }
 
                $query = <<<EOF
-SELECT ?otherEntity WHERE {
+SELECT DISTINCT ?otherEntity WHERE {
   BIND(wd:$eid AS ?entity)
   BIND($value AS ?value)
   ?entity ?p ?statement.
diff --git a/tests/phpunit/Helper/SparqlHelperTest.php 
b/tests/phpunit/Helper/SparqlHelperTest.php
index 22f28c2..b051acd 100644
--- a/tests/phpunit/Helper/SparqlHelperTest.php
+++ b/tests/phpunit/Helper/SparqlHelperTest.php
@@ -113,7 +113,7 @@
                                          ->getMock();
 
                $query = <<<EOF
-SELECT ?otherEntity WHERE {
+SELECT DISTINCT ?otherEntity WHERE {
   BIND(wds:Q1-8542690f-dfab-4846-944f-8382df730d2c AS ?statement)
   BIND(p:P1 AS ?p)
   BIND(ps:P1 AS ?ps)
@@ -170,7 +170,7 @@
                        ->getMock();
 
                $query = <<<EOF
-SELECT ?otherEntity WHERE {
+SELECT DISTINCT ?otherEntity WHERE {
   BIND(wd:Q10 AS ?entity)
   BIND($sparqlValue AS ?value)
   ?entity ?p ?statement.

-- 
To view, visit https://gerrit.wikimedia.org/r/404477
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie76949e4b85e9529b5b721691e5e6e5b8c46d319
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <lucas.werkmeis...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to