DrawRDF

A draw.io plugin that adds an option to export diagrams to RDF graphs.

Supports export to RDF Mapping Language graphs.

Example usage scenario: AA37-with-metadata-severely-mocked fixture

5-minute video demo of basic functionality: YouTube

Environment

draw.io version 24.7.5 release (Jul 25, 2024)

rdfexport plugin version 0.1.0 release commit 29afe9e1 (Dec 17, 2025)

[!TIP] πŸŽ‰ Available online! Public and free, no registration or credit card required. Hosted complimentary by GitHub Pages. Permalink: https://gbad-project.github.io/drawio/src/main/webapp/?p=rdf

The online version runs fully in the client web browser and does not require any installation except that JavaScript should be turned on (on by default in modern browsers like Chrome).

The entire rdfexport extension is condensed to a single file: rdfexport.js. If you would like to learn more about how it was built and/or modify it using modern tooling, refer to the section below.

For developers:

rdfexport extension itself is open source: Apache-2.0 license. drawio parser fork embedded inside also is (see discussion here). Pyodide is under Mozilla Public License 2.0. RDFLib is under BSD 3-Clause β€œNew” or β€œRevised” License.

Installation instructions (Linux or macOS):

  • Install Node via Volta on your system:

    • Bash (Linux default): curl https://get.volta.sh | bash && source ~/.bashrc && volta install

    • Zsh (macOS default): curl https://get.volta.sh | bash && source ~/.zshrc && volta install

  • Install Bun on your system:

    • Bash (Linux default): curl -fsSL https://bun.sh/install | bash && source ~/.bashrc

    • Zsh (macOS default): curl -fsSL https://bun.sh/install | bash && source ~/.zshrc

  • Navigate to rdfexport plugin dir: cd src/main/webapp/plugins/rdfexport

  • Review demo test log (optional, shows how a successful test run looks like): bun run test:log:show

  • Run setup scripts (explore what these commands do in package.json)

    • bun install

    • bun run setup (installs Python dependencies via uv and procures Pyodide runtime with an rdflib wheel)

      • If this command gives you an error because Python is not installed or not found, try installing Python via uv: uv python install

      • If the Pyodide assets are missing at runtime, the plugin should fall back to the public Pyodide CDN (https://cdn.jsdelivr.net/pyodide/v0.29.0/full/), although this fallback is untested

    • bun run test (optional, test coverage for both the Python and TypeScript codebase using diverse ground truth fixtures and artifacts obtained from a fork of the original Records in Contexts parser for draw.io)

    • bun run build (optional, rebuilds the extension bundle rdfexport.js)

    • bun run serve

  • Open in your web browser (e.g., Chrome): http://[::]:8000/src/main/webapp/?p=rdf

Repository structure

Most of the code for rdfexport extension was systematically developed using an asynchronous AI coding agent (OpenAI Codex, with a little bit of Google Jules).

AI coding agents are known to produce noisy code. Although the best effort was made to polish it – both via context engineering and post hoc code review, to reflect the generational difference from handwritten code, most of the agentic code is placed under aicode/ directory in hopes that clear separation is helpful for future maintainers. Its nested tree structure mirrors that of the root plugin dir to minimize friction when importing and switching between human and AI code. The code outside of aicode/ has primarily been written manually – albeit usually still with code completion, but at the function or statement/expression rather than module or class level. Upon sufficient refactoring, some code from aicode/ might sometimes become a first-class repo citizen and as such emigrate outside of the reserved dir.

You may review the development process using the repo commit history and AICODE reports. Kudoz to @abdullin for the AICODE mnemonics.

This project was created using bun init in bun v1.2.21. Bun is a fast all-in-one JavaScript runtime.