From GraphQL to Cytoscape data format

214 views
Skip to first unread message

Johann Höchtl

unread,
Dec 1, 2016, 2:50:42 PM12/1/16
to cytoscape-helpdesk
I really do not want to double-post, but just in case this group is mostly inactive on Stackoverflow ... I have results from a Graph Database, results obtained through GraphQL and would like to visualize it using js.cytoscape.

http://stackoverflow.com/questions/40918996/convert-graphql-to-cytoscape-json

My question now is: How can I effectively convert from my GraphQL retrieved format

    {
       "application" : {
          "has-instance" : [
             {
                "has-table" : [
                   {
                      "has-column" : [
                         {
                            "refers-to-table" : {
                               "label" : "EINGANGHEADER"
                            },
                            "label" : "EINGANG_DAT"
                         },
                         {
                            "label" : "KANAL",
                            "refers-to-table" : {
                               "label" : "EINGANGHEADER"
                            }
                         }
                      ],
                      "label" : "VE_VKE_EINGANGHEADER"
                   },
                   {
                      "has-column" : [
                         {
                            "label" : "PRODUKT",
                            "refers-to-table" : {
                               "label" : "EINGANG"
                            }
                         },
                         {
                            "label" : "ERFASSUNG_TS",
                            "refers-to-table" : {
                               "label" : "EINGANGDATEN"
                            }
                         },
                         {
                            "label" : "ID",
                            "refers-to-table" : {
                               "label" : "EINGANG"
                            }
                         },
                         {
                            "label" : "WEITERLEITUNG_TS",
                            "refers-to-table" : {
                               "label" : "EINGANG"
                            }
                         }
                      ],
                      "label" : "VE_VKE_EINGANG"
                   }
                ],
                "label" : "VE"
             }
          ]
       }
    }


to the Cytoscape data format?

piet molenaar

unread,
Dec 2, 2016, 4:15:50 AM12/2/16
to cytoscape-helpdesk
Hi Johann,
It is the other way around, the cytoscape.js community answers questions from stackoverflow. This helpdesk is for the Cytoscape java application.
Cheers,
Piet

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpdesk+unsub...@googlegroups.com.
To post to this group, send email to cytoscape-helpdesk@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/d/optout.



--
Piet Molenaar
piet...@gmail.com
Department of Oncogenomics, M1-131
Academic Medical Center
University of Amsterdam
Meibergdreef 9
1105 AZ Amsterdam
the Netherlands

tel (+31) 20-5666592
fax (+31) 20-6918626

Johann Höchtl

unread,
Dec 2, 2016, 4:35:45 AM12/2/16
to cytoscape-helpdesk


Am Freitag, 2. Dezember 2016 10:15:50 UTC+1 schrieb Piet:
Hi Johann,
It is the other way around, the cytoscape.js community answers questions from stackoverflow. This helpdesk is for the Cytoscape java application.

I see. Is the JSON-format  accepted by the Cytoscape Desktop Application the same / very similar to what js.cytoscape accepts?

Cheers,
Piet

To post to this group, send email to cytoscape...@googlegroups.com.

piet molenaar

unread,
Dec 2, 2016, 4:42:57 AM12/2/16
to cytoscape-helpdesk
Yes, the json format can be imported into the Cytoscape desktop app. You can also save your session from Cytoscape desktop as a cytoscape.js web application.
 

Cheers,
Piet

To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpdesk+unsubscribe@googlegroups.com.
To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.
For more options, visit https://groups.google.com/d/optout.



--
Piet Molenaar
piet...@gmail.com

Department of Oncogenomics, M1-131
Academic Medical Center
University of Amsterdam
Meibergdreef 9
1105 AZ Amsterdam
the Netherlands

tel (+31) 20-5666592
fax (+31) 20-6918626

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpdesk+unsub...@googlegroups.com.
To post to this group, send email to cytoscape-helpdesk@googlegroups.com.

Kei

unread,
Dec 8, 2016, 12:17:26 PM12/8/16
to cytoscape-helpdesk
The minimal example of Cytoscape.js network is something like:

{
  data: {name: "network-name"},
  elements: {
    nodes: [],
    edges: []
  }

and you can add nodes:

{
  data: { id: "A"}
}

and edges:

{
  data: {source: "A", target: "B"}
}

so it should be easy to convert your data even if you have your data in other data format.

Kei

2016年12月2日金曜日 1時35分45秒 UTC-8 Johann Höchtl:
Reply all
Reply to author
Forward
0 new messages