public static IGremlinQuery <Unit> Create(string graphName = "g") { return(GremlinQuery <Unit> .Create(graphName)); }
private static IEnumerable <IGremlinQuery <string> > CreateEdgeIndexQueries(this IDseGraphModel model, IIdentifierFactory identifierFactory) { return(model.EdgeIndexes.Keys .SelectMany(edgeType => model .GetDerivedTypes(edgeType, true) .Where(inheritedType => !inheritedType.GetTypeInfo().IsAbstract) .SelectMany(inheritedType => model .EdgeIndexes[inheritedType] .Where(index => index.direction != EdgeDirection.None) .SelectMany(index => model .GetDerivedTypes(index.vertexType, true) .Where(inheritedVertexType => !inheritedVertexType.GetTypeInfo().IsAbstract) .Select(inheritedVertexType => GremlinQuery .Create("schema") .AddStep <string>("vertexLabel", model.GetLabelOfType(inheritedVertexType)) .AddStep <string>("index", identifierFactory.CreateIndexName()) .AddStep <string>( index.direction == EdgeDirection.Out ? "outE" : index.direction == EdgeDirection.In ? "inE" : "bothE", model.GetLabelOfType(edgeType)) .AddStep <string>("by", ((index.indexExpression as LambdaExpression)?.Body.StripConvert() as MemberExpression)?.Member.Name) .AddStep <string>("add")))))); }
public static string CompileQuery(this GremlinQuery query) { return(query.CompileQuery()); }
internal ComposedGremlinQuery(GremlinQuery queryBase, string query) : base(queryBase._connector, query) { _queryBase = queryBase; }
public static GremlinQuery E(this GremlinQuery queryBase, string edgeLabel) { return(new ComposedGremlinQuery(queryBase, $"E({queryBase.ComposeParameter(edgeLabel)})")); }
internal PredicateGremlinQuery(GremlinQuery <T> query) : base(query) { }
public static GremlinQuery OtherV(this GremlinQuery queryBase) { return(new ComposedGremlinQuery(queryBase, $"otherV()")); }
public static GremlinQuery SubGraph(this GremlinQuery queryBase, string graphLabel) { return(new ComposedGremlinQuery(queryBase, $"subgraph({queryBase.ComposeParameter(graphLabel)})")); }
public static GremlinQuery PageRank(this GremlinQuery queryBase) { return(new ComposedGremlinQuery(queryBase, $"pageRank()")); }
public static GremlinQuery BothE(this GremlinQuery queryBase, params string[] names) { return(queryBase.Params("bothE", names)); }
public static GremlinQuery Out(this GremlinQuery queryBase, params string[] names) { return(queryBase.Params("out", names)); }
public static GremlinQuery E(this GremlinQuery queryBase) { return(new ComposedGremlinQuery(queryBase, $"E()")); }
internal GremlinEdgeQuery(GremlinQuery baseQuery) : base(baseQuery, null) { }
internal GremlinEdgeQuery(GremlinQuery baseQuery, string query) : base(baseQuery, query) { }
public DseGraphNativeQueryProvider(IDseSession session) { this._session = session; this.TraversalSource = GremlinQuery.Create((this._session.Cluster as IDseCluster)?.Configuration.GraphOptions.Source ?? "g"); }