use of org.apache.clerezza.rdf.core.sparql.query.BuiltInCall in project stanbol by apache.
the class NewIRIAtom method adapt.
@SuppressWarnings("unchecked")
@Override
public <T> T adapt(RuleAtom ruleAtom) throws RuleAtomCallExeption, UnavailableRuleObjectException, UnsupportedTypeForExportException {
org.apache.stanbol.rules.manager.atoms.NewIRIAtom tmp = (org.apache.stanbol.rules.manager.atoms.NewIRIAtom) ruleAtom;
StringFunctionAtom bindingAtom = tmp.getBinding();
IObjectAtom variableAtom = tmp.getNewNodeVariable();
ClerezzaSparqlObject binding = (ClerezzaSparqlObject) adapter.adaptTo(bindingAtom, ConstructQuery.class);
ClerezzaSparqlObject variable = (ClerezzaSparqlObject) adapter.adaptTo(variableAtom, ConstructQuery.class);
List<Expression> iriArgumentExpressions = new ArrayList<Expression>();
iriArgumentExpressions.add((Expression) binding.getClerezzaObject());
BuiltInCall iriBuiltInCall = new BuiltInCall("IRI", iriArgumentExpressions);
List<Expression> bindArgumentExpressions = new ArrayList<Expression>();
bindArgumentExpressions.add(iriBuiltInCall);
bindArgumentExpressions.add((Expression) variable.getClerezzaObject());
BuiltInCall bindBuiltInCall = new BuiltInCall("BIND", bindArgumentExpressions);
return (T) new ClerezzaSparqlObject(bindBuiltInCall);
}
Aggregations