public static IConfigurableGremlinQuerySource WithCosmosDbRemote(this IConfigurableGremlinQuerySource source, string hostname, string database, string graphName, string authKey, int port = 443)
 {
     return source.WithExecutor(
         new WebSocketGremlinQueryExecutor<CosmosDbGroovyGremlinQueryElementVisitor>(
             new CosmosDbGremlinClient(
                 new CosmosDbGremlinServer(hostname, database, graphName, authKey, port)),
             new CosmosDbGraphsonSerializerFactory(),
             source.Logger));
 }
Esempio n. 2
0
 public static IConfigurableGremlinQuerySource WithRemote(this IConfigurableGremlinQuerySource source, GremlinServer server, GraphsonVersion graphsonVersion)
 {
     return(source.WithExecutor(
                new WebSocketGremlinQueryExecutor <GroovyGremlinQueryElementVisitor>(
                    new GremlinClientEx(
                        server,
                        graphsonVersion),
                    new DefaultGraphsonSerializerFactory(),
                    source.Logger)));
 }
Esempio n. 3
0
        public async Task GraphSon3ReferenceVertex()
        {
            var array = await _g
                        .WithExecutor(new TestJsonQueryExecutor(Graphson3ReferenceVertex))
                        .V()
                        .Cast <JObject>()
                        .ToArrayAsync();

            array.Should().HaveCount(1);
            array[0]["id"].ToObject <int>().Should().Be(1);
            array[0]["label"].ToObject <string>().Should().Be("person");
            array[0]["name"].ToObject <string[]>(new GraphsonJsonSerializer(GremlinQueryEnvironment.Default)).Should().BeEquivalentTo("marko");
            array[0]["location"].ToObject <string[]>(new GraphsonJsonSerializer(GremlinQueryEnvironment.Default)).Should().BeEquivalentTo("san diego", "santa cruz", "brussels", "santa fe");
        }