return Collections.emptyList(); final Literal literal = getABox().getLiteral(canonicalLit);
_value = _abox.getLiteral(canonical); if (_value == null) _value = _abox.addLiteral(canonical);
_value = _abox.getLiteral(canonical); if (_value == null) _value = _abox.addLiteral(canonical);
return Collections.emptyList(); final Literal literal = getABox().getLiteral(canonicalLit);
final Literal mergeTo = _abox.getLiteral(mtc.getTarget()); mergeTo(l, mergeTo, mtc.getDepends()); node = mergeTo;
final Literal mergeTo = _abox.getLiteral(mtc.getTarget()); mergeTo(l, mergeTo, mtc.getDepends()); node = mergeTo;
Literal valueLiteral = _abox.getLiteral(valueTerm); if (valueLiteral == null)
Literal valueLiteral = _abox.getLiteral(valueTerm); if (valueLiteral == null)
@Override public void addType(final ATermAppl c, final DependencySet d) { if (hasType(c)) return; /* * A negated nominal is turned into a different */ if (ATermUtils.isNot(c)) { final ATermAppl arg = (ATermAppl) c.getArgument(0); if (ATermUtils.isNominal(arg)) { final ATermAppl v = (ATermAppl) arg.getArgument(0); Literal other = _abox.getLiteral(v); if (other == null) other = _abox.addLiteral(v, d); super.setDifferent(other, d); return; } } super.addType(c, d); // TODO when two literals are being merged this is not efficient // if(_abox.isInitialized()) checkClash(); }
@Override public void addType(final ATermAppl c, final DependencySet d) { if (hasType(c)) return; /* * A negated nominal is turned into a different */ if (ATermUtils.isNot(c)) { final ATermAppl arg = (ATermAppl) c.getArgument(0); if (ATermUtils.isNominal(arg)) { final ATermAppl v = (ATermAppl) arg.getArgument(0); Literal other = _abox.getLiteral(v); if (other == null) other = _abox.addLiteral(v, d); super.setDifferent(other, d); return; } } super.addType(c, d); // TODO when two literals are being merged this is not efficient // if(_abox.isInitialized()) checkClash(); }
@Test public void testDataRangeBindingHelper() { final DatavaluedPropertyAtom pattern = new DatavaluedPropertyAtom(dp2, _x, _z); final DataRangeAtom atom = new DataRangeAtom(ATermUtils.makeTermAppl(Namespaces.XSD + "integer"), _z); final BindingHelper patternHelper = new DatavaluePropertyBindingHelper(_kb.getABox(), pattern); final BindingHelper rangeHelper = new DataRangeBindingHelper(_kb.getABox(), atom); final BindingGenerator gen = new BindingGeneratorImpl(new VariableBinding(_kb.getABox()), Arrays.asList(new BindingHelper[] { patternHelper, rangeHelper, })); final VariableBinding expectedBinding = new VariableBinding(_kb.getABox()); expectedBinding.set(_x, _kb.getABox().getIndividual(victor)); expectedBinding.set(_z, _kb.getABox().getLiteral(data4)); final List<VariableBinding> expected = new LinkedList<>(); expected.add(expectedBinding); assertIteratorValues(gen.iterator(), expected.iterator()); }
assertTrue(kb.getABox().getLiteral(lit).hasType(Datatypes.LITERAL)); assertTrue(kb.getABox().getLiteral(lit).hasType(Datatypes.LITERAL));