A lightweight rescile application module that allows you to instantly download your modeled environment as a standard GraphML XML file.
This module acts as an "invisible launcher." When accessed, it fetches the current state of the graph, dynamically parses and types all node and edge properties, and seamlessly triggers a file download without displaying a web interface. The resulting graph.graphml file can be imported into network analysis and visualization tools like Gephi, yEd, or Cytoscape.
- Instant GraphML Export: Fetches the raw graph representation via GraphQL and converts it into a well-formed GraphML structure.
- Dynamic Type Inference: Automatically scans all vertex and edge properties to infer and promote correct GraphML attribute types (
boolean,long,double,string). - Invisible Launcher Mechanism: Uses an SVG-namespaced XML file to silently execute JavaScript, construct the XML payload in the browser, and trigger a download automatically.
- Zero Build Step: Implemented entirely as a single static file (
app/index.xml) with zero external dependencies, build tools, or CDNs required.
You can load this module into your rescile project directly from the GitHub repository using the rescile-ce CLI.
Start the rescile server with the module:
rescile-ce --module https://github.com/rescile/graphml-module serveOnce the server is running, navigate to the module's subpath in your web browser.
By default, simply visiting the module's URL will immediately download a file named graph.graphml to your machine.
This module is a perfect demonstration of the Alternate Formats (XML) pattern described in the rescile Application Modules documentation.
module.toml: The manifest defining the module's name, version (0.0.2), and compatibility (>=0.1.114).app/index.xml: The application's entry point.- The SVG Trick: Because web browsers do not natively execute JavaScript inside generic XML files, the root element is an
<svg>. The browser recognizes the SVG namespace and executes the embedded<script type="text/javascript">. - CDATA Protection: The script is wrapped in
<![CDATA[ ... ]]>so that characters like<and&do not break strict XML parsing. - Client-Side Fetching: The script makes a native
POSTrequest to the local/graphqlendpoint to execute the{ graphJson }query. - Blob Downloading: Once the GraphML string is constructed, it is converted into an
application/xmlBlob and downloaded via an ephemeral, click-triggered<a>tag.
- The SVG Trick: Because web browsers do not natively execute JavaScript inside generic XML files, the root element is an