Step - property

property(key, value) sets a property on the incoming vertex or edge; the value can be a constant or a child traversal (its first result; no result leaves the property untouched). The key can be a jpath(..) (Path Keys), and property(Cardinality, key, value) and property(map) exist as well.

A key named id or label

property("id", ..) and property("label", ..) store ordinary properties; they never change the element's id or label (TinkerPop accepts these keys too). values("label"), by("label") and select("label") on an element_map() read such a property, label(), by(T.label) and select(T.label) the element's label. Where a map leaves the engine with both (an element_map() result in a table or as JSON), the property wins under "label". See Properties Named id or label.

g.V("1").property("label", "CUSTOM").project("p", "t").by("label").by(T.label).next()   // {"p": "CUSTOM", "t": "person"}

property(traversal, value)

The key is the first result of a child traversal run on the incoming traverser (TinkerPop's AddPropertyStep with a key traversal):

g.withSideEffect("a", "name").addV().property(__.select("a"), "marko").values("name")   // "marko"

The key must be a string; no result or another value is a cast error. The value may be a traversal too (property(__.select("k"), __.values("age"))).

Rust: property_key_by(key_traversal, value), property_key_by_traversal(key_traversal, value_traversal).