コード例 #1
0
 public void CreateRelation(NEO.NEORSTRelation Relation, NEO.NEORSTNode Parent, NEO.NEORSTNode Child, IGraphClient client)
 {
     client.Cypher
     .Match("(a:RSTNode)", "(b:RSTNode)")
     .Where((RSTNode a) => a.name == Parent.name)
     .AndWhere((RSTNode b) => b.name == Child.name)
     .CreateUnique(string.Format("(a)-[r:RSTRelation {{ kind: '{0}'}}]->(b)", Relation.relation))
     .ExecuteWithoutResults();
 }
コード例 #2
0
 public NEORSTNode(RSTNode Node)
 {
     this.edu       = Node.edu;
     this.form      = Node.form;
     this.text      = Node.text;
     this.weight    = Node.Weight;
     this.relation  = Node.relation;
     this.leaf      = Node.leaf;
     this.Relations = new List <NEORSTRelation>();
     foreach (var item in Node.Children)
     {
         var rel = new NEORSTRelation();
         rel.relation = item.type.ToString();
         rel.Child    = new NEORSTNode(item);
         this.Relations.Add(rel);
     }
 }