[
https://issues.apache.org/jira/browse/TINKERPOP-3187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18098329#comment-18098329
]
ASF GitHub Bot commented on TINKERPOP-3187:
-------------------------------------------
GumpacG opened a new pull request, #3550:
URL: https://github.com/apache/tinkerpop/pull/3550
## Summary
[TINKERPOP-3186](https://issues.apache.org/jira/browse/TINKERPOP-3186)
normalized `Element.properties` to a flat list in the JavaScript, Python, and
.NET drivers, which removed the convenient "properties keyed by name" map
view. This PR adds an
opt-in `propertyMap()` helper on the **Vertex** type in those three drivers
that restructures the
flat properties list into a map of `property key -> list of VertexProperty
objects` (the same
shape as the Gremlin `propertyMap()` step). The default flat-list
representation is unchanged.
Scope note: `gremlin-go` is intentionally **not** included. Go's
`Element.properties` was always a
flat list and was never part of the 3186 change, so it has no lost map view
for this ticket to
restore. Adding it to Go would be a new convenience without the ticket's
regression rationale, so
it is left out.
Vertex-only: only vertices can hold multiple properties under one key
(multi-properties), so the
list-per-key shape is meaningful only there. Edges and vertex-properties are
single-valued per key
and keep their existing single-property access.
## Changes
| GLV | Method | Returns |
|---|---|---|
| JavaScript | `vertex.propertyMap()` | plain (null-prototype) object `{
[key]: VertexProperty[] }` |
| Python | `vertex.property_map()` | `dict[str, list]` |
| .NET | `Vertex.PropertyMap()` | `Dictionary<string, List<VertexProperty>>`
|
## Before / After (JavaScript, `marko` vertex)
```js
v.properties // [ VertexProperty{key:'name',...},
VertexProperty{key:'age',...} ]
v.propertyMap() // { name: [ VertexProperty{...} ], age: [
VertexProperty{...} ] }
```
## Tests
Per-GLV unit tests: multi-property grouping, single-valued, and empty cases.
## Docs
- `docs/src/upgrade/release-3.8.2.asciidoc` - "Vertex propertyMap() Helper"
note under "Upgrading for Users".
- `CHANGELOG.asciidoc` - entry under the 3.8.2 section.
Assisted-by: Kiro: Claude Opus 4.8
> Add helper that restructures properties() to Map
> ------------------------------------------------
>
> Key: TINKERPOP-3187
> URL: https://issues.apache.org/jira/browse/TINKERPOP-3187
> Project: TinkerPop
> Issue Type: Improvement
> Components: structure
> Affects Versions: 3.7.4
> Reporter: Stephen Mallette
> Assignee: Stephen Mallette
> Priority: Major
>
> After TINKERPOP-3186 which gets rid of {{Map}} datatype for {{properties}}
> for javascript and go, it would be nice to give folks an easy way back to
> that convenience. Perhaps {{propertyMap}} along the same lines as the Gremlin
> step would be a good name.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)