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;
}
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;
}
Aggregations