title: d3.js forced layout graph: parse String to link-array
body: <p>I am referring to this example: <a href="http://bl.ocks.org/mbostock/1153292" rel="nofollow">http://bl.ocks.org/mbostock/1153292</a> ,
  specifically to these beautiful lines of code:</p>
  
  <pre><code>var links = [
    {source: "Microsoft", target: "Amazon", type: "licensing"},
    ...
    {source: "Nokia", target: "Qualcomm", type: "suit"}
  ];
  
  var nodes = {};
  
  // Compute the distinct nodes from the links.
  links.forEach(function(link) {
    link.source = nodes[link.source] || (nodes[link.source] = {name: link.source});
    link.target = nodes[link.target] || (nodes[link.target] = {name: link.target});
  });
  </code></pre>
  
  <p>I'd like to know what data format <strong>'var links'</strong> here has, and how I would parse the following java string (with essentially the same content)</p>
  
  <pre><code>String someLinks = "[{source: \"Microsoft\", target: ... }, ...]"
  </code></pre>
  
  <p>into something equal to the javascript <strong>'var links'</strong> above, from which I can then create the graph.</p>
  
  <p>I've tried </p>
  
  <pre><code>var links = JSON.parse( string ); 
  </code></pre>
  
  <p>But that doesn't do the job... <strong>'var links'</strong> doesn't seem to be JSON?
  EDIT: Or should I use a different java format, e.g. some kind of Array? (Doesn't have to be a String)</p>