本文整理了Java中openllet.owlapi.OWL.subClassOf()
方法的一些代码示例,展示了OWL.subClassOf()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OWL.subClassOf()
方法的具体详情如下:
包路径:openllet.owlapi.OWL
类名称:OWL
方法名:subClassOf
暂无
代码示例来源:origin: Galigator/openllet
@Test
public void internalSplitTest()
{
final OWLAxiom[] axioms = { subClassOf(_A, Thing), subClassOf(_B, _A), subClassOf(_C, _B), subClassOf(_D, _C), subClassOf(_E, _B), subClassOf(_B, _C) };
final OWLAxiom[] additions = {};
final OWLAxiom[] deletions = { subClassOf(_B, _C) };
updateTest(axioms, additions, deletions);
}
代码示例来源:origin: Galigator/openllet
@Test
public void internalMergeTest()
{
final OWLAxiom[] axioms = { subClassOf(_A, Thing), subClassOf(_B, _A), subClassOf(_C, _B), subClassOf(_D, _C), subClassOf(_E, _B) };
final OWLAxiom[] additions = { subClassOf(_B, _C) };
final OWLAxiom[] deletions = {};
updateTest(axioms, additions, deletions);
}
代码示例来源: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 simpleSubClass() throws Exception
{
// this test case is to check the effect of classification and caching
// on explanations. the last axiom is to ebsure the EL classifier will
// not be used
final OWLAxiom[] axioms = { OWL.subClassOf(_A, _B), OWL.subClassOf(_B, _C), OWL.subClassOf(_A, OWL.all(_p, _B)) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.subClassOf(_A, _C), 0, axioms[0], axioms[1]);
}
代码示例来源:origin: Galigator/openllet
/**
* Test that entities appearing in annotations only can still be used in clashExplanation requests.
*/
@Test
public void annotationOnlyDuringMUPSEntity() throws Exception
{
final OWLAxiom[] axioms = { OWL.subClassOf(_A, OWL.Thing), OWL.subClassOf(_B, _A), OWL.comment(_B, "Annotation only class") };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.subClassOf(_B, _A), 0, new OWLAxiom[] { axioms[1] });
}
代码示例来源: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 basicDisjointnessTest()
{
final OWLAxiom[] axioms = { disjointClasses(_A, _B), subClassOf(_C, _A), subClassOf(_D, _B), equivalentClasses(_E, _A) };
disjointnessTest(axioms);
}
代码示例来源:origin: Galigator/openllet
@Test
public void disjointSupers() throws Exception
{
final OWLAxiom[] axioms = { OWL.subClassOf(_A, _B), OWL.subClassOf(_A, _C), OWL.disjointClasses(_B, _C) };
setupGenerators(Stream.of(axioms));
testExplanations(OWL.equivalentClasses(_A, OWL.Nothing), 0, axioms);
}
代码示例来源:origin: Galigator/openllet
@Test
public void basicDisjointnessUpdateTest()
{
final OWLAxiom[] axioms = { disjointClasses(_A, _B), subClassOf(_C, _A), subClassOf(_D, _B), equivalentClasses(_E, _A) };
final OWLAxiom[] additions = { disjointClasses(_D, _C) };
final OWLAxiom[] deletions = { disjointClasses(_A, _B) };
disjointnessUpdateTest(axioms, additions, deletions);
}
代码示例来源: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 testGCI()
{
final OWLAxiom axiom = OWL.subClassOf(_P0AllC0, _cls[1]);
final Lint lint = _pattern.match(_ontology, axiom);
assertNotNull(lint);
assertTrue(lint.getParticipatingClasses().isEmpty());
assertTrue(lint.getParticipatingAxioms().contains(axiom));
}
}
代码示例来源:origin: Galigator/openllet
/**
* Test that named classes as super in subClass axioms are handled correctly.
*/
@Test
public void objectSuperCls()
{
assertLocal(subClassOf(Class("A"), Class("B")), Class("A"));
assertNonLocal(subClassOf(Class("A"), Class("B")), Class("B"));
}
代码示例来源:origin: Galigator/openllet
@Test
public void testObjecDomainWithEquivalents()
{
createReasoner(OWL.subClassOf(_A, min(_p, 1)), OWL.domain(_p, _A), OWL.domain(_p, _C), OWL.subClassOf(_A, _B));
assertTrue(_reasoner.isEntailed(OWL.domain(_p, _A)));
assertStreamAsSetEquals(Stream.of(_A), _reasoner.getObjectPropertyDomains(_p, true).entities());
assertStreamAsSetEquals(Stream.of(_A, _B, _C, OWL.Thing), _reasoner.getObjectPropertyDomains(_p, false).entities());
}
代码示例来源:origin: Galigator/openllet
/**
* Test that complemented sub class descriptions are handled correctly.
*/
@Test
public void objectComplementSubCls()
{
assertLocal(subClassOf(not(Thing), Class("A")), Class("A"));
assertNonLocal(subClassOf(not(Class("B")), Class("A")), Class("A"));
assertNonLocal(subClassOf(not(Class("B")), Class("A")), Class("A"), Class("B"));
}
代码示例来源:origin: Galigator/openllet
@Test
public void testOneOf() throws OWLException
{
addAxiom(OWL.subClassOf(_cls[0], _P0AllC0));
final OWLClassExpression oneOf = OWL.oneOf(_ind);
addAxiom(OWL.equivalentClasses(CollectionUtil.asSet(_cls[0], _cls[1], oneOf)));
final List<Lint> lints = _pattern.match(_ontology);
assertEquals(0, lints.size());
}
代码示例来源:origin: Galigator/openllet
/**
* Test that in all circumstances where the role of an object existential is not in a signature, the axiom is non-local (Known to fail prior to r99)
*/
@Test
public void objectExistentialSuperClsProp()
{
assertNonLocal(subClassOf(Class("A"), some(ObjectProperty("p"), Thing)), Class("A"));
assertNonLocal(subClassOf(Class("A"), some(ObjectProperty("p"), Nothing)), Class("A"));
assertNonLocal(subClassOf(Class("A"), some(ObjectProperty("p"), Class("B"))), Class("A"));
assertNonLocal(subClassOf(Class("A"), some(ObjectProperty("p"), Class("A"))), Class("A"));
}
代码示例来源:origin: Galigator/openllet
@Test
public void objectMaxSubCls()
{
assertNonLocal(subClassOf(max(ObjectProperty("p"), 2, Thing), Class("A")), Class("A"));
assertNonLocal(subClassOf(max(ObjectProperty("p"), 2, Thing), Class("A")), Class("A"), ObjectProperty("p"));
assertNonLocal(subClassOf(max(ObjectProperty("p"), 2, Nothing), Class("A")), Class("A"));
assertNonLocal(subClassOf(max(ObjectProperty("p"), 2, Nothing), Class("A")), Class("A"), ObjectProperty("p"));
assertNonLocal(subClassOf(max(ObjectProperty("p"), 2, Class("B")), Class("A")), Class("A"));
assertNonLocal(subClassOf(max(ObjectProperty("p"), 2, Class("B")), Class("A")), Class("A"), ObjectProperty("p"));
assertNonLocal(subClassOf(max(ObjectProperty("p"), 2, Class("B")), Class("A")), Class("A"), ObjectProperty("p"), Class("B"));
}
代码示例来源:origin: Galigator/openllet
@Test
public void testObjectDomainWithSubClasses()
{
createReasoner(OWL.domain(_p, _A), OWL.subClassOf(_A, _B));
assertTrue(_reasoner.isEntailed(OWL.domain(_p, _A)));
assertStreamAsSetEquals(Stream.of(_A), _reasoner.getObjectPropertyDomains(_p, true).entities());
assertStreamAsSetEquals(Stream.of(_A, _B, OWL.Thing), _reasoner.getObjectPropertyDomains(_p, false).entities());
}
代码示例来源:origin: Galigator/openllet
/**
* Test that universal object restriction subclasses are handled correctly
*/
@Test
public void objectUniversalSubCls()
{
assertNonLocal(subClassOf(all(ObjectProperty("p"), Class("B")), Class("A")), Class("A"));
assertNonLocal(subClassOf(all(ObjectProperty("p"), Class("B")), Class("A")), Class("A"), Class("B"));
assertNonLocal(subClassOf(all(ObjectProperty("p"), Class("B")), Class("A")), Class("A"), ObjectProperty("p"));
}
}
代码示例来源: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());
}
内容来源于网络,如有侵权,请联系作者删除!