예제 #1
0
        public void Should_Be_Able_To_Create_Vertex_With_MetaProperties()
        {
            var g = DseGraph.Traversal(Session);

            g.AddV("meta_v")
            .Property("meta_prop", "White Walkers", "sub_prop", "Dragonglass", "sub_prop2", "Valyrian steel")
            .Next();
            StatementClassicIntegrationTest.VerifyMetaProperties(Session, g, "White Walkers", "Dragonglass", "Valyrian steel");
            g.V().HasLabel("meta_v").Drop().Next();
        }
        public async Task Should_Execute_A_Traversal()
        {
            var g  = DseGraph.Traversal(Session);
            var rs = await Session.ExecuteGraphAsync(g.V().HasLabel("person").Has("name", P.Eq("marko")));

            var rsSync = Session.ExecuteGraph(g.V().HasLabel("person").Has("name", P.Eq("marko")));

            // The result should be DSE driver vertices
            StatementClassicIntegrationTest.VerifyGraphResultSet(rs);
            StatementClassicIntegrationTest.VerifyGraphResultSet(rsSync);
        }
        public void Should_Be_Able_To_Create_Vertex_With_MetaProperties()
        {
            var g    = DseGraph.Traversal(Session);
            var stmt = DseGraph.StatementFromTraversal(g.AddV("meta_v")
                                                       .Property("meta_prop", "What can kill a dragon", "sub_prop", "Qyburn's scorpion", "sub_prop2", "Another dragon"));

            Session.ExecuteGraph(stmt);
            StatementClassicIntegrationTest.VerifyMetaProperties(Session, g, "What can kill a dragon", "Qyburn's scorpion", "Another dragon");
            var dropstmt = DseGraph.StatementFromTraversal(g.V().HasLabel("meta_v").Drop());

            Session.ExecuteGraph(dropstmt);
        }
예제 #4
0
        public void Should_Be_Able_To_Create_Vertex_With_Multicardinality_Property()
        {
            var g = DseGraph.Traversal(Session);

            g.AddV("multi_v")
            .Property("multi_prop", "Hold")
            .Property("multi_prop", "the")
            .Property("multi_prop", "door")
            .Next();
            StatementClassicIntegrationTest.VerifyMultiCardinalityProperty(Session, g, new [] { "Hold", "the", "door" });
            g.V().HasLabel("multi_v").Drop().Next();
        }
        public void Should_Be_Able_To_Create_Vertex_With_Multicardinality_Property()
        {
            var g          = DseGraph.Traversal(Session);
            var direwolves = new[] { "Ghost", "Nymeria", "Shaggydog", "Grey Wind", "Lady" };
            var addVertext = g.AddV("multi_v");

            foreach (var t in direwolves)
            {
                addVertext = addVertext.Property("multi_prop", t);
            }
            var stmt = DseGraph.StatementFromTraversal(addVertext);

            Session.ExecuteGraph(stmt);
            StatementClassicIntegrationTest.VerifyMultiCardinalityProperty(Session, g, direwolves);
            g.V().HasLabel("multi_v").Drop().Next();
        }