本文整理了Java中openllet.owlapi.OWL.or()
方法的一些代码示例,展示了OWL.or()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OWL.or()
方法的具体详情如下:
包路径:openllet.owlapi.OWL
类名称:OWL
方法名:or
暂无
代码示例来源:origin: Galigator/openllet
@Override
public void visit(final OWLDisjointUnionAxiom axiom)
{
processDisjoints(axiom, axiom.classExpressions());
processEquivalent(axiom, axiom.getOWLClass(), OWL.or(axiom.classExpressions()));
}
代码示例来源:origin: Galigator/openllet
@Override
public void visit(final OWLDisjointUnionAxiom axiom)
{
processDisjoints(axiom, axiom.classExpressions());
processEquivalent(axiom, axiom.getOWLClass(), OWL.or(axiom.classExpressions()));
}
代码示例来源:origin: Galigator/openllet
@Test
public void testNested2()
{
_pattern.setMaxAllowed(2);
final OWLClassExpression union1 = OWL.or(_cls[1], _cls[2], _cls[3]);
final OWLClassExpression all = OWL.all(_pro[0], union1);
final OWLClassExpression union2 = OWL.or(all, _cls[4]);
final OWLAxiom axiom = OWL.equivalentClasses(union2, _cls[0]);
assertNotNull(_pattern.match(_ontology, axiom));
}
}
代码示例来源:origin: Galigator/openllet
@Override
@Before
public void setUp() throws OWLOntologyCreationException
{
super.setUp();
_axioms = new OWLAxiom[] { OWL.subClassOf(_cls[0], OWL.or(_cls[1], _cls[2], _cls[3])), OWL.equivalentClasses(_cls[0], _cls[1]), OWL.differentFrom(_ind[2], _ind[3]) };
}
代码示例来源:origin: Galigator/openllet
@Test
public void testDisjointClasses()
{
_pattern.setMaxAllowed(2);
final OWLClassExpression union = OWL.or(_cls[1], _cls[2], _cls[3]);
final OWLAxiom axiom = OWL.disjointClasses(_cls[0], union);
assertNotNull(_pattern.match(_ontology, axiom));
}
代码示例来源:origin: Galigator/openllet
/**
* A _data property domain axiom should be removable without causing a full KB reload even if it is a class expression
*/
@Test
public void removeDataPropertyDomainAxiomExpression()
{
createReasoner(declaration(_dp), declaration(_C), declaration(_D), domain(_dp, or(_C, _D)), propertyAssertion(_a, _dp, _lit));
assertTrue(_reasoner.isConsistent());
assertTrue(_reasoner.isEntailed(classAssertion(_a, or(_C, _D))));
final boolean changeApplied = processRemove(domain(_dp, or(_C, _D)));
assertTrue("Unable to remove _data property domain axiom", changeApplied);
assertTrue(_reasoner.isConsistent());
assertFalse(_reasoner.isEntailed(classAssertion(_a, or(_C, _D))));
}
代码示例来源:origin: Galigator/openllet
/**
* An object property domain axiom should be removable without causing a full KB reload even if it is a class expression
*/
@Test
public void removeObjectPropertyDomainAxiomExpression()
{
createReasoner(declaration(_p), declaration(_C), declaration(_D), domain(_p, or(_C, _D)), propertyAssertion(_a, _p, _b));
assertTrue(_reasoner.isConsistent());
assertTrue(_reasoner.isEntailed(classAssertion(_a, or(_C, _D))));
final boolean changeApplied = processRemove(domain(_p, or(_C, _D)));
assertTrue("Unable to remove object property domain axiom", changeApplied);
assertTrue(_reasoner.isConsistent());
assertFalse(_reasoner.isEntailed(classAssertion(_a, or(_C, _D))));
}
代码示例来源:origin: Galigator/openllet
/**
* An object property range axiom should be removable without causing a full KB reload even if it is a class expression
*/
@Test
public void removeObjectPropertyRangeAxiomExpression()
{
createReasoner(declaration(_p), declaration(_C), declaration(_D), range(_p, or(_C, _D)), propertyAssertion(_a, _p, _b));
assertTrue(_reasoner.isConsistent());
assertTrue(_reasoner.isEntailed(classAssertion(_b, or(_C, _D))));
final boolean changeApplied = processRemove(range(_p, or(_C, _D)));
assertTrue("Unable to remove object property range axiom", changeApplied);
assertTrue(_reasoner.isConsistent());
assertFalse(_reasoner.isEntailed(classAssertion(_b, or(_C, _D))));
}
代码示例来源: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 unionTest()
{
final OWLAxiom[] axioms = { equivalentClasses(_A, or(_B, _C)) };
extractModules(axioms);
testModule(_A, _A, _B, _C);
testModule(_B, _A, _B, _C);
testModule(_C, _A, _B, _C);
}
代码示例来源: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 testComplementOfOthers()
{
final OWLClassExpression comp = OWL.not(OWL.or(_cls[1], _cls[2]));
final OWLAxiom axiom = OWL.equivalentClasses(_cls[0], comp);
final Lint lint = _pattern.match(_ontology, axiom);
assertNotNull(lint);
assertTrue(lint.getParticipatingClasses().contains(_cls[0]));
final LintFixer fixer = lint.getLintFixer();
assertTrue(fixer.getAxiomsToRemove().contains(axiom));
final OWLAxiom expectedAxiom = OWL.subClassOf(_cls[0], comp);
assertTrue(fixer.getAxiomsToAdd().contains(expectedAxiom));
}
}
代码示例来源:origin: Galigator/openllet
@Test
public void testNone()
{
_pattern.setMaxAllowed(3);
final OWLClassExpression union = OWL.or(_cls[1], OWL.Thing, OWL.Nothing);
final OWLAxiom axiom = OWL.subClassOf(_cls[0], union);
assertNull(_pattern.match(_ontology, axiom));
assertFalse(_pattern.isFixable());
}
代码示例来源:origin: Galigator/openllet
@Test
public void testNested1()
{
_pattern.setMaxAllowed(2);
final OWLClassExpression union = OWL.or(_cls[1], _cls[2], _cls[3]);
final OWLClassExpression all = OWL.all(_pro[0], union);
final OWLClassExpression and = OWL.and(all, _cls[4]);
final OWLAxiom axiom = OWL.equivalentClasses(and, _cls[0]);
assertNotNull(_pattern.match(_ontology, axiom));
}
代码示例来源: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 nestedUnionTest()
{
final OWLAxiom[] axioms = { equivalentClasses(_A, and(_B, or(_C, _D))), equivalentClasses(_E, and(_B, _C)) };
extractModules(axioms);
testModule(_A, _A, _B, _C, _D, _E);
testModule(_B, _B);
testModule(_C, _C);
testModule(_D, _D);
testModule(_E, _A, _B, _C, _D, _E);
}
代码示例来源:origin: Galigator/openllet
@Test
public void testSimple()
{
_pattern.setMaxAllowed(2);
final OWLClassExpression union = OWL.or(_cls[1], _cls[2], _cls[3]);
final OWLAxiom axiom = OWL.subClassOf(_cls[0], union);
final Lint lint = _pattern.match(_ontology, axiom);
assertNotNull(lint);
assertSame(_pattern, lint.getPattern());
assertEquals(1, lint.getParticipatingAxioms().size());
assertNull(lint.getLintFixer());
assertEquals(3.0, lint.getSeverity().doubleValue(), DOUBLE_DELTA);
assertSame(_ontology, lint.getParticipatingOntology());
}
代码示例来源:origin: Galigator/openllet
@Test
public void testNested()
{
_pattern.setMaxAllowed(2);
final OWLClassExpression exactCard = OWL.exactly(_pro[0], 3, _cls[0]);
final OWLClassExpression and = OWL.or(_cls[1], exactCard);
OWLAxiom axiom = OWL.subClassOf(and, _cls[2]);
assertNotNull(_pattern.match(_ontology, axiom));
final OWLClassExpression minCard = OWL.min(_pro[0], 3, _cls[0]);
final OWLClassExpression union = OWL.or(_cls[1], minCard);
axiom = OWL.subClassOf(union, _cls[2]);
assertNotNull(_pattern.match(_ontology, axiom));
final OWLClassExpression maxCard1 = OWL.max(_pro[0], 3, _cls[1]);
final OWLClassExpression and2 = OWL.and(_cls[2], maxCard1);
axiom = OWL.subClassOf(and2, _cls[3]);
assertNotNull(_pattern.match(_ontology, axiom));
final OWLClassExpression maxCard2 = OWL.max(_pro[0], 2, _cls[2]);
axiom = OWL.subClassOf(_cls[4], maxCard2);
assertNull(_pattern.match(_ontology, axiom));
}
}
代码示例来源:origin: Galigator/openllet
@Test
public void testStage1ZeroCard() throws OWLException
{
addAxiom(OWL.subClassOf(_cls[0], OWL.or(OWL.min(_pro[0], 0, _cls[1]), OWL.min(_pro[0], 0, _cls[2]))));
addAxiom(OWL.subClassOf(_cls[1], OWL.max(_pro[0], 0, _cls[0])));
addAxiom(OWL.subClassOf(_cls[1], OWL.max(_pro[0], 0, _cls[3])));
addAxiom(OWL.subClassOf(_cls[2], OWL.exactly(_pro[0], 0, _cls[3])));
addAxiom(OWL.subClassOf(_cls[2], OWL.exactly(_pro[0], 0, _cls[4])));
addAxiom(OWL.subClassOf(_cls[3], OWL.exactly(_pro[0], 0, _cls[0])));
addAxiom(OWL.subClassOf(_cls[4], OWL.exactly(_pro[0], 0, _cls[0])));
final int EXPECTED_SIZE = 0;
_pattern.setMaxTreeSize(EXPECTED_SIZE);
final List<Lint> lints = _pattern.match(_ontology);
assertEquals(0, lints.size());
}
代码示例来源:origin: Galigator/openllet
assertTrue(reasoner.isEntailed(asymmetric(as)));
assertTrue(reasoner.isEntailed(equivalentClasses(D, or(D1, D2, D3))));
assertTrue(reasoner.isEntailed(equivalentClasses(D, test1)));
assertTrue(reasoner.isEntailed(disjointClasses(D1, D2)));
内容来源于网络,如有侵权,请联系作者删除!