-
Notifications
You must be signed in to change notification settings - Fork 2
Description
This issue is reported with the assumption of the https://raw.githubusercontent.com/tinkerpop/blueprints/master/doc/images/graph-example-1.jpg graph in mind. Furthermore, this issue is a duplicate of clojurewerkz/ogre#68, I am (as described) not sure if this is a problem in the docs or in the actual code, I suspect the docs, hence me reporting it here too.
The documentation describes in the chapter "Traversals" that to query for the things Josh created we should do:
(q/query (g/find-by-id 4)
(q/--> :created)
q/into-vec!)This throws an error:
java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword
RT.java:505 clojure.lang.RT.seqFrom
RT.java:486 clojure.lang.RT.seq
core.clj:133 clojure.core/seq
core.clj:2595 clojure.core/filter[fn]
LazySeq.java:40 clojure.lang.LazySeq.sval
LazySeq.java:49 clojure.lang.LazySeq.seq
RT.java:484 clojure.lang.RT.seq
core.clj:133 clojure.core/seq
core.clj:2551 clojure.core/map[fn]
LazySeq.java:40 clojure.lang.LazySeq.sval
LazySeq.java:49 clojure.lang.LazySeq.seq
RT.java:484 clojure.lang.RT.seq
core.clj:133 clojure.core/seq
core.clj:3165 clojure.core/into-array
util.clj:35 clojurewerkz.ogre.util/str-array
util.clj:39 clojurewerkz.ogre.util/keywords-to-strings
core.clj:119 clojurewerkz.ogre.core/out[fn]
util.clj:58 clojurewerkz.ogre.util/compile-query[fn]
ArrayChunk.java:58 clojure.lang.ArrayChunk.reduce
protocols.clj:98 clojure.core.protocols/fn
protocols.clj:19 clojure.core.protocols/fn[fn]
protocols.clj:31 clojure.core.protocols/seq-reduce
protocols.clj:48 clojure.core.protocols/fn
protocols.clj:13 clojure.core.protocols/fn[fn]
core.clj:6289 clojure.core/reduce
util.clj:58 clojurewerkz.ogre.util/compile-query
pipe.clj:26 clojurewerkz.ogre.pipe/into-vec!
(...)
After investigation into the test suite of the library I came across the following lines:
- https://github.com/clojurewerkz/ogre/blob/master/test/clojurewerkz/ogre/traversal_test.clj#L91
- https://github.com/clojurewerkz/ogre/blob/master/test/clojurewerkz/ogre/traversal_test.clj#L98
The first argument for clojurewerkz.ogre.core/out is expected to be a vector, instead of a keyword. The following code worked:
(q/query (g/find-by-id 4)
(q/--> [:created])
q/into-vec!)Somewhere there is something wrong: either with the docs describing expect behaviour (but the behaviour is not in line with the code), or the docs describing behaviour not congruent with the code as proven by the results and test suite.