This is an automated email from the ASF dual-hosted git repository.
xiazcy pushed a commit to branch 3.8-dev
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/3.8-dev by this push:
new c6a1783c8d CTR fix strategies, BigInt/BigDecimal parsing in feature
tests, and fixed BigDecimal in gremlin-go
c6a1783c8d is described below
commit c6a1783c8de1d6006f680be42eb642e6a253f7a2
Author: Yang Xia <[email protected]>
AuthorDate: Fri Feb 28 13:27:18 2025 -0800
CTR fix strategies, BigInt/BigDecimal parsing in feature tests, and fixed
BigDecimal in gremlin-go
---
CHANGELOG.asciidoc | 2 +
.../language/translator/GoTranslateVisitor.java | 92 ++++++-----
.../language/translator/GremlinTranslatorTest.java | 16 +-
gremlin-go/driver/connection_test.go | 6 +-
gremlin-go/driver/cucumber/cucumberSteps_test.go | 20 ++-
gremlin-go/driver/cucumber/gremlin.go | 68 ++++----
gremlin-go/driver/graphBinary.go | 2 +-
gremlin-go/driver/graphBinary_test.go | 2 +-
gremlin-go/driver/strategies.go | 171 +++++++++++----------
gremlin-go/driver/strategies_test.go | 14 ++
gremlin-go/driver/traversal.go | 31 +++-
.../gremlin-javascript/test/cucumber/gremlin.js | 2 +-
.../ReservedKeysVerificationStrategy.feature | 5 +-
13 files changed, 266 insertions(+), 165 deletions(-)
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 53bb63c487..749af123e9 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -47,6 +47,8 @@ This release also includes changes from <<release-3-7-XXX,
3.7.XXX>>.
* Fixed bug in `group()` value traversal of the second `by()` where a
`CollectingBarrierStep` could produce an unexpected filtering effect when
`ReducingBarrierStep` or `SupplyingBarrierStep` instances were not taken into
account.
* Changed `DetachedFactory` to special case the handling of
`ComputerAdjacentVertex` which doesn't carry properties but still needs to be
detachable for OLAP cases.
* Deprecated `ProfilingAware.prepareForProfiling` method preferring to simply
`resetBarrierFromValueTraversal` from the `Grouping` interface after strategy
application.
+* Added missing strategies in `gremlin-go`, updated certain strategies to take
varargs and updated `GoTranslatorVisitor` for corresponding translations.
+* Fixed `BigInt` and `BigDecimal` parsing in `gremlin-go` cucumber test suite,
fixed `UnscaledValue` type in `BigDecimal` struct and added `ParseBigDecimal`
method.
== TinkerPop 3.7.0 (Gremfir Master of the Pan Flute)
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java
index 47ed839dac..ea3976211f 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java
@@ -27,14 +27,23 @@ import
org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.Option
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.util.DatetimeHelper;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.stream.Collectors;
public class GoTranslateVisitor extends AbstractTranslateVisitor {
private final static String GO_PACKAGE_NAME = "gremlingo.";
+ private final static List<String> STRATEGY_WITH_MAP_OPTS =
Collections.unmodifiableList(Arrays.asList(
+ "OptionsStrategy",
+ "ReferenceElementStrategy", "ComputerFinalizationStrategy",
"ProfileStrategy",
+ "ComputerVerificationStrategy", "StandardVerificationStrategy",
"VertexProgramRestrictionStrategy"));
+ private final static List<String> STRATEGY_WITH_STRING_SLICE =
Collections.unmodifiableList(Arrays.asList(
+ "ReservedKeysVerificationStrategy", "ProductiveByStrategy"));
public GoTranslateVisitor() {
super("g");
@@ -197,59 +206,53 @@ public class GoTranslateVisitor extends
AbstractTranslateVisitor {
else {
String strategyName = ctx.getChild(0).getText().equals("new") ?
ctx.getChild(1).getText() : ctx.getChild(0).getText();
sb.append(GO_PACKAGE_NAME).append(strategyName).append("(");
+ if (!STRATEGY_WITH_MAP_OPTS.contains(strategyName)) { // omit
strategies which use plain map instead of Config struct
+
sb.append(GO_PACKAGE_NAME).append(strategyName).append("Config{");
+ }
// get a list of all the arguments to the strategy - i.e. anything
not a terminal node
final List<ParseTree> configs = ctx.children.stream().
filter(c -> c instanceof
GremlinParser.ConfigurationContext).collect(Collectors.toList());
- if (configs.size() > 0 && ctx.children.stream().anyMatch(t ->
t.getText().equals(OptionsStrategy.class.getSimpleName()))) {
- sb.append("map[string]interface{}{");
- for (int ix = 0; ix < configs.size(); ix++) {
-
sb.append("\"").append(configs.get(ix).getChild(0).getText()).append("\":");
- visit(configs.get(ix).getChild(2));
- if (ix < configs.size() - 1)
- sb.append(", ");
- }
- sb.append("}");
- } else {
- // the rest are the arguments to the strategy
- sb.append(GO_PACKAGE_NAME + strategyName + "Config{");
- for (int ix = 0; ix < configs.size(); ix++) {
- visit(configs.get(ix));
- if (ix < configs.size() - 1)
- sb.append(", ");
- }
- sb.append("}");
+ // the rest are the arguments to the strategy
+ for (int ix = 0; ix < configs.size(); ix++) {
+ visit(configs.get(ix));
+ if (ix < configs.size() - 1)
+ sb.append(", ");
}
+ if (!Objects.equals(strategyName, "OptionsStrategy")) {
+ sb.append("}");
+ }
sb.append(")");
}
-
return null;
}
@Override
- public Void visitTraversalSourceSelfMethod_withoutStrategies(final
GremlinParser.TraversalSourceSelfMethod_withoutStrategiesContext ctx) {
- sb.append("WithoutStrategies(");
- sb.append(GO_PACKAGE_NAME).append(ctx.classType().getText());
-
- if (ctx.classTypeList() != null && ctx.classTypeList().classTypeExpr()
!= null) {
- for (GremlinParser.ClassTypeContext classTypeContext :
ctx.classTypeList().classTypeExpr().classType()) {
- sb.append(",
").append(GO_PACKAGE_NAME).append(classTypeContext.getText());
+ public Void visitConfiguration(final GremlinParser.ConfigurationContext
ctx) {
+ String parent = ctx.getParent().getText();
+ String parentName = parent.startsWith("new") ? parent.substring(3,
parent.indexOf('(')) : parent.substring(0, parent.indexOf('('));
+ if (STRATEGY_WITH_MAP_OPTS.contains(parentName)) { // handle
strategies which use plain map instead of Config struct
+ sb.append("map[string]interface{}{\"");
+ sb.append(ctx.getChild(0).getText());
+ sb.append("\": ");
+ visit(ctx.getChild(2));
+ sb.append("}");
+ } else {
+ // form of three tokens of key:value to become key=value
+ sb.append(SymbolHelper.toGo(ctx.getChild(0).getText()));
+ sb.append(": ");
+ visit(ctx.getChild(2));
+ // handles strategies that takes string slices as config
+ if (STRATEGY_WITH_STRING_SLICE.contains(parentName)) {
+ final int ix = sb.lastIndexOf("[]interface{}");
+ if (ix > 0) {
+ sb.replace(ix, ix +"[]interface{}".length(), "[]string");
+ }
}
}
- sb.append(")");
- return null;
- }
-
- @Override
- public Void visitConfiguration(final GremlinParser.ConfigurationContext
ctx) {
- // form of three tokens of key:value to become key=value
- sb.append(SymbolHelper.toGo(ctx.getChild(0).getText()));
- sb.append(": ");
- visit(ctx.getChild(2));
-
// need to convert List to Set for readPartitions until TINKERPOP-3032
if (ctx.getChild(0).getText().equals("readPartitions")) {
final int ix = sb.lastIndexOf("ReadPartitions: [");
@@ -264,6 +267,21 @@ public class GoTranslateVisitor extends
AbstractTranslateVisitor {
return null;
}
+ @Override
+ public Void visitTraversalSourceSelfMethod_withoutStrategies(final
GremlinParser.TraversalSourceSelfMethod_withoutStrategiesContext ctx) {
+ sb.append("WithoutStrategies(");
+
sb.append(GO_PACKAGE_NAME).append(ctx.classType().getText()).append("()");
+
+ if (ctx.classTypeList() != null && ctx.classTypeList().classTypeExpr()
!= null) {
+ for (GremlinParser.ClassTypeContext classTypeContext :
ctx.classTypeList().classTypeExpr().classType()) {
+ sb.append(",
").append(GO_PACKAGE_NAME).append(classTypeContext.getText()).append("()");
+ }
+ }
+
+ sb.append(")");
+ return null;
+ }
+
@Override
public Void visitTraversalCardinality(final
GremlinParser.TraversalCardinalityContext ctx) {
// handle the enum style of cardinality if there is one child,
otherwise it's the function call style
diff --git
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/translator/GremlinTranslatorTest.java
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/translator/GremlinTranslatorTest.java
index 1b9ecb97fe..985cd2f356 100644
---
a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/translator/GremlinTranslatorTest.java
+++
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/translator/GremlinTranslatorTest.java
@@ -605,7 +605,7 @@ public class GremlinTranslatorTest {
null,
"g.withStrategies(new
OptionsStrategy(myVar:number0))",
"g.WithStrategies(new OptionsStrategy(new
Dictionary<string, object> {{\"myVar\",10000},}))",
-
"g.WithStrategies(gremlingo.OptionsStrategy(map[string]interface{}{\"myVar\":10000}))",
+
"g.WithStrategies(gremlingo.OptionsStrategy(map[string]interface{}{\"myVar\":
10000}))",
null,
"g.withStrategies(OptionsStrategy.build().with(\"myVar\", 10000).create())",
"g.withStrategies(new OptionsStrategy({myVar:
10000}))",
@@ -671,16 +671,26 @@ public class GremlinTranslatorTest {
null,
null,
"g.WithoutStrategies(typeof(ReadOnlyStrategy))",
- "g.WithoutStrategies(gremlingo.ReadOnlyStrategy)",
// go - needs TINKERPOP-3055
+
"g.WithoutStrategies(gremlingo.ReadOnlyStrategy())", // go - needs
TINKERPOP-3055
null,
"g.withoutStrategies(ReadOnlyStrategy.class)",
"g.withoutStrategies(ReadOnlyStrategy)", //
javascript needs TINKERPOP-3055
"g.without_strategies(*[GremlinType('org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy')])"},
+
{"g.withStrategies(ReservedKeysVerificationStrategy(throwException: true, keys:
[\"age\"])).addV(\"person\").property(\"age\", 29).property(\"name\",
\"marko\")",
+
"g.withStrategies(ReservedKeysVerificationStrategy(throwException:true,
keys:[\"age\"])).addV(\"person\").property(\"age\", 29).property(\"name\",
\"marko\")",
+
"g.withStrategies(ReservedKeysVerificationStrategy(throwException:boolean0,
keys:list0)).addV(string0).property(string1, number0).property(string2,
string3)",
+ "g.WithStrategies(new
ReservedKeysVerificationStrategy(throwException: true, keys: new List<object> {
\"age\" })).AddV(\"person\").Property(\"age\", 29).Property(\"name\",
\"marko\")",
+
"g.WithStrategies(gremlingo.ReservedKeysVerificationStrategy(gremlingo.ReservedKeysVerificationStrategyConfig{ThrowException:
true, Keys: []string{\"age\"}})).AddV(\"person\").Property(\"age\",
29).Property(\"name\", \"marko\")",
+ "g.withStrategies(new
ReservedKeysVerificationStrategy(throwException:true,
keys:[\"age\"])).addV(\"person\").property(\"age\", 29).property(\"name\",
\"marko\")",
+
"g.withStrategies(ReservedKeysVerificationStrategy.build().throwException(true).keys(new
ArrayList<Object>() {{ add(\"age\");
}}).create()).addV(\"person\").property(\"age\", 29).property(\"name\",
\"marko\")",
+ "g.withStrategies(new
ReservedKeysVerificationStrategy({throwException: true, keys:
[\"age\"]})).addV(\"person\").property(\"age\", 29).property(\"name\",
\"marko\")",
+
"g.with_strategies(ReservedKeysVerificationStrategy(throw_exception=True,
keys=['age'])).add_v('person').property('age', 29).property('name', 'marko')"
+ },
{"g.withoutStrategies(ReadOnlyStrategy,
PathRetractionStrategy, FilterRankingStrategy)",
null,
null,
"g.WithoutStrategies(typeof(ReadOnlyStrategy),
typeof(PathRetractionStrategy), typeof(FilterRankingStrategy))",
- "g.WithoutStrategies(gremlingo.ReadOnlyStrategy,
gremlingo.PathRetractionStrategy, gremlingo.FilterRankingStrategy)", // go -
needs TINKERPOP-3055
+ "g.WithoutStrategies(gremlingo.ReadOnlyStrategy(),
gremlingo.PathRetractionStrategy(), gremlingo.FilterRankingStrategy())", // go
- needs TINKERPOP-3055
null,
"g.withoutStrategies(ReadOnlyStrategy.class,
PathRetractionStrategy.class, FilterRankingStrategy.class)",
"g.withoutStrategies(ReadOnlyStrategy,
PathRetractionStrategy, FilterRankingStrategy)", // javascript - needs
TINKERPOP-3055
diff --git a/gremlin-go/driver/connection_test.go
b/gremlin-go/driver/connection_test.go
index 0318b10a1e..fc5053366c 100644
--- a/gremlin-go/driver/connection_test.go
+++ b/gremlin-go/driver/connection_test.go
@@ -893,7 +893,7 @@ func TestConnection(t *testing.T) {
g := initializeGraph(t, testNoAuthUrl, testNoAuthAuthInfo,
testNoAuthTlsConfig)
defer g.remoteConnection.Close()
- prop := &BigDecimal{11, *big.NewInt(int64(22))}
+ prop := &BigDecimal{11, big.NewInt(int64(22))}
i := g.AddV("type_test").Property("data", prop).Iterate()
err := <-i
assert.Nil(t, err)
@@ -1074,12 +1074,12 @@ func TestConnection(t *testing.T) {
r, err := g.V((&Bindings{}).Of("x",
1)).Out("created").Map(&Lambda{Script: "it.get().value('name').length()",
Language: ""}).Sum().ToList()
assert.Nil(t, err)
for _, res := range r {
- assert.Equal(t, int64(3), res.GetInterface())
+ assert.Equal(t, int32(3), res.GetInterface())
}
r, err = g.V((&Bindings{}).Of("x",
4)).Out("created").Map(&Lambda{Script: "it.get().value('name').length()",
Language: ""}).Sum().ToList()
assert.Nil(t, err)
for _, res := range r {
- assert.Equal(t, int64(9), res.GetInterface())
+ assert.Equal(t, int32(9), res.GetInterface())
}
})
diff --git a/gremlin-go/driver/cucumber/cucumberSteps_test.go
b/gremlin-go/driver/cucumber/cucumberSteps_test.go
index cab43a6870..7e8a4218f7 100644
--- a/gremlin-go/driver/cucumber/cucumberSteps_test.go
+++ b/gremlin-go/driver/cucumber/cucumberSteps_test.go
@@ -25,6 +25,7 @@ import (
"errors"
"fmt"
"math"
+ "math/big"
"reflect"
"regexp"
"sort"
@@ -49,7 +50,9 @@ func init() {
parsers = map[*regexp.Regexp]func(string, string) interface{}{
regexp.MustCompile(`^str\[(.*)]$`): func(stringVal, graphName
string) interface{} { return stringVal }, //returns the string value as is
regexp.MustCompile(`^dt\[(.*)]$`): toDateTime,
- regexp.MustCompile(`^d\[(.*)]\.[bslfdmn]$`): toNumeric,
+ regexp.MustCompile(`^d\[(.*)]\.[bslfd]$`): toNumeric,
+ regexp.MustCompile(`^d\[(.*)]\.[m]$`): toBigDecimal,
+ regexp.MustCompile(`^d\[(.*)]\.[n]$`): toBigInt,
regexp.MustCompile(`^d\[(.*)]\.[i]$`): toInt32,
regexp.MustCompile(`^vp\[(.+)]$`): toVertexProperty,
regexp.MustCompile(`^v\[(.+)]$`): toVertex,
@@ -131,6 +134,21 @@ func toNumeric(stringVal, graphName string) interface{} {
return val
}
+// Parse bigInt.
+func toBigInt(stringVal, graphName string) interface{} {
+ val := new(big.Int)
+ val, ok := val.SetString(stringVal, 10)
+ if !ok {
+ return nil
+ }
+ return val
+}
+
+// Parse bigDecimal.
+func toBigDecimal(stringVal, graphName string) interface{} {
+ return gremlingo.ParseBigDecimal(stringVal)
+}
+
// Parse int32.
func toInt32(stringVal, graphName string) interface{} {
val, err := strconv.ParseInt(stringVal, 10, 32)
diff --git a/gremlin-go/driver/cucumber/gremlin.go
b/gremlin-go/driver/cucumber/gremlin.go
index 8df4c78ce3..94d8bc44a8 100644
--- a/gremlin-go/driver/cucumber/gremlin.go
+++ b/gremlin-go/driver/cucumber/gremlin.go
@@ -371,58 +371,58 @@ var translationMap = map[string][]func(g
*gremlingo.GraphTraversalSource, p map[
"g_V_asXnX_whereXorXselectXnX_hasLabelXsoftwareX_selectXnX_hasLabelXpersonXXX_selectXnX_byXnameX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.V().As("n").Where(gremlingo.T__.Or(gremlingo.T__.Select("n").HasLabel("software"),
gremlingo.T__.Select("n").HasLabel("person"))).Select("n").By("name")}},
"g_V_hasLabelXpersonX_asXxX_whereXinEXknowsX_count_isXgteX1XXX_selectXxX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.V().HasLabel("person").As("x").Where(gremlingo.T__.InE("knows").Count().Is(gremlingo.P.Gte(1))).Select("x")}},
"g_withStrategiesXAdjacentToIncidentStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.AdjacentToIncidentStrategy()).V()}},
- "g_withoutStrategiesXAdjacentToIncidentStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.AdjacentToIncidentStrategy).V()}},
+ "g_withoutStrategiesXAdjacentToIncidentStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.AdjacentToIncidentStrategy()).V()}},
"g_withStrategiesXAdjacentToIncidentStrategyX_V_out_count": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.AdjacentToIncidentStrategy()).V().Out().Count()}},
"g_withStrategiesXAdjacentToIncidentStrategyX_V_whereXoutX": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.AdjacentToIncidentStrategy()).V().Where(gremlingo.T__.Out())}},
"g_withStrategiesXByModulatorOptimizationStrategyX_V_order_byXvaluesXnameXX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.ByModulatorOptimizationStrategy()).V().Order().By(gremlingo.T__.Values("name"))}},
-
"g_withoutStrategiesXByModulatorOptimizationStrategyX_V_order_byXvaluesXnameXX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ByModulatorOptimizationStrategy).V().Order().By(gremlingo.T__.Values("name"))}},
+
"g_withoutStrategiesXByModulatorOptimizationStrategyX_V_order_byXvaluesXnameXX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ByModulatorOptimizationStrategy()).V().Order().By(gremlingo.T__.Values("name"))}},
"g_withStrategiesXComputerFinalizationStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.ComputerFinalizationStrategy()).V()}},
- "g_withoutStrategiesXByModulatorOptimizationStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ComputerFinalizationStrategy).V()}},
+ "g_withoutStrategiesXByModulatorOptimizationStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ComputerFinalizationStrategy()).V()}},
"g_withStrategiesXComputerVerificationStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.ComputerVerificationStrategy()).V()}},
- "g_withoutStrategiesXComputerVerificationStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ComputerVerificationStrategy).V()}},
+ "g_withoutStrategiesXComputerVerificationStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ComputerVerificationStrategy()).V()}},
"g_withStrategiesXConnectiveStrategyStrategyX_V_hasXname_markoX_or_whereXinXknowsX_hasXname_markoXX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.ConnectiveStrategy()).V().Has("name",
"marko").Or().Where(gremlingo.T__.In("knows").Has("name", "marko"))}},
-
"g_withoutStrategiesXConnectiveStrategyX_V_hasXname_markoX_or_whereXinXknowsX_hasXname_markoXX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ConnectiveStrategy).V().Has("name",
"marko").Or().Where(gremlingo.T__.In("knows").Has("name", "marko"))}},
+
"g_withoutStrategiesXConnectiveStrategyX_V_hasXname_markoX_or_whereXinXknowsX_hasXname_markoXX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ConnectiveStrategy()).V().Has("name",
"marko").Or().Where(gremlingo.T__.In("knows").Has("name", "marko"))}},
"g_withStrategiesXCountStrategyX_V_whereXoutE_count_isX0XX": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.CountStrategy()).V().Where(gremlingo.T__.OutE().Count().Is(0))}},
- "g_withoutStrategiesXCountStrategyX_V_whereXoutE_count_isX0XX": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.CountStrategy).V().Where(gremlingo.T__.OutE().Count().Is(0))}},
+ "g_withoutStrategiesXCountStrategyX_V_whereXoutE_count_isX0XX": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.CountStrategy()).V().Where(gremlingo.T__.OutE().Count().Is(0))}},
"g_withStrategiesXEarlyLimitStrategyX_V_out_order_valueMap_limitX3X_selectXnameX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.EarlyLimitStrategy()).V().Out().Order().ValueMap().Limit(3).Select("name")}},
-
"g_withoutStrategiesXEarlyLimitStrategyX_V_out_order_valueMap_limitX3X_selectXnameX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.EarlyLimitStrategy).V().Out().Order().ValueMap().Limit(3).Select("name")}},
+
"g_withoutStrategiesXEarlyLimitStrategyX_V_out_order_valueMap_limitX3X_selectXnameX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.EarlyLimitStrategy()).V().Out().Order().ValueMap().Limit(3).Select("name")}},
"g_withStrategiesXEdgeLabelVerificationStrategyXthrowException_true_logWarning_falseXX_V":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.EdgeLabelVerificationStrategy(gremlingo.EdgeLabelVerificationStrategyConfig{ThrowException:
true, LogWarning: false})).V().Out()}},
"g_withStrategiesXEdgeLabelVerificationStrategyXthrowException_false_logWarning_falseXX_V":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.EdgeLabelVerificationStrategy(gremlingo.EdgeLabelVerificationStrategyConfig{ThrowException:
false, LogWarning: false})).V().Out()}},
- "g_withoutStrategiesXEdgeLabelVerificationStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.EdgeLabelVerificationStrategy).V().Out()}},
+ "g_withoutStrategiesXEdgeLabelVerificationStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.EdgeLabelVerificationStrategy()).V().Out()}},
"g_withStrategiesXElementIdStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.ElementIdStrategy()).V()}},
- "g_withoutStrategiesXElementIdStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ElementIdStrategy).V()}},
+ "g_withoutStrategiesXElementIdStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ElementIdStrategy()).V()}},
"g_withStrategiesXFilterRankingStrategyX_V_out_order_dedup": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.FilterRankingStrategy()).V().Out().Order().Dedup()}},
- "g_withoutStrategiesXFilterRankingStrategyX_V_out_order_dedup": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.FilterRankingStrategy).V().Out().Order().Dedup()}},
+ "g_withoutStrategiesXFilterRankingStrategyX_V_out_order_dedup": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.FilterRankingStrategy()).V().Out().Order().Dedup()}},
"g_withStrategiesXGraphFilterStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.GraphFilterStrategy()).V()}},
- "g_withoutStrategiesXGraphFilterStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.GraphFilterStrategy).V()}},
+ "g_withoutStrategiesXGraphFilterStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.GraphFilterStrategy()).V()}},
"g_withStrategiesXHaltedTraverserStrategyXDetachedFactoryXX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.HaltedTraverserStrategy(gremlingo.HaltedTraverserStrategyConfig{HaltedTraverserFactory:
"org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory"})).V()}},
"g_withStrategiesXHaltedTraverserStrategyXReferenceFactoryXX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.HaltedTraverserStrategy(gremlingo.HaltedTraverserStrategyConfig{HaltedTraverserFactory:
"org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceFactory"})).V()}},
- "g_withoutStrategiesXHaltedTraverserStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.HaltedTraverserStrategy).V()}},
+ "g_withoutStrategiesXHaltedTraverserStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.HaltedTraverserStrategy()).V()}},
"g_withStrategiesXIdentityRemovalStrategyX_V_identity_out": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.IdentityRemovalStrategy()).V().Identity().Out()}},
- "g_withoutStrategiesXIdentityRemovalStrategyX_V_identity_out": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.IdentityRemovalStrategy).V().Identity().Out()}},
+ "g_withoutStrategiesXIdentityRemovalStrategyX_V_identity_out": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.IdentityRemovalStrategy()).V().Identity().Out()}},
"g_withStrategiesXIncidentToAdjacentStrategyX_V_outE_inV": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.IncidentToAdjacentStrategy()).V().OutE().InV()}},
- "g_withoutStrategiesXIncidentToAdjacentStrategyX_V_outE_inV": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.IncidentToAdjacentStrategy).V().OutE().InV()}},
+ "g_withoutStrategiesXIncidentToAdjacentStrategyX_V_outE_inV": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.IncidentToAdjacentStrategy()).V().OutE().InV()}},
"g_withStrategiesXInlineFilterStrategyX_V_filterXhasXname_markoXX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.InlineFilterStrategy()).V().Filter(gremlingo.T__.Has("name",
"marko"))}},
- "g_withoutStrategiesXInlineFilterStrategyX_V_filterXhasXname_markoXX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.InlineFilterStrategy).V().Filter(gremlingo.T__.Has("name",
"marko"))}},
+ "g_withoutStrategiesXInlineFilterStrategyX_V_filterXhasXname_markoXX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.InlineFilterStrategy()).V().Filter(gremlingo.T__.Has("name",
"marko"))}},
"g_withStrategiesXLambdaRestrictionStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return nil}}, // skipping as it contains a lambda
"g_withoutStrategiesXLambdaRestrictionStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return nil}}, // skipping as it contains a lambda
"g_withStrategiesXLazyBarrierStrategyX_V_out_bothE_count": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.LazyBarrierStrategy()).V().Out().BothE().Count()}},
- "g_withoutStrategiesXLazyBarrierStrategyX_V_out_bothE_count": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.LazyBarrierStrategy).V().Out().BothE().Count()}},
+ "g_withoutStrategiesXLazyBarrierStrategyX_V_out_bothE_count": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.LazyBarrierStrategy()).V().Out().BothE().Count()}},
"g_withStrategiesXMatchAlgorithmStrategyXmatchAlgorithm_CountMatchAlgorithmXX_V_matchXa_knows_b__a_created_cX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.MatchAlgorithmStrategy(gremlingo.MatchAlgorithmStrategyConfig{MatchAlgorithm:
"org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchStep$CountMatchAlgorithm"})).V().Match(gremlingo.T__.As("a").Out("knows").As("b"),
gremlingo.T__.As("a").Out [...]
"g_withStrategiesXMatchAlgorithmStrategyXmatchAlgorithm_GreedyMatchAlgorithmXX_V_matchXa_knows_b__a_created_cX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.MatchAlgorithmStrategy(gremlingo.MatchAlgorithmStrategyConfig{MatchAlgorithm:
"org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchStep$GreedyMatchAlgorithm"})).V().Match(gremlingo.T__.As("a").Out("knows").As("b"),
gremlingo.T__.As("a").O [...]
-
"g_withoutStrategiesXMatchAlgorithmStrategyX_V_matchXa_knows_b__a_created_cX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.MatchAlgorithmStrategy).V().Match(gremlingo.T__.As("a").Out("knows").As("b"),
gremlingo.T__.As("a").Out("created").As("c"))}},
+
"g_withoutStrategiesXMatchAlgorithmStrategyX_V_matchXa_knows_b__a_created_cX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.MatchAlgorithmStrategy()).V().Match(gremlingo.T__.As("a").Out("knows").As("b"),
gremlingo.T__.As("a").Out("created").As("c"))}},
"g_withStrategiesXMatchPredicateStrategyX_V_matchXa_created_lop_b__b_0created_29_cX_whereXc_repeatXoutX_timesX2XX_selectXa_b_cX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.MatchPredicateStrategy()).V().Match(gremlingo.T__.As("a").Out("created").Has("name",
"lop").As("b"), gremlingo.T__.As("b").In("created").Has("age",
29).As("c")).Where(gremlingo.T__.As("c").Repeat(gremlingo.T__.Out()).Times(2)).Sel
[...]
-
"g_withoutStrategiesXMatchPredicateStrategyX_V_matchXa_created_lop_b__b_0created_29_cX_whereXc_repeatXoutX_timesX2XX_selectXa_b_cX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.MatchPredicateStrategy).V().Match(gremlingo.T__.As("a").Out("created").Has("name",
"lop").As("b"), gremlingo.T__.As("b").In("created").Has("age",
29).As("c")).Where(gremlingo.T__.As("c").Repeat(gremlingo.T__.Out()).Times(2))
[...]
+
"g_withoutStrategiesXMatchPredicateStrategyX_V_matchXa_created_lop_b__b_0created_29_cX_whereXc_repeatXoutX_timesX2XX_selectXa_b_cX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.MatchPredicateStrategy()).V().Match(gremlingo.T__.As("a").Out("created").Has("name",
"lop").As("b"), gremlingo.T__.As("b").In("created").Has("age",
29).As("c")).Where(gremlingo.T__.As("c").Repeat(gremlingo.T__.Out()).Times(2
[...]
"g_withStrategiesXMessagePassingReductionStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.MessagePassingReductionStrategy()).V()}},
- "g_withoutStrategiesXMessagePassingReductionStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.MessagePassingReductionStrategy).V()}},
+ "g_withoutStrategiesXMessagePassingReductionStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.MessagePassingReductionStrategy()).V()}},
"g_withoutStrategiesXCountStrategyX_V_count": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return g.Inject(6)}},
"g_V_coworker": {func(g *gremlingo.GraphTraversalSource, p
map[string]interface{}) *gremlingo.GraphTraversal {return
g.V().HasLabel("person").Filter(gremlingo.T__.OutE("created")).Aggregate("p").As("p1").Values("name").As("p1n").Select("p").Unfold().Where(gremlingo.P.Neq("p1")).As("p2").Values("name").As("p2n").Select("p2").Out("created").Choose(gremlingo.T__.In("created").Where(gremlingo.P.Eq("p1")),
gremlingo.T__.Values("name"),
gremlingo.T__.Constant(p["xx1"])).Group().By(gremling [...]
"g_V_coworker_with_midV": {func(g *gremlingo.GraphTraversalSource, p
map[string]interface{}) *gremlingo.GraphTraversal {return
g.V().HasLabel("person").Filter(gremlingo.T__.OutE("created")).As("p1").V().HasLabel("person").Where(gremlingo.P.Neq("p1")).Filter(gremlingo.T__.OutE("created")).As("p2").Map(gremlingo.T__.Out("created").Where(gremlingo.T__.In("created").As("p1")).Values("name").Fold()).Group().By(gremlingo.T__.Select("p1").By("name")).By(gremlingo.T__.Group().By(gremlingo.T_
[...]
"g_withStrategiesXOptionsStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.OptionsStrategy()).V()}},
- "g_withStrategiesXOptionsStrategyXmyVar_myValueXX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.OptionsStrategy(map[string]interface{}{"myVar":"myValue"})).V()}},
- "g_withoutStrategiesXOptionsStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.OptionsStrategy).V()}},
+ "g_withStrategiesXOptionsStrategyXmyVar_myValueXX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.OptionsStrategy(map[string]interface{}{"myVar":
"myValue"})).V()}},
+ "g_withoutStrategiesXOptionsStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.OptionsStrategy()).V()}},
"g_withStrategiesXOrderLimitStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.OrderLimitStrategy()).V()}},
- "g_withoutStrategiesXOrderLimitStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.OrderLimitStrategy).V()}},
+ "g_withoutStrategiesXOrderLimitStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.OrderLimitStrategy()).V()}},
"g_withStrategiesXPartitionStrategyXwrite_a_read_aXX_V_name": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return g.AddV("person").Property("_partition",
"a").Property("name", "alice").AddV("person").Property("_partition",
"b").Property("name", "bob")}, func(g *gremlingo.GraphTraversalSource, p
map[string]interface{}) *gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.PartitionStrategy(gremlingo.PartitionStrategyConfig{Partit
[...]
"g_withStrategiesXPartitionStrategyXwrite_a_read_a_bXX_V_name": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return g.AddV("person").Property("_partition",
"a").Property("name", "alice").AddV("person").Property("_partition",
"b").Property("name", "bob")}, func(g *gremlingo.GraphTraversalSource, p
map[string]interface{}) *gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.PartitionStrategy(gremlingo.PartitionStrategyConfig{Part
[...]
"g_withStrategiesXPartitionStrategyXwrite_a_read_cXX_V_name": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return g.AddV("person").Property("_partition",
"a").Property("name", "alice").AddV("person").Property("_partition",
"b").Property("name", "bob")}, func(g *gremlingo.GraphTraversalSource, p
map[string]interface{}) *gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.PartitionStrategy(gremlingo.PartitionStrategyConfig{Partit
[...]
@@ -448,14 +448,14 @@ var translationMap = map[string][]func(g
*gremlingo.GraphTraversalSource, p map[
"g_withStrategiesXPartitionStrategyXwrite_a_read_aXX_mergeV_optionXonCreateX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return g.AddV("person").Property("_partition",
"b").Property("name", "alice")}, func(g *gremlingo.GraphTraversalSource, p
map[string]interface{}) *gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.PartitionStrategy(gremlingo.PartitionStrategyConfig{PartitionKey:
"_partition", WritePartition: "a", ReadPar [...]
"g_withStrategiesXPartitionStrategyXwrite_a_read_aXX_injectX0X__mergeV_optionXonCreateX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return g.AddV("person").Property("_partition",
"b").Property("name", "alice")}, func(g *gremlingo.GraphTraversalSource, p
map[string]interface{}) *gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.PartitionStrategy(gremlingo.PartitionStrategyConfig{PartitionKey:
"_partition", WritePartition: " [...]
"g_withStrategiesXPathProcessorStrategyX_V_asXaX_selectXaX_byXvaluesXnameXX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.PathProcessorStrategy()).V().As("a").Select("a").By(gremlingo.T__.Values("name"))}},
-
"g_withoutStrategiesXPathProcessorStrategyX_V_asXaX_selectXaX_byXvaluesXnameXX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.PathProcessorStrategy).V().As("a").Select("a").By(gremlingo.T__.Values("name"))}},
+
"g_withoutStrategiesXPathProcessorStrategyX_V_asXaX_selectXaX_byXvaluesXnameXX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.PathProcessorStrategy()).V().As("a").Select("a").By(gremlingo.T__.Values("name"))}},
"g_withStrategiesXPathRetractionStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.PathRetractionStrategy()).V()}},
- "g_withoutStrategiesXPathRetractionStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.PathRetractionStrategy).V()}},
+ "g_withoutStrategiesXPathRetractionStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.PathRetractionStrategy()).V()}},
"g_V_shortestpath": {func(g *gremlingo.GraphTraversalSource, p
map[string]interface{}) *gremlingo.GraphTraversal {return
g.V().As("v").Both().As("v").Project("src", "tgt",
"p").By(gremlingo.T__.Select(gremlingo.Pop.First,
"v")).By(gremlingo.T__.Select(gremlingo.Pop.Last,
"v")).By(gremlingo.T__.Select(gremlingo.Pop.All,
"v")).As("triple").Group("x").By(gremlingo.T__.Select("src",
"tgt")).By(gremlingo.T__.Select("p").Fold()).Select("tgt").Barrier().Repeat(gremlingo.T__.Both().As("v").P
[...]
"g_withStrategiesXProductiveByStrategyX_V_group_byXageX_byXnameX": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.ProductiveByStrategy()).V().Group().By("age").By("name")}},
- "g_withoutStrategiesXProductiveByStrategyX_V_group_byXageX_byXnameX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ProductiveByStrategy).V().Group().By("age").By("name")}},
+ "g_withoutStrategiesXProductiveByStrategyX_V_group_byXageX_byXnameX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ProductiveByStrategy()).V().Group().By("age").By("name")}},
"g_withStrategiesXProfileStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.ProfileStrategy()).V()}},
- "g_withoutStrategiesXProfileStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ProfileStrategy).V()}},
+ "g_withoutStrategiesXProfileStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ProfileStrategy()).V()}},
"g_withStrategiesXReadOnlyStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.ReadOnlyStrategy()).V()}},
"g_withStrategiesXReadOnlyStrategyX_V_outXknowsX_name": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.ReadOnlyStrategy()).V().Out("knows").Values("name")}},
"g_withStrategiesXReadOnlyStrategyX_addVXpersonX": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.ReadOnlyStrategy()).AddV("person")}},
@@ -465,16 +465,16 @@ var translationMap = map[string][]func(g
*gremlingo.GraphTraversalSource, p map[
"g_withStrategiesXReadOnlyStrategyX_E_propertyXweight_0X": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.ReadOnlyStrategy()).E().Property("weight", 0)}},
"g_V_classic_recommendation": {func(g *gremlingo.GraphTraversalSource, p
map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("name",
"DARK
STAR").As("a").Out("followedBy").Aggregate("stash").In("followedBy").Where(gremlingo.P.Neq("a").And(gremlingo.P.Not(gremlingo.P.Within("stash")))).GroupCount().Unfold().Project("x",
"y",
"z").By(gremlingo.T__.Select(gremlingo.Column.Keys).Values("name")).By(gremlingo.T__.Select(gremlingo.Column.Keys).Values("performances")).By(grem
[...]
"g_withStrategiesXReferenceElementStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.ReferenceElementStrategy()).V()}},
- "g_withoutStrategiesXReferenceElementStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ReferenceElementStrategy).V()}},
+ "g_withoutStrategiesXReferenceElementStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ReferenceElementStrategy()).V()}},
"g_withStrategiesXRepeatUnrollStrategyX_V_repeatXoutX_timesX2X": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.RepeatUnrollStrategy()).V().Repeat(gremlingo.T__.Out()).Times(2)}},
- "g_withoutStrategiesXRepeatUnrollStrategyX_V_repeatXoutX_timesX2X":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.RepeatUnrollStrategy).V().Repeat(gremlingo.T__.Out()).Times(2)}},
+ "g_withoutStrategiesXRepeatUnrollStrategyX_V_repeatXoutX_timesX2X":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.RepeatUnrollStrategy()).V().Repeat(gremlingo.T__.Out()).Times(2)}},
"g_withStrategiesXReservedKeysVerificationStrategyXthrowException_trueXX_addVXpersonX_propertyXid_123X_propertyXname_markoX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.ReservedKeysVerificationStrategy(gremlingo.ReservedKeysVerificationStrategyConfig{ThrowException:
true})).AddV("person").Property("id", 123).Property("name", "marko")}},
"g_withStrategiesXReservedKeysVerificationStrategyXthrowException_trueXX_addVXpersonX_propertyXage_29X_propertyXname_markoX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.ReservedKeysVerificationStrategy(gremlingo.ReservedKeysVerificationStrategyConfig{ThrowException:
true, Keys: gremlingo.NewSimpleSet("age")})).AddV("person").Property("age",
29).Property("name", "marko")}},
-
"g_withoutStrategiesXReservedKeysVerificationStrategyX_addVXpersonX_propertyXid_123X_propertyXname_markoX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ReservedKeysVerificationStrategy).AddV("person").Property("id",
123).Property("name", "marko")}},
+
"g_withoutStrategiesXReservedKeysVerificationStrategyX_addVXpersonX_propertyXid_123X_propertyXname_markoX":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.ReservedKeysVerificationStrategy()).AddV("person").Property("id",
123).Property("name", "marko").Values()}},
"g_withStrategiesXSeedStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.SeedStrategy(gremlingo.SeedStrategyConfig{Seed:
7})).V().Coin(0.5)}},
- "g_withoutStrategiesXSeedStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.SeedStrategy).V()}},
+ "g_withoutStrategiesXSeedStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.SeedStrategy()).V()}},
"g_withStrategiesXStandardVerificationStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.StandardVerificationStrategy()).V()}},
- "g_withoutStrategiesXStandardVerificationStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.StandardVerificationStrategy).V()}},
+ "g_withoutStrategiesXStandardVerificationStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.StandardVerificationStrategy()).V()}},
"g_withStrategiesXSubgraphStrategyXsubgraphAXX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{Vertices:
gremlingo.T__.Has("name", gremlingo.P.Within("josh", "lop",
"ripple"))})).V()}},
"g_withStrategiesXSubgraphStrategyXsubgraphAXX_E": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{Vertices:
gremlingo.T__.Has("name", gremlingo.P.Within("josh", "lop",
"ripple"))})).E()}},
"g_withStrategiesXSubgraphStrategyXsubgraphAXX_VX4X_outE": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{Vertices:
gremlingo.T__.Has("name", gremlingo.P.Within("josh", "lop",
"ripple"))})).V(p["vid4"]).OutE()}},
@@ -536,11 +536,11 @@ var translationMap = map[string][]func(g
*gremlingo.GraphTraversalSource, p map[
"g_withStrategiesXSubgraphStrategyXsubgraphDXX_EX12X_bothV": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{CheckAdjacentVertices:
false, Vertices: gremlingo.T__.Has("name", gremlingo.P.Within("josh", "lop",
"ripple")), Edges: gremlingo.T__.Or(gremlingo.T__.Has("weight",
0.4).HasLabel("created"), gremlingo.T__.Has("weight",
1.0).HasLabel("created"))})).E( [...]
"g_withStrategiesXSubgraphStrategyXsubgraphDXX_EX9X_bothV": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{CheckAdjacentVertices:
false, Vertices: gremlingo.T__.Has("name", gremlingo.P.Within("josh", "lop",
"ripple")), Edges: gremlingo.T__.Or(gremlingo.T__.Has("weight",
0.4).HasLabel("created"), gremlingo.T__.Has("weight",
1.0).HasLabel("created"))})).E(p [...]
"g_withStrategiesXSubgraphStrategyXcheckAdjacentVertices_subgraphDXX_EX9X_bothV":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{CheckAdjacentVertices:
true, Vertices: gremlingo.T__.Has("name", gremlingo.P.Within("josh", "lop",
"ripple")), Edges: gremlingo.T__.Or(gremlingo.T__.Has("weight",
0.4).HasLabel("created"), gremlingo.T__.Has("weight", 1.0).HasLab [...]
-
"g_withStrategiesXVertexProgramRestrictionStrategyX_withoutStrategiesXVertexProgramStrategyX_V":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.VertexProgramRestrictionStrategy()).WithoutStrategies(gremlingo.VertexProgramStrategy).V()}},
+
"g_withStrategiesXVertexProgramRestrictionStrategyX_withoutStrategiesXVertexProgramStrategyX_V":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.VertexProgramRestrictionStrategy()).WithoutStrategies(gremlingo.VertexProgramStrategy()).V()}},
"g_withStrategiesXVertexProgramRestrictionStrategy_VertexProgramStrategyX_V":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.VertexProgramRestrictionStrategy(),
gremlingo.VertexProgramStrategy()).V()}},
- "g_withoutStrategiesXVertexProgramRestrictionStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.VertexProgramRestrictionStrategy).WithStrategies(gremlingo.VertexProgramStrategy()).V()}},
+ "g_withoutStrategiesXVertexProgramRestrictionStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.VertexProgramRestrictionStrategy()).WithStrategies(gremlingo.VertexProgramStrategy()).V()}},
"g_withStrategiesXVertexProgramStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithStrategies(gremlingo.VertexProgramStrategy()).V()}},
- "g_withoutStrategiesXVertexProgramStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.VertexProgramStrategy).V()}},
+ "g_withoutStrategiesXVertexProgramStrategyX_V": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return
g.WithoutStrategies(gremlingo.VertexProgramStrategy()).V()}},
"g_VX1X_asXaX_outXcreatedX_addEXcreatedByX_toXaX": {func(g
*gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return g.AddV("person").Property("name",
"marko").Property("age", 29).As("marko").AddV("person").Property("name",
"vadas").Property("age", 27).As("vadas").AddV("software").Property("name",
"lop").Property("lang", "java").As("lop").AddV("person").Property("name",
"josh").Property("age", 32).As("josh").AddV("software").Property("name",
"ripple [...]
"g_VX1X_asXaX_outXcreatedX_addEXcreatedByX_toXaX_propertyXweight_2X":
{func(g *gremlingo.GraphTraversalSource, p map[string]interface{})
*gremlingo.GraphTraversal {return g.AddV("person").Property("name",
"marko").Property("age", 29).As("marko").AddV("person").Property("name",
"vadas").Property("age", 27).As("vadas").AddV("software").Property("name",
"lop").Property("lang", "java").As("lop").AddV("person").Property("name",
"josh").Property("age", 32).As("josh").AddV("software").Prope [...]
"g_V_outE_propertyXweight_nullX": {func(g *gremlingo.GraphTraversalSource,
p map[string]interface{}) *gremlingo.GraphTraversal {return
g.AddV("person").Property("name", "marko").Property("age",
29).As("marko").AddV("person").Property("name", "vadas").Property("age",
27).As("vadas").AddV("software").Property("name", "lop").Property("lang",
"java").As("lop").AddV("person").Property("name", "josh").Property("age",
32).As("josh").AddV("software").Property("name", "ripple").Property("lang [...]
diff --git a/gremlin-go/driver/graphBinary.go b/gremlin-go/driver/graphBinary.go
index 39c6d2f029..18b69dc421 100644
--- a/gremlin-go/driver/graphBinary.go
+++ b/gremlin-go/driver/graphBinary.go
@@ -893,7 +893,7 @@ func readBigDecimal(data *[]byte, i *int) (interface{},
error) {
if err != nil {
return nil, err
}
- bigDecimal.UnscaledValue = *unscaled.(*big.Int)
+ bigDecimal.UnscaledValue = unscaled.(*big.Int)
return bigDecimal, nil
}
diff --git a/gremlin-go/driver/graphBinary_test.go
b/gremlin-go/driver/graphBinary_test.go
index d8c66d2816..69ea3aa4ce 100644
--- a/gremlin-go/driver/graphBinary_test.go
+++ b/gremlin-go/driver/graphBinary_test.go
@@ -115,7 +115,7 @@ func TestGraphBinaryV1(t *testing.T) {
t.Run("read-write BigDecimal", func(t *testing.T) {
pos := 0
var buffer bytes.Buffer
- source := &BigDecimal{11, *big.NewInt(int64(22))}
+ source := &BigDecimal{11, big.NewInt(int64(22))}
buf, err := bigDecimalWriter(source, &buffer, nil)
assert.Nil(t, err)
res, err := readBigDecimal(&buf, &pos)
diff --git a/gremlin-go/driver/strategies.go b/gremlin-go/driver/strategies.go
index 9108e6b419..e2887eb703 100644
--- a/gremlin-go/driver/strategies.go
+++ b/gremlin-go/driver/strategies.go
@@ -27,6 +27,8 @@ const (
verificationNamespace = baseNamespace + "verification."
computerDecorationNamespace =
"org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration."
computerVerificationNamespace =
"org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.verification."
+ //
org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.verification
+ // org.apache.tinkerpop.gremlin.process.traversal.strategy.verification
computerFinalizationNamespace =
"org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.finalization."
computerOptimizationNamespace =
"org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.optimization."
)
@@ -56,10 +58,12 @@ func ElementIdStrategy() TraversalStrategy {
return &traversalStrategy{name: decorationNamespace +
"ElementIdStrategy"}
}
-func HaltedTraverserStrategy(config HaltedTraverserStrategyConfig)
TraversalStrategy {
+func HaltedTraverserStrategy(config ...HaltedTraverserStrategyConfig)
TraversalStrategy {
configMap := make(map[string]interface{})
- if config.HaltedTraverserFactory != "" {
- configMap["haltedTraverserFactory"] =
config.HaltedTraverserFactory
+ if len(config) > 0 {
+ if config[0].HaltedTraverserFactory != "" {
+ configMap["haltedTraverserFactory"] =
config[0].HaltedTraverserFactory
+ }
}
return &traversalStrategy{name: decorationNamespace +
"HaltedTraverserStrategy", configuration: configMap}
}
@@ -75,14 +79,12 @@ type HaltedTraverserStrategyConfig struct {
// essentially a way for users to provide Traversal level configuration
options that can be used in various ways
// by different Graph providers.
func OptionsStrategy(options ...map[string]interface{}) TraversalStrategy {
- var opts map[string]interface{}
+ optsMap := make(map[string]interface{})
if len(options) > 0 {
- opts = options[0]
- } else {
- opts = make(map[string]interface{})
+ optsMap = options[0]
}
- return &traversalStrategy{name: decorationNamespace +
"OptionsStrategy", configuration: opts}
+ return &traversalStrategy{name: decorationNamespace +
"OptionsStrategy", configuration: optsMap}
}
// PartitionStrategy partitions the Vertices, Edges and Vertex properties of a
Graph into String named
@@ -118,8 +120,12 @@ type PartitionStrategyConfig struct {
// of results but not necessarily the same ones. The same problem can occur in
OLAP-based Taversals where
// iteration order is not explicitly guaranteed. The only way to ensure
completely deterministic results in that
// sense is to apply some form of order() in these cases.
-func SeedStrategy(config SeedStrategyConfig) TraversalStrategy {
- configMap := map[string]interface{}{"seed": config.Seed}
+func SeedStrategy(config ...SeedStrategyConfig) TraversalStrategy {
+ configMap := make(map[string]interface{})
+ if len(config) > 0 {
+ configMap["seed"] = config[0].Seed
+ }
+
return &traversalStrategy{name: decorationNamespace + "SeedStrategy",
configuration: configMap}
}
@@ -157,33 +163,31 @@ type SubgraphStrategyConfig struct {
}
func VertexProgramStrategy(config ...VertexProgramStrategyConfig)
TraversalStrategy {
- var cfg VertexProgramStrategyConfig
+ configMap := make(map[string]interface{})
if len(config) > 0 {
- cfg = config[0]
+ if config[0].GraphComputer != "" {
+ configMap["graphComputer"] = config[0].GraphComputer
+ }
+ if config[0].Workers != 0 {
+ configMap["workers"] = config[0].Workers
+ }
+ if config[0].Persist != "" {
+ configMap["persist"] = config[0].Persist
+ }
+ if config[0].Result != "" {
+ configMap["result"] = config[0].Result
+ }
+ if config[0].Vertices != nil {
+ configMap["vertices"] = config[0].Vertices
+ }
+ if config[0].Edges != nil {
+ configMap["edges"] = config[0].Edges
+ }
+ for k, v := range config[0].Configuration {
+ configMap[k] = v
+ }
}
- configMap := make(map[string]interface{})
- if cfg.GraphComputer != "" {
- configMap["graphComputer"] = cfg.GraphComputer
- }
- if cfg.Workers != 0 {
- configMap["workers"] = cfg.Workers
- }
- if cfg.Persist != "" {
- configMap["persist"] = cfg.Persist
- }
- if cfg.Result != "" {
- configMap["result"] = cfg.Result
- }
- if cfg.Vertices != nil {
- configMap["vertices"] = cfg.Vertices
- }
- if cfg.Edges != nil {
- configMap["edges"] = cfg.Edges
- }
- for k, v := range cfg.Configuration {
- configMap[k] = v
- }
return &traversalStrategy{name: computerDecorationNamespace +
"VertexProgramStrategy", configuration: configMap}
}
@@ -199,45 +203,16 @@ type VertexProgramStrategyConfig struct {
Configuration map[string]interface{}
}
-func ProfileStrategy() TraversalStrategy {
- return &traversalStrategy{name: finalizationNamespace +
"ProfileStrategy"}
-}
-
-func ReferenceElementStrategy() TraversalStrategy {
- return &traversalStrategy{name: finalizationNamespace +
"ReferenceElementStrategy"}
-}
-
-func StandardVerificationStrategy() TraversalStrategy {
- return &traversalStrategy{name: finalizationNamespace +
"StandardVerificationStrategy"}
-}
-
-func ComputerFinalizationStrategy() TraversalStrategy {
- return &traversalStrategy{name: computerFinalizationNamespace +
"ComputerFinalizationStrategy"}
-}
-
-func ComputerVerificationStrategy() TraversalStrategy {
- return &traversalStrategy{name: computerVerificationNamespace +
"ComputerVerificationStrategy"}
-}
-
-func VertexProgramRestrictionStrategy() TraversalStrategy {
- return &traversalStrategy{name: computerVerificationNamespace +
"VertexProgramRestrictionStrategy"}
-}
-
-func GraphFilterStrategy() TraversalStrategy {
- return &traversalStrategy{name: computerOptimizationNamespace +
"GraphFilterStrategy"}
-}
-
-func MessagePassingReductionStrategy() TraversalStrategy {
- return &traversalStrategy{name: computerOptimizationNamespace +
"MessagePassingReductionStrategy"}
-}
-
// Finalization strategies
-func MatchAlgorithmStrategy(config MatchAlgorithmStrategyConfig)
TraversalStrategy {
+func MatchAlgorithmStrategy(config ...MatchAlgorithmStrategyConfig)
TraversalStrategy {
configMap := make(map[string]interface{})
- if config.MatchAlgorithm != "" {
- configMap["matchAlgorithm"] = config.MatchAlgorithm
+ if len(config) > 0 {
+ if config[0].MatchAlgorithm != "" {
+ configMap["matchAlgorithm"] = config[0].MatchAlgorithm
+ }
}
+
return &traversalStrategy{name: finalizationNamespace +
"MatchAlgorithmStrategy", configuration: configMap}
}
@@ -247,15 +222,32 @@ type MatchAlgorithmStrategyConfig struct {
MatchAlgorithm string
}
+func ReferenceElementStrategy() TraversalStrategy {
+ return &traversalStrategy{name: finalizationNamespace +
"ReferenceElementStrategy"}
+}
+
+func ComputerFinalizationStrategy() TraversalStrategy {
+ return &traversalStrategy{name: computerFinalizationNamespace +
"ComputerFinalizationStrategy"}
+}
+
+func ProfileStrategy() TraversalStrategy {
+ return &traversalStrategy{name: finalizationNamespace +
"ProfileStrategy"}
+}
+
// Verification strategies
+func ComputerVerificationStrategy() TraversalStrategy {
+ return &traversalStrategy{name: verificationNamespace +
"ComputerVerificationStrategy"}
+}
+
// EdgeLabelVerificationStrategy does not allow Edge traversal steps to have
no label specified.
// Providing one or more labels is considered to be a best practice, however,
TinkerPop will not force
// the specification of Edge labels; instead, providers or users will have to
enable this strategy explicitly.
-func EdgeLabelVerificationStrategy(config EdgeLabelVerificationStrategyConfig)
TraversalStrategy {
- configMap := map[string]interface{}{
- "logWarning": config.LogWarning,
- "throwException": config.ThrowException,
+func EdgeLabelVerificationStrategy(config
...EdgeLabelVerificationStrategyConfig) TraversalStrategy {
+ configMap := make(map[string]interface{})
+ if len(config) > 0 {
+ configMap["logWarning"] = config[0].LogWarning
+ configMap["throwException"] = config[0].ThrowException
}
return &traversalStrategy{name: verificationNamespace +
"EdgeLabelVerificationStrategy", configuration: configMap}
@@ -283,13 +275,14 @@ func ReadOnlyStrategy() TraversalStrategy {
// ReservedKeysVerificationStrategy detects property keys that should not be
used by the traversal.
// A term may be reserved by a particular graph implementation or as a
convention given best practices.
-func ReservedKeysVerificationStrategy(config
ReservedKeysVerificationStrategyConfig) TraversalStrategy {
- configMap := map[string]interface{}{
- "logWarning": config.LogWarning,
- "throwException": config.ThrowException,
- }
- if len(config.Keys.ToSlice()) != 0 {
- configMap["keys"] = config.Keys
+func ReservedKeysVerificationStrategy(config
...ReservedKeysVerificationStrategyConfig) TraversalStrategy {
+ configMap := make(map[string]interface{})
+ if len(config) > 0 {
+ configMap["logWarning"] = config[0].LogWarning
+ configMap["throwException"] = config[0].ThrowException
+ if config[0].Keys != nil && len(config[0].Keys.ToSlice()) != 0 {
+ configMap["keys"] = config[0].Keys
+ }
}
return &traversalStrategy{name: verificationNamespace +
"ReservedKeysVerificationStrategy", configuration: configMap}
}
@@ -302,6 +295,14 @@ type ReservedKeysVerificationStrategyConfig struct {
Keys Set
}
+func StandardVerificationStrategy() TraversalStrategy {
+ return &traversalStrategy{name: verificationNamespace +
"StandardVerificationStrategy"}
+}
+
+func VertexProgramRestrictionStrategy() TraversalStrategy {
+ return &traversalStrategy{name: computerVerificationNamespace +
"VertexProgramRestrictionStrategy"}
+}
+
// Optimization strategies
// AdjacentToIncidentStrategy looks for Vertex- and value-emitting steps
followed by a CountGlobalStep and replaces
@@ -344,6 +345,10 @@ func FilterRankingStrategy() TraversalStrategy {
return &traversalStrategy{name: optimizationNamespace +
"FilterRankingStrategy"}
}
+func GraphFilterStrategy() TraversalStrategy {
+ return &traversalStrategy{name: computerOptimizationNamespace +
"GraphFilterStrategy"}
+}
+
// IdentityRemovalStrategy looks for IdentityStep instances and removes them.
// If the identity step is labeled, its labels are added to the previous step.
// If the identity step is labeled and it's the first step in the traversal,
it stays.
@@ -386,6 +391,10 @@ func MatchPredicateStrategy() TraversalStrategy {
return &traversalStrategy{name: optimizationNamespace +
"MatchPredicateStrategy"}
}
+func MessagePassingReductionStrategy() TraversalStrategy {
+ return &traversalStrategy{name: computerOptimizationNamespace +
"MessagePassingReductionStrategy"}
+}
+
// OrderLimitStrategy is an OLAP strategy that folds a RangeGlobalStep into a
preceding
// OrderGlobalStep. This helps to eliminate traversers early in the traversal
and can
// significantly reduce the amount of memory required by the OLAP execution
engine.
@@ -413,7 +422,7 @@ func PathRetractionStrategy() TraversalStrategy {
// ByModulatorOptimizationStrategy which features optimizations relevant to
this one.
func ProductiveByStrategy(config ...ProductiveByStrategyConfig)
TraversalStrategy {
configMap := make(map[string]interface{})
- if len(config) == 1 {
+ if len(config) > 0 {
configMap["productiveKeys"] = config[0].ProductiveKeys
}
diff --git a/gremlin-go/driver/strategies_test.go
b/gremlin-go/driver/strategies_test.go
index db5695e9c6..c519be5d66 100644
--- a/gremlin-go/driver/strategies_test.go
+++ b/gremlin-go/driver/strategies_test.go
@@ -413,4 +413,18 @@ func TestStrategy(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, int32(6), val)
})
+
+ t.Run("Test without strategies MessagePassingReductionStrategy", func(t
*testing.T) {
+ g := getModernGraph(t, testNoAuthUrl, &AuthInfo{},
&tls.Config{})
+ defer g.remoteConnection.Close()
+
+ count, err :=
g.WithoutStrategies(MessagePassingReductionStrategy()).V().Count().ToList()
+ assert.Nil(t, err)
+ assert.NotNil(t, count)
+ assert.Equal(t, 1, len(count))
+ val, err := count[0].GetInt32()
+ assert.Nil(t, err)
+ assert.Equal(t, int32(6), val)
+ })
+
}
diff --git a/gremlin-go/driver/traversal.go b/gremlin-go/driver/traversal.go
index be80c0c0e0..a6011eab53 100644
--- a/gremlin-go/driver/traversal.go
+++ b/gremlin-go/driver/traversal.go
@@ -21,6 +21,7 @@ package gremlingo
import (
"math/big"
+ "strings"
)
// Traverser is the objects propagating through the traversal.
@@ -702,7 +703,35 @@ type GremlinType struct {
// unscaled value and a 32-bit integer scale.
type BigDecimal struct {
Scale int32
- UnscaledValue big.Int
+ UnscaledValue *big.Int
+}
+
+// ParseBigDecimal creates a BigDecimal from a string value.
+func ParseBigDecimal(strValue string) *BigDecimal {
+ val := &BigDecimal{}
+
+ // get float value
+ bfVal := new(big.Float)
+ bfVal, ok := bfVal.SetString(strValue)
+ if !ok {
+ return nil
+ }
+ // resolve big int
+ unscaled := new(big.Int)
+ unscaled, ok = unscaled.SetString(strings.Replace(bfVal.String(), ".",
"",-1), 10)
+ if !ok {
+ return nil
+ }
+ val.UnscaledValue = unscaled
+ // scale is the number of digits to the right of decimal point
+ scale := 0
+ decimalPos := strings.Index(strValue, ".")
+ if decimalPos > -1 {
+ scale = len(strValue) - decimalPos - 1
+ }
+ val.Scale = int32(scale)
+
+ return val
}
// ByteBuffer represents the GraphBinary type ByteBuffer which can be used to
serialize a binary data.
diff --git
a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js
b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js
index 1f97d8e195..7f012d60fe 100644
---
a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js
+++
b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js
@@ -491,7 +491,7 @@ const gremlins = {
g_withoutStrategiesXRepeatUnrollStrategyX_V_repeatXoutX_timesX2X:
[function({g}) { return
g.withoutStrategies(RepeatUnrollStrategy).V().repeat(__.out()).times(2) }],
g_withStrategiesXReservedKeysVerificationStrategyXthrowException_trueXX_addVXpersonX_propertyXid_123X_propertyXname_markoX:
[function({g}) { return g.withStrategies(new
ReservedKeysVerificationStrategy({throwException:
true})).addV("person").property("id", 123).property("name", "marko") }],
g_withStrategiesXReservedKeysVerificationStrategyXthrowException_trueXX_addVXpersonX_propertyXage_29X_propertyXname_markoX:
[function({g}) { return g.withStrategies(new
ReservedKeysVerificationStrategy({throwException: true, keys: new
Set(["age"])})).addV("person").property("age", 29).property("name", "marko")
}],
-
g_withoutStrategiesXReservedKeysVerificationStrategyX_addVXpersonX_propertyXid_123X_propertyXname_markoX:
[function({g}) { return
g.withoutStrategies(ReservedKeysVerificationStrategy).addV("person").property("id",
123).property("name", "marko") }],
+
g_withoutStrategiesXReservedKeysVerificationStrategyX_addVXpersonX_propertyXid_123X_propertyXname_markoX:
[function({g}) { return
g.withoutStrategies(ReservedKeysVerificationStrategy).addV("person").property("id",
123).property("name", "marko").values() }],
g_withStrategiesXSeedStrategyX_V: [function({g}) { return
g.withStrategies(new SeedStrategy({seed: 7})).V().coin(0.5) }],
g_withoutStrategiesXSeedStrategyX_V: [function({g}) { return
g.withoutStrategies(SeedStrategy).V() }],
g_withStrategiesXStandardVerificationStrategyX_V: [function({g}) { return
g.withStrategies(new StandardVerificationStrategy()).V() }],
diff --git
a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/integrated/ReservedKeysVerificationStrategy.feature
b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/integrated/ReservedKeysVerificationStrategy.feature
index 4a9f4cd28e..0eb6f23870 100644
---
a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/integrated/ReservedKeysVerificationStrategy.feature
+++
b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/integrated/ReservedKeysVerificationStrategy.feature
@@ -42,9 +42,10 @@ Feature: Step - ReservedKeysVerificationStrategy
Given the empty graph
And the traversal of
"""
-
g.withoutStrategies(ReservedKeysVerificationStrategy).addV("person").property("id",
123).property("name", "marko")
+
g.withoutStrategies(ReservedKeysVerificationStrategy).addV("person").property("id",
123).property("name", "marko").values()
"""
When iterated to list
Then the result should be unordered
| result |
- | v[marko] |
+ | marko |
+ | d[123].i |