/** * {@inheritDoc} */ @Override protected void addRoleChainRule(final ATerm[] chain, final ATermAppl sup) { if (chain.length < 1) return; final List<ClauseEntry> body = new ArrayList<>(); final FreeVariableStore freeVar = new FreeVariableStore(); final Node var[] = new Node[chain.length + 1]; var[0] = freeVar.next(); for (int i = 0; i < chain.length; i++) { var[i + 1] = freeVar.next(); body.add(makeSubOfSomeTriple(var[i], (ATermAppl) chain[i], var[i + 1])); } final ClauseEntry head = makeSubOfSomeTriple(var[0], sup, var[var.length - 1]); _rules.add(new Rule(Collections.singletonList(head), body)); }
private void translateSub(final List<ClauseEntry> outBody, final ATermAppl sub, final FreeVariableStore freeVar, final Node currentVar) { final AFun fun = sub.getAFun(); if (ATermUtils.isPrimitive(sub) || ATermUtils.isBottom(sub)) outBody.add(makeSubclassTriple(currentVar, _names.get(sub))); else if (fun.equals(ATermUtils.ANDFUN)) { ATermList list = (ATermList) sub.getArgument(0); while (!list.isEmpty()) { final ATermAppl conj = (ATermAppl) list.getFirst(); translateSub(outBody, conj, freeVar, currentVar); list = list.getNext(); } } else if (fun.equals(ATermUtils.SOMEFUN)) { final ATermAppl prop = (ATermAppl) sub.getArgument(0); final ATermAppl q = (ATermAppl) sub.getArgument(1); final Node nextVar = freeVar.next(); outBody.add(makeSubOfSomeTriple(currentVar, prop, nextVar)); translateSub(outBody, q, freeVar, nextVar); } else assert false; }
private void translateSub(final List<ClauseEntry> outBody, final ATermAppl sub, final FreeVariableStore freeVar, final Node currentVar) { final AFun fun = sub.getAFun(); if (ATermUtils.isPrimitive(sub) || ATermUtils.isBottom(sub)) outBody.add(makeSubclassTriple(currentVar, _names.get(sub))); else if (fun.equals(ATermUtils.ANDFUN)) { ATermList list = (ATermList) sub.getArgument(0); while (!list.isEmpty()) { final ATermAppl conj = (ATermAppl) list.getFirst(); translateSub(outBody, conj, freeVar, currentVar); list = list.getNext(); } } else if (fun.equals(ATermUtils.SOMEFUN)) { final ATermAppl prop = (ATermAppl) sub.getArgument(0); final ATermAppl q = (ATermAppl) sub.getArgument(1); final Node nextVar = freeVar.next(); outBody.add(makeSubOfSomeTriple(currentVar, prop, nextVar)); translateSub(outBody, q, freeVar, nextVar); } else assert false; }
private void translateSub(final List<ClauseEntry> outBody, final ATermAppl sub, final FreeVariableStore freeVar, final Node currentVar) { final AFun fun = sub.getAFun(); if (ATermUtils.isPrimitive(sub) || ATermUtils.isBottom(sub)) outBody.add(makeSubclassTriple(currentVar, _names.get(sub))); else if (fun.equals(ATermUtils.ANDFUN)) { ATermList list = (ATermList) sub.getArgument(0); while (!list.isEmpty()) { final ATermAppl conj = (ATermAppl) list.getFirst(); translateSub(outBody, conj, freeVar, currentVar); list = list.getNext(); } } else if (fun.equals(ATermUtils.SOMEFUN)) { final ATermAppl prop = (ATermAppl) sub.getArgument(0); final ATermAppl q = (ATermAppl) sub.getArgument(1); final Node nextVar = freeVar.next(); outBody.add(makeSubOfSomeTriple(currentVar, prop, nextVar)); translateSub(outBody, q, freeVar, nextVar); } else assert false; }
/** * {@inheritDoc} */ @Override protected void addRoleChainRule(final ATerm[] chain, final ATermAppl sup) { if (chain.length < 1) return; final List<ClauseEntry> body = new ArrayList<>(); final FreeVariableStore freeVar = new FreeVariableStore(); final Node var[] = new Node[chain.length + 1]; var[0] = freeVar.next(); for (int i = 0; i < chain.length; i++) { var[i + 1] = freeVar.next(); body.add(makeSubOfSomeTriple(var[i], (ATermAppl) chain[i], var[i + 1])); } final ClauseEntry head = makeSubOfSomeTriple(var[0], sup, var[var.length - 1]); _rules.add(new Rule(Collections.singletonList(head), body)); }
/** * {@inheritDoc} */ @Override protected void addRoleChainRule(final ATerm[] chain, final ATermAppl sup) { if (chain.length < 1) return; final List<ClauseEntry> body = new ArrayList<>(); final FreeVariableStore freeVar = new FreeVariableStore(); final Node var[] = new Node[chain.length + 1]; var[0] = freeVar.next(); for (int i = 0; i < chain.length; i++) { var[i + 1] = freeVar.next(); body.add(makeSubOfSomeTriple(var[i], (ATermAppl) chain[i], var[i + 1])); } final ClauseEntry head = makeSubOfSomeTriple(var[0], sup, var[var.length - 1]); _rules.add(new Rule(Collections.singletonList(head), body)); }
/** * {@inheritDoc} */ @Override protected void addRoleRangeRule(final ATermAppl p, final ATermAppl range) { final List<ClauseEntry> body = new ArrayList<>(); final List<ClauseEntry> head = new ArrayList<>(); final FreeVariableStore freeVar = new FreeVariableStore(); final Node var0 = freeVar.next(); final Node var1 = freeVar.next(); body.add(makeSubOfSomeTriple(var0, p, var1)); final ATermAppl someOfRange = ATermUtils.makeSomeValues(p, range); translateSuper(head, someOfRange, freeVar, var0); _rules.add(new Rule(head, body)); }
/** * {@inheritDoc} */ @Override protected void addRoleRangeRule(final ATermAppl p, final ATermAppl range) { final List<ClauseEntry> body = new ArrayList<>(); final List<ClauseEntry> head = new ArrayList<>(); final FreeVariableStore freeVar = new FreeVariableStore(); final Node var0 = freeVar.next(); final Node var1 = freeVar.next(); body.add(makeSubOfSomeTriple(var0, p, var1)); final ATermAppl someOfRange = ATermUtils.makeSomeValues(p, range); translateSuper(head, someOfRange, freeVar, var0); _rules.add(new Rule(head, body)); }
/** * {@inheritDoc} */ @Override protected void addRoleDomainRule(final ATermAppl p, final ATermAppl domain) { final List<ClauseEntry> body = new ArrayList<>(); final List<ClauseEntry> head = new ArrayList<>(); final FreeVariableStore freeVar = new FreeVariableStore(); final Node var0 = freeVar.next(); final Node var1 = freeVar.next(); body.add(makeSubOfSomeTriple(var0, p, var1)); translateSuper(head, domain, freeVar, var0); _rules.add(new Rule(head, body)); }
/** * {@inheritDoc} */ @Override protected void addRoleRangeRule(final ATermAppl p, final ATermAppl range) { final List<ClauseEntry> body = new ArrayList<>(); final List<ClauseEntry> head = new ArrayList<>(); final FreeVariableStore freeVar = new FreeVariableStore(); final Node var0 = freeVar.next(); final Node var1 = freeVar.next(); body.add(makeSubOfSomeTriple(var0, p, var1)); final ATermAppl someOfRange = ATermUtils.makeSomeValues(p, range); translateSuper(head, someOfRange, freeVar, var0); _rules.add(new Rule(head, body)); }
/** * {@inheritDoc} */ @Override protected void addRoleDomainRule(final ATermAppl p, final ATermAppl domain) { final List<ClauseEntry> body = new ArrayList<>(); final List<ClauseEntry> head = new ArrayList<>(); final FreeVariableStore freeVar = new FreeVariableStore(); final Node var0 = freeVar.next(); final Node var1 = freeVar.next(); body.add(makeSubOfSomeTriple(var0, p, var1)); translateSuper(head, domain, freeVar, var0); _rules.add(new Rule(head, body)); }
/** * {@inheritDoc} */ @Override protected void addRoleDomainRule(final ATermAppl p, final ATermAppl domain) { final List<ClauseEntry> body = new ArrayList<>(); final List<ClauseEntry> head = new ArrayList<>(); final FreeVariableStore freeVar = new FreeVariableStore(); final Node var0 = freeVar.next(); final Node var1 = freeVar.next(); body.add(makeSubOfSomeTriple(var0, p, var1)); translateSuper(head, domain, freeVar, var0); _rules.add(new Rule(head, body)); }
private void makeBottomAxiom() { final FreeVariableStore freeVar = new FreeVariableStore(); final Node var0 = freeVar.next(); final Node var1 = freeVar.next(); final Node var2 = freeVar.next(); final List<ClauseEntry> body = new ArrayList<>(); body.add(makeSubOfSomeTriple(var0, var1, var2)); body.add(makePropertyAssertionFunctor(var1)); body.add(makeSubclassTriple(var2, BOTTOM)); final ClauseEntry head = makeSubclassTriple(var0, BOTTOM); _rules.add(new Rule(Collections.singletonList(head), body)); }
private void makeBottomAxiom() { final FreeVariableStore freeVar = new FreeVariableStore(); final Node var0 = freeVar.next(); final Node var1 = freeVar.next(); final Node var2 = freeVar.next(); final List<ClauseEntry> body = new ArrayList<>(); body.add(makeSubOfSomeTriple(var0, var1, var2)); body.add(makePropertyAssertionFunctor(var1)); body.add(makeSubclassTriple(var2, BOTTOM)); final ClauseEntry head = makeSubclassTriple(var0, BOTTOM); _rules.add(new Rule(Collections.singletonList(head), body)); }
private void makeBottomAxiom() { final FreeVariableStore freeVar = new FreeVariableStore(); final Node var0 = freeVar.next(); final Node var1 = freeVar.next(); final Node var2 = freeVar.next(); final List<ClauseEntry> body = new ArrayList<>(); body.add(makeSubOfSomeTriple(var0, var1, var2)); body.add(makePropertyAssertionFunctor(var1)); body.add(makeSubclassTriple(var2, BOTTOM)); final ClauseEntry head = makeSubclassTriple(var0, BOTTOM); _rules.add(new Rule(Collections.singletonList(head), body)); }
private void addSubclassRule(final ATermAppl sub, final ATermAppl sup, final FreeVariableStore freeVar) { final List<ClauseEntry> body = new ArrayList<>(); final List<ClauseEntry> head = new ArrayList<>(); final Node var = freeVar.next(); translateSub(body, sub, freeVar, var); translateSuper(head, sup, freeVar, var); _rules.add(new Rule(head, body)); }
/** * {@inheritDoc} */ @Override protected void addSubclassRule(final ATermAppl sub, final ATermAppl sup) { addSubclassRule(sub, sup, new FreeVariableStore()); }
private void addSubclassRule(final ATermAppl sub, final ATermAppl sup, final FreeVariableStore freeVar) { final List<ClauseEntry> body = new ArrayList<>(); final List<ClauseEntry> head = new ArrayList<>(); final Node var = freeVar.next(); translateSub(body, sub, freeVar, var); translateSuper(head, sup, freeVar, var); _rules.add(new Rule(head, body)); }
private void addSubclassRule(final ATermAppl sub, final ATermAppl sup, final FreeVariableStore freeVar) { final List<ClauseEntry> body = new ArrayList<>(); final List<ClauseEntry> head = new ArrayList<>(); final Node var = freeVar.next(); translateSub(body, sub, freeVar, var); translateSuper(head, sup, freeVar, var); _rules.add(new Rule(head, body)); }
/** * {@inheritDoc} */ @Override protected void addSubclassRule(final ATermAppl sub, final ATermAppl sup) { addSubclassRule(sub, sup, new FreeVariableStore()); }