use of org.apache.stanbol.rules.manager.atoms.NumericFunctionAtom in project stanbol by apache.
the class SumAtom method adapt.
@SuppressWarnings("unchecked")
@Override
public <T> T adapt(RuleAtom ruleAtom) throws RuleAtomCallExeption, UnavailableRuleObjectException, UnsupportedTypeForExportException {
org.apache.stanbol.rules.manager.atoms.SumAtom tmp = (org.apache.stanbol.rules.manager.atoms.SumAtom) ruleAtom;
NumericFunctionAtom numericFunctionAtom1 = tmp.getNumericFunctionAtom1();
NumericFunctionAtom numericFunctionAtom2 = tmp.getNumericFunctionAtom2();
ClerezzaSparqlObject argument1 = (ClerezzaSparqlObject) adapter.adaptTo(numericFunctionAtom1, ConstructQuery.class);
ClerezzaSparqlObject argument2 = (ClerezzaSparqlObject) adapter.adaptTo(numericFunctionAtom2, ConstructQuery.class);
Expression lhsOperand = (Expression) argument1.getClerezzaObject();
Expression rhsOperand = (Expression) argument2.getClerezzaObject();
BinaryOperation binaryOperation = new BinaryOperation("+", lhsOperand, rhsOperand);
return (T) new ClerezzaSparqlObject(binaryOperation);
}
Aggregations