Wednesday, 7 June 2017

access nested json using node js

I am a newbie for using either javascript and node js, I am developing chat bot on telegram. My .jar file gives the output in JSON. I find myself confused how to access or parse the JSON. I want to get the object's value

Here is my JSON example :

  {"head": {
    "vars": [ "s" , "name" , "synonims" ]
  } ,
  "results": {
    "bindings": [
      {
        "subject": { "type": "uri" , "value": "http://127.0.0.1:3333/haz/3" } ,
        "predicate": { "type": "literal" , "value": "Metaldehyde" } ,
        "object": { "type": "literal" , "value": "2,4,6,8-Tetramethyl-1,3,5,7-tetroxocane; Acetaldehyde, tetramer; Ariotox; Cekumeta; Corry's Slug Death; Halizan; Metacetaldehyde; Metaldehyd [German]; Metaldeide [Italian]; Metason; Slug-Tox; r-2,c-4,c-6,c-8-Tetramethyl-1,3,5,7-tetroxocane; 1,3,5,7-Tetroxocane, 2,4,6,8-tetramethyl-; 2,4,6,8-Tetramethyl-1,3,5,7-tetraoxacyclooctane; [ChemIDplus] UN1332" }
      }
    ]
  }
}



via user3610391

No comments:

Post a Comment