本文整理汇总了Java中com.hp.hpl.jena.rdf.model.InfModel.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java InfModel.isEmpty方法的具体用法?Java InfModel.isEmpty怎么用?Java InfModel.isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hp.hpl.jena.rdf.model.InfModel
的用法示例。
在下文中一共展示了InfModel.isEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testIsEmpty
import com.hp.hpl.jena.rdf.model.InfModel; //导入方法依赖的package包/类
/**
* Test if an inference model produce any results
*
*/
@Test
public void testIsEmpty() throws Exception {
boolean res = false;
InfModel inf = ModelFactory.createInfModel(this.myReasoner, this.instances);
if (!inf.isEmpty()) {
/// Inference is OK. Maybe we have new statements
res = true;
}
assertTrue(res);
}
示例2: testIsConsistent
import com.hp.hpl.jena.rdf.model.InfModel; //导入方法依赖的package包/类
/**
* Test if the new Inference Model is consistent.
*
*/
@Test
public void testIsConsistent() throws Exception {
boolean res = false;
InfModel inf = ModelFactory.createInfModel(this.myReasoner, this.instances);
if (!inf.isEmpty()) {
ValidityReport validity = inf.validate();
if (validity.isValid()) {
// Our inference has been validated and we can say that is consistent based on new rules.
res = true;
}
}
assertTrue(res);
}
示例3: testNewStatements
import com.hp.hpl.jena.rdf.model.InfModel; //导入方法依赖的package包/类
/**
* Test if there are new statements based on loaded rule in the Reasoner
*
*/
@Test
public void testNewStatements() throws Exception {
boolean res = false;
InfModel inf = ModelFactory.createInfModel(this.myReasoner, this.instances);
if (!inf.isEmpty()) {
// It returns True if empty
res = !inf.getDeductionsModel().isEmpty();
}
assertTrue(res);
}