use of org.apache.stanbol.rules.base.api.util.AtomList in project stanbol by apache.
the class RuleParserImpl method unionAtom.
public final RuleAtom unionAtom() throws ParseException {
AtomList atomList1;
AtomList atomList2;
jj_consume_token(UNION);
jj_consume_token(LPAR);
atomList1 = atomList();
jj_consume_token(COMMA);
atomList2 = atomList();
jj_consume_token(RPAR);
{
if (true)
return new UnionAtom(atomList1, atomList2);
}
throw new Error("Missing return statement in function");
}
use of org.apache.stanbol.rules.base.api.util.AtomList in project stanbol by apache.
the class RuleParserImpl method atomList.
public final AtomList atomList() throws ParseException {
AtomList atomList = new AtomList();
RuleAtom kReSAtom;
switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case SAME:
case DIFFERENT:
case LESSTHAN:
case GREATERTHAN:
case IS:
case NEW_IRI:
case NEW_LITERAL:
case STARTS_WITH:
case ENDS_WITH:
case LET:
case HAS:
case VALUES:
case NOT:
case UNION:
case IS_BLANK:
kReSAtom = atom();
atomList = atomListRest();
atomList.addToHead(kReSAtom);
{
if (true)
return atomList;
}
break;
default:
jj_la1[2] = jj_gen;
{
if (true)
return atomList;
}
}
throw new Error("Missing return statement in function");
}
use of org.apache.stanbol.rules.base.api.util.AtomList in project stanbol by apache.
the class RuleParserImpl method prefix.
public final void prefix() throws ParseException {
String nsPrefix;
Object obj;
Rule rule;
nsPrefix = getVariable();
switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case EQUAL:
obj = equality();
String prefixURI = (String) obj;
prefixURI = prefixURI.substring(1, prefixURI.length() - 1);
kb.addPrefix(nsPrefix, prefixURI);
break;
case LQUAD:
obj = rule();
AtomList[] atoms = (AtomList[]) obj;
String ruleStorePrefix = kb.getPrefixURI("rmi2");
ruleStorePrefix = ruleStorePrefix.substring(0, ruleStorePrefix.length());
if (atoms.length == 1) {
AtomList body = atoms[0];
if (body.size() == 1) {
// FIXME it previously managed SPARQL code injection.
}
} else {
rule = new RuleImpl(new IRI(ruleStorePrefix + nsPrefix), nsPrefix, atoms[0], atoms[1]);
kb.addRule(rule);
}
break;
default:
jj_la1[1] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
use of org.apache.stanbol.rules.base.api.util.AtomList in project stanbol by apache.
the class RuleParserImpl method atomListRest.
public final AtomList atomListRest() throws ParseException {
AtomList atomList = new AtomList();
RuleAtom kReSAtom;
switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case AND:
jj_consume_token(AND);
atomList = atomList();
{
if (true)
return atomList;
}
break;
default:
jj_la1[3] = jj_gen;
{
if (true)
return atomList;
}
}
throw new Error("Missing return statement in function");
}
use of org.apache.stanbol.rules.base.api.util.AtomList in project stanbol by apache.
the class RuleParserImpl method ruleDefinition.
public final AtomList[] ruleDefinition() throws ParseException {
AtomList body;
AtomList head;
Token t;
body = atomList();
jj_consume_token(LARROW);
head = atomList();
{
if (true)
return new AtomList[] { body, head };
}
throw new Error("Missing return statement in function");
}
Aggregations