Skip to content

Standard Cytoscape JSON Models

dotasek edited this page Aug 11, 2017 · 15 revisions

This page lists the accepted JSON representations of the Cytoscape Application Data Model. Using these models when Cytoscape objects are returned from automation functions or commands constitutes a best practice.

CyIdentifiable.java

Implemented in CyNode, CyEdge, CyNetwork, CyTable, and CyRow.

SUIDFactory.java

Not a Data Model.

CyDisposable.java

Not useful in automation contexts. Applicable to Cytoscape internal implementations.

CyNode.java

CyNode as SUID List

[
   63,
   ...
]

CyNode as Single Object

{
  "data": {
    "id": 63,
    "SUID": 63,
    "shared name": "Node 1",
    "name": "Node 1",
    "selected": false,
    "int_column": 1
  }
}

CyEdge.java

CyEdges as an SUID List

[
   83,
   ...
]

CyEdge as Single Object

{
  "data": {
    "source": 62,
    "target": 63,
    "SUID": 83,
    "shared name": "Node 2 (interacts with) Node 1",
    "shared interaction": "interacts with",
    "name": "Node 2 (interacts with) Node 1",
    "selected": false,
    "interaction": "interacts with"
  }
}

CyNetwork.java

CyNetworks as an SUID list

[
   52,
   ...
]

CyNetwork as a Single Object

{
    "shared name": "Network",
    "name": "Network",
    "SUID": 52,
    "__Annotations": [
      ""
    ],
    "selected": true
  }```

### _CyNetwork as named SUID List_

Though a useful possibility, this is more of a convenience format.

```json
[
  {
    "name": "Network",
    "SUID": 52
  },
  ...
]

CyNetwork as cytoscape.js

See cytoscape.js

CyNetworkFactory.java

Not a Data Model.

CyNetworkManager.java

Not a Data Model.

CyNetworkTableManager.java

Not a Data Model.

CyTable.java

[
  ...
  {
    "SUID": 54,
    "title": "Network default network",
    "public": true,
    "mutable": "PERMANENTLY_IMMUTABLE",
    "primaryKey": "SUID",
    "rows": [
      {
        "shared name": "Network",
        "name": "Network",
        "SUID": 52,
        "__Annotations": [
          ""
        ],
        "selected": true
      }
    ]
  },
  ...
]

CyRow.java

[
  ...
  {
    "SUID": 63,
    "shared name": "Node 1",
    "name": "Node 1",
    "selected": true,
    "int_column": 1
  },
  ...
]

CyColumn.java

As a List of CyColumns

[
   {
      "name": "name",
      "type": "String",
      "immutable": true,
      "primaryKey": false
   },
   ...
]

As a Single Column

{
  "name": "name",
  "values": [
    "Node 2",
    "Node 1"
  ]
}

CyTableFactory.java

Not a Data Model.

CyTableManager.java

Not a Data Model.

CyTableMetadata.java

Could be useful to identify relationships between tables and networks. Unknown if useful to scripters.

CyTableUtil.java

Not a Data Model.

SavePolicy.java

Applicable to CyNetwork and CyTable. This could be useful to identify tables that won't be saved for automation scripters.

VirtualColumnInfo.java