Package

org.opencypher.spark

web

Permalink

package web

Visibility
  1. Public
  2. All

Type Members

  1. trait JsonSerialiser extends AnyRef

    Permalink

Value Members

  1. object CAPSJsonSerialiser extends JsonSerialiser

    Permalink

    Serialises CAPSRecords to a JSON string.

    Serialises CAPSRecords to a JSON string. The format is as follows:

    {
      "columns" : [ "key" ]   // array of columns
      "rows" : [              // array of rows
        {                     // each row is an object
          "key" : "value"     // each cell is a tuple
        }
      ]
    }

    CAPSGraphs are serialized in the following format:

    {
      "nodes" : [ LIST_OF_NODES ]   // array of nodes
      "edges" : [ LIST_OF_EDGES ]   // array of relationships
      "labels": [ "Person", "Book"] // each label present in the graph
      "types": [ "KNOWS", "READS"]  // each relationship type present in the graph
    }

    The format of scalar values follows the format of org.opencypher.okapi.api.value.CypherValue.CypherValue#toString. The format of nodes is as follows:

    "n" : {
      "id" : 0,           // id is an integer
      "labels" : [        // labels is an array of strings
        "A",
        "B"
      ],
      "properties" : {    // properties is an object
        "key" : "value",  // key-value is a tuple
        "foo" : bar
      }
    }

    The format of relationships is as follows:

    "n" : {
      "id" : 0,           // id is an integer
      "source" : 0,       // id of source node
      "target" : 0,       // id of target node
      "type" : "T"        // relationship type is a string
      "properties" : {    // properties is an object
        "key" : "value",  // key-value is a tuple
        "foo" : bar
      }
    }

Ungrouped