forked from orientechnologies/orientdb
-
Notifications
You must be signed in to change notification settings - Fork 0
SQL Delete Edge
Kazunobu Yamaguchi edited this page Aug 16, 2014
·
9 revisions
このコマンドはデータベースからリレーションを削除します. このコマンドはグラフに対して使用します. "Delete edge" は"in" and "out" verticesの両方の頂点の相互参照している全てを削除することに注意してください.
DELETE EDGE <rid>|FROM <rid>|TO <rid>|[<class>] [WHERE <conditions>]> [LIMIT <MaxRecords>]
WHERE 句は他のSQLと同じものが使用できます.
- 1.1: 最初のバージョン
- starting from v.1.4 the command uses the Blueprints API under the hood, so if you're working in Java using the OGraphDatabase API you could experience in some difference how edges are managed. To force the command to work with the "old" API change the GraphDB settings described in Graph backward compatibility
二つのノードの間で 日付のプロパティをもつリレーションを削除:
DELETE EDGE from #11:101 TO #11:117 Where date >= "2012-01-15"
リレーションのクラスでフィルタリングしたリレーションを削除:
DELETE EDGE FROM #11:101 TO #11:117 WHERE @class = 'owns' and comment like "regex of forbidden words"
これは DELETE EDGE WHERE @class = 'owns' and date < "2011-11"
より高速な代替方法です:
DELETE EDGE Owns WHERE date < "2011-11"
in.price が 'to vertex' のリレーションの条件となっているリレーションを削除
DELETE EDGE Owns WHERE date < "2011-11" and in.price >= 202.43
#Java によるリレーションの削除:
User が company をフォローする場合はUser と companyの間にfollowCompany と CompanyFollowedByクラスを作成します
node1 is User node,
node2 is company node
OGraphDatabase rawGraph = orientGraph.getRawGraph();
String[] arg={"followCompany,"CompanyFollowedBy"};
Set<OIdentifiable> edges=rawGraph.getEdgesBetweenVertexes(node1, node2,null,arg);
for (OIdentifiable oIdentifiable : edges) {
**rawGraph.removeEdge(oIdentifiable);
}
Home - Download - Install - Upgrade - Professional Support - Courses - Team
- Copyright (C) Orient Technologies - All rights reserved.