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"))))));
 }
Beispiel #3
0
 public static string CompileQuery(this GremlinQuery query)
 {
     return(query.CompileQuery());
 }
Beispiel #4
0
 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)})"));
 }
Beispiel #6
0
 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()"));
 }
Beispiel #13
0
 internal GremlinEdgeQuery(GremlinQuery baseQuery) : base(baseQuery, null)
 {
 }
Beispiel #14
0
 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");
            }