Object

org.opencypher.spark.web

CAPSJsonSerialiser

Related Doc: package web

Permalink

object CAPSJsonSerialiser extends JsonSerialiser

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
  }
}
Linear Supertypes
JsonSerialiser, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CAPSJsonSerialiser
  2. JsonSerialiser
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def constructValue(cv: CypherValue): Json

    Permalink
    Attributes
    protected
    Definition Classes
    JsonSerialiser
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def formatGraph(graph: CAPSGraph, nodes: Seq[Json], rels: Seq[Json]): Json

    Permalink
    Attributes
    protected
    Definition Classes
    JsonSerialiser
  11. def formatNode(id: Long, labels: Set[String], properties: Map[String, Json]): Json

    Permalink
    Attributes
    protected
    Definition Classes
    JsonSerialiser
  12. def formatRel(id: Long, source: Long, target: Long, typ: String, properties: Map[String, Json]): Json

    Permalink
    Attributes
    protected
    Definition Classes
    JsonSerialiser
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. implicit val graphEncoder: Encoder[CAPSGraph]

    Permalink
    Definition Classes
    JsonSerialiser
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. implicit val recordsEncoder: Encoder[CAPSRecords]

    Permalink
    Definition Classes
    JsonSerialiser
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  22. def toJsonString(graph: CAPSGraph): String

    Permalink
    Definition Classes
    JsonSerialiser
  23. def toJsonString(records: CAPSRecords): String

    Permalink
    Definition Classes
    JsonSerialiser
  24. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from JsonSerialiser

Inherited from AnyRef

Inherited from Any

Ungrouped