mikepersonick commented on a change in pull request #1553:
URL: https://github.com/apache/tinkerpop/pull/1553#discussion_r794904865
##########
File path:
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/AndStep.java
##########
@@ -33,10 +34,18 @@ public AndStep(final Traversal.Admin traversal, final
Traversal<S, ?>... travers
@Override
protected boolean filter(final Traverser.Admin<S> traverser) {
+ GremlinTypeErrorException typeError = null;
for (final Traversal.Admin<S, ?> traversal : this.traversals) {
- if (!TraversalUtil.test(traverser, traversal))
- return false;
+ try {
+ if (!TraversalUtil.test(traverser, traversal))
+ return false;
+ } catch (GremlinTypeErrorException ex) {
+ // hold onto it until the end in case any other arguments
evaluate to FALSE
Review comment:
We are trying to bring things more in line with SPARQL, which has well
defined logics for error expressions. There are certain value expressions that
simply cannot be proved as true or false. There are some nice properties we get
by using `ERROR` instead of `FALSE` for these. For example any numeric
comparison to NaN is an `ERROR` - P.lt/lte/gt/gte - all `ERROR`, and all reduce
to `FALSE` if evaluated on their own. When enclosed by a `NOT`, if we simply
immediately used `FALSE` instead of `ERROR`, we would get things like
`NOT(P.lt(NaN)) = TRUE`, which is logically inconsistent with `P.gte(NaN) =
FALSE`.
It may just be that we need to beef up the documentation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]