@Override public void visit(final SWRLIndividualArgument iobj) { iobj.getIndividual().accept(this); _swrlIObject = new AtomIConstant(_term); }
public Individual set(final AtomIVariable key, final ATermAppl value) { final AtomIConstant constant = new AtomIConstant(value); final IndividualValueCollector collector = new IndividualValueCollector(); constant.accept(collector); return set(key, collector.getValue()); }
/** * {@inheritDoc} */ @Override public void visit(final AtomIConstant constant) { _term = constant.getValue(); }
@Override public void visit(final SWRLIndividualArgument iobj) { iobj.getIndividual().accept(this); _swrlIObject = new AtomIConstant(_term); }
public Individual set(final AtomIVariable key, final ATermAppl value) { final AtomIConstant constant = new AtomIConstant(value); final IndividualValueCollector collector = new IndividualValueCollector(); constant.accept(collector); return set(key, collector.getValue()); }
/** * {@inheritDoc} */ @Override public void visit(final AtomIConstant constant) { _term = constant.getValue(); }
@Override public void visit(final SWRLIndividualArgument iobj) { iobj.getIndividual().accept(this); _swrlIObject = new AtomIConstant(_term); }
private boolean argMatches(final ClassAtom atom) { final AtomObject arg = atom.getArgument(); return _name == null ? arg instanceof AtomVariable : (arg instanceof AtomIConstant && ((AtomIConstant) arg).getValue().equals(_name)); }
private AtomIObject convertAtomIObject(final ATermAppl t) { if (ATermUtils.isVar(t)) return new AtomIVariable(((ATermAppl) t.getArgument(0)).getName()); else if (_originalKB.isIndividual(t)) return new AtomIConstant(t); else if (ATermUtils.isAnon(t)) return new AtomIConstant(t); throw new InternalReasonerException("Unrecognized term: " + t); }
private boolean argMatches(final ClassAtom atom) { final AtomObject arg = atom.getArgument(); return _name == null ? arg instanceof AtomVariable : (arg instanceof AtomIConstant && ((AtomIConstant) arg).getValue().equals(_name)); }
private AtomIObject convertAtomIObject(final ATermAppl t) { if (ATermUtils.isVar(t)) return new AtomIVariable(((ATermAppl) t.getArgument(0)).getName()); else if (_originalKB.isIndividual(t)) return new AtomIConstant(t); else if (ATermUtils.isAnon(t)) return new AtomIConstant(t); throw new InternalReasonerException("Unrecognized term: " + t); }
@Override public void visit(final AtomIConstant constant) { _abox.copyOnWrite(); value = _abox.getIndividual(constant.getValue()); }
@Test public void testRuleIndividuals() { final ATermAppl c = term("C"), d = term("D"), i = term("i"); _kb.addClass(c); _kb.addClass(d); _kb.addIndividual(i); _kb.addType(i, c); _kb.addRule(new Rule(Arrays.asList(new RuleAtom[] { new ClassAtom(d, new AtomIConstant(i)) }), Arrays.asList(new RuleAtom[] { new ClassAtom(c, new AtomIConstant(i)) }))); _kb.realize(); assertTrue(_kb.getTypes(i).contains(Collections.singleton(d))); }
@Override public void visit(final AtomIConstant constant) { _abox.copyOnWrite(); value = _abox.getIndividual(constant.getValue()); }
final AtomIConstant arg = new AtomIConstant(nominal); final RuleAtom atom = new IndividualPropertyAtom(p, var, arg); atoms.add(atom);
@Override public String toString() { return URIUtils.getLocalName(getValue().getName()); } }
@Test public void testDatavalueBindingGeneratorObjects() { final DatavaluedPropertyAtom pattern = new DatavaluedPropertyAtom(dp2, new AtomIConstant(mary), _z); final BindingHelper genHelper = new DatavaluePropertyBindingHelper(_kb.getABox(), pattern); final BindingGenerator gen = new BindingGeneratorImpl(new VariableBinding(_kb.getABox()), Collections.singletonList(genHelper)); assertIteratorValues(new BindingToMapIterator(gen.iterator()), new Object[] { Collections.singletonMap(_z, data1), Collections.singletonMap(_z, data2), }); }
@Override public String toString() { return URIUtils.getLocalName(getValue().getName()); } }
final AtomIConstant arg = new AtomIConstant(nominal); final RuleAtom atom = new IndividualPropertyAtom(p, var, arg); atoms.add(atom);
@Override @SuppressWarnings("rawtypes") public boolean matches(final RuleAtom atom) { return ((atom instanceof IndividualPropertyAtom) || (atom instanceof DatavaluedPropertyAtom)) && atom.getPredicate().equals(_role.getName()) && ((BinaryAtom) atom).getArgument1() instanceof AtomIConstant && ((AtomIConstant) ((BinaryAtom) atom).getArgument1()).getValue().equals(_name) && ((BinaryAtom) atom).getArgument2() instanceof AtomVariable; }