Search in sources :

Example 1 with FilterOperatorValueElement

use of com.inova8.pathql.element.FilterOperatorValueElement in project com.inova8.intelligentgraph by peterjohnlawrence.

the class PathPatternVisitor method visitOperator.

/**
 * Visit operator.
 *
 * @param ctx the ctx
 * @return the filter operator value element
 */
@Override
public FilterOperatorValueElement visitOperator(OperatorContext ctx) {
    // operator : OPERATOR ;
    // OPERATOR : 'lt'|'gt'|'le'|'ge'|'eq'|'ne'|'like';
    FilterOperatorValueElement operatorElement = new FilterOperatorValueElement(this.repositoryContext);
    operatorElement.setFilterOperator(PathConstants.filterOperators.get(ctx.getText()));
    return operatorElement;
}
Also used : FilterOperatorValueElement(com.inova8.pathql.element.FilterOperatorValueElement)

Example 2 with FilterOperatorValueElement

use of com.inova8.pathql.element.FilterOperatorValueElement in project com.inova8.intelligentgraph by peterjohnlawrence.

the class PathPatternVisitor method visitPropertyListNotEmpty.

/**
 * Visit property list not empty.
 *
 * @param ctx the ctx
 * @return the fact filter element
 */
@Override
public FactFilterElement visitPropertyListNotEmpty(PropertyListNotEmptyContext ctx) {
    // propertyListNotEmpty :   verbObjectList ( ';' ( verbObjectList )? )* ;
    FactFilterElement propertyListNotEmptyElement = new FactFilterElement(this.repositoryContext);
    ArrayList<VerbObjectList> propertyListNotEmpty = new ArrayList<VerbObjectList>();
    for (VerbObjectListContext verbObjectListContext : ctx.verbObjectList()) {
        PathElement verb = visit(verbObjectListContext.verb());
        ObjectListValueElement objectList = (ObjectListValueElement) visit(verbObjectListContext.objectList());
        VerbObjectList verbObjectList = new VerbObjectList(this.repositoryContext);
        if (verb instanceof ValueElement) {
            verbObjectList.setFilterOperator(((FilterOperatorValueElement) verb).getFilterOperator());
        } else if (verb instanceof PredicateElement) {
            verbObjectList.setPredicate(((PredicateElement) verb));
        }
        verbObjectList.setObjectList(objectList.getObjectList());
        propertyListNotEmpty.add(verbObjectList);
    }
    propertyListNotEmptyElement.setPropertyListNotEmpty(propertyListNotEmpty);
    return propertyListNotEmptyElement;
}
Also used : ObjectListValueElement(com.inova8.pathql.element.ObjectListValueElement) ValueElement(com.inova8.pathql.element.ValueElement) ObjectListValueElement(com.inova8.pathql.element.ObjectListValueElement) IriRefValueElement(com.inova8.pathql.element.IriRefValueElement) FilterOperatorValueElement(com.inova8.pathql.element.FilterOperatorValueElement) LiteralValueElement(com.inova8.pathql.element.LiteralValueElement) SequencePathElement(com.inova8.pathql.element.SequencePathElement) BoundPathElement(com.inova8.pathql.element.BoundPathElement) PathElement(com.inova8.pathql.element.PathElement) AlternativePathElement(com.inova8.pathql.element.AlternativePathElement) QueryOptionsPathElement(com.inova8.pathql.element.QueryOptionsPathElement) VerbObjectListContext(com.inova8.pathql.pathPattern.PathPatternParser.VerbObjectListContext) PredicateElement(com.inova8.pathql.element.PredicateElement) ArrayList(java.util.ArrayList) VerbObjectList(com.inova8.pathql.element.VerbObjectList) FactFilterElement(com.inova8.pathql.element.FactFilterElement)

Aggregations

FilterOperatorValueElement (com.inova8.pathql.element.FilterOperatorValueElement)2 AlternativePathElement (com.inova8.pathql.element.AlternativePathElement)1 BoundPathElement (com.inova8.pathql.element.BoundPathElement)1 FactFilterElement (com.inova8.pathql.element.FactFilterElement)1 IriRefValueElement (com.inova8.pathql.element.IriRefValueElement)1 LiteralValueElement (com.inova8.pathql.element.LiteralValueElement)1 ObjectListValueElement (com.inova8.pathql.element.ObjectListValueElement)1 PathElement (com.inova8.pathql.element.PathElement)1 PredicateElement (com.inova8.pathql.element.PredicateElement)1 QueryOptionsPathElement (com.inova8.pathql.element.QueryOptionsPathElement)1 SequencePathElement (com.inova8.pathql.element.SequencePathElement)1 ValueElement (com.inova8.pathql.element.ValueElement)1 VerbObjectList (com.inova8.pathql.element.VerbObjectList)1 VerbObjectListContext (com.inova8.pathql.pathPattern.PathPatternParser.VerbObjectListContext)1 ArrayList (java.util.ArrayList)1