jenkins-bot has submitted this change and it was merged. (
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(-)
Approvals:
WMDE-leszek: Looks good to me, approved
jenkins-bot: Verified
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: merged
Gerrit-Change-Id: Ie76949e4b85e9529b5b721691e5e6e5b8c46d319
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: WMDE-leszek <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits