Skip to content

Repository files navigation

LPG Modeler

Design a property graph once. Generate every schema from it.

Documentation · Marketplace · Model format · Design notes

Marketplace version MIT licensed

A VS Code extension and CLI for authoring Labeled Property Graph schemas as text, viewing them as ERD-like diagrams, and generating database DDL and RDF artifacts from a single model.

One model, four artifacts

What it does

  • Authors the model as reviewable YAML, validated by a contributed JSON Schema — so completion and hover come from the YAML tooling you already have.
  • Edits it on a canvas beside the file. Every canvas action becomes a targeted text splice, applied as a workspace edit. Coordinates live in a sidecar, so moving a box produces no semantic diff.
  • Generates seven targets from one model: LadybugDB DDL, Neo4j constraints, SHACL shapes, and an OWL ontology — plus three standards artifacts, GQL graph types (ISO/IEC 39075), PG-Schema, and LinkML.
  • Reports every downgrade. Anything a target cannot enforce becomes an editor diagnostic and a comment at the lossy line of the artifact. Nothing disappears quietly.
  • Models lists, enums, open types and cardinality — and cardinality is genuinely enforced where it can be: LadybugDB rejects a violating write, and SHACL bounds both directions.
  • Stays interoperable. The model file is self-describing, its scalar types answer to their GQL names, and the JSON Schema is 2020-12 — so a model is readable outside this tool, not only inside it.
  • Runs in CI. The same validation, with no editor present, so a pull request can be gated on schema validity.

Full feature tour: https://volland.github.io/lpg-modeler/

Install

From the VS Code Marketplace:

code --install-extension pavlyshyn.lpg-modeler

The CLI, for continuous integration:

npx lpg check model/domain.lpg.yaml
npx lpg emit model/domain.lpg.yaml --target ladybug --out schema

Repository layout

A monorepo of three packages.

Package Holds
packages/core Parsing, the intermediate representation, resolution, validation, targeted edits, and every generator
packages/cli The lpg command, wrapping core for continuous integration
packages/vscode The extension: webview canvas, diagnostics, commands

core must never import vscode — enforced by an ESLint rule and by a test that scans the source. That single rule is what keeps generator tests runnable in plain Node with no editor harness. See the design notes.

Development

npm install
npm run build          # builds core, then cli, then the extension and its webview
npm test               # vitest, across all packages
npm run lint

To run the extension from source, open the repository in VS Code and launch the Run Extension target, or package it:

cd packages/vscode
npx @vscode/vsce package --no-dependencies

The extension bundle is self-contained — esbuild inlines @lpg/core into out/extension.js, so --no-dependencies is correct rather than a shortcut.

Tests

Every generator has golden-file tests for output stability. The Ladybug target additionally executes its generated DDL against an in-process LadybugDB instance and asserts that the declared constraints really do reject invalid data — a golden file alone only proves that output has not changed, not that it is valid.

Documentation

Architecture and design intent live in lat.md/, a cross-linked knowledge graph maintained with lat.md. Run lat check before opening a pull request. The published website is generated from docs/.

License

MIT — see LICENSE.

About

Design a labeled property graph once. Generate LadybugDB DDL, Neo4j constraints, SHACL shapes and an OWL ontology from it. VS Code extension + CLI.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages