Can I name the result of an anonymous traversal without moving the traverser?
store``` gremlin> g.V().hasLabel("person"). ......1> has("name", "josh"). ......2> where(__.out().has("name", "ripple").store('a'))....
Can GraphBinary be used to save a graph to file?
GraphBinaryGraphWriterimplementations because GraphBinary was built for network serialization. I suppose it could be used that way, but no one has ever really made a request to do that.
How to get cardinality of property?
VertexFeatures.getCardinality(String)which, if implemented by the provider, will tell you a hint at the cardinality. https://github.com/apache/tinkerpop/blob/1e3c881d9f157167b53f431898e6d1ee40429cd0/gremlin-core/src/main/java/org/apache/t...
inverted regex search
Pwhich is a form of predicate and
Pcannot take dynamic values. The only way you could do it is to use a lambda/closure as you already tried to do: ``` gremlin> import java.util.regex.Pattern ==>java.util.regex.Pattern gremlin> g = TinkerGraph.open().traversal()...
Debug message spam from tinkerpop server 3.7
DEBUG=Falseto do the trick but this does not seem to be the case? It may be relevant that I am running this on windows, and therefore using the .bat and not the .sh. I feel like I am missing something obvious, but I am not sure what I should be looking at next?...
InProcess GraphDB with Gremlin Support? (C# or NodeJS)
Easiest Way to Get List Cardinality Properties As a List?
valueMap()as you did and
group()would be the the primary ways you'd end with a
Listwhere the former is the most likely one for the average case where you might want to do like: but instead, as there is no
localhave to do:...
filter lambda in remote console
within() and case insensitive
TextP.regexcan be used, something like
project("p").by(__.values("a", "b") Only Outputs Single Property, Bug or Expected?
by()modulators only grab the first item in the traversal provided to it so if you want all of them you need to provide your own reducing operator to convert all the items into a single one. typically this is done with
Use of by()
by()is a step modulator, meaning it modifies the step it is being applied to in some way by giving it some additional instruction. an easy example to see this with is
groupCount()without modulation implies the default behavior of grouping on the incoming traverser (i.e. the current
Vertexis simply counted once as a result as they are each unique entities. If we want to change that grouping behavior, we modulate that step with
by(), like: ```gremlin> g.V().groupCount().by(label)...
@GremlinDSL support in the GremlinLangScriptEngine
ScriptEngineimplementations are not meant to have complete feature parity.
GremlinLangScriptEnginedoes not process arbitrary code. It only processes Gremlin, which I tend to think is a good thing compared to
GremlinGroovyScriptEnginewhich will run any arbitrary code and is therefore a bit of a security risk. That said there is some untangling to do in Gremlin Server, ScriptEngines and the grammar and that's the main reason TinkerPop has not yet promoted
GremlinLangScriptEngineover its groovy counterpart despite it being more secure and generally more performant than both groovy and bytecode. This is the reason why we don't have much documentation on it. I believe that you should be able to process Gremlin that originated from a DSL in the
GremlinLangScriptEnginebut you couldn't do it in the fashion you can with groovy. To understand how it's worth noting that any DSL step is really just a compositions of standard Gremlin steps. in other words, a DSL step like:
g.persons()might really just compose as:
Trying to find a Vertex using a variable injected earlier in the traversal
toVertex. From business logic, I will know the ID of the
fromVertex for the new Edge . I am able to create the new Vertex without any issue, but when I am having trouble grabbing the
fromVertex to create the edge. Is there a way to do this/what am I doing wrong? ```g.inject(["myID": "2", "parentID": "1", "properties": ["key1":"value1"]]). addV("MyVertex").as("newVertex"). property(id, select("myID"))....
Individual Vertex per property or Vertex with grouped properties
Question on running queries in windows env.
RuntimeError: Event loop is closed, but after troubleshooting I notice that my script ran just fine. It crashed after the script eded. I suppose I was just ignoring it at first, but should I? I'm using
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()). Should I just ignore the error or should I deal with it? if the latter, how?
PropertiesStep.hashcode() not always unique
applymethod of the strategy I was getting the index of the
PropertiesStepinstances using the
PropertiesStepunder the same traversal. I am not sure if we need to improve that part, a user might need to specify the Step they want by its index, or use
==and compare by reference (you need the reference of the exact object in advance though). You may also rely on Step ID to identify some Step in such case as well....