private Term getNestedConcat(String str){ ArrayList<Term> terms = new ArrayList<Term>(); terms = addToTermsList(str); if(terms.size() == 1){ Variable v = (Variable) terms.get(0); variableSet.add(v); return v; } Function f = dfac.getFunction(ExpressionOperation.CONCAT, terms.get(0), terms.get(1)); for(int j=2;j<terms.size();j++) { f = dfac.getFunction(ExpressionOperation.CONCAT, f, terms.get(j)); } return f; }
Predicate p = operations.get(op); if (p != null) { compositeTerm = fac.getFunction(p, t1, t2); break; case "~": compositeTerm = fac.getFunction(ExpressionOperation.REGEX, t1, t2, fac.getConstantLiteral("")); break; case "~*": compositeTerm = fac.getFunction(ExpressionOperation.REGEX, t1, t2, fac.getConstantLiteral("i")); // i flag for case insensitivity break; case "!~": compositeTerm = fac.getFunctionNOT( fac.getFunction(ExpressionOperation.REGEX, t1, t2, fac.getConstantLiteral(""))); break; case "!~*": compositeTerm = fac.getFunctionNOT( fac.getFunction(ExpressionOperation.REGEX,t1, t2, fac.getConstantLiteral("i"))); break; case "REGEXP": compositeTerm = fac.getFunction(ExpressionOperation.REGEX, t1, t2, fac.getConstantLiteral("i")); break; case "REGEXP BINARY": compositeTerm = fac.getFunction(ExpressionOperation.REGEX, t1, t2, fac.getConstantLiteral("")); break; default:
public static Function getAtom(RelationDefinition r, List<Term> terms) { if (r.getAttributes().size() != terms.size()) throw new IllegalArgumentException("The number of terms does not match the arity of relation"); Predicate pred = createPredicateFromRelation(r); return fac.getFunction(pred, terms); }
@Deprecated private Term getExplicitTypedObject(String string) { Term typedObject = null; String[] strings = string.split("<"); if (strings.length > 1) { String consts = strings[0]; consts = consts.substring(0, consts.length() - 2); consts = trim(consts); String type = strings[1]; if (type.endsWith(">")) type = type.substring(0, type.length() - 1); DatatypePredicate predicate = new DatatypePredicateImpl(type, COL_TYPE.OBJECT); Term constant = fac.getConstantLiteral(consts); typedObject = fac.getFunction(predicate, constant); } return typedObject; }
Function bodyAtom = fac.getFunction(pred, terms); body.add(bodyAtom);
@Override public void visit(Concat concat) { Expression left = concat.getLeftExpression(); Expression right = concat.getRightExpression(); Term l = visitEx(left); Term r = visitEx(right); result = fac.getFunction(ExpressionOperation.CONCAT, l, r); }
t3 = fac.getConstantLiteral(""); result = fac.getFunction(ExpressionOperation.REGEX, t1, t2, t3); in_string = fac.getConstantLiteral(""); result = fac.getFunction(ExpressionOperation.REPLACE, t1, out_string, in_string, fac.getConstantLiteral("")); // the 4th argument is flags Term second_string = visitEx(second); topConcat = fac.getFunction(ExpressionOperation.CONCAT, first_string, second_string); Term second_string = visitEx(second); topConcat = fac.getFunction(ExpressionOperation.CONCAT, topConcat, second_string);
Function f = fac.getFunction(ExpressionOperation.CONCAT, terms.get(0), terms.get(1)); for(int j=2;j<terms.size();j++){ f = fac.getFunction(ExpressionOperation.CONCAT, f, terms.get(j));
Function newAtom = dfac.getFunction(newPredicate, oldAtom.getTerms()); body.set(idx, newAtom);
body.add(fac.getFunction(classPred, subjectAtom)); Function constPred = (Function) term0; Predicate newpred = constPred.getFunctionSymbol(); Function bodyAtom = fac.getFunction(newpred, subjectAtom); body.add(bodyAtom); String predName = vconst.getValue(); Predicate newpred = fac.getPredicate(predName, 1); Function bodyAtom = fac.getFunction(newpred, subjectAtom); body.add(bodyAtom); Function bodyAtom = fac.getFunction(bodyPred, subjectAtom, objectAtom); body.add(bodyAtom);
if (arity == 1) { Predicate p = dfac.getClassPredicate(predName); result = dfac.getFunction(p, atom.getTerm(0)); result = dfac.getFunction(p, atom.getTerm(0), atom.getTerm(2));
terms = new Vector<Term>(); value = dfac.getFunction(predicate, terms);
int arity = terms21.size(); Predicate functionSymbol = dfac.getPredicate(functionName, arity); value = dfac.getFunction(functionSymbol, terms21);
Function newhead = dfac.getFunction(predicate, variableList); rule.updateHead(newhead);
else { functionSymbol = dfac.getPredicate(functionName, arity); value = dfac.getFunction(functionSymbol, terms31);
ValueConstant c = ((ValueConstant) ((Function) object).getTerm(0)); // it has to be a URI constant Predicate predicate = dfac.getClassPredicate(c.getValue()); atom = dfac.getFunction(predicate, subject); } else { atom = dfac.getTripleAtom(subject, pred, object); throw new IllegalArgumentException("predicate should be a URI Function"); atom = dfac.getFunction(predicate, subject, object);
newTerms.add(renameVariables(innerTerm, lookupTable, idfac)); return fac.getFunction(func.getFunctionSymbol(), newTerms);