You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Sam Adams (JIRA)" <ji...@apache.org> on 2018/10/01 17:36:00 UTC

[jira] [Commented] (TINKERPOP-2052) Adding GraphSONMapper to gremlin-javascript

    [ https://issues.apache.org/jira/browse/TINKERPOP-2052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16634372#comment-16634372 ] 

Sam Adams commented on TINKERPOP-2052:
--------------------------------------

Ran across an interesting side effect while looking for a workaround:

g.V(148082784.next()  => v[148082784]

g.V(148082784).as('v').select('v').next()  => v[148082784]

g.V(148082784).as('v').id().as('vid').select('v','vid').next()  =>
{noformat}
{
  "v": {
    "id": 148082784,
    "label": "education_record",
    "properties": {
      "_creation_time": [
        {
          "id": {
            "value": "56rrik-2g5xeo-20p1",
            "@class": "java.util.HashMap"
          },
          "label": "_creation_time",
          "value": "\"2018-09-18T14:13:48.533Z\"",
          "key": "_creation_time"
        }
      ],
      "course_number": [
        {
          "id": {
            "value": "56rr4c-2g5xeo-t8l",
            "@class": "java.util.HashMap"
          },
          "label": "course_number",
          "value": "unknown",
          "key": "course_number"
        }
      ],
      "description": [
        {
          "id": {
            "value": "56rrws-2g5xeo-u11",
            "@class": "java.util.HashMap"
          },
          "label": "description",
          "value": "",
          "key": "description"
        }
      ],
      "school_name": [
        {
          "id": {
            "value": "56rsb0-2g5xeo-uth",
            "@class": "java.util.HashMap"
          },
          "label": "school_name",
          "value": "unknown",
          "key": "school_name"
        }
      ],
      "id_ipeds": [
        {
          "id": {
            "value": "56rsp8-2g5xeo-vlx",
            "@class": "java.util.HashMap"
          },
          "label": "id_ipeds",
          "value": "126818",
          "key": "id_ipeds"
        }
      ],
      "_id": [
        {
          "id": {
            "value": "56rt3g-2g5xeo-pad",
            "@class": "java.util.HashMap"
          },
          "label": "_id",
          "value": "unknown",
          "key": "_id"
        }
      ],
      "source": [
        {
          "id": {
            "value": "56rtho-2g5xeo-10cl",
            "@class": "java.util.HashMap"
          },
          "label": "source",
          "value": "unknown",
          "key": "source"
        }
      ],
      "title": [
        {
          "id": {
            "value": "56rtvw-2g5xeo-wed",
            "@class": "java.util.HashMap"
          },
          "label": "title",
          "value": "unknown",
          "key": "title"
        }
      ],
      "url": [
        {
          "id": {
            "value": "56rua4-2g5xeo-x6t",
            "@class": "java.util.HashMap"
          },
          "label": "url",
          "value": "unknown",
          "key": "url"
        }
      ],
      "_label": [
        {
          "id": {
            "value": "56ruoc-2g5xeo-1151",
            "@class": "java.util.HashMap"
          },
          "label": "_label",
          "value": "unknown",
          "key": "_label"
        }
      ],
      "prereq": [
        {
          "id": {
            "value": "56rv2k-2g5xeo-xz9",
            "@class": "java.util.HashMap"
          },
          "label": "prereq",
          "value": "unknown",
          "key": "prereq"
        }
      ]
    }
  },
  "vid": 148082784
}{noformat}
Apparently there is a side effect is select() that selecting multiple variables impacts.

Good news is:  I have a functional workaround for the time being.  Still need a more general solution like GraphSONMapper to handle subgraphs and structures of graph elements

> Adding GraphSONMapper to gremlin-javascript
> -------------------------------------------
>
>                 Key: TINKERPOP-2052
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2052
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: io, javascript
>            Reporter: Sam Adams
>            Priority: Blocker
>
> Thanks [~jorgebg] for the excellent start on the GLV for javascript! Using it daily.
> Really need GraphSONMapper equivalent as my use cases need to retrieve and process graph elements and subgraphs as JSON.
> Any plans for adding this, or should I look for workarounds?
> I would imagine that we will also need this after we can submit scripts directly ala TINKERPOP-1959



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)