use of org.openrefine.wikidata.schema.entityvalues.ReconItemIdValue in project OpenRefine by OpenRefine.
the class WbItemVariable method fromCell.
@Override
public ItemIdValue fromCell(Cell cell, ExpressionContext ctxt) throws SkipSchemaExpressionException {
if (cell.recon != null && (Judgment.Matched.equals(cell.recon.judgment) || Judgment.New.equals(cell.recon.judgment))) {
if (cell.recon.identifierSpace == null || !cell.recon.identifierSpace.equals(ctxt.getBaseIRI())) {
QAWarning warning = new QAWarning("invalid-identifier-space", null, QAWarning.Severity.INFO, 1);
warning.setProperty("example_cell", cell.value.toString());
ctxt.addWarning(warning);
throw new SkipSchemaExpressionException();
}
return new ReconItemIdValue(cell.recon, cell.value.toString());
}
throw new SkipSchemaExpressionException();
}
use of org.openrefine.wikidata.schema.entityvalues.ReconItemIdValue in project OpenRefine by OpenRefine.
the class WbEntityVariableTest method testReconciledItemCell.
@Test
public void testReconciledItemCell() {
Recon recon = Recon.makeWikidataRecon(3782378L);
recon.judgment = Recon.Judgment.Matched;
recon.match = new ReconCandidate("Q123", "some item", null, 100.0);
Cell cell = new Cell("some value", recon);
evaluatesTo(new ReconItemIdValue(recon, "some value"), cell);
}
use of org.openrefine.wikidata.schema.entityvalues.ReconItemIdValue in project OpenRefine by OpenRefine.
the class WbEntityVariableTest method testNewItemCell.
@Test
public void testNewItemCell() {
Recon recon = Recon.makeWikidataRecon(3782378L);
recon.judgment = Recon.Judgment.New;
recon.candidates = Collections.singletonList(new ReconCandidate("Q123", "some item", null, 100.0));
Cell cell = new Cell("some value", recon);
evaluatesTo(new ReconItemIdValue(recon, "some value"), cell);
}
use of org.openrefine.wikidata.schema.entityvalues.ReconItemIdValue in project OpenRefine by OpenRefine.
the class WbItemVariableTest method testNewItemCell.
@Test
public void testNewItemCell() {
Recon recon = Recon.makeWikidataRecon(3782378L);
recon.judgment = Recon.Judgment.New;
recon.candidates = Collections.singletonList(new ReconCandidate("Q123", "some item", null, 100.0));
Cell cell = new Cell("some value", recon);
evaluatesTo(new ReconItemIdValue(recon, "some value"), cell);
}
use of org.openrefine.wikidata.schema.entityvalues.ReconItemIdValue in project OpenRefine by OpenRefine.
the class WbItemVariableTest method testReconciledCell.
@Test
public void testReconciledCell() {
Recon recon = Recon.makeWikidataRecon(3782378L);
recon.judgment = Recon.Judgment.Matched;
recon.match = new ReconCandidate("Q123", "some item", null, 100.0);
Cell cell = new Cell("some value", recon);
evaluatesTo(new ReconItemIdValue(recon, "some value"), cell);
}
Aggregations