AtomList body = atoms[0];
if (body.size() == 1) {
Iterator<RuleAtom> it = body.iterator();
RuleAtom atom = it.next();
if (atom.isSPARQLConstruct()) {
rule = new RuleImpl(varPrefix + nsPrefix, atoms[0],
null, RuleExpressiveness.SPARQLConstruct);
kb.addRule(rule);
} else if (atom.isSPARQLDelete()) {
rule = new RuleImpl(varPrefix + nsPrefix, atoms[0],
null, RuleExpressiveness.SPARQLDelete);
kb.addRule(rule);
} else if (atom.isSPARQLDeleteData()) {
rule = new RuleImpl(varPrefix + nsPrefix, atoms[0],
null, RuleExpressiveness.SPARQLDeleteData);
kb.addRule(rule);
}
}
} else {
rule = new RuleImpl(varPrefix + nsPrefix, atoms[0],
atoms[1], RuleExpressiveness.KReSCore);
kb.addRule(rule);
}
break;
default:
jj_la1[1] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
case FORWARD_CHAIN:
jj_consume_token(FORWARD_CHAIN);
nsPrefix = getVariable();
obj = rule();
AtomList[] atoms = (AtomList[]) obj;
String varPrefix = kb.getPrefixURI("var");
varPrefix = varPrefix.substring(0, varPrefix.length());
rule = new RuleImpl(varPrefix + nsPrefix, atoms[0], atoms[1],
RuleExpressiveness.ForwardChaining);
kb.addRule(rule);
break;
case REFLEXIVE:
jj_consume_token(REFLEXIVE);
nsPrefix = getVariable();
obj = rule();
AtomList[] kReSAtoms = (AtomList[]) obj;
String pref = kb.getPrefixURI("var");
pref = pref.substring(0, pref.length());
rule = new RuleImpl(pref + nsPrefix, kReSAtoms[0], kReSAtoms[1],
RuleExpressiveness.Reflexive);
kb.addRule(rule);
break;
default:
jj_la1[2] = jj_gen;