title: how to read graph-domain attributes with boost::read_graphml?
body: <p>Probably a silly question, but I can't find any answer online. My application reads a topology from a custom file and builds a boost::graph out of it. I'm in the process of moving to a more standard graphml representation. I can read/write node properties using a vertex_descriptor as a key, and similarly I can use an edge_descriptor for edge attributes, but what about graph attributes? To which key type will they be associated when they are read in the graphml file?</p>
  
  <p>To explain my doubt, here's the code I have to define the graph and read the graphml file:</p>
  
  <pre><code>struct NetworkNode {
    int ponCustomers;
    int asid;
  }; //bundled property map for nodes
  
  struct NetworkEdge {
    int length;
    Capacity maxCapacity;
    Capacity spareCapacity;
    std::set&lt;Flow*&gt; activeFlows;
    Capacity peakCapacity;
  }; //bundled property map for edges
  
  typedef boost::adjacency_list&lt;boost::vecS, boost::vecS, boost::directedS, 
      NetworkNode, NetworkEdge&gt; DGraph;
  typedef DGraph::vertex_descriptor Vertex;
  [...]
  DGraph topology;
  boost::dynamic_properties dp;
  dp.property("asid", boost::get(&amp;NetworkNode::asid, topology));
  dp.property("ponCustomers", boost::get(&amp;NetworkNode::ponCustomers, topology));
  dp.property("length", boost::get(&amp;NetworkEdge::length, topology));
  dp.property("maxCapacity", boost::get(&amp;NetworkEdge::maxCapacity, topology));
  dp.property("spareCapacity", boost::get(&amp;NetworkEdge::spareCapacity, topology));
  dp.property("peakCapacity", boost::get(&amp;NetworkEdge::peakCapacity, topology));    
  std::map&lt;Vertex, int&gt; avgUsersMap;
  boost::associative_property_map&lt;std::map&lt;Vertex, int&gt; &gt;
      avgUsersPMap(avgUsersMap);
  dp.property("avgUsers", avgUsersPMap);
  [...]
  try {
    boost::read_graphml(stream, this-&gt;topology, dp);
  } catch [...]
  </code></pre>
  
  <p>Notice how I create new associative maps to store properties that are useful for the definition of the graph (e.g. when I build it) but not worth storing in every single node/edge for the entire graph lifetime. Now, some of these properties are related to the entire graph; for example I could define in the graphml file something like</p>
  
  <pre><code>&lt;key id="name" for="graph" attr.name="graphName" attr.type="string" /&gt;
  </code></pre>
  
  <p>How do I define the required property_map and add it to dp so that this bit of information will be parsed correctly?</p>