From 4983dbc0f76de719d596d1c39ee982495577e98b Mon Sep 17 00:00:00 2001 From: darecoder1999 Date: Wed, 10 Jun 2020 09:36:08 +0530 Subject: [PATCH] Fixed typos made in PR #2641 --- .../openrefine/wikidata/qa/ConstraintFetcher.java | 1 - .../wikidata/qa/WikidataConstraintFetcher.java | 6 +++++- .../qa/scrutinizers/ConflictsWithScrutinizer.java | 6 +++++- .../wikidata/qa/MockConstraintFetcher.java | 12 ++++++------ .../scrutinizers/ConflictsWithScrutinizerTest.java | 10 +++++----- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/extensions/wikidata/src/org/openrefine/wikidata/qa/ConstraintFetcher.java b/extensions/wikidata/src/org/openrefine/wikidata/qa/ConstraintFetcher.java index 05b85f882..40f761efa 100644 --- a/extensions/wikidata/src/org/openrefine/wikidata/qa/ConstraintFetcher.java +++ b/extensions/wikidata/src/org/openrefine/wikidata/qa/ConstraintFetcher.java @@ -144,7 +144,6 @@ public interface ConstraintFetcher { boolean usableOnItems(PropertyIdValue pid); /** -<<<<<<< HEAD * Retrieves the lower bound of the range * required in difference-within-range constraint * diff --git a/extensions/wikidata/src/org/openrefine/wikidata/qa/WikidataConstraintFetcher.java b/extensions/wikidata/src/org/openrefine/wikidata/qa/WikidataConstraintFetcher.java index deaeea196..1196d9b71 100644 --- a/extensions/wikidata/src/org/openrefine/wikidata/qa/WikidataConstraintFetcher.java +++ b/extensions/wikidata/src/org/openrefine/wikidata/qa/WikidataConstraintFetcher.java @@ -28,7 +28,11 @@ import org.wikidata.wdtk.datamodel.helpers.Datamodel; import org.wikidata.wdtk.datamodel.implementation.QuantityValueImpl; import org.wikidata.wdtk.datamodel.interfaces.*; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.HashMap; import java.util.stream.Collectors; import java.util.stream.Stream; diff --git a/extensions/wikidata/src/org/openrefine/wikidata/qa/scrutinizers/ConflictsWithScrutinizer.java b/extensions/wikidata/src/org/openrefine/wikidata/qa/scrutinizers/ConflictsWithScrutinizer.java index 77580924d..9711d4ba1 100644 --- a/extensions/wikidata/src/org/openrefine/wikidata/qa/scrutinizers/ConflictsWithScrutinizer.java +++ b/extensions/wikidata/src/org/openrefine/wikidata/qa/scrutinizers/ConflictsWithScrutinizer.java @@ -6,7 +6,11 @@ import org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue; import org.wikidata.wdtk.datamodel.interfaces.Statement; import org.wikidata.wdtk.datamodel.interfaces.Value; -import java.util.*; +import java.util.Set; +import java.util.Map; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; public class ConflictsWithScrutinizer extends EditScrutinizer { diff --git a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/MockConstraintFetcher.java b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/MockConstraintFetcher.java index 3c10ac104..c514a773b 100644 --- a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/MockConstraintFetcher.java +++ b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/MockConstraintFetcher.java @@ -33,9 +33,9 @@ import java.math.BigDecimal; import java.util.Arrays; import java.util.Collections; import java.util.Set; -import org.wikidata.wdtk.datamodel.interfaces.*; - -import java.util.*; +import java.util.Map; +import java.util.HashMap; +import java.util.List; import java.util.stream.Collectors; public class MockConstraintFetcher implements ConstraintFetcher { @@ -70,9 +70,9 @@ public class MockConstraintFetcher implements ConstraintFetcher { public static QuantityValue maxValuePid = Datamodel.makeQuantityValue(new BigDecimal(150)); public static PropertyIdValue conflictsWithPid = Datamodel.makeWikidataPropertyIdValue("P50"); - public static PropertyIdValue pidConflictingStatement = Datamodel.makeWikidataPropertyIdValue("P31"); + public static Value conflictsWithStatementValue = Datamodel.makeWikidataItemIdValue("Q36322"); + public static PropertyIdValue conflictingStatementPid = Datamodel.makeWikidataPropertyIdValue("P31"); public static Value conflictingStatementValue = Datamodel.makeWikidataItemIdValue("Q5"); - public static Value conflictsWithValue = Datamodel.makeWikidataItemIdValue("Q36322"); @Override public String getFormatRegex(PropertyIdValue pid) { @@ -214,7 +214,7 @@ public class MockConstraintFetcher implements ConstraintFetcher { public Map> getParamConflictsWith(PropertyIdValue pid) { Map> propertyIdValueListMap = new HashMap<>(); List items = Arrays.asList(conflictingStatementValue, null); - propertyIdValueListMap.put(pidConflictingStatement, items); + propertyIdValueListMap.put(conflictingStatementPid, items); return propertyIdValueListMap; } } diff --git a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/ConflictsWithScrutinizerTest.java b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/ConflictsWithScrutinizerTest.java index 374fdccd8..8436525a8 100644 --- a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/ConflictsWithScrutinizerTest.java +++ b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/ConflictsWithScrutinizerTest.java @@ -20,9 +20,9 @@ public class ConflictsWithScrutinizerTest extends ScrutinizerTest { ItemIdValue idA = TestingData.existingId; PropertyIdValue conflictsWithPid = MockConstraintFetcher.conflictsWithPid; - Value conflictsWithValue = MockConstraintFetcher.conflictsWithValue; + Value conflictsWithValue = MockConstraintFetcher.conflictsWithStatementValue; - PropertyIdValue propertyWithConflictsPid = MockConstraintFetcher.pidConflictingStatement; + PropertyIdValue propertyWithConflictsPid = MockConstraintFetcher.conflictingStatementPid; Value conflictingValue = MockConstraintFetcher.conflictingStatementValue; ValueSnak value1 = Datamodel.makeValueSnak(conflictsWithPid, conflictsWithValue); @@ -42,7 +42,7 @@ public class ConflictsWithScrutinizerTest extends ScrutinizerTest { ItemIdValue idA = TestingData.existingId; PropertyIdValue conflictsWithPid = MockConstraintFetcher.conflictsWithPid; - Value conflictsWithValue = MockConstraintFetcher.conflictsWithValue; + Value conflictsWithValue = MockConstraintFetcher.conflictsWithStatementValue; ValueSnak value1 = Datamodel.makeValueSnak(conflictsWithPid, conflictsWithValue); @@ -58,9 +58,9 @@ public class ConflictsWithScrutinizerTest extends ScrutinizerTest { ItemIdValue idA = TestingData.existingId; PropertyIdValue conflictsWithPid = MockConstraintFetcher.conflictsWithPid; - Value conflictsWithValue = MockConstraintFetcher.conflictsWithValue; + Value conflictsWithValue = MockConstraintFetcher.conflictsWithStatementValue; - PropertyIdValue propertyWithConflictsPid = MockConstraintFetcher.pidConflictingStatement; + PropertyIdValue propertyWithConflictsPid = MockConstraintFetcher.conflictingStatementPid; ValueSnak value1 = Datamodel.makeValueSnak(conflictsWithPid, conflictsWithValue); NoValueSnak value2 = Datamodel.makeNoValueSnak(propertyWithConflictsPid);