← Revision 14 as of 2009-02-12 01:03:36
4018
Comment: converted to 1.6 markup
|
← Revision 15 as of 2012-03-03 00:39:39
5875
|
Deletions are marked like this. | Additions are marked like this. |
Line 57: | Line 57: |
=== Example === The example below describes a small graph in xgmml which contains a sub-graph and will import successfully into '''Cytoscape v2.8.2''' with '''metaNodePlugin2 v1.6''' loaded {{{ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <graph label="small metanode example" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cy="http://www.cytoscape.org" xmlns="http://www.cs.rpi.edu/XGMML" directed="1"> <node label="B" id="1"></node> <node label="A" id="2"></node> <node label="M" id="10"> <att type="string" name="__groupViewer" value="metaNode"/> <att> <graph> <node label="D" id="8"></node> <node label="E" id="9"></node> <node label="C" id="7"></node> <edge label="D-E" source="8" target="9"> <att name="weight" type="integer" value="4"/> </edge> <edge label="E-C" source="9" target="7"></edge> <edge label="C-D" source="7" target="8"></edge> </graph> </att> </node> <edge label="A-B" source="2" target="1"></edge> <edge label="A-E" source="2" target="9"></edge> </graph> }}} please note that: * every <graph>, <node> and <edge> element '''must''' contain a ''label'' attribute. Failure to do so will result in a null-pointer error during the import. * all of the ''xmsns'' attributes in the root <graph> element '''must''' be present * the <node> containing the sub-graph '''must''' contain <att type="string" name=" groupViewer" value="metaNode"/> as shown in the example (note the 2 underline characters) * including data associated with <graph>, <node> and <edge> elements requires an <att> element with the attributes ''name'', ''type'' and ''value'' as shown |
How Metanodes Are Stored In An XGMML File?
(Under construction)
There are three types of nodes in Cytoscape XGMML files.
- Base Node - node without children.
- Meta Node - node which has at least one child.
- Node Reference - pointer to actual node data structure.
Base Node
<node id="GAL80" label="GAL80" name="base"> <att value="GAL80" name="commonName"/> <att value="GAL80 " name="ALIASES"/> <att value="GAL80" name="canonicalName"/> <att value="Saccharomyces cerevisiae" name="species"/> <graphics fill="#00ff00" outline="#000000" h="30.0" w="50.0" x="199.5" y="-53.5" type="rectangle"/> </node>
A Base Node is a node which has no internal structure. This type of entry has the following members.
ID - ID of the node. Must be unique.
Label - Label of the node.
Name - Type of the node. Base, metaNode or reference. This is a bit confusing, but in XGMML standard, type attribute is used as XLink (XML Linking Language). So name is used to repredent node type in Cytoscape.
Attributes - Arbitrary number of user attributes.
Graphics - Graphical information, such as node shape, size, etc.
Metanode
(The example below does not have edges. Will be updated shortly.)
<node id="MetaNode_-14" label="MetaNode_-14" name="metaNode"> <att value="GAL80,GAL4,GAL6" name="commonName"/> <att name="ALIASES"/> <att value="MetaNode_-14" name="canonicalName"/> <att value="Saccharomyces cerevisiae" name="species"/> <att name="metanodeChildren"> <graph> <node id="GAL80" label="GAL80" name="reference"/> <node id="GAL4" label="GAL4" name="reference"/> <node id="MetaNode_-16" label="MetaNode_-16" name="reference"/> </graph> </att> <graphics fill="#ffffff" outline="#000000" h="75.6939756606048" w="75.6939756606048" x="227.33333418100946" y="-12.666665818990552" type="rectangle"/> </node>
Most of the part is the same as base nodes. The difference is, metanode always has a subgraph, which contains child nodes and edges. To avoid redundancy, nodes and edges in metanodes are references to the actual XML data element. Also, metanode can have metanodes as children.
ScooterMorris 04-05-06: This is a good start, and very exciting to see, but I have a number of problems, particularly from the standpoint of being able to read a "normal" XGMML file into Cytoscape:
First, while type is, indeed part of XLink, within the context of an XGMML document, it must be preceded by its own namespace (e.g. xlink:type), so there will never be any confusion. Further, the spec specifically states that type is used for the type of an attribute. , so you should definitely use it in that context.
As far as node type I don't really see a need for typing nodes as you have currently done. A metaNode node should be defined exclusively as the result of containing a <graph> element. If a node contains a <graph> then it must be a metaNode. Indeed, any XGMML graph generator will not provide the extra name attribute, which will cause your reader to incorrectly convert the file to a Cytoscape network. References can be handled cleanly using XLink within the document (e.g. xlink:href="#GAL80").
The XGMML reader must be able to handle hierarchies -- a <node> might contain a <graph> which contains <node>s which might contain <graph>s, etc. This will be critical for our application, and any XGMML generator will certainly assume that will be the case. You will also need to be able to handle "real" nodes embedded within an embedded <graph>. Its not clear how your current implementation handles this.
Be careful with your use of id in your example. ID must always be unique in any DOM-compliant XML language, but doesn't always have to be present.
Example
The example below describes a small graph in xgmml which contains a sub-graph and will import successfully into Cytoscape v2.8.2 with metaNodePlugin2 v1.6 loaded
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <graph label="small metanode example" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cy="http://www.cytoscape.org" xmlns="http://www.cs.rpi.edu/XGMML" directed="1"> <node label="B" id="1"></node> <node label="A" id="2"></node> <node label="M" id="10"> <att type="string" name="__groupViewer" value="metaNode"/> <att> <graph> <node label="D" id="8"></node> <node label="E" id="9"></node> <node label="C" id="7"></node> <edge label="D-E" source="8" target="9"> <att name="weight" type="integer" value="4"/> </edge> <edge label="E-C" source="9" target="7"></edge> <edge label="C-D" source="7" target="8"></edge> </graph> </att> </node> <edge label="A-B" source="2" target="1"></edge> <edge label="A-E" source="2" target="9"></edge> </graph>
please note that:
every <graph>, <node> and <edge> element must contain a label attribute. Failure to do so will result in a null-pointer error during the import.
all of the xmsns attributes in the root <graph> element must be present
the <node> containing the sub-graph must contain <att type="string" name=" groupViewer" value="metaNode"/> as shown in the example (note the 2 underline characters)
including data associated with <graph>, <node> and <edge> elements requires an <att> element with the attributes name, type and value as shown