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

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

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

OWL.domain介绍

暂无

代码示例

代码示例来源: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: com.github.galigator.openllet/openllet-examples

OWL.domain(w, g), //
OWL.domain(v, e), //
OWL.domain(v, f), //

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

@Test
public void koalaHardWorkingDomain() throws Exception
{
  final String ns = "http://protege.stanford.edu/plugins/owl/owl-library/koala.owl#";
  final OWLOntology ontology = _manager.loadOntologyFromOntologyDocument(ClassLoader.getSystemResourceAsStream("test/data/modularity/koala.owl"));
  final OWLClass animal = OWL.Class(ns + "Animal");
  final OWLClass person = OWL.Class(ns + "Person");
  final OWLDataProperty hardWorking = OWL.DataProperty(ns + "isHardWorking");
  setupGenerators(ontology.axioms());
  testExplanations(OWL.domain(hardWorking, animal), 0, new OWLAxiom[] { OWL.subClassOf(person, animal), OWL.domain(hardWorking, person) });
}

代码示例来源: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 object property domain axioms are handled correctly
 */
@Test
public void objectDomain()
{
  assertLocal(domain(ObjectProperty("p"), Class("D")));
  assertLocal(domain(ObjectProperty("p"), Class("D")), Class("D"));
  assertNonLocal(domain(ObjectProperty("p"), Class("D")), ObjectProperty("p"));
  assertLocal(domain(ObjectProperty("p"), Thing), ObjectProperty("p"));
  assertNonLocal(domain(ObjectProperty("p"), Class("D")), ObjectProperty("p"), Class("D"));
}

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

@Test
public void testDataDomainWithSubClasses()
{
  createReasoner(OWL.domain(_dp, _A), OWL.subClassOf(_A, _B));
  assertTrue(_reasoner.isEntailed(OWL.domain(_dp, _A)));
  assertStreamAsSetEquals(Stream.of(_A), _reasoner.getDataPropertyDomains(_dp, true).entities());
  assertStreamAsSetEquals(Stream.of(_A, _B, OWL.Thing), _reasoner.getDataPropertyDomains(_dp, false).entities());
}

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

/**
   * Test that object property domain axioms are handled correctly
   */
  @Test
  public void objectDomain()
  {
    assertLocal(domain(ObjectProperty("p"), Class("D")));
    assertNonLocal(domain(ObjectProperty("p"), Class("D")), Class("D"));
    assertLocal(domain(ObjectProperty("p"), Class("D")), ObjectProperty("p"));
    assertLocal(domain(ObjectProperty("p"), Thing), ObjectProperty("p"));
    assertNonLocal(domain(ObjectProperty("p"), Class("D")), ObjectProperty("p"), Class("D"));
  }
}

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

@Test
public void testDataDomainWithEquivalents()
{
  createReasoner(OWL.subClassOf(_A, min(_dp, 1)), OWL.domain(_dp, _A), OWL.subClassOf(_A, _B));
  assertTrue(_reasoner.isEntailed(OWL.domain(_dp, _A)));
  assertStreamAsSetEquals(Stream.of(_A), _reasoner.getDataPropertyDomains(_dp, true).entities());
  assertStreamAsSetEquals(Stream.of(_A, _B, OWL.Thing), _reasoner.getDataPropertyDomains(_dp, false).entities());
}

代码示例来源: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 basicTypesTest()
{
  final OWLAxiom[] axioms = { classAssertion(_a, _A), classAssertion(_b, _B), domain(_p, _C), range(_p, _D), propertyAssertion(_a, _p, _b) };
  typesTest(axioms);
}

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

@Test
public void basicInstancesTest()
{
  final OWLAxiom[] axioms = { classAssertion(_a, _A), classAssertion(_b, _B), domain(_p, _C), range(_p, _D), propertyAssertion(_a, _p, _b) };
  instancesTest(axioms);
}

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

