Lucas Werkmeister (WMDE) has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/405728 )
Change subject: Add missing DISTINCT to SPARQL query ...................................................................... Add missing DISTINCT to SPARQL query Bug: T184705 Change-Id: Ie76949e4b85e9529b5b721691e5e6e5b8c46d319 (cherry picked from commit e6e6d4f34422c921e0c4246534fb315b69d433ad) --- 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/28/405728/1 diff --git a/src/ConstraintCheck/Helper/SparqlHelper.php b/src/ConstraintCheck/Helper/SparqlHelper.php index 3855258..db7dc49 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 ?entity ?otherEntity WHERE { +SELECT DISTINCT ?entity ?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 5c34130..e814c71 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 ?entity ?otherEntity WHERE { +SELECT DISTINCT ?entity ?otherEntity WHERE { BIND(wd:Q10 AS ?entity) BIND($sparqlValue AS ?value) ?entity ?p ?statement. -- To view, visit https://gerrit.wikimedia.org/r/405728 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: wmf/1.31.0-wmf.17 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