本文整理了Java中openllet.owlapi.OWL.constant()
方法的一些代码示例,展示了OWL.constant()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OWL.constant()
方法的具体详情如下:
包路径:openllet.owlapi.OWL
类名称:OWL
方法名:constant
[英]Convenience method that obtains a constant typed as an integer.
[中]获取类型为整数的常数的简便方法。
代码示例来源:origin: com.github.galigator.openllet/openllet-owlapi
public static SWRLLiteralArgument constant(final String constant)
{
return OWL._factory.getSWRLLiteralArgument(OWL.constant(constant));
}
代码示例来源:origin: com.github.galigator.openllet/openllet-owlapi
public static SWRLLiteralArgument constant(final String value, final OWLDatatype datatype)
{
return OWL._factory.getSWRLLiteralArgument(OWL.constant(value, datatype));
}
代码示例来源:origin: com.github.galigator.openllet/openllet-owlapi
public static SWRLLiteralArgument constant(final float constant)
{
return OWL._factory.getSWRLLiteralArgument(OWL.constant(constant));
}
代码示例来源:origin: com.github.galigator.openllet/openllet-owlapi
public static SWRLLiteralArgument constant(final int constant)
{
return OWL._factory.getSWRLLiteralArgument(OWL.constant(constant));
}
代码示例来源:origin: com.github.galigator.openllet/openllet-owlapi
public static SWRLLiteralArgument constant(final String value, final String lang)
{
return OWL._factory.getSWRLLiteralArgument(OWL.constant(value, lang));
}
代码示例来源:origin: com.github.galigator.openllet/openllet-owlapi
public static SWRLLiteralArgument constant(final double constant)
{
return OWL._factory.getSWRLLiteralArgument(OWL.constant(constant));
}
代码示例来源:origin: Galigator/openllet
public static SWRLLiteralArgument constant(final float constant)
{
return OWL._factory.getSWRLLiteralArgument(OWL.constant(constant));
}
代码示例来源:origin: Galigator/openllet
public static SWRLLiteralArgument constant(final String value, final OWLDatatype datatype)
{
return OWL._factory.getSWRLLiteralArgument(OWL.constant(value, datatype));
}
代码示例来源:origin: Galigator/openllet
public static SWRLLiteralArgument constant(final int constant)
{
return OWL._factory.getSWRLLiteralArgument(OWL.constant(constant));
}
代码示例来源:origin: Galigator/openllet
public static SWRLLiteralArgument constant(final String value, final String lang)
{
return OWL._factory.getSWRLLiteralArgument(OWL.constant(value, lang));
}
代码示例来源:origin: Galigator/openllet
@Test
public void datatypeEnumeration() throws Exception
{
final OWLAxiom[] axioms = { OWL.propertyAssertion(_a, dp, OWL.constant(1)), OWL.propertyAssertion(_a, dp, OWL.constant(2)), OWL.equivalentClasses(_A, OWL.some(dp, _dt)), OWL.datatypeDefinition(_dt, OWL.oneOf(OWL.constant(1), OWL.constant(2), OWL.constant(3))) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.classAssertion(_a, _A), 0, new OWLAxiom[] { axioms[0], axioms[2], axioms[3] }, new OWLAxiom[] { axioms[1], axioms[2], axioms[3] });
}
代码示例来源:origin: Galigator/openllet
@Test
public void subPropertiesOfFunctionalDataProperty() throws Exception
{
final OWLAxiom[] axioms = { OWL.functional(dp), OWL.subPropertyOf(dq, dp), OWL.subPropertyOf(dr, dp), OWL.propertyAssertion(_a, dq, OWL.constant(1)), OWL.classAssertion(_a, OWL.some(dr, XSD.INTEGER)) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.propertyAssertion(_a, dp, OWL.constant(1)), 0, new OWLAxiom[] { axioms[1], axioms[3] });
testExplanations(OWL.propertyAssertion(_a, dr, OWL.constant(1)), 0, axioms);
}
代码示例来源:origin: Galigator/openllet
@Test
public void testQuotedLiteral()
{
final OWLLiteral literal = OWL.constant("\"test\"");
createReasoner(OWL.propertyAssertion(_a, _dp, literal));
assertTrue(_reasoner.isEntailed(OWL.propertyAssertion(_a, _dp, literal)));
assertEquals(Collections.singleton(literal), _reasoner.getDataPropertyValues(_a, _dp));
}
代码示例来源:origin: Galigator/openllet
@Test
public void multipleDatatypeRange() throws Exception
{
final OWLAxiom[] axioms = { OWL.range(dp, XSD.BYTE), OWL.range(dp, XSD.NON_POSITIVE_INTEGER), OWL.range(dp, XSD.NON_NEGATIVE_INTEGER), OWL.subClassOf(_A, OWL.min(dp, 1)), OWL.classAssertion(_a, _A) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.propertyAssertion(_a, dp, OWL.constant(0)), 0, new OWLAxiom[] { axioms[1], axioms[2], axioms[3], axioms[4] });
}
代码示例来源:origin: Galigator/openllet
@Test
public void userDefinedDatatype1() throws Exception
{
final OWLAxiom[] axioms = { OWL.classAssertion(_a, _A), OWL.propertyAssertion(_a, dp, OWL.constant(9)), OWL.equivalentClasses(_B, OWL.and(_A, OWL.some(dp, OWL.restrict(XSD.INTEGER, OWL.maxExclusive(10))))) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.classAssertion(_a, _B), 0, axioms);
}
代码示例来源:origin: Galigator/openllet
@Test
public void userDefinedDatatype3() throws Exception
{
final OWLAxiom[] axioms = { OWL.classAssertion(_a, _A), OWL.propertyAssertion(_a, dp, OWL.constant(9)), OWL.equivalentClasses(_B, OWL.and(_A, OWL.some(dp, _dt))), OWL.datatypeDefinition(_dt, OWL.restrict(XSD.INTEGER, OWL.maxExclusive(10))) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.classAssertion(_a, _B), 0, axioms);
}
代码示例来源:origin: Galigator/openllet
@Test
public void ruleBuiltinTest1() throws Exception
{
final OWLAxiom[] axioms = { OWL.classAssertion(_a, _A), OWL.propertyAssertion(_a, dp, OWL.constant(9)), SWRL.rule(SWRL.antecedent(SWRL.classAtom(_A, _x), SWRL.propertyAtom(dp, _x, _dx), SWRL.lessThan(_dx, SWRL.constant(10))), SWRL.consequent(SWRL.classAtom(_B, _x))) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.classAssertion(_a, _B), 0, axioms);
}
代码示例来源:origin: Galigator/openllet
@Test
public void ruleBuiltinTest2() throws Exception
{
final OWLAxiom[] axioms = { OWL.classAssertion(_a, _A), OWL.propertyAssertion(_a, dp, OWL.constant(9)), SWRL.rule(SWRL.antecedent(SWRL.classAtom(_A, _x), SWRL.propertyAtom(dp, _x, _dx), SWRL.greaterThan(_dx, SWRL.constant(5)), SWRL.lessThan(_dx, SWRL.constant(10))), SWRL.consequent(SWRL.classAtom(_B, _x))) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.classAssertion(_a, _B), 0, axioms);
}
代码示例来源:origin: Galigator/openllet
/**
* A _data property range axiom should be removable without causing a full KB reload
*/
@Test
public void removeDataPropertyRangeAxiom()
{
createReasoner(declaration(_dp), declaration(_C), range(_dp, XSD.INTEGER), propertyAssertion(_a, _dp, constant("foo")));
assertFalse(_reasoner.isConsistent());
final boolean changeApplied = processRemove(range(_dp, XSD.INTEGER));
assertTrue("Unable to remove _data property range axiom", changeApplied);
assertTrue(_reasoner.isConsistent());
}
代码示例来源:origin: Galigator/openllet
@Test
public void datatypeDefinition()
{
final OWLDatatype between5and10 = OWL.Datatype("between5and10");
final OWLDatatype between6and8 = OWL.Datatype("between6and8");
createReasoner(OWL.datatypeDefinition(between5and10, OWL.restrict(XSD.INTEGER, OWL.minInclusive(5), OWL.maxInclusive(10))), OWL.datatypeDefinition(between6and8, OWL.restrict(XSD.INTEGER, OWL.minInclusive(6), OWL.maxInclusive(8))), OWL.equivalentClasses(_A, OWL.some(_dp, between5and10)), OWL.equivalentClasses(_B, OWL.some(_dp, between6and8)), OWL.propertyAssertion(_a, _dp, OWL.constant(9)), OWL.propertyAssertion(_b, _dp, OWL.constant(7)));
assertTrue(_reasoner.isEntailed(OWL.subClassOf(_B, _A)));
assertTrue(_reasoner.isEntailed(OWL.classAssertion(_a, _A)));
assertFalse(_reasoner.isEntailed(OWL.classAssertion(_a, _B)));
assertTrue(_reasoner.isEntailed(OWL.classAssertion(_b, _A)));
assertTrue(_reasoner.isEntailed(OWL.classAssertion(_b, _B)));
}
内容来源于网络,如有侵权,请联系作者删除!