@Test
  public void removeAndAddObjectPropertyDomainAxiom()
  {
    createReasoner(declaration(_p), declaration(_C), domain(_p, _C), propertyAssertion(_a, _p, _b));

    assertTrue(_reasoner.isConsistent());
    assertTrue(_reasoner.isEntailed(classAssertion(_a, _C)));

    final boolean removeApplied = processRemove(domain(_p, _C));
    assertTrue("Unable to remove object property domain axiom", removeApplied);

    final boolean addApplied = processAdd(domain(_p, _C));
    assertTrue("Unable to add object property domain axiom", addApplied);

    assertTrue(_reasoner.isConsistent());
    assertTrue(_reasoner.isEntailed(classAssertion(_a, _C)));
  }
}

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

@Test
public void testObjectRangeWithSubClasses()
{
  createReasoner(OWL.domain(_p, _A), OWL.range(_p, _C), OWL.range(_p, _D), OWL.subClassOf(_C, _E));
  assertTrue(_reasoner.isEntailed(OWL.range(_p, _C)));
  assertStreamAsSetEquals(Stream.of(_C, _D), _reasoner.getObjectPropertyRanges(_p, true).entities());
  assertStreamAsSetEquals(Stream.of(_C, _D, _E, OWL.Thing), _reasoner.getObjectPropertyRanges(_p, false).entities());
}

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

@Test
public void basicInstancesUpdateTest()
{
  final OWLAxiom[] axioms = { classAssertion(_a, _A), classAssertion(_b, _B), domain(_p, _C), range(_p, _D), propertyAssertion(_a, _p, _b) };
  final OWLAxiom[] additions = { range(_p, _E) };
  final OWLAxiom[] deletions = { range(_p, _D) };
  instancesUpdateTest(axioms, additions, deletions);
}

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

@Test
public void basicTypesUpdateTest()
{
  final OWLAxiom[] axioms = { classAssertion(_a, _A), classAssertion(_b, _B), domain(_p, _C), range(_p, _D), propertyAssertion(_a, _p, _b) };
  final OWLAxiom[] additions = { range(_p, _E) };
  final OWLAxiom[] deletions = { range(_p, _D) };
  typesUpdateTest(axioms, additions, deletions);
}

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

/**
 * An object property domain axiom should be removable without causing a full KB reload
 */
@Test
public void removeObjectPropertyDomainAxiom()
{
  createReasoner(declaration(_p), declaration(_C), domain(_p, _C), propertyAssertion(_a, _p, _b));
  assertTrue(_reasoner.isConsistent());
  assertTrue(_reasoner.isEntailed(classAssertion(_a, _C)));
  final boolean changeApplied = processRemove(domain(_p, _C));
  assertTrue("Unable to remove object property domain axiom", changeApplied);
  assertTrue(_reasoner.isConsistent());
  assertFalse(_reasoner.isEntailed(classAssertion(_a, _C)));
}

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

/**
 * A _data property domain axiom should be removable without causing a full KB reload
 */
@Test
public void removeDataPropertyDomainAxiom()
{
  createReasoner(declaration(_dp), declaration(_C), domain(_dp, _C), propertyAssertion(_a, _dp, _lit));
  assertTrue(_reasoner.isConsistent());
  assertTrue(_reasoner.isEntailed(classAssertion(_a, _C)));
  final boolean changeApplied = processRemove(domain(_dp, _C));
  assertTrue("Unable to remove _data property domain axiom", changeApplied);
  assertTrue(_reasoner.isConsistent());
  assertFalse(_reasoner.isEntailed(classAssertion(_a, _C)));
}

代码示例来源: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

@Test
/**
 * Tests for the bug reported in #150
 */
public void test150_2()
{
  createReasoner(OWL.domain(_p, _C), OWL.range(_q, _D), OWL.disjointClasses(_C, _D));
  assertTrue(_reasoner.isEntailed(OWL.disjointProperties(_p, OWL.inverse(_q))));
  assertTrue(_reasoner.isEntailed(OWL.disjointProperties(OWL.inverse(_p), _q)));
}

代码示例来源: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))));
}

相关文章