Hi Darrick,
It's a very OrientDB-specific solution since it's just adding to the SQL index query rather than going through the Blueprints interface, I'm pulling out the property named 'label', not particularly elegant. I think it would be good to have a Blueprints-based solution, I believe they are making vertex labels first-class citizens in TP3 but I haven't been following their progress. I'm happy to make a pull request and tidy it up if you want.
The default Date/Time decoders in Orient is actually converting times and dates to UTC on decoding rather than encoding, which I think might be a bit backwards. When I use the binary encoders (which try to preserve timezone on Time) and try to run comparison traversals (using 'where' steps with a date) on binary-encoded Time objects I get
Java::JavaLang::ClassCastException: [B cannot be cast to java.lang.Comparable
from com.tinkerpop.blueprints.Compare.evaluate(com/tinkerpop/blueprints/com/tinkerpop/blueprints/Compare.java:25)
I'm not sure if using DateTime will help here because they are all being converted to java bytes.
The symbol/Set problem was actually when I tried to have #where filter steps executing some ruby code involving the symbols or comparing values in traversals. The recursion's actually working correctly:
g.encode_property Set[:a,:b:c]
#<HashSet: {byte[4, 8, 58, 6, 97]@4a14edc4, byte[4, 8, 58, 6, 98]@2c28414b, byte[4, 8, 58, 6, 99]@65f653f0}>
The Ruby interpreter just doesn't like Java's byte syntax after encoding variables for the comparison and complains about the @. Also:
Marshal.dump(:a).to_java_bytes == Marshal.dump(:a).to_java_bytes
Returns false, since JRuby doesn't seem to support comparisons for Java byte values either.
So I've been converting all symbols to strings, Date/Time to UTC, and typecasting them back to the correct datatype and timezone in my application, no big deal as I'm using Rails and need to have an ORM anyway. But I guess it would be nice if we could encode and decode things with impunity!
Thanks,
Ilya