use of org.openrefine.wikidata.updates.TermedStatementEntityEditBuilder in project OpenRefine by OpenRefine.
the class QuickStatementsExporterTest method testNameDesc.
@Test
public void testNameDesc() throws IOException {
/**
* Adding labels and description without overriding is not supported by QS, so we fall back on adding them with
* overriding.
*/
TermedStatementEntityEdit update = new TermedStatementEntityEditBuilder(qid1).addLabel(Datamodel.makeMonolingualTextValue("some label", "en"), true).addDescription(Datamodel.makeMonolingualTextValue("some description", "en"), true).build();
assertEquals("Q1377\tLen\t\"some label\"\n" + "Q1377\tDen\t\"some description\"\n", export(update));
}
use of org.openrefine.wikidata.updates.TermedStatementEntityEditBuilder in project OpenRefine by OpenRefine.
the class QuickStatementsExporterTest method testOptionalNameDesc.
@Test
public void testOptionalNameDesc() throws IOException {
TermedStatementEntityEdit update = new TermedStatementEntityEditBuilder(newIdA).addLabel(Datamodel.makeMonolingualTextValue("my new item", "en"), false).addDescription(Datamodel.makeMonolingualTextValue("isn't it awesome?", "en"), false).addAlias(Datamodel.makeMonolingualTextValue("fabitem", "en")).build();
assertEquals("CREATE\n" + "LAST\tLen\t\"my new item\"\n" + "LAST\tDen\t\"isn't it awesome?\"\n" + "LAST\tAen\t\"fabitem\"\n", export(update));
}
use of org.openrefine.wikidata.updates.TermedStatementEntityEditBuilder in project OpenRefine by OpenRefine.
the class CommonDescriptionScrutinizerTest method testIdenticalWithLabel1.
@Test
public void testIdenticalWithLabel1() {
String description = "identical with label";
TermedStatementEntityEdit update = new TermedStatementEntityEditBuilder(TestingData.newIdA).addDescription(Datamodel.makeMonolingualTextValue(description, "en"), true).addLabel(Datamodel.makeMonolingualTextValue("bonjour", "fr"), true).build();
scrutinize(update);
assertNoWarningRaised();
}
use of org.openrefine.wikidata.updates.TermedStatementEntityEditBuilder in project OpenRefine by OpenRefine.
the class CommonDescriptionScrutinizerTest method testGoodDesc.
@Test
public void testGoodDesc() {
String description = "good description";
TermedStatementEntityEdit update = new TermedStatementEntityEditBuilder(TestingData.newIdA).addDescription(Datamodel.makeMonolingualTextValue(description, "en"), true).build();
scrutinize(update);
assertNoWarningRaised();
}
use of org.openrefine.wikidata.updates.TermedStatementEntityEditBuilder in project OpenRefine by OpenRefine.
the class CommonDescriptionScrutinizerTest method testIdenticalWithLabel.
@Test
public void testIdenticalWithLabel() {
String description = "identical with label";
TermedStatementEntityEdit update = new TermedStatementEntityEditBuilder(TestingData.newIdA).addDescription(Datamodel.makeMonolingualTextValue(description, "en"), true).addLabel(Datamodel.makeMonolingualTextValue(description, "en"), true).build();
scrutinize(update);
assertWarningsRaised(CommonDescriptionScrutinizer.descIdenticalWithLabel);
}
Aggregations