Skip to content

Instantly share code, notes, and snippets.

@jbmusso
Last active February 28, 2016 20:11
Show Gist options
  • Save jbmusso/e6cabc21486e78f89580 to your computer and use it in GitHub Desktop.
Save jbmusso/e6cabc21486e78f89580 to your computer and use it in GitHub Desktop.

Vertices

Current format

{
  "id": 1,
  "label": "vertex",
  "type": "vertex",
  "properties": {
    "name": [
      {
        "id": 0,
        "value": "marko"
      }
    ],
    "age": [
      {
        "id": 2,
        "value": 29
      }
    ]
  }
}

Proposal #1

{
  "_id": 1,
  "_label": "vertex",
  "_type": "vertex",
  "name": ["marko"],
  "age": 29
}

Proposal #2

{
  "id": 1,
  "label": "vertex",
  "type": "vertex",
  "properties": {
    "name": ["marko"],
    "age": 29
  }
}

Proposal #3

{
  "meta": {
    "id": 1,
    "label": "vertex",
    "type": "vertex",
  },
  "properties": {
    "name": ["marko"],
    "age": 29
  }
}

Edges

Current format

{
  "id": 7,
  "label": "knows",
  "type": "edge",
  "inVLabel": "vertex",
  "outVLabel": "vertex",
  "inV": 2,
  "outV": 1,
  "properties": {
    "weight": 0.5
  }
}

Proposal #1

{
  "_id": 7,
  "_label": "knows",
  "_type": "edge",
  "_inV": {
    "_label": "vertex",
    "_id": 2
  },
  "_outV": {
    "_label": "vertex",
    "_id": 1
  },
  "weight": 0.5
}

Proposal #2

{
  "id": 7,
  "inV": {
    "label": "vertex",
    "id": 2
  },
  "outV": {
    "label": "vertex",
    "id": 1
  },
  "label": "knows",
  "type": "edge",
  "properties": {
    "weight": 0.5
  }
}

###Proposal #3

{
  "meta": {
    "id": 7,
    "inV": {
      "label": "vertex",
      "id": 2
    },
    "outV": {
      "label": "vertex",
      "id": 1
    },
    "label": "knows",
    "type": "edge"
  },
  "properties": {
    "weight": 0.5
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment