use of org.apache.stanbol.rules.base.api.RuleAtom in project stanbol by apache.
the class UnionAtom method prettyPrint.
@Override
public String prettyPrint() {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("the union of the set of conjunctive atoms {");
boolean first = true;
for (RuleAtom ruleAtom : atomList1) {
if (!first) {
stringBuilder.append(" AND ");
} else {
first = false;
}
stringBuilder.append(ruleAtom.toString());
}
stringBuilder.append("} with the set of conjunctive atoms {");
first = true;
for (RuleAtom ruleAtom : atomList2) {
if (!first) {
stringBuilder.append(" AND ");
} else {
first = false;
}
stringBuilder.append(ruleAtom.toString());
}
stringBuilder.append("}");
return stringBuilder.toString();
}
use of org.apache.stanbol.rules.base.api.RuleAtom in project stanbol by apache.
the class UnionAtom method toString.
@Override
public String toString() {
String scope1 = "";
for (RuleAtom ruleAtom : atomList1) {
if (!scope1.isEmpty()) {
scope1 += " . ";
}
scope1 += ruleAtom.toString();
}
String scope2 = "";
for (RuleAtom ruleAtom : atomList2) {
if (!scope2.isEmpty()) {
scope2 += " . ";
}
scope2 += ruleAtom.toString();
}
return "union(" + scope1 + ", " + scope2 + ")";
}
use of org.apache.stanbol.rules.base.api.RuleAtom in project stanbol by apache.
the class RuleParserImpl method startsWithAtom.
public final ComparisonAtom startsWithAtom() throws ParseException {
RuleAtom ruleAtom;
StringFunctionAtom arg;
StringFunctionAtom stringFunctionAtom;
jj_consume_token(STARTS_WITH);
jj_consume_token(LPAR);
arg = stringFunctionAtom();
jj_consume_token(COMMA);
stringFunctionAtom = stringFunctionAtom();
jj_consume_token(RPAR);
{
if (true)
return new StartsWithAtom(arg, stringFunctionAtom);
}
throw new Error("Missing return statement in function");
}
use of org.apache.stanbol.rules.base.api.RuleAtom in project stanbol by apache.
the class RuleParserImpl method datavaluedPropertyAtom.
public final DatavaluedPropertyAtom datavaluedPropertyAtom() throws ParseException {
IObjectAtom uri1;
IObjectAtom uri2;
RuleAtom obj;
jj_consume_token(VALUES);
jj_consume_token(LPAR);
uri1 = iObject();
jj_consume_token(COMMA);
uri2 = iObject();
jj_consume_token(COMMA);
obj = dObject();
jj_consume_token(RPAR);
{
if (true)
return new DatavaluedPropertyAtom(uri1, uri2, obj);
}
throw new Error("Missing return statement in function");
}
use of org.apache.stanbol.rules.base.api.RuleAtom 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");
}
Aggregations