コード例 #1
0
        public void SubgraphWithDifferentKeys()
        {
            using (GraphViewCommand command = new GraphViewCommand(graphConnection))
            {
                command.CommandText =
                    "g.V().outE('knows').subgraph('knowsG').inV().outE('created').subgraph('createdG').inV().inE('created').subgraph('createdG')";
                var result = command.ExecuteAndGetResults();

                Assert.AreEqual(result.Count, 4);
            }
        }
コード例 #2
0
        public void SubgraphInRepeat()
        {
            using (GraphViewCommand command = new GraphViewCommand(graphConnection))
            {
                command.CommandText =
                    "g.V().has('name', 'lop').repeat(__.inE().subgraph('subGraph').outV()).times(3).cap('subGraph')";
                var subGraphSON = command.ExecuteAndGetResults()[0];
                var subGraph    = JArray.Parse(subGraphSON);

                Assert.AreEqual(subGraph.Count, 4);
            }
        }
コード例 #3
0
        public void SubgraphAggregation()
        {
            using (GraphViewCommand command = new GraphViewCommand(graphConnection))
            {
                command.OutputFormat = OutputFormat.GraphSON;
                var originGraphSON = command.g().V().Next()[0];
                command.OutputFormat = OutputFormat.Regular;
                command.CommandText  =
                    "g.E().hasLabel('created').subgraph('sg').bothV().bothE().subgraph('sg').cap('sg')";
                var subGraphSON = command.ExecuteAndGetResults()[0];

                var originGraph = JToken.Parse(originGraphSON);
                var subGraph    = JToken.Parse(subGraphSON);

                Assert.IsTrue(JToken.DeepEquals(originGraph, subGraph));
            }
        }