The GraphSON representation has been kinda tough to figure out. While it
would be nice if it was consistent between vertex and edge, I'm not so sure
that will be so good. First of all, edge properties don't have
identifiers, so your edge properies would be left with:
{
"weight":[
{
"value":0.5
}
]
}
If you were looking for consistency you'd then also have to look at meta
properties on vertices as they technically are an Element so vertex goes to:
{
"name":[
{
"id":0,
"value":"marko"
"properties": [
"weight":[
{
"value":0.5
}
]
]
}
]
}
I kinda feel like type checking is better. Also, as it stands now, we
don't have the extra weight of the "value" property key when its not really
needed. Not sure how other folks feel.
On Sat, May 23, 2015 at 4:00 PM, Dylan Millikin <[email protected]>
wrote:
> I did a bit of homework and I see where this stems from. With that said,
> even vertex properties with a cardinality of single will display in the
> above manner. It would be nice to have edge properties also format like
> this in GraphSON. Even if there is no gain from doing so it means we can
> handle data coming from gremlin-server with a baseElement class and not
> worry about having to override property reading methods per element type.
> (Which is what I'm currently setting up and going to use)
> I don't know if this has too many implications, or if it's an option at
> all. Thought I would throw it out as a suggestion.
>
> On Sat, May 23, 2015 at 1:13 PM, Dylan Millikin <[email protected]>
> wrote:
>
> > Hey,
> >
> > Are these elements handled differently? It would be really nice to get
> > consistent formatting of properties across both edge and vertex elements
> in
> > GraphSON.
> >
> > As a reminder the current format will display edge properties as:
> >
> > {
> > "weight": 0.5
> > }
> >
> > and vertex properties as:
> >
> > {
> > "name":[
> > {
> > "id":0,
> > "value":"marko"
> > }
> > ]
> > }
> >
> > Best,
> > Dylan.
> >
> >
>