当前位置: 首页>>代码示例>>Java>>正文


Java PropertyIdValue.NULL属性代码示例

本文整理汇总了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);
}
 
开发者ID:Wikidata,项目名称:Wikidata-Toolkit,代码行数:22,代码来源:StatementBuilderTest.java

示例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);
}
 
开发者ID:Wikidata,项目名称:Wikidata-Toolkit,代码行数:22,代码来源:StatementBuilderTest.java

示例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);
}
 
开发者ID:Wikidata,项目名称:Wikidata-Toolkit,代码行数:25,代码来源:StatementBuilderTest.java

示例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);
}
 
开发者ID:Wikidata,项目名称:Wikidata-Toolkit,代码行数:16,代码来源:ReferenceBuilderTest.java

示例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);
}
 
开发者ID:Wikidata,项目名称:Wikidata-Toolkit,代码行数:13,代码来源:StatementBuilderTest.java

示例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);
}
 
开发者ID:Wikidata,项目名称:Wikidata-Toolkit,代码行数:14,代码来源:StatementBuilderTest.java

示例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);
}
 
开发者ID:Wikidata,项目名称:Wikidata-Toolkit,代码行数:14,代码来源:StatementBuilderTest.java


注:本文中的org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue.NULL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。