Search in sources :

Example 1 with UnaryOperation

use of org.apache.clerezza.rdf.core.sparql.query.UnaryOperation in project stanbol by apache.

the class NotAtom method adapt.

@SuppressWarnings("unchecked")
@Override
public <T> T adapt(RuleAtom ruleAtom) throws RuleAtomCallExeption, UnavailableRuleObjectException, UnsupportedTypeForExportException {
    org.apache.stanbol.rules.manager.atoms.LowerCaseAtom tmp = (org.apache.stanbol.rules.manager.atoms.LowerCaseAtom) ruleAtom;
    StringFunctionAtom argument = tmp.getStringFunctionAtom();
    ClerezzaSparqlObject argument1 = (ClerezzaSparqlObject) adapter.adaptTo(argument, ConstructQuery.class);
    List<Expression> argumentExpressions = new ArrayList<Expression>();
    argumentExpressions.add((Expression) argument1.getClerezzaObject());
    BuiltInCall builtInCall = new BuiltInCall("BOUND", argumentExpressions);
    UnaryOperation unaryOperation = new UnaryOperation("!", builtInCall);
    return (T) new ClerezzaSparqlObject(unaryOperation);
}
Also used : UnaryOperation(org.apache.clerezza.rdf.core.sparql.query.UnaryOperation) ArrayList(java.util.ArrayList) BuiltInCall(org.apache.clerezza.rdf.core.sparql.query.BuiltInCall) ConstructQuery(org.apache.clerezza.rdf.core.sparql.query.ConstructQuery) StringFunctionAtom(org.apache.stanbol.rules.manager.atoms.StringFunctionAtom) Expression(org.apache.clerezza.rdf.core.sparql.query.Expression) ClerezzaSparqlObject(org.apache.stanbol.rules.adapters.clerezza.ClerezzaSparqlObject)

Aggregations

ArrayList (java.util.ArrayList)1 BuiltInCall (org.apache.clerezza.rdf.core.sparql.query.BuiltInCall)1 ConstructQuery (org.apache.clerezza.rdf.core.sparql.query.ConstructQuery)1 Expression (org.apache.clerezza.rdf.core.sparql.query.Expression)1 UnaryOperation (org.apache.clerezza.rdf.core.sparql.query.UnaryOperation)1 ClerezzaSparqlObject (org.apache.stanbol.rules.adapters.clerezza.ClerezzaSparqlObject)1 StringFunctionAtom (org.apache.stanbol.rules.manager.atoms.StringFunctionAtom)1