本文整理了Java中openllet.owlapi.OWL.some()
方法的一些代码示例,展示了OWL.some()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OWL.some()
方法的具体详情如下:
包路径:openllet.owlapi.OWL
类名称:OWL
方法名:some
暂无
代码示例来源:origin: Galigator/openllet
@Test
public void someValuesFrom()
{
assertRendering("p some A", OWL.some(_p, _A));
}
代码示例来源:origin: Galigator/openllet
@Test
public void disjointRange() throws Exception
{
final OWLAxiom[] axioms = { OWL.subClassOf(_A, OWL.some(_p, _B)), OWL.range(_p, _C), OWL.disjointClasses(_B, _C) };
final OWLAxiom axiom = OWL.equivalentClasses(_A, OWL.Nothing);
final OWLAxiom[] explanation = new OWLAxiom[] { OWL.subClassOf(_A, OWL.some(_p, _B)), OWL.range(_p, _C), OWL.disjointClasses(_B, _C) };
setupGenerators(Stream.of(axioms));
testExplanations(axiom, 0, explanation);
}
代码示例来源:origin: Galigator/openllet
/**
* Test that entities appearing in declarations only can still be used in clashExplanation requests (in uninteresting ways).
*/
@Test
public void declarationOnlyIrrelevantEntity() throws Exception
{
final OWLAxiom[] axioms = { OWL.subClassOf(_B, _A), OWL.declaration(_p) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.subClassOf(OWL.and(_B, OWL.some(_p, OWL.Thing)), _A), 0, new OWLAxiom[] { axioms[0] });
}
代码示例来源:origin: Galigator/openllet
@Test
public void indirectSubClassTest()
{
final OWLAxiom[] axioms = { subClassOf(_A, Thing), equivalentClasses(_A, some(_p, _C)), equivalentClasses(_B, some(_p, _D)), subClassOf(_C, Thing), subClassOf(_D, _C), subClassOf(_E, Thing), subClassOf(_F, _E) };
final OWLAxiom[] additions = {};
final OWLAxiom[] deletions = { subClassOf(_D, _C) };
updateTest(axioms, additions, deletions);
}
代码示例来源:origin: Galigator/openllet
@Test
public void someValuesTest()
{
final OWLAxiom[] axioms = { equivalentClasses(_A, some(_p, _B)) };
extractModules(axioms);
testModule(_A, _A, _p, _B);
testModule(_B, _B);
}
代码示例来源:origin: Galigator/openllet
/**
* Test that anonymous individuals as the object of property assertions are translated correctly
*/
@Test
public void anonymousIndividualPropertyAssertion() throws Exception
{
assumeTrue(!(this instanceof JenaExplanationTest));
final OWLAxiom[] axioms = { OWL.propertyAssertion(_a, _p, _anon1), OWL.classAssertion(_anon1, _A), OWL.subClassOf(OWL.some(_p, _A), _B) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.classAssertion(_a, _B), 0, axioms);
}
代码示例来源:origin: Galigator/openllet
@Test
public void propertyChain2() throws Exception
{
final OWLAxiom[] axioms = { OWL.subPropertyOf(new OWLObjectProperty[] { _p, _q }, _r), OWL.propertyAssertion(_a, _p, _b), OWL.propertyAssertion(_b, _q, _c), OWL.equivalentClasses(_A, OWL.some(_r, OWL.Thing)) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.classAssertion(_a, _A), 0, axioms);
}
代码示例来源:origin: Galigator/openllet
@Test
public void expressionInDomain() throws Exception
{
final OWLAxiom[] axioms = { OWL.subClassOf(_A, OWL.some(_p, _B)), OWL.domain(_p, OWL.or(_C, _D)), OWL.disjointClasses(_A, _C) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.subClassOf(_A, _D), 0, axioms);
}
代码示例来源:origin: Galigator/openllet
@Test
public void expressionInRange() throws Exception
{
final OWLAxiom[] axioms = { OWL.subClassOf(_A, OWL.some(_p, _B)), OWL.range(_p, OWL.or(_C, _D)), OWL.disjointClasses(_B, _C), OWL.disjointClasses(_B, _D) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.subClassOf(_A, OWL.Nothing), 0, axioms);
}
代码示例来源:origin: Galigator/openllet
@Test
public void testObjectRangeWithEquivalents()
{
createReasoner(OWL.equivalentClasses(_C, some(inverse(_p), OWL.Thing)), OWL.range(_p, _D), OWL.subClassOf(_C, _E));
_reasoner.getKB().printClassTree();
assertTrue(_reasoner.isEntailed(OWL.range(_p, _C)));
assertStreamAsSetEquals(Stream.of(_C), _reasoner.getEquivalentClasses(some(inverse(_p), OWL.Thing)).entities());
assertStreamAsSetEquals(Stream.of(_C), _reasoner.getObjectPropertyRanges(_p, true).entities());
assertStreamAsSetEquals(Stream.of(_C, _D, _E, OWL.Thing), _reasoner.getObjectPropertyRanges(_p, false).entities());
}
代码示例来源:origin: Galigator/openllet
/**
* Test that filler classes used in existentials as superclass are handled correctly.
*/
@Test
public void objectExistentialFillerSuperCls()
{
assertNonLocal(subClassOf(Class("A"), some(ObjectProperty("p"), Class("B"))), Class("A"));
assertNonLocal(subClassOf(Class("A"), some(ObjectProperty("p"), Class("B"))), Class("A"), ObjectProperty("p"));
}
代码示例来源:origin: Galigator/openllet
@Test
public void ruleTest6() throws Exception
{
final OWLAxiom[] axioms = { OWL.propertyAssertion(_a, _p, _b), OWL.classAssertion(_b, _B), SWRL.rule(SWRL.antecedent(SWRL.classAtom(OWL.some(_p, _B), _x)), SWRL.consequent(SWRL.classAtom(_C, _x))) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.classAssertion(_a, _C), 1, axioms);
}
代码示例来源: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 disjointRangeSuper() throws Exception
{
final OWLAxiom[] axioms = { OWL.subClassOf(_A, OWL.some(_p, _B)), OWL.range(_p, _C), OWL.subClassOf(_B, _D), OWL.disjointClasses(_D, _C), OWL.subClassOf(_A, _E), OWL.subClassOf(_B, _F) };
setupGenerators(Stream.of(axioms));
// explain disjointness of _B and _C first so reasoner will _cache this
// result
testExplanations(OWL.disjointClasses(_B, _C), 0, new OWLAxiom[] { axioms[2], axioms[3] });
// explain the unsatisfiability of _A and make sure cached results do not
// interfere with clashExplanation
testExplanations(OWL.equivalentClasses(_A, OWL.Nothing), 0, new OWLAxiom[] { axioms[0], axioms[1], axioms[2], axioms[3] });
}
代码示例来源: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 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 userDefinedDatatype2() throws Exception
{
final OWLAxiom[] axioms = { OWL.classAssertion(_a, _A), OWL.subClassOf(_A, OWL.and(OWL.max(dp, 1), OWL.some(dp, OWL.restrict(XSD.INTEGER, OWL.minExclusive(10))))), OWL.equivalentClasses(_B, OWL.and(OWL.min(dp, 1), OWL.all(dp, OWL.restrict(XSD.INTEGER, OWL.minExclusive(5))))) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.classAssertion(_a, _B), 0, axioms);
}
代码示例来源:origin: Galigator/openllet
@Test
public void indirectModuleTest()
{
final OWLAxiom[] axioms = { subClassOf(_A, and(_B, _C, some(_p, _C))), subClassOf(_B, or(all(_p, not(_C)), _D)), subClassOf(_D, _E) };
final OWLAxiom[] additions = { subClassOf(_A, not(_E)) };
final OWLAxiom[] deletions = {};
updateTest(axioms, additions, deletions);
}
代码示例来源: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)));
}
内容来源于网络,如有侵权,请联系作者删除!