在TinkerPop3.3.1中新加的功能是增加了addV,addE步骤。这些新的功能允许我们用遍历来决定新的顶点或边应当用什么标签。看下面的例子。我们在本书的最开始就见过这样的查询。它简单的告诉我们代表AUS机场的顶点有的是什么标签。
In TinkerPop 3.3.1 a new capability was added to the addV and addE steps. This new capability
allows us to use a traversal to determine what the label used by a new vertex or edge should be.
Take a look at the query below. We have seen this type of query used earlier in the book. It simply
tells us what label the vertex representing the Austin (AUS) airport has.

 Tinker pop3.3.1中新增加的功能允许我们把上面的的遍历放在一个addV步骤内,就像下面所示的这样。提供的遍历所返回的结果的第一个字符串将被用作是标签的名称。

What the new capability added in TinkerPop 3.3.1 allows us to do is include the traversal above
inside of an addV step as shown below. The first string result returned by the provided traversal
will be used as the label name. 

 我们可以使用valueMap步骤来检查新的顶点,从而确保我们的标签已被正确的赋予。

We can inspect the new vertex using valueMap to make sure that our label was correctly assigned.

 这些特性要求您所使用的图数据库系统支持Tinkerpop3.3.1或者以上的版本。

These features require that the graph database system you are using supports a
TinkerPop version of 3.3.1 or higher.
我们可以做一些相似的事动态的找出新的机场和AUS之间的边应该有的标签是什么。
We can now do something similar to dynamically work out what the label should be for an edge
between our new airport and Austin.

 在本书的后边我们将基于这些特概念来呈现如何使用一条查询语句将一个顶点的属性的键和值以及标签复制到一个新的顶点上。

Later in the book we will build upon these concepts to show how the property keys
and values from one vertex, as well as the label, can be copied into a new vertex
using a single query.
再一次,我们用valueMap步骤来确保新的边的标签是好的。
Once again, we can use a valueMap step to make sure our new edge label looks OK.

 

 

posted on 2022-04-22 11:17  bokeyuannicheng0000  阅读(8)  评论(0)    收藏  举报