本文整理汇总了Java中org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue.NULL属性的典型用法代码示例。如果您正苦于以下问题:Java PropertyIdValue.NULL属性的具体用法?Java PropertyIdValue.NULL怎么用?Java PropertyIdValue.NULL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue
的用法示例。
在下文中一共展示了PropertyIdValue.NULL属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testComplexStatement
@Test
public void testComplexStatement() {
ItemIdValue i = ItemIdValue.NULL;
PropertyIdValue p = PropertyIdValue.NULL;
Snak q1 = Datamodel.makeSomeValueSnak(p);
Snak q2 = Datamodel.makeNoValueSnak(p);
Snak q3 = Datamodel.makeValueSnak(p, i);
SnakGroup sg = Datamodel.makeSnakGroup(Arrays.asList(q1, q2, q3));
Reference r = Datamodel.makeReference(Collections.singletonList(sg));
Statement stmt1 = Datamodel.makeStatement(Datamodel.makeClaim(i,
Datamodel.makeValueSnak(p, i), Collections.singletonList(sg)),
Collections.singletonList(r), StatementRank.PREFERRED, "id");
Statement stmt2 = StatementBuilder.forSubjectAndProperty(i, p)
.withRank(StatementRank.PREFERRED).withValue(i)
.withQualifierSomeValue(p).withQualifierNoValue(p)
.withQualifierValue(p, i).withId("id").withReference(r).build();
assertEquals(stmt1, stmt2);
}
示例2: testQualifierList
@Test
public void testQualifierList() {
ItemIdValue i = ItemIdValue.NULL;
PropertyIdValue p = PropertyIdValue.NULL;
Snak q1 = Datamodel.makeSomeValueSnak(p);
Snak q2 = Datamodel.makeNoValueSnak(p);
Snak q3 = Datamodel.makeValueSnak(p, i);
SnakGroup sg = Datamodel.makeSnakGroup(Arrays.asList(q1, q2, q3));
Reference r = Datamodel.makeReference(Collections.singletonList(sg));
Statement stmt1 = Datamodel.makeStatement(Datamodel.makeClaim(i,
Datamodel.makeValueSnak(p, i), Collections.singletonList(sg)),
Collections.singletonList(r), StatementRank.PREFERRED, "id");
Statement stmt2 = StatementBuilder.forSubjectAndProperty(i, p)
.withRank(StatementRank.PREFERRED).withValue(i)
.withQualifiers(stmt1.getClaim().getQualifiers()).withId("id")
.withReference(r).build();
assertEquals(stmt1, stmt2);
}
示例3: testReferenceList
@Test
public void testReferenceList() {
ItemIdValue i = ItemIdValue.NULL;
PropertyIdValue p = PropertyIdValue.NULL;
Reference r1 = ReferenceBuilder.newInstance().withSomeValue(p).build();
Reference r2 = ReferenceBuilder.newInstance().withPropertyValue(p, i)
.build();
Snak q1 = Datamodel.makeSomeValueSnak(p);
Snak q2 = Datamodel.makeNoValueSnak(p);
Snak q3 = Datamodel.makeValueSnak(p, i);
SnakGroup sg = Datamodel.makeSnakGroup(Arrays.asList(q1, q2, q3));
Statement stmt1 = Datamodel.makeStatement(Datamodel.makeClaim(i,
Datamodel.makeValueSnak(p, i), Collections.singletonList(sg)),
Arrays.asList(r1, r2), StatementRank.PREFERRED, "id");
Statement stmt2 = StatementBuilder.forSubjectAndProperty(i, p)
.withRank(StatementRank.PREFERRED).withValue(i)
.withQualifierSomeValue(p).withQualifierNoValue(p)
.withQualifierValue(p, i).withId("id")
.withReferences(Arrays.asList(r1, r2)).build();
assertEquals(stmt1, stmt2);
}
示例4: testComplexReference
@Test
public void testComplexReference() {
ItemIdValue i = ItemIdValue.NULL;
PropertyIdValue p = PropertyIdValue.NULL;
Snak q1 = Datamodel.makeSomeValueSnak(p);
Snak q2 = Datamodel.makeNoValueSnak(p);
Snak q3 = Datamodel.makeValueSnak(p, i);
SnakGroup sg = Datamodel.makeSnakGroup(Arrays.asList(q1, q2, q3));
Reference r1 = Datamodel.makeReference(Collections.singletonList(sg));
Reference r2 = ReferenceBuilder.newInstance().withSomeValue(p)
.withNoValue(p).withPropertyValue(p, i).build();
assertEquals(r1, r2);
}
示例5: testEmptyStatement
@Test
public void testEmptyStatement() {
ItemIdValue i = ItemIdValue.NULL;
PropertyIdValue p = PropertyIdValue.NULL;
Statement stmt1 = Datamodel.makeStatement(Datamodel.makeClaim(i,
Datamodel.makeSomeValueSnak(p),
Collections.<SnakGroup> emptyList()), Collections
.<Reference> emptyList(), StatementRank.NORMAL, "");
Statement stmt2 = StatementBuilder.forSubjectAndProperty(i, p).build();
assertEquals(stmt1, stmt2);
}
示例6: testNoValueStatement
@Test
public void testNoValueStatement() {
ItemIdValue i = ItemIdValue.NULL;
PropertyIdValue p = PropertyIdValue.NULL;
Statement stmt1 = Datamodel.makeStatement(Datamodel.makeClaim(i,
Datamodel.makeNoValueSnak(p),
Collections.<SnakGroup> emptyList()), Collections
.<Reference> emptyList(), StatementRank.NORMAL, "");
Statement stmt2 = StatementBuilder.forSubjectAndProperty(i, p)
.withNoValue().build();
assertEquals(stmt1, stmt2);
}
示例7: testSomeValueStatement
@Test
public void testSomeValueStatement() {
ItemIdValue i = ItemIdValue.NULL;
PropertyIdValue p = PropertyIdValue.NULL;
Statement stmt1 = Datamodel.makeStatement(Datamodel.makeClaim(i,
Datamodel.makeSomeValueSnak(p),
Collections.<SnakGroup> emptyList()), Collections
.<Reference> emptyList(), StatementRank.NORMAL, "");
Statement stmt2 = StatementBuilder.forSubjectAndProperty(i, p)
.withSomeValue().build();
assertEquals(stmt1, stmt2);
}