@Override public boolean contains(final KnowledgeBase kb, final GraphLoader loader, final Node s, final Node p, final Node o) { final ATermAppl prop = loader.node2term(p); if (!kb.isProperty(prop)) return false; for (final ATermAppl ind : kb.getIndividuals()) if (kb.hasKnownPropertyValue(ind, prop, null).isTrue()) return true; return false; }
@Override public boolean contains(final KnowledgeBase kb, final GraphLoader loader, final Node s, final Node p, final Node o) { final ATermAppl prop = loader.node2term(p); if (!kb.isProperty(prop)) return false; for (final ATermAppl ind : kb.getIndividuals()) if (kb.hasKnownPropertyValue(ind, prop, null).isTrue()) return true; return false; }
@Override public boolean contains(final KnowledgeBase kb, final GraphLoader loader, final Node s, final Node p, final Node o) { final ATermAppl prop = loader.node2term(p); if (!kb.isProperty(prop)) return false; for (final ATermAppl ind : kb.getIndividuals()) if (kb.hasKnownPropertyValue(ind, prop, null).isTrue()) return true; return false; }
case Annotation: case PropertyValue: tripleSatisfied = kb.hasKnownPropertyValue(arguments.get(0), arguments.get(1), arguments.get(2)); break; default:
case Annotation: case PropertyValue: tripleSatisfied = kb.hasKnownPropertyValue(arguments.get(0), arguments.get(1), arguments.get(2)); break; default:
case Annotation: case PropertyValue: tripleSatisfied = kb.hasKnownPropertyValue(arguments.get(0), arguments.get(1), arguments.get(2)); break; default:
/** * Test that _node merge state is correctly handled in reset. In trunk r1495, this is known to cause a NPE because Node._mergeDepends is incorrectly reset * to null */ @Test public void mergeDependsAfterReset() { _kb.addIndividual(_robert); _kb.addIndividual(_chris); _kb.addSame(_robert, _chris); _kb.addDatatypeProperty(_ssn); _kb.addDatatypeProperty(_mbox); final ATermAppl literal = ATermUtils.makePlainLiteral("xxx"); _kb.addPropertyValue(_ssn, _chris, literal); _kb.addPropertyValue(_mbox, _chris, literal); assertTrue(_kb.isConsistent()); assertEquals(Bool.TRUE, _kb.hasKnownPropertyValue(_chris, _ssn, literal)); assertEquals(Bool.TRUE, _kb.hasKnownPropertyValue(_robert, _ssn, literal)); // ABox property removal should cause ABox reset. assertTrue(_kb.removePropertyValue(_mbox, _chris, literal)); assertTrue(_kb.isChanged(ChangeType.ABOX_DEL)); assertTrue(_kb.isConsistent()); assertEquals(Bool.TRUE, _kb.hasKnownPropertyValue(_chris, _ssn, literal)); assertEquals(Bool.TRUE, _kb.hasKnownPropertyValue(_robert, _ssn, literal)); }