graphexp icon indicating copy to clipboard operation
graphexp copied to clipboard

Is it possible to load a local graphSON file to this software?

Open texzone opened this issue 6 years ago • 4 comments

The point of this issue is to offer to me, and perhaps others, some guide as to how to load data into this. Let us assume a have a graph.json file that has contents as such:

{
    "mode":"EXTENDED",
    "vertices": [
        {
            "name": {
                "type": "string",
                "value": "lop"
            },
            "lang": {
                "type": "string",
                "value": "java"
            },
            "_id": "3",
            "_type": "vertex"
        },
        {
            "name": {
                "type": "string",
                "value": "vadas"
            },
            "age": {
                "type": "integer",
                "value": 27
            },
            "_id": "2",
            "_type": "vertex"
        },
        {
            "name": {
                "type": "string",
                "value": "marko"
            },
            "age": {
                "type": "integer",
                "value": 29
            },
            "_id": "1",
            "_type": "vertex"
        },
        {
            "name": {
                "type": "string",
                "value": "peter"
            },
            "age": {
                "type": "integer",
                "value": 35
            },
            "_id": "6",
            "_type": "vertex"
        },
        {
            "name": {
                "type": "string",
                "value": "ripple"
            },
            "lang": {
                "type": "string",
                "value": "java"
            },
            "_id": "5",
            "_type": "vertex"
        },
        {
            "name": {
                "type": "string",
                "value": "josh"
            },
            "age": {
                "type": "integer",
                "value": 32
            },
            "_id": "4",
            "_type": "vertex"
        }
    ],
    "edges": [
        {
            "weight": {
                "type": "float",
                "value": 1
            },
            "_id": "10",
            "_type": "edge",
            "_outV": "4",
            "_inV": "5",
            "_label": "created"
        },
        {
            "weight": {
                "type": "float",
                "value": 0.5
            },
            "_id": "7",
            "_type": "edge",
            "_outV": "1",
            "_inV": "2",
            "_label": "knows"
        },
        {
            "weight": {
                "type": "float",
                "value": 0.4000000059604645
            },
            "_id": "9",
            "_type": "edge",
            "_outV": "1",
            "_inV": "3",
            "_label": "created"
        },
        {
            "weight": {
                "type": "float",
                "value": 1
            },
            "_id": "8",
            "_type": "edge",
            "_outV": "1",
            "_inV": "4",
            "_label": "knows"
        },
        {
            "weight": {
                "type": "float",
                "value": 0.4000000059604645
            },
            "_id": "11",
            "_type": "edge",
            "_outV": "4",
            "_inV": "3",
            "_label": "created"
        },
        {
            "weight": {
                "type": "float",
                "value": 0.20000000298023224
            },
            "_id": "12",
            "_type": "edge",
            "_outV": "6",
            "_inV": "3",
            "_label": "created"
        }
    ]
}

If I wanted to load this file onto the graph, there seems to be two general options available:

  1. Load this file locally somehow (through a file explorer, etc). This does NOT seem to be an available option.

  2. Send this file through the gremlin server. I saw the commands used for docker with the demo graph, but I have no idea how the graphSON file was... "dockerized".

Essentially, what I am asking is, if I wanted to send this file above to the graph, what is the simplest way to do so?

texzone avatar Sep 23 '19 22:09 texzone

@bricaud

texzone avatar Sep 23 '19 22:09 texzone

No, it is not possible at the moment. It could be adapted but I do not have the time for that. If you want to contribute you are welcome.

bricaud avatar Sep 24 '19 05:09 bricaud

Would it be as simple a change as changing how we receive the json info? So, instead of receiving some json data from the gremlin server, we just load up the entire json file? I imagine some other parts would have to change to, since the script doesn’t seem to be loading the entire json data, just specific parts. Or is it way more complicated?

texzone avatar Sep 24 '19 05:09 texzone

To explore a graph in a json file there are already some tools available, like Gephi or sigma.js if you want to code in javascript. It will be faster for you than creating a pluggin for Graphexp. That is also why I did not develop anything to handle json.

bricaud avatar Sep 25 '19 17:09 bricaud