Opened 10 years ago

Closed 10 years ago

#7016 closed Bugs (fixed)

"graphml" value for the "for" attribute of a key shouldn't throw an exception

Reported by: Guillaume Ansanay-Alex <guillaume.ansanay@…> Owned by: Jeremiah Willcock
Milestone: To Be Determined Component: graph
Version: Boost 1.49.0 Severity: Problem
Keywords: Cc:

Description

The GraphML specification (http://graphml.graphdrawing.org/xmlns/1.1/graphml-structure.xsd) states that the possible values for the "for" attribute of a key are "all", "graphml", "graph", "node", "edge", "hyperedge", "port" and "endpoint".

(Actually the "graphml" value is absent from the documentation of the scheme, but present as a possible value in the .xsd file. I have sent an e-mail to the authors of the specification, mentioning this ambiguity.)

If the value is "graphml", the graphml reader in BGL throws an exception : "Attribute for is not valid: graphml".

This value should be added to the ones accepted by the BGL reader, otherwise files such as those produced by the yEd graph editor cannot be read.

Change History (3)

comment:1 by Jeremiah Willcock, 10 years ago

What are the semantics for graphml when it is used as the value of for? I don't see it mentioned anywhere in the spec or in the yFiles documentation other than as just a possible option. How does yEd use for="graphml"?

comment:2 by Will Plano, 10 years ago

I've just come across this defect, also while trying to parse a yEd file.

According to the documentation at graphml.graphdrawing.org/specification/schema_element.xsd.htm the for="graphml" key attribute is for data associated with "the whole collection of graphs described by the content of <graphml>" Since read_graphml only deals with a single graph in the file, I beleive it is correct to silently ignore this section.

As for how yEd uses it, it looks like it's for shared resources within the file...

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
...
snip schema definitions for spam filter
...
  <!--Created by yFiles for Java 2.10-->
  <key for="graphml" id="d0" yfiles.type="resources"/>
...
snip
...
  <data key="d0">
    <y:Resources/>
  </data>
</graphml>

see the attached patch on the duplicate ticket 7155

comment:3 by Jeremiah Willcock, 10 years ago

Resolution: fixed
Status: newclosed

(In [83961]) Applied patch from #7155 to add "graphml" as a value for "for"; fixes #7155; fixes #7016

Note: See TracTickets for help on using tickets.