biolink/kgx

Edge attribute JSON is stringified

maximusunc opened this issue · 0 comments

Describe the bug
I would like to upload JSON to a neo4j DB via KGX with nested objects as edge attributes. When I upload via the kgx neo4j-upload cli, the edge is added, but the attribute is stringified.

To Reproduce
Here's a sample json I'm uploading:

{
  "nodes": [
    {
      "id": "EFO:0000246",
      "name": "age",
      "category": [
        "biolink:NamedThing",
        "biolink:BiologicalEntity",
        "biolink:ThingWithTaxon",
        "biolink:Entity",
        "biolink:DiseaseOrPhenotypicFeature",
        "biolink:PhenotypicFeature"
      ],
      "equivalent_identifiers": [
        "EFO:0000246"
      ]
    },
    {
      "id": "NCIT:C138901",
      "name": "Body Mass Index Finding",
      "category": [
        "biolink:NamedThing",
        "biolink:BiologicalEntity",
        "biolink:ThingWithTaxon",
        "biolink:Entity",
        "biolink:DiseaseOrPhenotypicFeature",
        "biolink:PhenotypicFeature"
      ],
      "equivalent_identifiers": [
        "NCIT:C138901",
        "UMLS:C0578022",
        "SNOMEDCT:301331008"
      ]
    }
  ],
  "edges": [
    {
      "id": "e0",
      "subject": "EFO:0000246",
      "predicate": "biolink:related_to",
      "object": "NCIT:C138901",
      "biolink:original_knowledge_source": "infores:icees-kg",
      "contingency:matrices": [
        {
          "feature_matrix": [
            [
              {
                "frequency": 0.0,
                "row_percentage": 0.0,
                "col_percentage": 0.0,
                "total_percentage": 0.0
              }
            ]
          ],
          "total": 60.0,
          "chi_squared": 13.104376458650128,
          "p_value": 0.5942361353626833
        }
      ]
    }
  ]
}

Expected behavior
I expect the uploaded edge to have an attribute containing the nested object as JSON and not a string.

Code snippets
kgx neo4j-upload --uri bolt://localhost:7687 --username XXX --password XXX --input-format json ./json_file.json