Search in sources :

Example 21 with StringFunctionAtom

use of org.apache.stanbol.rules.manager.atoms.StringFunctionAtom in project stanbol by apache.

the class RuleParserImpl method substringAtom.

public final SubstringAtom substringAtom() throws ParseException {
    StringFunctionAtom arg;
    NumericFunctionAtom start;
    NumericFunctionAtom length;
    jj_consume_token(SUBSTRING);
    jj_consume_token(LPAR);
    arg = stringFunctionAtom();
    jj_consume_token(COMMA);
    start = numericFunctionAtom();
    jj_consume_token(COMMA);
    length = numericFunctionAtom();
    jj_consume_token(RPAR);
    {
        if (true)
            return new SubstringAtom(arg, start, length);
    }
    throw new Error("Missing return statement in function");
}
Also used : StringFunctionAtom(org.apache.stanbol.rules.manager.atoms.StringFunctionAtom) NumericFunctionAtom(org.apache.stanbol.rules.manager.atoms.NumericFunctionAtom) SubstringAtom(org.apache.stanbol.rules.manager.atoms.SubstringAtom)

Example 22 with StringFunctionAtom

use of org.apache.stanbol.rules.manager.atoms.StringFunctionAtom in project stanbol by apache.

the class RuleParserImpl method stringFunctionAtom.

public final StringFunctionAtom stringFunctionAtom() throws ParseException {
    Object obj;
    StringFunctionAtom stringFunctionAtom;
    switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
        case CONCAT:
            stringFunctionAtom = concatAtom();
            break;
        case UPPERCASE:
            stringFunctionAtom = upperCaseAtom();
            break;
        case LOWERCASE:
            stringFunctionAtom = lowerCaseAtom();
            break;
        case SUBSTRING:
            stringFunctionAtom = substringAtom();
            break;
        case NAMESPACE:
            stringFunctionAtom = namespaceAtom();
            break;
        case LOCALNAME:
            stringFunctionAtom = localnameAtom();
            break;
        case STR:
            stringFunctionAtom = strAtom();
            break;
        case STRING:
            stringFunctionAtom = stringAtom();
            break;
        case PROP:
            stringFunctionAtom = propStringAtom();
            break;
        case CREATE_LABEL:
            stringFunctionAtom = createLabelAtom();
            break;
        case VARIABLE:
            stringFunctionAtom = stringVariable();
            break;
        default:
            jj_la1[5] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
    }
    {
        if (true)
            return stringFunctionAtom;
    }
    throw new Error("Missing return statement in function");
}
Also used : StringFunctionAtom(org.apache.stanbol.rules.manager.atoms.StringFunctionAtom)

Example 23 with StringFunctionAtom

use of org.apache.stanbol.rules.manager.atoms.StringFunctionAtom in project stanbol by apache.

the class RuleParserImpl method letAtom.

public final LetAtom letAtom() throws ParseException {
    IObjectAtom uri1;
    StringFunctionAtom fun;
    jj_consume_token(LET);
    jj_consume_token(LPAR);
    uri1 = iObject();
    jj_consume_token(COMMA);
    fun = stringFunctionAtom();
    jj_consume_token(RPAR);
    {
        if (true)
            return new LetAtom(uri1, fun);
    }
    throw new Error("Missing return statement in function");
}
Also used : StringFunctionAtom(org.apache.stanbol.rules.manager.atoms.StringFunctionAtom) LetAtom(org.apache.stanbol.rules.manager.atoms.LetAtom) IObjectAtom(org.apache.stanbol.rules.manager.atoms.IObjectAtom)

Example 24 with StringFunctionAtom

use of org.apache.stanbol.rules.manager.atoms.StringFunctionAtom in project stanbol by apache.

the class RuleParserImpl method lowerCaseAtom.

public final LowerCaseAtom lowerCaseAtom() throws ParseException {
    StringFunctionAtom arg;
    jj_consume_token(LOWERCASE);
    jj_consume_token(LPAR);
    arg = stringFunctionAtom();
    jj_consume_token(RPAR);
    {
        if (true)
            return new LowerCaseAtom(arg);
    }
    throw new Error("Missing return statement in function");
}
Also used : StringFunctionAtom(org.apache.stanbol.rules.manager.atoms.StringFunctionAtom) LowerCaseAtom(org.apache.stanbol.rules.manager.atoms.LowerCaseAtom)

Example 25 with StringFunctionAtom

use of org.apache.stanbol.rules.manager.atoms.StringFunctionAtom in project stanbol by apache.

the class RuleParserImpl method newIRIAtom.

public final NewIRIAtom newIRIAtom() throws ParseException {
    IObjectAtom arg1;
    StringFunctionAtom arg2;
    jj_consume_token(NEW_IRI);
    jj_consume_token(LPAR);
    arg1 = iObject();
    jj_consume_token(COMMA);
    arg2 = stringFunctionAtom();
    jj_consume_token(RPAR);
    {
        if (true)
            return new NewIRIAtom(arg1, arg2);
    }
    throw new Error("Missing return statement in function");
}
Also used : StringFunctionAtom(org.apache.stanbol.rules.manager.atoms.StringFunctionAtom) NewIRIAtom(org.apache.stanbol.rules.manager.atoms.NewIRIAtom) IObjectAtom(org.apache.stanbol.rules.manager.atoms.IObjectAtom)

Aggregations

StringFunctionAtom (org.apache.stanbol.rules.manager.atoms.StringFunctionAtom)38 ArrayList (java.util.ArrayList)15 Expression (org.apache.clerezza.rdf.core.sparql.query.Expression)11 ClerezzaSparqlObject (org.apache.stanbol.rules.adapters.clerezza.ClerezzaSparqlObject)11 ConstructQuery (org.apache.clerezza.rdf.core.sparql.query.ConstructQuery)10 SPARQLObject (org.apache.stanbol.rules.base.api.SPARQLObject)10 RuleAtomCallExeption (org.apache.stanbol.rules.base.api.RuleAtomCallExeption)9 SPARQLFunction (org.apache.stanbol.rules.adapters.sparql.SPARQLFunction)8 IRI (org.apache.clerezza.commons.rdf.IRI)7 FunctionCall (org.apache.clerezza.rdf.core.sparql.query.FunctionCall)7 IObjectAtom (org.apache.stanbol.rules.manager.atoms.IObjectAtom)6 BuiltInCall (org.apache.clerezza.rdf.core.sparql.query.BuiltInCall)4 UnavailableRuleObjectException (org.apache.stanbol.rules.base.api.UnavailableRuleObjectException)4 UnsupportedTypeForExportException (org.apache.stanbol.rules.base.api.UnsupportedTypeForExportException)4 NumericFunctionAtom (org.apache.stanbol.rules.manager.atoms.NumericFunctionAtom)4 ArgumentSWRLAtom (org.apache.stanbol.rules.adapters.swrl.ArgumentSWRLAtom)3 HigherOrderSWRLAtom (org.apache.stanbol.rules.adapters.swrl.HigherOrderSWRLAtom)3 OWLDataFactory (org.semanticweb.owlapi.model.OWLDataFactory)3 SWRLArgument (org.semanticweb.owlapi.model.SWRLArgument)3 SWRLAtom (org.semanticweb.owlapi.model.SWRLAtom)3