openllet.owlapi.OWL.value()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中openllet.owlapi.OWL.value()方法的一些代码示例,展示了OWL.value()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OWL.value()方法的具体详情如下:
包路径:openllet.owlapi.OWL
类名称:OWL
方法名:value

OWL.value介绍

暂无

代码示例

代码示例来源:origin: Galigator/openllet

@Test
public void transitiveProperty() throws Exception
{
  final OWLAxiom[] axioms = { OWL.transitive(_p), OWL.propertyAssertion(_a, _p, _b), OWL.propertyAssertion(_b, _p, _c), OWL.equivalentClasses(_A, OWL.value(_p, _c)) };
  setupGenerators(Stream.of(axioms));
  testExplanations(OWL.classAssertion(_b, _A), 0, new OWLAxiom[] { axioms[2], axioms[3] });
  testExplanations(OWL.classAssertion(_a, _A), 0, axioms);
}

代码示例来源:origin: Galigator/openllet

@Test
public void testAddAndRemove() throws OWLOntologyCreationException
{
  try (final OWLManagerGroup group = new OWLManagerGroup())
  {
    final OWLOntologyID ontId = OWLHelper.getVersion(IRI.create(NS + "owlapi.add.remove"), 1.0);
    final OWLHelper owl = new OWLGenericTools(group, ontId, true);
    owl.addAxiom(OWL.declaration(OWL.DataProperty(NS + "propA")));
    owl.addAxiom(OWL.declaration(OWL.Class(NS + "clsA")));
    owl.addAxiom(OWL.equivalentClasses(OWL.Class(NS + "clsA"), //
        OWL.value(OWL.DataProperty(NS + "propA"), OWL.constant(12))//
    ));
    assertTrue(owl.getReasoner().instances(OWL.Class(NS + "clsA")).count() == 0);
    final OWLNamedIndividual x1 = OWL.Individual(NS + "I1");
    owl.addAxiom(OWL.classAssertion(x1, OWL.Class(NS + "clsA")));
    assertTrue(owl.getReasoner().instances(OWL.Class(NS + "clsA")).count() == 1);
    owl.removeAxiom(OWL.classAssertion(x1, OWL.Class(NS + "clsA")));
    assertTrue(owl.getReasoner().instances(OWL.Class(NS + "clsA")).count() == 0);
  } // The test is just about not crash.
}

代码示例来源:origin: com.github.galigator.openllet/openllet-owlapi

@Test
public void testAddAndRemove() throws OWLOntologyCreationException
{
  try (final OWLManagerGroup group = new OWLManagerGroup())
  {
    final OWLOntologyID ontId = OWLHelper.getVersion(IRI.create(NS + "owlapi.add.remove"), 1.0);
    final OWLHelper owl = new OWLGenericTools(group, ontId, true);
    owl.addAxiom(OWL.declaration(OWL.DataProperty(NS + "propA")));
    owl.addAxiom(OWL.declaration(OWL.Class(NS + "clsA")));
    owl.addAxiom(OWL.equivalentClasses(OWL.Class(NS + "clsA"), //
        OWL.value(OWL.DataProperty(NS + "propA"), OWL.constant(12))//
    ));
    assertTrue(owl.getReasoner().instances(OWL.Class(NS + "clsA")).count() == 0);
    final OWLNamedIndividual x1 = OWL.Individual(NS + "I1");
    owl.addAxiom(OWL.classAssertion(x1, OWL.Class(NS + "clsA")));
    assertTrue(owl.getReasoner().instances(OWL.Class(NS + "clsA")).count() == 1);
    owl.removeAxiom(OWL.classAssertion(x1, OWL.Class(NS + "clsA")));
    assertTrue(owl.getReasoner().instances(OWL.Class(NS + "clsA")).count() == 0);
  } // The test is just about not crash.
}

相关文章