public static Properties singleton(final String key, final String value) { return new PropertiesBuilder().set(key, value).build(); } }
public static Properties singleton(final String key, final String value) { return new PropertiesBuilder().set(key, value).build(); } }
public IncJenaConsistencyTests(final boolean ucq, final boolean uic, final boolean uid) { final PropertiesBuilder pb = new PropertiesBuilder(); pb.set("USE_COMPLETION_QUEUE", String.valueOf(ucq)); pb.set("USE_INCREMENTAL_CONSISTENCY", String.valueOf(uic)); pb.set("USE_INCREMENTAL_DELETION", String.valueOf(uid)); _newOptions = pb.build(); }
/** * Tests whether PelletOptions.DISABLE_EL_CLASSIFIER can be properly read from a properties file */ @Test public void testDisableELClassifierOptionRead() { Properties newOptions = new PropertiesBuilder().set("DISABLE_EL_CLASSIFIER", "true").build(); final Properties savedOptions = OpenlletOptions.setOptions(newOptions); try { assertTrue(OpenlletOptions.DISABLE_EL_CLASSIFIER); newOptions = new PropertiesBuilder().set("DISABLE_EL_CLASSIFIER", "false").build(); OpenlletOptions.setOptions(newOptions); assertFalse(OpenlletOptions.DISABLE_EL_CLASSIFIER); } finally { OpenlletOptions.setOptions(savedOptions); } }
@Test public void testCRonDTP() { // Test for ticket #143 final Properties newOptions = new PropertiesBuilder().set("SILENT_UNDEFINED_ENTITY_HANDLING", "false").build(); final Properties savedOptions = OpenlletOptions.setOptions(newOptions); try { final KnowledgeBase kb = new KnowledgeBaseImpl(); final ATermAppl p = term("p"); final ATermAppl c = and(all(p, value(literal("s"))), min(p, 2, value(literal("l")))); kb.addDatatypeProperty(p); assertFalse(kb.isSatisfiable(c)); } finally { OpenlletOptions.setOptions(savedOptions); } }
@Test public void testIncrementalTBoxDisjointRemove6() { // test that a disjoint axiom absorbed into range axiom cannot // be removed final Properties newOptions = new PropertiesBuilder().set("USE_TRACING", "true").set("USE_ROLE_ABSORPTION", "true").build(); final Properties savedOptions = OpenlletOptions.setOptions(newOptions); try { final ATermAppl A = ATermUtils.makeTermAppl("A"); final ATermAppl p = ATermUtils.makeTermAppl("p"); final KnowledgeBase kb = new KnowledgeBaseImpl(); kb.addClass(A); kb.addObjectProperty(p); kb.addSubClass(TOP, all(p, A)); final Role r = kb.getRole(p); assertTrue(kb.isConsistent()); assertTrue(r.getRanges().contains(A)); assertFalse(kb.removeAxiom(ATermUtils.makeSub(TOP, all(p, A)))); } finally { OpenlletOptions.setOptions(savedOptions); } }
@Test public void testIncrementalTBoxDisjointRemove5() { // Same as testIncrementalTBoxDisjointRemove4 but // uses n-ary disjointness axioms final Properties newOptions = new PropertiesBuilder().set("USE_TRACING", "true").set("USE_ROLE_ABSORPTION", "true").build(); final Properties savedOptions = OpenlletOptions.setOptions(newOptions); try { final ATermAppl A = ATermUtils.makeTermAppl("A"); final ATermAppl B = ATermUtils.makeTermAppl("B"); final ATermAppl p = ATermUtils.makeTermAppl("p"); final KnowledgeBase kb = new KnowledgeBaseImpl(); kb.addClass(A); kb.addClass(B); kb.addObjectProperty(p); final ATermAppl or1 = or(A, some(p, A)); final ATermAppl or2 = or(B, some(p, B)); kb.addDisjointClass(or1, or2); assertTrue(kb.isConsistent()); final ATermAppl disjoint = ATermUtils.makeDisjoint(or1, or2); assertFalse(kb.removeAxiom(disjoint)); } finally { OpenlletOptions.setOptions(savedOptions); } }
@Test public void testIncrementalTBoxDisjointRemove4() { // test that a disjoint axiom absorbed into domain axiom cannot // be removed final Properties newOptions = new PropertiesBuilder().set("USE_TRACING", "true").set("USE_ROLE_ABSORPTION", "true").build(); final Properties savedOptions = OpenlletOptions.setOptions(newOptions); try { final ATermAppl A = ATermUtils.makeTermAppl("A"); final ATermAppl B = ATermUtils.makeTermAppl("B"); final ATermAppl p = ATermUtils.makeTermAppl("p"); final KnowledgeBase kb = new KnowledgeBaseImpl(); kb.addClass(A); kb.addClass(B); kb.addObjectProperty(p); final ATermAppl or1 = or(A, some(p, A)); final ATermAppl or2 = or(B, some(p, B)); final ATermList list = ATermUtils.toSet(new ATerm[] { or1, or2 }, 2); kb.addDisjointClasses(list); assertTrue(kb.isConsistent()); final ATermAppl disjoint = ATermUtils.makeDisjoints(list); assertFalse(kb.removeAxiom(disjoint)); } finally { OpenlletOptions.setOptions(savedOptions); } }