diff --git a/extensions/wikidata/src/org/openrefine/wikidata/schema/WbItemVariable.java b/extensions/wikidata/src/org/openrefine/wikidata/schema/WbItemVariable.java index 9eebde938..bea6636e7 100644 --- a/extensions/wikidata/src/org/openrefine/wikidata/schema/WbItemVariable.java +++ b/extensions/wikidata/src/org/openrefine/wikidata/schema/WbItemVariable.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.refine.model.Cell; +import com.google.refine.model.Recon.Judgment; public class WbItemVariable extends WbItemExpr { /* An item that depends on a reconciled value in a column */ @@ -24,7 +25,9 @@ public class WbItemVariable extends WbItemExpr { @Override public ItemIdValue evaluate(ExpressionContext ctxt) throws SkipSchemaExpressionException { Cell cell = ctxt.getCellByName(getColumnName()); - if (cell != null && cell.recon != null) { + if (cell != null && cell.recon != null + && (Judgment.Matched.equals(cell.recon.judgment) || + Judgment.New.equals(cell.recon.judgment))) { return new ReconItemIdValue(cell.recon, cell.value.toString()); } throw new SkipSchemaExpressionException(); diff --git a/extensions/wikidata/src/org/openrefine/wikidata/schema/entityvalues/ReconEntityIdValue.java b/extensions/wikidata/src/org/openrefine/wikidata/schema/entityvalues/ReconEntityIdValue.java index 51d6b6817..44190310a 100644 --- a/extensions/wikidata/src/org/openrefine/wikidata/schema/entityvalues/ReconEntityIdValue.java +++ b/extensions/wikidata/src/org/openrefine/wikidata/schema/entityvalues/ReconEntityIdValue.java @@ -33,6 +33,8 @@ public abstract class ReconEntityIdValue implements PrefetchedEntityIdValue { public ReconEntityIdValue(Recon match, String cellValue) { _recon = match; _cellValue = cellValue; + assert (Recon.Judgment.Matched.equals(_recon.judgment) || + Recon.Judgment.New.equals(_recon.judgment)); } protected boolean isMatched() {