Hello,
If a query contains a connective predicate with string ids, it fails with an IllegalArgumentException:
gremlin> g.V().or(has(T.id, "1933504"), has(T.id, "2265280"), has(T.id, "2027592"))
java.lang.IllegalArgumentException: Invalid condition: [2265280, 2027592, 1933504]
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:217)
at org.janusgraph.graphdb.query.graph.GraphCentricQueryBuilder.has(GraphCentricQueryBuilder.java:148)
at org.janusgraph.graphdb.query.graph.GraphCentricQueryBuilder.has(GraphCentricQueryBuilder.java:67)
at org.janusgraph.graphdb.tinkerpop.optimize.step.JanusGraphStep.addConstraint(JanusGraphStep.java:168)
at org.janusgraph.graphdb.tinkerpop.optimize.step.JanusGraphStep.buildGlobalGraphCentricQuery(JanusGraphStep.java:156)
at org.janusgraph.graphdb.tinkerpop.optimize.step.JanusGraphStep.buildGlobalGraphCentricQuery(JanusGraphStep.java:131)
The condition is invalid because the predicate value is not a List [1] but a HashSet. The value is changed to a HashSet by HasContainer because it detects an id strings [2].
The same query with numerical id works.
I think the value of a connective predicate could be a Collection. The "isValidCondition" could check on this super class.
Regards,
Toom.
[1] https://github.com/JanusGraph/janusgraph/blob/v0.6.1/janusgraph-core/src/main/java/org/janusgraph/graphdb/predicate/ConnectiveJanusPredicate.java#L45-L47
[2] https://github.com/apache/tinkerpop/blob/3.5.1/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/HasContainer.java#L69-L72